EventDistributor#

Modules#

event_cc_t

zaf_event_distributor_cc_event_handler_map_v1_t

SEventDistributor

Enumerations#

enum
EEVENTDISTRIBUTOR_STATUS_SUCCESS = 0
EEVENTDISTRIBUTOR_STATUS_TABLE_TOO_LARGE
}

Defines return values from EventDistributorConfigure.

Typedefs#

typedef void(*

Redefine latest version to a common define called latest.

Defines return values from EventDistributorConfigure.

typedef void(*

Defines callback pointer for Event handler.

typedef struct SEventDistributor

EventDistributor object.

Functions#

void

Initializes the ZAF Event Distributor component.

Gets the events distributor.

uint32_t

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

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

void

Used by the application to handle serial data received.

void

Used by the application to handle serial timeout.

void

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

uint8_t

Used by application to verify if it is a primary controller.

bool

Enqueues an event in the application queue.

bool

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.

EventDistributorConfig(SEventDistributor *pThis, uint8_t iEventHandlerTableSize, const EventDistributorEventHandler *pEventHandlerTable, void(*pNoEvent)(void))

Configures the EventDistributor.

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.

Macros#

#define
ZAF_EVENT_DISTRIBUTOR_CC_EVENT_HANDLER_SECTION "zw_zaf_event_distributor_cc_event_handler"

Section name.

#define
ZAF_EVENT_DISTRIBUTOR_REGISTER_CC_EVENT_HANDLER (command_class, handler)

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.

Parameters
TypeDirectionArgument NameDescription
voidN/A

This function invokes EventDistributorConfig().


zaf_event_distributor_get#

const SEventDistributor * zaf_event_distributor_get (void )

Gets the events distributor.

Parameters
TypeDirectionArgument NameDescription
voidN/A

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

Returns


zaf_event_distributor_distribute#

uint32_t zaf_event_distributor_distribute (void )

Distributes events.

Parameters
TypeDirectionArgument NameDescription
voidN/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.

Parameters
TypeDirectionArgument NameDescription
SZwaveReceivePackage *N/ARxPackage

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.

Parameters
TypeDirectionArgument NameDescription
SZwaveCommandStatusPackage *N/AStatus

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.

Parameters
TypeDirectionArgument NameDescription
voidN/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.

Parameters
TypeDirectionArgument NameDescription
voidN/A

zaf_event_distributor_app_serial_timeout#

void zaf_event_distributor_app_serial_timeout (void )

Used by the application to handle serial timeout.

Parameters
TypeDirectionArgument NameDescription
voidN/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.

Parameters
TypeDirectionArgument NameDescription
const uint8_tN/Aevent

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.

Parameters
TypeDirectionArgument NameDescription
voidN/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.

Parameters
TypeDirectionArgument NameDescription
const uint8_tN/Aevent

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.

Parameters
TypeDirectionArgument NameDescription
const uint8_tN/Aevent

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.

Parameters
TypeDirectionArgument NameDescription
const uint16_tN/Acommand_class

The command class to receive the event

const uint8_tN/Aevent

The event to enqueue.

const void *N/Adata

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.

Parameters
TypeDirectionArgument NameDescription
const uint16_tN/Acommand_class

The command class to receive the event

const uint8_tN/Aevent

The event to enqueue.

const void *N/Adata

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.

Parameters
TypeDirectionArgument NameDescription
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.

Parameters
TypeDirectionArgument NameDescription
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.