Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Custom Application States

Code Block
languagec
#define STATE_DIAG_CHECK       0
#define STATE_DIAG_ISR_XFER    1
  • STATE_DIAG_CHECK - When this state is received by the polling callback and the application has not be marked for deactivation, it will generate a diagnostic report, send the results to the Gateway Notecard, and mark itself ready for deactivation. Otherwise, if this state is received by the polling callback and the application has already been marked for deactivation then it will log a completion message and immediately deactivate.

    STATE_DIAG_ISR_XFER - This state is set from within the ISR, and it allows the polling callback to know the interrupt was invoked.

Application Specific Values

Code Block
languagec
#define REQUESTID_TEMPLATE     2
  • REQUESTID_TEMPLATE - To keep track of responses to specific Notes, you need to supply an “id” tag to the Note. If an “id” was supplied to a Note, then the response parameter provided to diagResponse() will contain the matching “id”.

Code Block
languagec
#define APPLICATION_NOTEFILE "*#diag.qo"
  • APPLICATION_NOTEFILE - The dynamic filename of the application specific queue.

    NOTE: The Gateway will replace * with the originating node's ID. The resulting transformation will resemble 2037335832365003001b0037#diag.qo.

Array and Counter Limits

Code Block
languagec
#define ISR_MAX_CALL_RETENTION 8  // Must be a power of 2
#define ISR_COUNTER_MASK       ~(ISR_MAX_CALL_RETENTION-1)
  • ISR_MAX_CALL_RETENTION - The maximum number of ISRs that will be recorded.

    ISR_COUNTER_MASK - The mask will limit the value of the counter.

Structures

Code Block
languagec
typedef struct ISR_parameters {
    int appID;
    uint16_t pins;
} ISR_parameters;
  • ISR_parameters - Used to collect information available in ISR for later processing.

...