在我以前的代码中,我使用以下代码行来获取“命令”字符串的最后 9 位
if(command.indexOf("kitchen light: set top color") >=0)
{OnColorValueRed = (command.charAt(28)- 48)*100 + (command.charAt(29)- 48)*10 + (command.charAt(30)- 48);}
现在我正在使用一个字符缓冲区(char packetBuffer[UDP_TX_PACKET_MAX_SIZE];)并且使用上面的代码不起作用,因为 packetBuffer 不是一个字符串,我该如何解决这个问题