A DLN adapter generates the DLN_GPIO_EVENT_CHANGE
events each time the level on the input pin changes.
Use the DlnGpioPinSetEventCfg()function to configure events. Pass DLN_GPIO_EVENT_CHANGE
for the eventType
parameter.
If the eventPeriod
parameter is zero, the DLN adapter generates single events when the level on the input pin changes.
If the eventPeriod
is non-zero, the DLN adapter resents the events periodically with the eventPeriod
interval while the level on the pin remains unchanged (a series of events).
A series of e vents begins when the level on the GPIO line changes. At this moment, the DLN adapter sends the first event in the series. The eventCount
field of the first event is set to zero and the value
field contains the actual value on the GPIO line. Then, while the level on the GPIO line remains unchanged, the DLN adapter repeatedly sends events with the same value in the value
field. The interval between recurring events is equal to eventPeriod
milliseconds. The eventCount
field increments for each event in the series. You can use this field to calculate the time passed from the last level change (time = eventCount * eventPeriod).When the level on the GPIO line changes, a new series of events begins. The eventCount
field is reset to zero and the value
field is set to the actual value present on the line after the change.