Refacter the MQTT-SN Packet printf()

Signed-off-by: tomoaki <tomoaki@tomy-tech.com>
This commit is contained in:
tomoaki
2019-01-15 16:38:55 +09:00
parent 7e13268466
commit c7b8ef1e54
4 changed files with 354 additions and 181 deletions

View File

@@ -423,12 +423,9 @@ char* MQTTSNPacket::print(char* pbuf)
{
char* ptr = pbuf;
char** pptr = &pbuf;
int value = 0;
int i = MQTTSNPacket_decode(_buf, _bufLen, &value);
int size = _bufLen > SIZE_OF_LOG_PACKET ? SIZE_OF_LOG_PACKET : _bufLen;
for (i = 0; i < size; i++)
for (int i = 0; i < size; i++)
{
sprintf(*pptr, " %02X", *(_buf + i));
*pptr += 3;