EventDistributor#
Modules#
zaf_event_distributor_cc_event_handler_map_v1_t
Enumerations#
Defines return values from EventDistributorConfigure.
Typedefs#
Redefine latest version to a common define called latest.
Defines return values from EventDistributorConfigure.
Defines callback pointer for Event handler.
EventDistributor object.
Functions#
Initializes the ZAF Event Distributor component.
Gets the events distributor.
Distributes events.
Used by the application to handle protocol received events.
Used by the application to handle protocol command status.
Used by the application to handle state changes in the NCP state machine.
Used by the application to handle serial data received.
Used by the application to handle serial timeout.
Used by the application to handle application/system received events.
Used by application to verify if it is a primary controller.
Enqueues an event in the application queue.
Enqueues an event in the application queue.
Enqueues an event in the command class event queue.
Enqueues an event in the command class event queue.
Configures the EventDistributor.
Waits for Task notification and calls event handlers matching the set notification bits.
Macros#
Section name.
Registers a custom event handler for a specific command class.
Enumeration Documentation#
EEventDistributorStatus#
EEventDistributorStatus
Defines return values from EventDistributorConfigure.
Enumerator | |
---|---|
EEVENTDISTRIBUTOR_STATUS_SUCCESS | |
EEVENTDISTRIBUTOR_STATUS_TABLE_TOO_LARGE |
Typedef Documentation#
zaf_event_distributor_cc_event_handler_handler_v1_t#
typedef void(* zaf_event_distributor_cc_event_handler_handler_v1_t) (const uint8_t, const void *) )(const uint8_t, const void *)
zaf_event_distributor_cc_event_handler_map_latest_t#
typedef zaf_event_distributor_cc_event_handler_map_v1_t zaf_event_distributor_cc_event_handler_map_latest_t
Redefine latest version to a common define called latest.
EEventDistributorStatus#
typedef enum EEventDistributorStatus EEventDistributorStatus
Defines return values from EventDistributorConfigure.
EventDistributorEventHandler#
typedef void(* EventDistributorEventHandler) (void) )(void)
Defines callback pointer for Event handler.
Typedef to simplify syntax.
SEventDistributor#
typedef struct SEventDistributor SEventDistributor
EventDistributor object.
All content is private.
Function Documentation#
zaf_event_distributor_init#
void zaf_event_distributor_init (void )
Initializes the ZAF Event Distributor component.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
This function invokes EventDistributorConfig().
zaf_event_distributor_get#
const SEventDistributor * zaf_event_distributor_get (void )
Gets the events distributor.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Each variation (NCP,SOC) must implement it's own event distributor table
Returns
const SEventDistributor
zaf_event_distributor_distribute#
uint32_t zaf_event_distributor_distribute (void )
Distributes events.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Wraps EventDistributorDistribute().
Returns
bitfield with unhandled events
zaf_event_distributor_app_zw_rx#
void zaf_event_distributor_app_zw_rx (SZwaveReceivePackage * RxPackage)
Used by the application to handle protocol received events.
Type | Direction | Argument Name | Description |
---|---|---|---|
SZwaveReceivePackage * | N/A | RxPackage | ZW Receive Package |
zaf_event_distributor_app_zw_command_status#
void zaf_event_distributor_app_zw_command_status (SZwaveCommandStatusPackage * Status)
Used by the application to handle protocol command status.
Type | Direction | Argument Name | Description |
---|---|---|---|
SZwaveCommandStatusPackage * | N/A | Status | ZW Command Status Package |
zaf_event_distributor_app_state_change#
void zaf_event_distributor_app_state_change (void )
Used by the application to handle state changes in the NCP state machine.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
zaf_event_distributor_app_serial_data_rx#
void zaf_event_distributor_app_serial_data_rx (void )
Used by the application to handle serial data received.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
zaf_event_distributor_app_serial_timeout#
void zaf_event_distributor_app_serial_timeout (void )
Used by the application to handle serial timeout.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
zaf_event_distributor_app_event_manager#
void zaf_event_distributor_app_event_manager (const uint8_t event)
Used by the application to handle application/system received events.
Type | Direction | Argument Name | Description |
---|---|---|---|
const uint8_t | N/A | event | application/system received event |
zaf_event_distributor_is_primary_controller#
uint8_t zaf_event_distributor_is_primary_controller (void )
Used by application to verify if it is a primary controller.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Returns
uint8_t 1 if it is primary controller else 0
zaf_event_distributor_enqueue_app_event#
bool zaf_event_distributor_enqueue_app_event (const uint8_t event)
Enqueues an event in the application queue.
Type | Direction | Argument Name | Description |
---|---|---|---|
const uint8_t | N/A | event | The event to enqueue. |
Returns
Returns true if the event was enqueued and false otherwise.
zaf_event_distributor_enqueue_app_event_from_isr#
bool zaf_event_distributor_enqueue_app_event_from_isr (const uint8_t event)
Enqueues an event in the application queue.
Type | Direction | Argument Name | Description |
---|---|---|---|
const uint8_t | N/A | event | The event to enqueue. |
Returns
Returns true if the event was enqueued and false otherwise.
zaf_event_distributor_enqueue_cc_event#
bool zaf_event_distributor_enqueue_cc_event (const uint16_t command_class, const uint8_t event, const void * data)
Enqueues an event in the command class event queue.
Type | Direction | Argument Name | Description |
---|---|---|---|
const uint16_t | N/A | command_class | The command class to receive the event |
const uint8_t | N/A | event | The event to enqueue. |
const void * | N/A | data | A data pointer. It must point to a global variable |
Returns
Returns true if the event was enqueued and false otherwise.
zaf_event_distributor_enqueue_cc_event_from_isr#
bool zaf_event_distributor_enqueue_cc_event_from_isr (const uint16_t command_class, const uint8_t event, const void * data)
Enqueues an event in the command class event queue.
Type | Direction | Argument Name | Description |
---|---|---|---|
const uint16_t | N/A | command_class | The command class to receive the event |
const uint8_t | N/A | event | The event to enqueue. |
const void * | N/A | data | A data pointer. It must point to a global variable |
Returns
Returns true if the event was enqueued and false otherwise.
EventDistributorConfig#
EEventDistributorStatus EventDistributorConfig (SEventDistributor * pThis, uint8_t iEventHandlerTableSize, const EventDistributorEventHandler * pEventHandlerTable, void(*)(void) pNoEvent)
Configures the EventDistributor.
Type | Direction | Argument Name | Description |
---|---|---|---|
SEventDistributor * | [in] | pThis | Pointer to the EventDistributor object. |
uint8_t | [in] | iEventHandlerTableSize | Number of entries in EventHandlerTable pointed to by argument pEventHandlerTable Table size range is 0 - 32) |
const EventDistributorEventHandler * | [in] | pEventHandlerTable | Pointer to table of EventHandler function pointers |
void(*)(void) | [in] | pNoEvent | Function pointer that will be called on notifications without event or wait for event timeout |
Configure must be called before calling any other EventDistributor methods. EventDistributor supports reconfiguration at all times.
EventDistributorDistribute#
uint32_t EventDistributorDistribute (const SEventDistributor * pThis, uint32_t iEventWait, uint32_t NotificationClearMask)
Waits for Task notification and calls event handlers matching the set notification bits.
Type | Direction | Argument Name | Description |
---|---|---|---|
const SEventDistributor * | [in] | pThis | Pointer to the EventDistributor object |
uint32_t | [in] | iEventWait | Timeout (in mS) when waiting for event. Value must NOT be zero. |
uint32_t | [in] | NotificationClearMask | Mask of additional notification bits to clear, which is not handled by EventDistributor. EventDistributor will always clear notification bits assigned to events. This mask is additional bits to clear. |
Method returns when a notification has arrived (or waiting timed out) and any pending events has been handled.
Returns
uint32_t Task notification value. All bits handled by EventDistributor are set to zero.