SeeedJP / wioterminal-aziot-example

This repository contains a sample application showing how to connect a Wio Terminal to Azure IoT Hub to send telemetry and receive commands.
9 stars 8 forks source link

symmetric key is displayed too short #3

Closed matsujirushi closed 3 years ago

matsujirushi commented 3 years ago

image

matsujirushi commented 3 years ago

Displayed char. length is 79.

0         1         2         3         4         5         6         7         8
012345678901234567890123456789012345678901234567890123456789012345678901234567890
Symmetric key of Azure IoT DPS = DI0guSAsWEmbcmBS1eVMtHvyxPIrJjROy9ALhfZ0hzQMaf

This program using Serial.printf().

Serial.printf("Symmetric key of Azure IoT DPS = %s" DLM, Storage::SymmetricKey.c_str());

It is limited by PRINTF_BUF(80) in ArduinoCore-samd board package.

size_t Print::printf(const char format[], ...)
{
  size_t r;
  char buf[PRINTF_BUF];
  va_list ap;
  va_start(ap, format);
  r = vsnprintf(buf, sizeof(buf), format, ap);
  write(buf);
  va_end(ap);
  return r;
}
#define PRINTF_BUF 80