Goodday
Im currently checking for a true condition in a incoming char buffer as follow. below im looking for 197403290000000000123456789ABC0000 in a BLE string.
uint8_t buf[BLE_MAX_ADV_DATA_LEN];
if ((buf[13]==0x19)&&(buf[14]==0x74)&&(buf[15]==0x03)&&(buf[16]==0x29)&&(buf[17]==0x00)&&(buf[18]==0x00)&&
(buf[19]==0x00)&&(buf[20]==0x00)&&(buf[21]==0x00)&&(buf[22]==0x00)&&(buf[23]==0x12)&&(buf[24]==0x34)&&
(buf[25]==0x56)&&(buf[26]==0x78)&&(buf[27]==0x9A)&&(buf[28]==0xBC)&&(buf[29]==0x00)&&(buf[30]==0x00)){
then do stuff
}
It does work but is there a better way to compare a string segment and compare it to a known segment.