Logo
DSR GreenBOSS  1.1.0
Data Structures | Typedefs | Enumerations | Functions
Application Initialization and Configuration

Data Structures

struct  gboss_comm_options_s
 GPD Commissioning - Options field descriptor. More...
 
struct  gboss_comm_ext_options_s
 GPD Commissioning - Extended options field descriptor. More...
 
struct  gboss_comm_app_info_s
 GPD Commissioning - Application information descriptor. More...
 
struct  gboss_device_config_s
 Main configuration constants of a GP device. More...
 
struct  gboss_tx_cfg_s
 TX configuration outlining how a transmission should proceed concerning the channels to be used and the number of repetitions. More...
 

Typedefs

typedef enum gboss_mac_sequence_number_capabilities_e gboss_mac_sequence_number_capabilities_t
 GP device MAC sequence number capabilities enum. More...
 
typedef struct gboss_comm_options_s gboss_comm_options_t
 GPD Commissioning - Options field descriptor. More...
 
typedef enum gboss_security_key_capabilities_e gboss_security_key_capabilities_t
 GPD Commissioning - Security key capabilities. More...
 
typedef enum gboss_key_types_e gboss_key_types_t
 GPD Commissioning - Key types. More...
 
typedef struct gboss_comm_ext_options_s gboss_comm_ext_options_t
 GPD Commissioning - Extended options field descriptor. More...
 
typedef struct gboss_comm_app_info_s gboss_comm_app_info_t
 GPD Commissioning - Application information descriptor. More...
 
typedef enum gboss_app_ids_e gboss_app_ids_t
 GPD Application IDs. More...
 
typedef enum gboss_dev_id_e gboss_dev_id_t
 Possible ZGPD device identifiers. More...
 
typedef struct gboss_device_config_s gboss_device_config_t
 Main configuration constants of a GP device. More...
 
typedef struct gboss_tx_cfg_s gboss_tx_cfg_t
 TX configuration outlining how a transmission should proceed concerning the channels to be used and the number of repetitions. More...
 

Enumerations

enum  gboss_mac_sequence_number_capabilities_e { GBOSS_MAC_SEQ_NUM_RANDOM = 0, GBOSS_MAC_SEQ_NUM_INCREMENTAL = 1 }
 GP device MAC sequence number capabilities enum. More...
 
enum  gboss_security_key_capabilities_e { GBOSS_SECURITY_KEY_CAP_L0 = 0, GBOSS_SECURITY_KEY_CAP_L2 = 2, GBOSS_SECURITY_KEY_CAP_L3 = 3 }
 GPD Commissioning - Security key capabilities. More...
 
enum  gboss_key_types_e {
  GBOSS_KEY_TYPE_NO_KEY = 0, GBOSS_KEY_TYPE_ZB_NWK_KEY = 1, GBOSS_KEY_TYPE_GPD_GROUP_KEY = 2, GBOSS_KEY_TYPE_NWK_KEY_DERIVED_GPD_GROUP_KEY = 3,
  GBOSS_KEY_TYPE_INDIVIDUAL_PRE_CONFIG_KEY = 4, GBOSS_KEY_TYPE_DERIVED_INDIVIDUAL_GROUP_KEY = 7
}
 GPD Commissioning - Key types. More...
 
enum  gboss_app_ids_e { GBOSS_APP_ID_0 = 0, GBOSS_APP_ID_2 = 2 }
 GPD Application IDs. More...
 
enum  gboss_dev_id_e {
  GBOSS_SIMPLE_GEN_1_STATE_SWITCH_DEV_ID = 0x00, GBOSS_SIMPLE_GEN_2_STATE_SWITCH_DEV_ID = 0x01, GBOSS_ON_OFF_SWITCH_DEV_ID = 0x02, GBOSS_LEVEL_CONTROL_SWITCH_DEV_ID = 0x03,
  GBOSS_SIMPLE_SENSOR_DEV_ID = 0x04, GBOSS_ADVANCED_GEN_1_STATE_SWITCH_DEV_ID = 0x05, GBOSS_ADVANCED_GEN_2_STATE_SWITCH_DEV_ID = 0x06, GBOSS_GEN_8_CONT_SWITCH_DEV_ID = 0x07,
  GBOSS_COLOR_DIMMER_SWITCH_DEV_ID = 0x10, GBOSS_LIGHT_SENSOR_DEV_ID = 0x11, GBOSS_OCCUPANCY_SENSOR_DEV_ID = 0x12, GBOSS_DOOR_LOCK_CONTROLLER_DEV_ID = 0x20,
  GBOSS_TEMPERATURE_SENSOR_DEV_ID = 0x30, GBOSS_PRESSURE_SENSOR_DEV_ID = 0x31, GBOSS_FLOW_SENSOR_DEV_ID = 0x32, GBOSS_ENVIRONMENT_SENSOR_DEV_ID = 0x33,
  GBOSS_MANUF_SPECIFIC_DEV_ID = 0xfe, GBOSS_UNDEFINED_DEV_ID = 0xff
}
 Possible ZGPD device identifiers. More...
 

Functions

void gboss_app_init (const zb_uint8_t *key, const gboss_device_config_t *device_config)
 Initializes the ZGPD stack. More...
 
void gboss_platform_init (ARGC_ARGV_PROTO)
 Initializes the platform layer. More...
 
void gboss_wait_for_button (void)
 Waits until any button is pressed. More...
 
zb_uint32_t gboss_test_get_button_mask (void)
 Gets bitmask of buttons pressed on the device boot. More...
 
void gboss_set_buttons_max_num (zb_uint8_t num)
 Informs platform layer about number of supported buttons. More...
 

Detailed Description

Typedef Documentation

§ gboss_mac_sequence_number_capabilities_t

GP device MAC sequence number capabilities enum.

§ gboss_comm_options_t

GPD Commissioning - Options field descriptor.

static const zb_uint8_t gs_commands[] = {
GBOSS_APP_CMD_ID_OFF,
GBOSS_APP_CMD_ID_ON,
GBOSS_APP_CMD_ID_TOGGLE
};
static const zb_uint16_t gs_clusters_cli[] = {
ZB_ZCL_CLUSTER_ID_LEVEL_CONTROL
};
static const zb_uint16_t gs_clusters_srv[] = {
ZB_ZCL_CLUSTER_ID_REL_HUMIDITY_MEASUREMENT
};
static const gboss_device_config_t g_device_config = {
.manufacturer = 0x1234, /* DSR */
.model = 0x0001,
.src_addr = {0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88},
.src_id = 0xabacadac,
.application_id = GBOSS_APP_ID_0,
.endpoint = 0x55,
.comm_options = {
.mac_sequence_number_capability = GBOSS_MAC_SEQ_NUM_INCREMENTAL,
.rx_on_capability = ZB_FALSE,
.application_info_present = ZB_TRUE,
.pan_id_request = ZB_FALSE,
.gp_security_key_request = ZB_FALSE,
.fixed_location = ZB_FALSE,
.extended_options_present = ZB_TRUE},
.comm_extended_options = {
.security_level_capabilities = GBOSS_SECURITY_KEY_CAP_L3,
.gpd_key_present = ZB_TRUE,
.gpd_key_encryption = ZB_TRUE,
.gpd_outgoing_counter_present = ZB_TRUE},
.comm_app_info = {
.manuf_id_present = ZB_TRUE,
.model_id_present = ZB_TRUE,
.gpd_commands_present = ZB_TRUE,
.cluster_list_present = ZB_TRUE,
.switch_info_present = ZB_FALSE,
.gpd_app_descr_command_follows = ZB_FALSE},
.cmd_list_count = ZB_ARRAY_SIZE(gs_commands),
.cmd_list = gs_commands,
.cluster_srv_cnt = ZB_ARRAY_SIZE(gs_clusters_srv),
.cluster_list_srv = gs_clusters_srv,
.cluster_cli_cnt = ZB_ARRAY_SIZE(gs_clusters_cli),
.cluster_list_cli = gs_clusters_cli
};

§ gboss_security_key_capabilities_t

GPD Commissioning - Security key capabilities.

§ gboss_key_types_t

GPD Commissioning - Key types.

§ gboss_comm_ext_options_t

GPD Commissioning - Extended options field descriptor.

static const zb_uint8_t gs_commands[] = {
GBOSS_APP_CMD_ID_OFF,
GBOSS_APP_CMD_ID_ON,
GBOSS_APP_CMD_ID_TOGGLE
};
static const zb_uint16_t gs_clusters_cli[] = {
ZB_ZCL_CLUSTER_ID_LEVEL_CONTROL
};
static const zb_uint16_t gs_clusters_srv[] = {
ZB_ZCL_CLUSTER_ID_REL_HUMIDITY_MEASUREMENT
};
static const gboss_device_config_t g_device_config = {
.manufacturer = 0x1234, /* DSR */
.model = 0x0001,
.src_addr = {0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88},
.src_id = 0xabacadac,
.application_id = GBOSS_APP_ID_0,
.endpoint = 0x55,
.comm_options = {
.mac_sequence_number_capability = GBOSS_MAC_SEQ_NUM_INCREMENTAL,
.rx_on_capability = ZB_FALSE,
.application_info_present = ZB_TRUE,
.pan_id_request = ZB_FALSE,
.gp_security_key_request = ZB_FALSE,
.fixed_location = ZB_FALSE,
.extended_options_present = ZB_TRUE},
.comm_extended_options = {
.security_level_capabilities = GBOSS_SECURITY_KEY_CAP_L3,
.gpd_key_present = ZB_TRUE,
.gpd_key_encryption = ZB_TRUE,
.gpd_outgoing_counter_present = ZB_TRUE},
.comm_app_info = {
.manuf_id_present = ZB_TRUE,
.model_id_present = ZB_TRUE,
.gpd_commands_present = ZB_TRUE,
.cluster_list_present = ZB_TRUE,
.switch_info_present = ZB_FALSE,
.gpd_app_descr_command_follows = ZB_FALSE},
.cmd_list_count = ZB_ARRAY_SIZE(gs_commands),
.cmd_list = gs_commands,
.cluster_srv_cnt = ZB_ARRAY_SIZE(gs_clusters_srv),
.cluster_list_srv = gs_clusters_srv,
.cluster_cli_cnt = ZB_ARRAY_SIZE(gs_clusters_cli),
.cluster_list_cli = gs_clusters_cli
};

§ gboss_comm_app_info_t

GPD Commissioning - Application information descriptor.

static const zb_uint8_t gs_commands[] = {
GBOSS_APP_CMD_ID_OFF,
GBOSS_APP_CMD_ID_ON,
GBOSS_APP_CMD_ID_TOGGLE
};
static const zb_uint16_t gs_clusters_cli[] = {
ZB_ZCL_CLUSTER_ID_LEVEL_CONTROL
};
static const zb_uint16_t gs_clusters_srv[] = {
ZB_ZCL_CLUSTER_ID_REL_HUMIDITY_MEASUREMENT
};
static const gboss_device_config_t g_device_config = {
.manufacturer = 0x1234, /* DSR */
.model = 0x0001,
.src_addr = {0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88},
.src_id = 0xabacadac,
.application_id = GBOSS_APP_ID_0,
.endpoint = 0x55,
.comm_options = {
.mac_sequence_number_capability = GBOSS_MAC_SEQ_NUM_INCREMENTAL,
.rx_on_capability = ZB_FALSE,
.application_info_present = ZB_TRUE,
.pan_id_request = ZB_FALSE,
.gp_security_key_request = ZB_FALSE,
.fixed_location = ZB_FALSE,
.extended_options_present = ZB_TRUE},
.comm_extended_options = {
.security_level_capabilities = GBOSS_SECURITY_KEY_CAP_L3,
.gpd_key_present = ZB_TRUE,
.gpd_key_encryption = ZB_TRUE,
.gpd_outgoing_counter_present = ZB_TRUE},
.comm_app_info = {
.manuf_id_present = ZB_TRUE,
.model_id_present = ZB_TRUE,
.gpd_commands_present = ZB_TRUE,
.cluster_list_present = ZB_TRUE,
.switch_info_present = ZB_FALSE,
.gpd_app_descr_command_follows = ZB_FALSE},
.cmd_list_count = ZB_ARRAY_SIZE(gs_commands),
.cmd_list = gs_commands,
.cluster_srv_cnt = ZB_ARRAY_SIZE(gs_clusters_srv),
.cluster_list_srv = gs_clusters_srv,
.cluster_cli_cnt = ZB_ARRAY_SIZE(gs_clusters_cli),
.cluster_list_cli = gs_clusters_cli
};

§ gboss_app_ids_t

GPD Application IDs.

§ gboss_dev_id_t

Possible ZGPD device identifiers.

See also
ZGP spec, A.4.3

§ gboss_device_config_t

Main configuration constants of a GP device.

static const zb_uint8_t gs_commands[] = {
GBOSS_APP_CMD_ID_OFF,
GBOSS_APP_CMD_ID_ON,
GBOSS_APP_CMD_ID_TOGGLE
};
static const zb_uint16_t gs_clusters_cli[] = {
ZB_ZCL_CLUSTER_ID_LEVEL_CONTROL
};
static const zb_uint16_t gs_clusters_srv[] = {
ZB_ZCL_CLUSTER_ID_REL_HUMIDITY_MEASUREMENT
};
static const gboss_device_config_t g_device_config = {
.manufacturer = 0x1234, /* DSR */
.model = 0x0001,
.src_addr = {0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88},
.src_id = 0xabacadac,
.application_id = GBOSS_APP_ID_0,
.endpoint = 0x55,
.comm_options = {
.mac_sequence_number_capability = GBOSS_MAC_SEQ_NUM_INCREMENTAL,
.rx_on_capability = ZB_FALSE,
.application_info_present = ZB_TRUE,
.pan_id_request = ZB_FALSE,
.gp_security_key_request = ZB_FALSE,
.fixed_location = ZB_FALSE,
.extended_options_present = ZB_TRUE},
.comm_extended_options = {
.security_level_capabilities = GBOSS_SECURITY_KEY_CAP_L3,
.gpd_key_present = ZB_TRUE,
.gpd_key_encryption = ZB_TRUE,
.gpd_outgoing_counter_present = ZB_TRUE},
.comm_app_info = {
.manuf_id_present = ZB_TRUE,
.model_id_present = ZB_TRUE,
.gpd_commands_present = ZB_TRUE,
.cluster_list_present = ZB_TRUE,
.switch_info_present = ZB_FALSE,
.gpd_app_descr_command_follows = ZB_FALSE},
.cmd_list_count = ZB_ARRAY_SIZE(gs_commands),
.cmd_list = gs_commands,
.cluster_srv_cnt = ZB_ARRAY_SIZE(gs_clusters_srv),
.cluster_list_srv = gs_clusters_srv,
.cluster_cli_cnt = ZB_ARRAY_SIZE(gs_clusters_cli),
.cluster_list_cli = gs_clusters_cli
};

§ gboss_tx_cfg_t

TX configuration outlining how a transmission should proceed concerning the channels to be used and the number of repetitions.

The channel array describes list of channels that are used for frames transmission in unidirectional commissioning and frames transmission and reception in bidirectional commissioning. The channel array is logically divided by chunks of "channel_group_size".

Example: If "channels" points to channel_list as follows zb_uint8_t channel_list[9] = [11, 12, 13, 14, 15, 16, 17, 18, 19] and channel_group_size equals to 3, it will give three logical groups of channels:

  • group #0: channels 11, 12, 13
  • group #1: channels 14, 15, 16
  • group #2: channels 17, 18, 19

The channel array size must be a multiple of channel_group_size. Group size determines channels that are used in one commissioning attempt. The interpretation of how channels are used differs depending on the device state (commissioned or commissioning in progress) and commissioning type (unidirectional or bidirectional).

Unidirectional commissioning or application command TX time - repeat "repetition" times executes the following procedure:

  • Get channel from the channels array,
  • Change channel,
  • Send a frame,
  • Get next channel from the channels array.

Bidirectional commissioning:

  • Number of repetitions is a GPFS size (number of consequent GP frames to be sent in one TX attempt),
  • Channel_group_size is a number of channels used in "Channel request" commissioning phase.

Bidirectional commissioning after channel is established:

  • Number of repetitions is a GPFS size,
  • TX on a single channel stored in NVM.

    static const zb_uint8_t g_zgpd_channels[] = {
    16,15,14,13,17,18,12,11,19,20,21,22,23,24,25,26
    };
    static const gboss_tx_cfg_t g_tx_cfg = {
    .channels = g_zgpd_channels,
    .channel_count = ZB_ARRAY_SIZE(g_zgpd_channels),
    .channel_group_size = 4,
    .repetitions = 3
    };

Enumeration Type Documentation

§ gboss_mac_sequence_number_capabilities_e

GP device MAC sequence number capabilities enum.

Enumerator
GBOSS_MAC_SEQ_NUM_RANDOM 

GPD uses random MAC sequence number.

GBOSS_MAC_SEQ_NUM_INCREMENTAL 

GPD uses incremental MAC sequence number.

§ gboss_security_key_capabilities_e

GPD Commissioning - Security key capabilities.

Enumerator
GBOSS_SECURITY_KEY_CAP_L0 

No security.

GBOSS_SECURITY_KEY_CAP_L2 

4B frame counter and 4B MIC only

GBOSS_SECURITY_KEY_CAP_L3 

Encryption & 4B frame counter and 4B MIC.

§ gboss_key_types_e

GPD Commissioning - Key types.

Enumerator
GBOSS_KEY_TYPE_NO_KEY 

No protection for GPDF communication.

GBOSS_KEY_TYPE_ZB_NWK_KEY 

GPD communication is secured with Zigbee NWK key.

GBOSS_KEY_TYPE_GPD_GROUP_KEY 

Group key is shared between GPDs and GP infrastructure devices.

GBOSS_KEY_TYPE_NWK_KEY_DERIVED_GPD_GROUP_KEY 

Group key is shared between GPDs and GP infrastructure devices, derived from ZB NWK key.

GBOSS_KEY_TYPE_INDIVIDUAL_PRE_CONFIG_KEY 

GPD is pre-configured with a security key.

GBOSS_KEY_TYPE_DERIVED_INDIVIDUAL_GROUP_KEY 

An individual key is derived from the GPD independent group key (0x010) used by a particular network.

§ gboss_app_ids_e

GPD Application IDs.

Enumerator
GBOSS_APP_ID_0 

Uses SrcID.

GBOSS_APP_ID_2 

Uses GPD IEEE address.

§ gboss_dev_id_e

Possible ZGPD device identifiers.

See also
ZGP spec, A.4.3
Enumerator
GBOSS_SIMPLE_GEN_1_STATE_SWITCH_DEV_ID 

Simple Generic 1-state ZGP Switch.

GBOSS_SIMPLE_GEN_2_STATE_SWITCH_DEV_ID 

Simple Generic 2-state ZGP Switch.

GBOSS_ON_OFF_SWITCH_DEV_ID 

ZGP On/Off Switch.

GBOSS_LEVEL_CONTROL_SWITCH_DEV_ID 

ZGP Level Control Switch.

GBOSS_SIMPLE_SENSOR_DEV_ID 

ZGP Simple Sensor.

GBOSS_ADVANCED_GEN_1_STATE_SWITCH_DEV_ID 

Advanced Generic 1-state ZGP Switch.

GBOSS_ADVANCED_GEN_2_STATE_SWITCH_DEV_ID 

Advanced Generic 2-state ZGP Switch.

GBOSS_GEN_8_CONT_SWITCH_DEV_ID 

Generic 8-contact ZGP Switch.

GBOSS_COLOR_DIMMER_SWITCH_DEV_ID 

Color Dimmer ZGP Switch.

GBOSS_LIGHT_SENSOR_DEV_ID 

ZGP Light Sensor.

GBOSS_OCCUPANCY_SENSOR_DEV_ID 

ZGP Occupancy Sensor.

GBOSS_DOOR_LOCK_CONTROLLER_DEV_ID 

ZGP Door Lock Controller.

GBOSS_TEMPERATURE_SENSOR_DEV_ID 

ZGP Temperature Sensor.

GBOSS_PRESSURE_SENSOR_DEV_ID 

ZGP Pressure Sensor.

GBOSS_FLOW_SENSOR_DEV_ID 

ZGP Flow Sensor.

GBOSS_ENVIRONMENT_SENSOR_DEV_ID 

ZGP Temperature + Humidity Sensor.

GBOSS_MANUF_SPECIFIC_DEV_ID 

Manufactures-specific; 2 more fields in the Commissioning frame.

See 4.1 Manufacturer Specific Green Power Device Type Use case in Green Power Device Manufacturer Specific Device & Command Definition Proposal

GBOSS_UNDEFINED_DEV_ID 

Undefined device type.

Function Documentation

§ gboss_app_init()

void gboss_app_init ( const zb_uint8_t key,
const gboss_device_config_t device_config 
)

Initializes the ZGPD stack.

Parameters
keyPointer to a 16-bytes OOB key or NULL if not used
device_configGPD configuration block
static const zb_uint8_t g_zgpd_encryption_key[] = {
0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7,
0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF
};
static const zb_uint8_t gs_commands[] = {
GBOSS_APP_CMD_ID_OFF,
GBOSS_APP_CMD_ID_ON,
GBOSS_APP_CMD_ID_TOGGLE
};
static const zb_uint16_t gs_clusters_cli[] = {
ZB_ZCL_CLUSTER_ID_LEVEL_CONTROL
};
static const zb_uint16_t gs_clusters_srv[] = {
ZB_ZCL_CLUSTER_ID_REL_HUMIDITY_MEASUREMENT
};
static const gboss_device_config_t g_device_config = {
.manufacturer = 0x1234, /* DSR */
.model = 0x0001,
.src_addr = {0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88},
.src_id = 0xabacadac,
.application_id = GBOSS_APP_ID_0,
.endpoint = 0x55,
.comm_options = {
.mac_sequence_number_capability = GBOSS_MAC_SEQ_NUM_INCREMENTAL,
.rx_on_capability = ZB_FALSE,
.application_info_present = ZB_TRUE,
.pan_id_request = ZB_FALSE,
.gp_security_key_request = ZB_FALSE,
.fixed_location = ZB_FALSE,
.extended_options_present = ZB_TRUE},
.comm_extended_options = {
.security_level_capabilities = GBOSS_SECURITY_KEY_CAP_L3,
.gpd_key_present = ZB_TRUE,
.gpd_key_encryption = ZB_TRUE,
.gpd_outgoing_counter_present = ZB_TRUE},
.comm_app_info = {
.manuf_id_present = ZB_TRUE,
.model_id_present = ZB_TRUE,
.gpd_commands_present = ZB_TRUE,
.cluster_list_present = ZB_TRUE,
.switch_info_present = ZB_FALSE,
.gpd_app_descr_command_follows = ZB_FALSE},
.cmd_list_count = ZB_ARRAY_SIZE(gs_commands),
.cmd_list = gs_commands,
.cluster_srv_cnt = ZB_ARRAY_SIZE(gs_clusters_srv),
.cluster_list_srv = gs_clusters_srv,
.cluster_cli_cnt = ZB_ARRAY_SIZE(gs_clusters_cli),
.cluster_list_cli = gs_clusters_cli
};
static const zb_uint8_t g_zgpd_channels[] = {
16,15,14,13,17,18,12,11,19,20,21,22,23,24,25,26
};
static const gboss_tx_cfg_t g_tx_cfg = {
.channels = g_zgpd_channels,
.channel_count = ZB_ARRAY_SIZE(g_zgpd_channels),
.channel_group_size = 4,
.repetitions = 3
};
/* Platform-specific initialization */
gboss_platform_init(ARGC_ARGV);
TRACE_INIT("zgpd_unidir_onoff");
/* ZPGD stack init */
gboss_app_init(g_zgpd_encryption_key, &g_device_config);
/* Inform platform layer about buttons number */
/* Pass information about */
/* Get mask of buttons pressed at power ON time - if multiple are pressed
simultaneously, only the higher index is considered */
button_mask = gboss_test_get_button_mask();
button_id = 31 - MAGIC_CLZ(button_mask);

References zb_mac_init(), and zb_mac_set_tx_power().

§ gboss_platform_init()

void gboss_platform_init ( ARGC_ARGV_PROTO  )

Initializes the platform layer.

To be called before gboss_app_init().

/* Platform-specific initialization */
gboss_platform_init(ARGC_ARGV);
TRACE_INIT("zgpd_unidir_onoff");
/* ZPGD stack init */
gboss_app_init(g_zgpd_encryption_key, &g_device_config);
/* Inform platform layer about buttons number */
/* Pass information about */
/* Get mask of buttons pressed at power ON time - if multiple are pressed
simultaneously, only the higher index is considered */
button_mask = gboss_test_get_button_mask();
button_id = 31 - MAGIC_CLZ(button_mask);

§ gboss_wait_for_button()

void gboss_wait_for_button ( void  )

Waits until any button is pressed.

To be called before gboss_test_get_button_mask() for bidirectional battery powered device.

§ gboss_test_get_button_mask()

zb_uint32_t gboss_test_get_button_mask ( void  )

Gets bitmask of buttons pressed on the device boot.

Returns
Bit mask of pressed buttons
/* Platform-specific initialization */
gboss_platform_init(ARGC_ARGV);
TRACE_INIT("zgpd_unidir_onoff");
/* ZPGD stack init */
gboss_app_init(g_zgpd_encryption_key, &g_device_config);
/* Inform platform layer about buttons number */
/* Pass information about */
/* Get mask of buttons pressed at power ON time - if multiple are pressed
simultaneously, only the higher index is considered */
button_mask = gboss_test_get_button_mask();
button_id = 31 - MAGIC_CLZ(button_mask);

§ gboss_set_buttons_max_num()

void gboss_set_buttons_max_num ( zb_uint8_t  num)

Informs platform layer about number of supported buttons.

Parameters
numNumber of supported buttons in application