Logo
Developing with ZBOSS for Zigbee

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)

#include </conan-data/ti_zigbee/9.14.00.04/library-lprf/ga/build/f6d18801b7b469a709ae7e8290b03ecdc7a7ad4c/zboss_r23/include/zboss_api_zdo.h>

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);
}
else
{
TRACE_MSG(TRACE_APP1, "Authenticate device 0x%x without interview", (FMT__D, dev_interview_params->short_addr));
}
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)

#include </conan-data/ti_zigbee/9.14.00.04/library-lprf/ga/build/f6d18801b7b469a709ae7e8290b03ecdc7a7ad4c/zboss_r23/include/zboss_api_zdo.h>

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);
}
else
{
TRACE_MSG(TRACE_APP1, "Authenticate device 0x%x without interview", (FMT__D, dev_interview_params->short_addr));
}
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  )

#include </conan-data/ti_zigbee/9.14.00.04/library-lprf/ga/build/f6d18801b7b469a709ae7e8290b03ecdc7a7ad4c/zboss_r23/include/zboss_api_zdo.h>

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)

#include </conan-data/ti_zigbee/9.14.00.04/library-lprf/ga/build/f6d18801b7b469a709ae7e8290b03ecdc7a7ad4c/zboss_r23/include/zboss_api_zdo.h>

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)

#include </conan-data/ti_zigbee/9.14.00.04/library-lprf/ga/build/f6d18801b7b469a709ae7e8290b03ecdc7a7ad4c/zboss_r23/include/zboss_api_zdo.h>

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