From 05ea7cd0c6f5cda9cdf98bfd2e9e74fbf0968225 Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Thu, 19 Mar 2020 09:43:04 +0100 Subject: [PATCH] Fix probing ModelId and ManudID --- tasmota/xdrv_23_zigbee_8_parsers.ino | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tasmota/xdrv_23_zigbee_8_parsers.ino b/tasmota/xdrv_23_zigbee_8_parsers.ino index 1ca3c3b29..fa73c3797 100644 --- a/tasmota/xdrv_23_zigbee_8_parsers.ino +++ b/tasmota/xdrv_23_zigbee_8_parsers.ino @@ -248,17 +248,24 @@ int32_t Z_ReceiveActiveEp(int32_t res, const class SBuffer &buf) { ResponseAppend_P(PSTR("]}}")); MqttPublishPrefixTopic_P(RESULT_OR_TELE, PSTR(D_JSON_ZIGBEEZCL_RECEIVED)); XdrvRulesProcess(); + + Z_SendAFInfoRequest(nwkAddr); // probe for ModelId and ManufId + return -1; } -void Z_SendAFInfoRequest(uint16_t shortaddr, uint8_t endpoint, uint16_t clusterid, uint8_t transacid) { +void Z_SendAFInfoRequest(uint16_t shortaddr) { + uint8_t endpoint = zigbee_devices.findFirstEndpoint(shortaddr); + if (0x00 == endpoint) { endpoint = 0x01; } // if we don't know the endpoint, try 0x01 + uint8_t transacid = zigbee_devices.getNextSeqNumber(shortaddr); + SBuffer buf(100); buf.add8(Z_SREQ | Z_AF); // 24 buf.add8(AF_DATA_REQUEST); // 01 buf.add16(shortaddr); buf.add8(endpoint); // dest endpoint buf.add8(0x01); // source endpoint - buf.add16(clusterid); + buf.add16(0x0000); buf.add8(transacid); buf.add8(0x30); // 30 options buf.add8(0x1E); // 1E radius