找回密码
 立即注册

微信扫码登录

查看: 46|回复: 2

How to use bdb_join_direct() function ?

[复制链接]

29

主题

22

回帖

389

积分

流光翡翠

积分
389
发表于 6 天前 | 显示全部楼层 |阅读模式 来自 韩国
information
说明:   建议参照本版块置顶帖内容输入必要信息
芯片型号: tlsr8258
SDK及版本: zigbee_ble_concurrent_sdk_v2.4.0.1
How to use bdb_join_direct() function ?

29

主题

22

回帖

389

积分

流光翡翠

积分
389
 楼主| 发表于 4 天前 | 显示全部楼层 来自 韩国

Buyer's Coordinator Information
- channel : 19
- pan id : 0x4B1C
- ext pan id : 0x35A980B2CD34C3AE
- security key : 0x3E4F3F1BEC449651904EAA1FF5BAF119

I run below function, but the sampleLight is not connected to the coordinator.
How to connect the sampleLight to the coordinator ?

s32 sampleLight_bdbNetworkJoinDirect2(void)
{
        u8 extPanId[] = {0xae, 0xc3, 0x34, 0xcd, 0xb2, 0x80, 0xa9, 0x35 };
        u8 nwkKey[] = {0x19, 0xf1, 0xba, 0xf5, 0x1f, 0xaa, 0x4e, 0x90, 0x51, 0x96, 0x44, 0xec, 0x1b, 0x3f, 0x4f, 0x3e };
//        u8 nwkKey[] = {0x3e, 0x4f, 0x3f, 0x1b, 0xec, 0x44, 0x96, 0x51, 0x90, 0x4e, 0xaa, 0x1f, 0xf5, 0xba, 0xf1, 0x19};
        u8 tcAddr[] = {0x78, 0x56, 0x34, 0x12, 0x24, 0x10, 0x15, 0x20 };

        g_joinNetworkInfo.channel = 19;
        g_joinNetworkInfo.panId = 0x4B1C;
        g_joinNetworkInfo.nwkAddr = 0x5555;

#if 0 // SEMODE Distributed
        if(SUCCESS == bdb_join_direct(g_joinNetworkInfo.channel, g_joinNetworkInfo.panId, g_joinNetworkInfo.nwkAddr, extPanId, nwkKey, SS_SEMODE_DISTRIBUTED, 1, NULL))
#else // SEMODE Centralized
        if(SUCCESS == bdb_join_direct(g_joinNetworkInfo.channel, g_joinNetworkInfo.panId, g_joinNetworkInfo.nwkAddr, extPanId, nwkKey, SS_SEMODE_CENTRALIZED, 1, tcAddr))
#endif
        {
                return -1;
        }
        return 0;
}

13

主题

72

回帖

412

积分

璀璨钻石

积分
412
发表于 4 天前 | 显示全部楼层 来自 澳大利亚
本帖最后由 wes58 于 2025-8-14 13:05 编辑
jylee@kme21.com 发表于 2025-8-14 10:07
Buyer's Coordinator Information
- channel : 19
- pan id : 0x4B1C

I haven't done it but have a look in the ZibBee BLE concurrent sampleSwitch project.
You will find this function:
  1. int zb_ble_hci_cmd_handler(u16 cmdId, u8 len, u8 *payload){
  2.         int ret = 0;
  3.         if(cmdId == APP_BLE_CMD_ZB_NETWORK_JOIN){
  4.                 bdb_networkSteerStart();
  5.         }else if(cmdId == APP_BLE_CMD_ZB_FACTORY_RESET){
  6.                 zb_resetDevice2FN();
  7.         }else if(cmdId == APP_BLE_CMD_ZB_NETWORK_JOIN_DIRECT){
  8.                 g_joinNetworkInfo.channel = payload[0];
  9.                 g_joinNetworkInfo.panId = ((u16)payload[1] | ((u16)payload[2] << 8));
  10.                 g_joinNetworkInfo.nwkAddr = ((u16)payload[3] | ((u16)payload[4] << 8));

  11.                 if(g_switchAppCtx.timerSteering){
  12.                         TL_ZB_TIMER_CANCEL(&g_switchAppCtx.timerSteering);
  13.                 }

  14.                 TL_ZB_TIMER_SCHEDULE(sampleSwitch_bdbNetworkJoinDirect, NULL, 50);
  15.         }else{
  16.                 ret = -1;
  17.         }
  18.         return ret;
  19. }
复制代码


You will see how this function sampleSwitch_bdbNetworkJoinDirect or in your example sampleLight is a function that is called. There are other paramaters that have to be set before it is called.
  1. TL_ZB_TIMER_SCHEDULE(sampleSwitch_bdbNetworkJoinDirect, NULL, 50);
复制代码
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Telink forum ( 沪ICP备17008231号-1 )

GMT+8, 2025-8-18 03:12 , Processed in 0.108918 second(s), 20 queries .

Powered by Telink 隐私政策

泰凌微电子版权所有 © 。保留所有权利。 2024

快速回复 返回顶部 返回列表