From 9e27302eae30ae9203d7f3fd69f707a8d6c4c987 Mon Sep 17 00:00:00 2001 From: JeroenSt Date: Sun, 14 Feb 2021 11:53:29 +0100 Subject: [PATCH] Added comments about tuya protocol --- tuya.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tuya.cpp b/tuya.cpp index dcd4ed9..00c251a 100644 --- a/tuya.cpp +++ b/tuya.cpp @@ -1,6 +1,25 @@ #include "espMQTT.h" #include "tuya.h" +/* https://images.tuyacn.com/smart/aircondition/Guide-to-Interworking-with-the-Tuya-MCU.pdf + * Tuyapacket with DP command = 0x55, 0xAA, VERSION, COMMAND, 0x00, LENGTH, DPID, DATA TYPE, FUNCTION LENGTH, FUCTION DATA + * + * COMMAND + * 0x00 Heartbeat detection. + * 0x01 Query product information. + * 0x02 Query the working mode of the Wi-Fi module. + * 0x03 Report the network connection status of the device. + * 0x04 Reset the Wi-Fi module and switch the network configuration mode. + * 0x05 Reset the Wi-Fi module and select a network configuration mode. + * 0x06 Deliver DP commands. + * 0x07 Report DP status. + * 0x08 Query the device initialization status. + * 0x0a (Optional) Start OTA upgrade. + * 0x0b (Optional) Transmit the OTA upgrade package. + * 0x1c (Optional) Obtain the local time. + * 0x0e Test the Wi-Fi function (product testing command). + */ + static uint8_t tuya_dimvalue0 = 0; static uint8_t tuya_dimvalue1 = 0; static uint8_t tuya_dimstate0 = 0;