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.

bool

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

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

Definition at line 59 of file /mnt/raid/workspaces/ws.Mh9rMZz8x/overlay/gsdk/protocol/z-wave/Components/EventDistributor/EventDistributor.h

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

Definition at line 20 of file /mnt/raid/workspaces/ws.Mh9rMZz8x/overlay/gsdk/protocol/z-wave/ZAF/ApplicationUtilities/EventHandling/zaf_event_distributor_soc.h

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.


Definition at line 40 of file /mnt/raid/workspaces/ws.Mh9rMZz8x/overlay/gsdk/protocol/z-wave/ZAF/ApplicationUtilities/EventHandling/zaf_event_distributor_soc.h

EEventDistributorStatus#

typedef enum EEventDistributorStatus EEventDistributorStatus

Defines return values from EventDistributorConfigure.


Definition at line 63 of file /mnt/raid/workspaces/ws.Mh9rMZz8x/overlay/gsdk/protocol/z-wave/Components/EventDistributor/EventDistributor.h

EventDistributorEventHandler#

typedef void(* EventDistributorEventHandler) (void) )(void)

Defines callback pointer for Event handler.

Typedef to simplify syntax.


Definition at line 70 of file /mnt/raid/workspaces/ws.Mh9rMZz8x/overlay/gsdk/protocol/z-wave/Components/EventDistributor/EventDistributor.h

SEventDistributor#

typedef struct SEventDistributor SEventDistributor

EventDistributor object.

All content is private.


Definition at line 83 of file /mnt/raid/workspaces/ws.Mh9rMZz8x/overlay/gsdk/protocol/z-wave/Components/EventDistributor/EventDistributor.h

Function Documentation#

zaf_event_distributor_init#

void zaf_event_distributor_init (void )

Initializes the ZAF Event Distributor component.

Parameters
N/A

This function invokes EventDistributorConfig().


Definition at line 26 of file /mnt/raid/workspaces/ws.Mh9rMZz8x/overlay/gsdk/protocol/z-wave/ZAF/ApplicationUtilities/EventHandling/zaf_event_distributor.h

zaf_event_distributor_get#

const SEventDistributor * zaf_event_distributor_get (void )

Gets the events distributor.

Parameters
N/A

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

Returns


Definition at line 35 of file /mnt/raid/workspaces/ws.Mh9rMZz8x/overlay/gsdk/protocol/z-wave/ZAF/ApplicationUtilities/EventHandling/zaf_event_distributor.h

zaf_event_distributor_distribute#

bool zaf_event_distributor_distribute (void )

Distributes events.

Parameters
N/A

Wraps EventDistributorDistribute().

Returns

  • true In case of success

  • false In case of error


Definition at line 45 of file /mnt/raid/workspaces/ws.Mh9rMZz8x/overlay/gsdk/protocol/z-wave/ZAF/ApplicationUtilities/EventHandling/zaf_event_distributor.h

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
N/ARxPackage

ZW Receive Package


Definition at line 25 of file /mnt/raid/workspaces/ws.Mh9rMZz8x/overlay/gsdk/protocol/z-wave/ZAF/ApplicationUtilities/EventHandling/zaf_event_distributor_ncp.h

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
N/AStatus

ZW Command Status Package


Definition at line 32 of file /mnt/raid/workspaces/ws.Mh9rMZz8x/overlay/gsdk/protocol/z-wave/ZAF/ApplicationUtilities/EventHandling/zaf_event_distributor_ncp.h

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
N/A

Definition at line 39 of file /mnt/raid/workspaces/ws.Mh9rMZz8x/overlay/gsdk/protocol/z-wave/ZAF/ApplicationUtilities/EventHandling/zaf_event_distributor_ncp.h

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
N/A

Definition at line 45 of file /mnt/raid/workspaces/ws.Mh9rMZz8x/overlay/gsdk/protocol/z-wave/ZAF/ApplicationUtilities/EventHandling/zaf_event_distributor_ncp.h

zaf_event_distributor_app_serial_timeout#

void zaf_event_distributor_app_serial_timeout (void )

Used by the application to handle serial timeout.

Parameters
N/A

Definition at line 51 of file /mnt/raid/workspaces/ws.Mh9rMZz8x/overlay/gsdk/protocol/z-wave/ZAF/ApplicationUtilities/EventHandling/zaf_event_distributor_ncp.h

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
N/Aevent

application/system received event


Definition at line 77 of file /mnt/raid/workspaces/ws.Mh9rMZz8x/overlay/gsdk/protocol/z-wave/ZAF/ApplicationUtilities/EventHandling/zaf_event_distributor_soc.h

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
N/A

Returns

  • uint8_t 1 if it is primary controller else 0


Definition at line 84 of file /mnt/raid/workspaces/ws.Mh9rMZz8x/overlay/gsdk/protocol/z-wave/ZAF/ApplicationUtilities/EventHandling/zaf_event_distributor_soc.h

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
N/Aevent

The event to enqueue.

Returns

  • Returns true if the event was enqueued and false otherwise.


Definition at line 91 of file /mnt/raid/workspaces/ws.Mh9rMZz8x/overlay/gsdk/protocol/z-wave/ZAF/ApplicationUtilities/EventHandling/zaf_event_distributor_soc.h

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
N/Aevent

The event to enqueue.

Returns

  • Returns true if the event was enqueued and false otherwise.


Definition at line 98 of file /mnt/raid/workspaces/ws.Mh9rMZz8x/overlay/gsdk/protocol/z-wave/ZAF/ApplicationUtilities/EventHandling/zaf_event_distributor_soc.h

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
N/Acommand_class

The command class to receive the event

N/Aevent

The event to enqueue.

N/Adata

A data pointer. It must point to a global variable

Returns

  • Returns true if the event was enqueued and false otherwise.


Definition at line 108 of file /mnt/raid/workspaces/ws.Mh9rMZz8x/overlay/gsdk/protocol/z-wave/ZAF/ApplicationUtilities/EventHandling/zaf_event_distributor_soc.h

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
N/Acommand_class

The command class to receive the event

N/Aevent

The event to enqueue.

N/Adata

A data pointer. It must point to a global variable

Returns

  • Returns true if the event was enqueued and false otherwise.


Definition at line 120 of file /mnt/raid/workspaces/ws.Mh9rMZz8x/overlay/gsdk/protocol/z-wave/ZAF/ApplicationUtilities/EventHandling/zaf_event_distributor_soc.h

EventDistributorConfig#

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

Configures the EventDistributor.

Parameters
[in]pThis

Pointer to the EventDistributor object.

[in]iEventHandlerTableSize

Number of entries in EventHandlerTable pointed to by argument pEventHandlerTable Table size range is 0 - 32)

[in]pEventHandlerTable

Pointer to table of EventHandler function pointers

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


Definition at line 101 of file /mnt/raid/workspaces/ws.Mh9rMZz8x/overlay/gsdk/protocol/z-wave/Components/EventDistributor/EventDistributor.h

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
[in]pThis

Pointer to the EventDistributor object

[in]iEventWait

Timeout (in mS) when waiting for event. Value must NOT be zero.

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


Definition at line 124 of file /mnt/raid/workspaces/ws.Mh9rMZz8x/overlay/gsdk/protocol/z-wave/Components/EventDistributor/EventDistributor.h

Macro Definition Documentation#

ZAF_EVENT_DISTRIBUTOR_CC_EVENT_HANDLER_SECTION#

#define ZAF_EVENT_DISTRIBUTOR_CC_EVENT_HANDLER_SECTION
Value:
"zw_zaf_event_distributor_cc_event_handler"

Section name.


Definition at line 45 of file /mnt/raid/workspaces/ws.Mh9rMZz8x/overlay/gsdk/protocol/z-wave/ZAF/ApplicationUtilities/EventHandling/zaf_event_distributor_soc.h

ZAF_EVENT_DISTRIBUTOR_REGISTER_CC_EVENT_HANDLER#

#define ZAF_EVENT_DISTRIBUTOR_REGISTER_CC_EVENT_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

Registers a custom event handler for a specific command class.


Definition at line 53 of file /mnt/raid/workspaces/ws.Mh9rMZz8x/overlay/gsdk/protocol/z-wave/ZAF/ApplicationUtilities/EventHandling/zaf_event_distributor_soc.h