-
Notifications
You must be signed in to change notification settings - Fork 15
GPIO Configs
GPIO configs consist of many gpio operation related parameters as
-
gpio modes : the mode in which corresponding gpio is operating like OFF, DIGITAL_WRITE, DIGITAL_READ, DIGITAL_BLINK, ANALOG_WRITE, ANALOG_READ
-
gpio readings : will keep the gpio actual reading values
-
gpio alert comparators : comparators like EQUAL, GREATER_THAN, LESS_THAN are assigned to gpios if the gpio is enabled.
-
gpio alert channel : alert channels are those which are to signal the user about gpio has matched alert condition set by them. alert condition uses alert comparators and alert values set by users for particular gpio to check whether gpio reading are satisfying alert condition. currently only Email as alert channel is supported.
-
gpio alert values : values those set by user along with comparator for gpio. once gpio reading satisfy this value and assigned comparator condition it alerts the user via alert channel
-
gpio host : user can add any server host to which he wish device should send all gpio status table
-
post frequency : this is to define data sending rate to given gpio host server
these all parameters for each gpio are saved in database as gpio config table.
In case when device wants to alert user, the frequency of alert can be defined with below two parameters in millisecond format.
- GPIO_ALERT_DURATION_FOR_SUCCEED is used when alert raises continuously and user has already notified successfully by device when it occurred first. its not a good practice to keep continuously notifying user about alert. so device will wait this duration in such continuous alert situation and send next alert after this duration.
- GPIO_ALERT_DURATION_FOR_FAILED Device will wait this duration in continuous alert situation if it failed to notify user about alert.
#define GPIO_ALERT_DURATION_FOR_SUCCEED 3600000
#define GPIO_ALERT_DURATION_FOR_FAILED 300000
- GPIO_OPERATION_DURATION is gpio scanning (reading, writing) duration. all gpio operation performed every this duration
- GPIO_TABLE_UPDATE_DURATION is gpio data update duration in database
/**
* @define gpio parameters
*/
#define GPIO_OPERATION_DURATION MILLISECOND_DURATION_1000
#define GPIO_TABLE_UPDATE_DURATION 300000
Note that these configs will get excluded if user undefine gpio service from common config file