mirror of
https://github.com/openshwprojects/OpenBK7231T_App.git
synced 2026-03-08 00:07:42 +01:00
TuyaMCU send date month fix - Tuya uses range [1,12] for month number and TM structure uses [0,11]
This commit is contained in:
@@ -444,7 +444,9 @@ void TuyaMCU_Send_SetTime(struct tm *pTime) {
|
||||
payload_buffer[0] = 0x01;
|
||||
// datetime
|
||||
payload_buffer[1] = pTime->tm_year % 100;
|
||||
payload_buffer[2] = pTime->tm_mon;
|
||||
// tm uses: int tm_mon; // months since January - [0, 11]
|
||||
// Tuya uses: Data[1] indicates the month, ranging from 1 to 12.
|
||||
payload_buffer[2] = pTime->tm_mon + 1;
|
||||
payload_buffer[3] = pTime->tm_mday;
|
||||
payload_buffer[4] = pTime->tm_hour;
|
||||
payload_buffer[5] = pTime->tm_min;
|
||||
|
||||
Reference in New Issue
Block a user