Code: Select all
static void notifyCallback(BLERemoteCharacteristic* pBLERemoteCharacteristic,
uint8_t* pData, size_t length,
bool isNotify)
{
Serial.print("Length: ");
Serial.println(length);
Serial.print("pData :");
Serial.println((char *)pData);
char temp[length];
for (int i=0; i<length; i++) {
temp[i] = (char)pData[i];
}
Serial.print("temp: ");
Serial.println(temp);
}
I don't know how to do it. Please help me.Length: 3
pData :chi⸮⸮?
temp: chi⸮⸮⸮?⸮⸮⸮?8⸮⸮?⸮Z
⸮⸮⸮⸮?
Length: 3
pData :hay⸮⸮?
temp: hay⸮⸮⸮?⸮⸮⸮?8⸮⸮?⸮Z
⸮⸮⸮⸮?
Length: 9
pData :heyGoogle
temp: heyGoogle⸮⸮?8⸮⸮?⸮Z
⸮⸮⸮⸮?
Length: 2
pData :hiyGoogle
temp: hi
⸮⸮⸮?⸮⸮⸮?8⸮⸮?⸮Z
⸮⸮⸮⸮?
Length: 5
pData :motayogle
temp: motay⸮⸮?⸮⸮⸮?8⸮⸮?⸮Z
⸮⸮⸮⸮?
Length: 6
Thanks in advance