Developing with ZBOSS for Zigbee
R23_dev_iterview

Functions

zb_bool_t zb_tc_is_device_interview_enabled (void)
 
void zb_tc_enable_device_interview (zb_bool_t enable)
 
zb_ret_t zb_tc_auth_device_after_interview (const zb_ieee_addr_t device_addr)
 
void zb_tc_reject_device_after_interview (const zb_ieee_addr_t device_addr)
 
zb_bool_t zb_tc_is_interview_active_for_device (zb_uint16_t device_addr)
 

Detailed Description

Function Documentation

◆ zb_tc_auth_device_after_interview()

zb_ret_t zb_tc_auth_device_after_interview ( const zb_ieee_addr_t  device_addr)

Authenticates device after Device Interview.

See also
ZB_ZDO_SIGNAL_DEVICE_INTERVIEW_FINISHED
Parameters
device_addr- address of the device to authenticate
/* Switch ON device interview. Now ZC app receives
* ZB_ZDO_SIGNAL_DEVICE_READY_FOR_INTERVIEW signal and must explicitly finish
* the interview by calling zb_tc_auth_device_after_interview() */
/* Initiate the stack start with starting the commissioning */
{
TRACE_MSG(TRACE_ERROR, "ERROR zboss_start failed", (FMT__0));
}
else
{
/* Call the main loop */
}
{
TRACE_MSG(TRACE_APP1, "ZB_ZDO_SIGNAL_DEVICE_READY_FOR_INTERVIEW, short_addr 0x%x, ieee_addr " TRACE_FORMAT_64,
(FMT__D_A, dev_interview_params->short_addr, TRACE_ARG_64(dev_interview_params->long_addr)));
if (ZB_IEEE_ADDR_CMP(dev_interview_params->long_addr, g_r23_zed_ieee_addr))
{
TRACE_MSG(TRACE_APP1, "Start device interview for 0x%x", (FMT__D, dev_interview_params->short_addr));
app_start_device_interview(param, dev_interview_params->short_addr);
param = ZB_UNDEFINED_BUFFER;
}
else
{
TRACE_MSG(TRACE_APP1, "Authenticate device 0x%x without interview", (FMT__D, dev_interview_params->short_addr));
param = ZB_UNDEFINED_BUFFER;
}
break;
} /* ZB_ZDO_SIGNAL_DEVICE_READY_FOR_INTERVIEW */
{
TRACE_MSG(TRACE_APP1, "ZB_ZDO_SIGNAL_DEVICE_INTERVIEW_FINISHED, status %hd", (FMT__H, status));
break;
} /* ZB_ZDO_SIGNAL_DEVICE_INTERVIEW_FINISHED */
/* To continue the device interview, the TC can send another requests.
* To close the device interview and reject the device do nothing - after apsSecurityTimeOutPeriod (10s by default)
* the device will be removed automatically.
* To close the device interview and authorize the device call zb_tc_auth_device_after_interview() .
*/
if (resp->hdr.status == ZB_ZDP_STATUS_SUCCESS)
{
zb_ieee_addr_t ieee_addr;
if (RET_OK == zb_address_ieee_by_short(resp->hdr.nwk_addr, ieee_addr))
{
{
TRACE_MSG(TRACE_APP1, "device authorized " TRACE_FORMAT_64, (FMT__A, TRACE_ARG_64(ieee_addr)));
}
}
}

◆ zb_tc_enable_device_interview()

void zb_tc_enable_device_interview ( zb_bool_t  enable)

Enables Device Interview stage.

Parameters
enable- flag that shows whether device interview should be enabled Default value - ZB_FALSE, the stage is disabled
See also
ZB_ZDO_SIGNAL_DEVICE_READY_FOR_INTERVIEW.
/* Switch ON device interview. Now ZC app receives
* ZB_ZDO_SIGNAL_DEVICE_READY_FOR_INTERVIEW signal and must explicitly finish
* the interview by calling zb_tc_auth_device_after_interview() */
/* Initiate the stack start with starting the commissioning */
{
TRACE_MSG(TRACE_ERROR, "ERROR zboss_start failed", (FMT__0));
}
else
{
/* Call the main loop */
}
{
TRACE_MSG(TRACE_APP1, "ZB_ZDO_SIGNAL_DEVICE_READY_FOR_INTERVIEW, short_addr 0x%x, ieee_addr " TRACE_FORMAT_64,
(FMT__D_A, dev_interview_params->short_addr, TRACE_ARG_64(dev_interview_params->long_addr)));
if (ZB_IEEE_ADDR_CMP(dev_interview_params->long_addr, g_r23_zed_ieee_addr))
{
TRACE_MSG(TRACE_APP1, "Start device interview for 0x%x", (FMT__D, dev_interview_params->short_addr));
app_start_device_interview(param, dev_interview_params->short_addr);
param = ZB_UNDEFINED_BUFFER;
}
else
{
TRACE_MSG(TRACE_APP1, "Authenticate device 0x%x without interview", (FMT__D, dev_interview_params->short_addr));
param = ZB_UNDEFINED_BUFFER;
}
break;
} /* ZB_ZDO_SIGNAL_DEVICE_READY_FOR_INTERVIEW */
{
TRACE_MSG(TRACE_APP1, "ZB_ZDO_SIGNAL_DEVICE_INTERVIEW_FINISHED, status %hd", (FMT__H, status));
break;
} /* ZB_ZDO_SIGNAL_DEVICE_INTERVIEW_FINISHED */
/* To continue the device interview, the TC can send another requests.
* To close the device interview and reject the device do nothing - after apsSecurityTimeOutPeriod (10s by default)
* the device will be removed automatically.
* To close the device interview and authorize the device call zb_tc_auth_device_after_interview() .
*/
if (resp->hdr.status == ZB_ZDP_STATUS_SUCCESS)
{
zb_ieee_addr_t ieee_addr;
if (RET_OK == zb_address_ieee_by_short(resp->hdr.nwk_addr, ieee_addr))
{
{
TRACE_MSG(TRACE_APP1, "device authorized " TRACE_FORMAT_64, (FMT__A, TRACE_ARG_64(ieee_addr)));
}
}
}

◆ zb_tc_is_device_interview_enabled()

zb_bool_t zb_tc_is_device_interview_enabled ( void  )

Checks whether Device Interview is enabled

Returns
Device Interview status

◆ zb_tc_is_interview_active_for_device()

zb_bool_t zb_tc_is_interview_active_for_device ( zb_uint16_t  device_addr)

Checks whether Device Interview is active for a device.

Parameters
device_addr- address of the device

◆ zb_tc_reject_device_after_interview()

void zb_tc_reject_device_after_interview ( const zb_ieee_addr_t  device_addr)

Rejects device after Device Interview and send Leave command.

See also
ZB_ZDO_SIGNAL_DEVICE_INTERVIEW_FINISHED
Parameters
device_addr- address of the device to reject
TRACE_MSG
#define TRACE_MSG(lm, fmts, args)
Put trace output.
Definition: zb_trace.h:369
zb_zdo_beacon_survey_resp_params_s::status
zb_uint8_t status
Definition: zboss_api_zdo.h:4082
zb_zdo_signal_device_ready_for_interview_params_s
Device Ready For Interview signal parameters.
Definition: zboss_api_zdo.h:1377
zboss_main_loop
void zboss_main_loop(void)
ZB_TRUE
#define ZB_TRUE
Definition: zb_types.h:350
zb_zdo_signal_device_ready_for_interview_params_s::long_addr
zb_ieee_addr_t long_addr
Definition: zboss_api_zdo.h:1380
ZB_ZDO_SIGNAL_DEVICE_READY_FOR_INTERVIEW
#define ZB_ZDO_SIGNAL_DEVICE_READY_FOR_INTERVIEW
Definition: zboss_api_zdo.h:815
zb_address_ieee_by_short
zb_ret_t zb_address_ieee_by_short(zb_uint16_t short_addr, zb_ieee_addr_t ieee_address)
ZB_ZDP_STATUS_SUCCESS
#define ZB_ZDP_STATUS_SUCCESS
Definition: zboss_api_zdo.h:41
zb_tc_enable_device_interview
void zb_tc_enable_device_interview(zb_bool_t enable)
ZB_ZDO_SIGNAL_DEVICE_INTERVIEW_FINISHED
#define ZB_ZDO_SIGNAL_DEVICE_INTERVIEW_FINISHED
Definition: zboss_api_zdo.h:944
zb_ieee_addr_t
zb_64bit_addr_t zb_ieee_addr_t
Long (64-bit) device address.
Definition: zb_types.h:535
RET_OK
#define RET_OK
Error codes for non-void stack functions. In general, function can return OK, BLOCKED or some error....
Definition: zb_errors.h:79
zb_tc_auth_device_after_interview
zb_ret_t zb_tc_auth_device_after_interview(const zb_ieee_addr_t device_addr)
ZB_ZDO_SIGNAL_GET_PARAMS
#define ZB_ZDO_SIGNAL_GET_PARAMS(sg_p, type)
Definition: zboss_api_zdo.h:1109
zboss_start_no_autostart
zb_ret_t zboss_start_no_autostart(void)