silicon gatewayhost mqtt 修复设备入网只报1个端口的问题

本文详细介绍了在Zigbee网络中,当有新设备加入时,如何优化处理流程。具体包括:针对特定设备ID(如IAS_ZONE)写入CIE地址,更新设备状态,调用回调函数通知新设备加入,并保存设备表。同时,提出了对查找设备表索引函数的改进,增加了endpoint参数,以更精确地定位设备。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

device-table-discovery.c :

// We have a new endpoint.
static void newEndpointDiscovered(EmberAfPluginDeviceTableEntry *p_entry)
{
  // Figure out if we need to do anything, like write the CIE address to it.
  if (p_entry->deviceId == DEVICE_ID_IAS_ZONE) {
    // write IEEE address to CIE address location
    emAfDeviceTableSendCieAddressWrite(p_entry->nodeId, p_entry->endpoint);
  }
  p_entry->state = EMBER_AF_PLUGIN_DEVICE_TABLE_STATE_JOINED;
  // New device is set, time to make the callback to indicate a new device
  // has joined.
  emberAfPluginDeviceTableNewDeviceCallback(p_entry->eui64, p_entry->endpoint);//增加endpoint参数
  emAfDeviceTableSave();
}

gateway-relay-mqtt.c:

将  deviceTableIndex = emberAfDeviceTableGetFirstIndexFromEui64(eui64);

替换为

deviceTableIndex = emberAfDeviceTableGetIndexFromEui64AndEndpoint(eui64,endpoint);

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值