mirror of
https://github.com/openshwprojects/OpenBK7231T_App.git
synced 2026-02-04 23:55:41 +00:00
tuyaMcu_sendCmd without second param bugfix (#1585)
This commit is contained in:
@ -2008,15 +2008,19 @@ commandResult_t TuyaMCU_SendUserCmd(const void* context, const char* cmd, const
|
||||
Tokenizer_TokenizeString(args, 0);
|
||||
|
||||
int command = Tokenizer_GetArgInteger(0);
|
||||
const char *s = Tokenizer_GetArg(1);
|
||||
//XJIKKA 20250327 tuyaMcu_sendCmd without second param bug
|
||||
if (Tokenizer_GetArgsCount() >= 2) {
|
||||
const char* s = Tokenizer_GetArg(1);
|
||||
if (s) {
|
||||
while (*s) {
|
||||
byte b;
|
||||
b = CMD_ParseOrExpandHexByte(&s);
|
||||
|
||||
while (*s) {
|
||||
byte b;
|
||||
b = CMD_ParseOrExpandHexByte(&s);
|
||||
|
||||
if (sizeof(packet) > c + 1) {
|
||||
packet[c] = b;
|
||||
c++;
|
||||
if (sizeof(packet) > c + 1) {
|
||||
packet[c] = b;
|
||||
c++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
TuyaMCU_SendCommandWithData(command,packet, c);
|
||||
|
||||
Reference in New Issue
Block a user