void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
int length = 6;
const uint8_t* payload = {"hello\0"};
char message[length+1]={0x00};
uint8_t* p = payload;
for (int i = 0; i < length;i++){
Serial.print(*(const char *)p);
message[i]= *p;
p++;
}
Serial.println();
Serial.println(message);
}
void loop() {
// put your main code here, to run repeatedly:
}