Trident IoT Z-Wave SDK
 
Loading...
Searching...
No Matches
EventDistributor
+ Collaboration diagram for EventDistributor:

Data Structures

struct  event_cc_t
 
struct  zaf_event_distributor_cc_event_handler_map_v1_t
 

Macros

#define ZAF_EVENT_DISTRIBUTOR_CC_EVENT_HANDLER_SECTION   "zw_zaf_event_distributor_cc_event_handler"
 
#define ZAF_EVENT_DISTRIBUTOR_REGISTER_CC_EVENT_HANDLER(command_class, handler)
 

Typedefs

typedef void(* zaf_event_distributor_cc_event_handler_handler_v1_t) (const uint8_t, const void *)
 
typedef zaf_event_distributor_cc_event_handler_map_v1_t zaf_event_distributor_cc_event_handler_map_latest_t
 

Functions

void zaf_event_distributor_init (void)
 Initializes the ZAF Event Distributor component.
 
const SEventDistributor * zaf_event_distributor_get (void)
 Gets the events distributor.
 
uint32_t zaf_event_distributor_distribute (void)
 Distributes events.
 
void zaf_event_distributor_app_zw_rx (SZwaveReceivePackage *RxPackage)
 Used by the application to handle protocol received events.
 
void zaf_event_distributor_app_zw_command_status (SZwaveCommandStatusPackage *Status)
 Used by the application to handle protocol command status.
 
void zaf_event_distributor_app_state_change (void)
 Used by the application to handle state changes in the NCP state machine.
 
void zaf_event_distributor_app_serial_data_rx (void)
 Used by the application to handle serial data received.
 
void zaf_event_distributor_app_serial_timeout (void)
 Used by the application to handle serial timeout.
 
void zaf_event_distributor_app_event_manager (const uint8_t event)
 Used by the application to handle application/system received events.
 
uint8_t zaf_event_distributor_is_primary_controller (void)
 Used by application to verify if it is a primary controller.
 
bool zaf_event_distributor_enqueue_app_event (const uint8_t event)
 Enqueues an event in the application queue.
 
bool zaf_event_distributor_enqueue_app_event_from_isr (const uint8_t event)
 Enqueues an event in the application queue.
 
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.
 
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.
 

Detailed Description

Macro Definition Documentation

◆ ZAF_EVENT_DISTRIBUTOR_CC_EVENT_HANDLER_SECTION

#define ZAF_EVENT_DISTRIBUTOR_CC_EVENT_HANDLER_SECTION   "zw_zaf_event_distributor_cc_event_handler"

Section name

◆ ZAF_EVENT_DISTRIBUTOR_REGISTER_CC_EVENT_HANDLER

#define ZAF_EVENT_DISTRIBUTOR_REGISTER_CC_EVENT_HANDLER ( command_class,
handler )
Value:
static const zaf_event_distributor_cc_event_handler_map_latest_t zaf_event_distributor_cc_event_handler_##command_class##event##handler \
__attribute__((aligned(4), __used__, __section__(ZAF_EVENT_DISTRIBUTOR_CC_EVENT_HANDLER_SECTION))) = { handler, command_class, 1 }; \
void * zaf_event_distributor_register_cc_event_handler_##table_entry##handler
#define ZAF_EVENT_DISTRIBUTOR_CC_EVENT_HANDLER_SECTION
Definition zaf_event_distributor_soc.h:45
Definition zaf_event_distributor_soc.h:31

Registers a custom event handler for a specific command class

Parameters
[in]command_classCommand Class
[in]handlerAddress of the handler function.

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 *)

◆ zaf_event_distributor_cc_event_handler_map_latest_t

Redefine latest version to a common define called latest

Function Documentation

◆ zaf_event_distributor_app_event_manager()

void zaf_event_distributor_app_event_manager ( const uint8_t event)
extern

Used by the application to handle application/system received events.

Parameters
eventapplication/system received event

◆ zaf_event_distributor_app_serial_data_rx()

void zaf_event_distributor_app_serial_data_rx ( void )
extern

Used by the application to handle serial data received.

◆ zaf_event_distributor_app_serial_timeout()

void zaf_event_distributor_app_serial_timeout ( void )
extern

Used by the application to handle serial timeout.

◆ zaf_event_distributor_app_state_change()

void zaf_event_distributor_app_state_change ( void )
extern

Used by the application to handle state changes in the NCP state machine.

◆ 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.

Parameters
StatusZW Command Status Package

◆ zaf_event_distributor_app_zw_rx()

void zaf_event_distributor_app_zw_rx ( SZwaveReceivePackage * RxPackage)

Used by the application to handle protocol received events.

Parameters
RxPackageZW Receive Package

◆ zaf_event_distributor_distribute()

uint32_t zaf_event_distributor_distribute ( void )

Distributes events.

Wraps EventDistributorDistribute().

Returns
bitfield with unhandled events

◆ zaf_event_distributor_enqueue_app_event()

bool zaf_event_distributor_enqueue_app_event ( const uint8_t event)

Enqueues an event in the application queue.

Parameters
eventThe 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.

Parameters
eventThe 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.

Parameters
command_classThe command class to receive the event
eventThe event to enqueue.
dataA 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.

Parameters
command_classThe command class to receive the event
eventThe event to enqueue.
dataA data pointer. It must point to a global variable
Returns
Returns true if the event was enqueued and false otherwise.

◆ zaf_event_distributor_get()

const SEventDistributor * zaf_event_distributor_get ( void )

Gets the events distributor.

Each variation (NCP,SOC) must implement it's own event distributor table

Returns
const SEventDistributor

◆ zaf_event_distributor_init()

void zaf_event_distributor_init ( void )

Initializes the ZAF Event Distributor component.

This function invokes EventDistributorConfig().

◆ 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.

Returns
uint8_t 1 if it is primary controller else 0