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);