mqtt_sn_debug.c File Reference

Data logging functions for debugging purpose (MQTT-SN) More...

#include "core/net.h"
#include "mqtt_sn/mqtt_sn_client.h"
#include "mqtt_sn/mqtt_sn_debug.h"
#include "debug.h"

Go to the source code of this file.

Macros

#define TRACE_LEVEL   MQTT_SN_TRACE_LEVEL
 

Functions

error_t mqttSnDumpMessage (const uint8_t *message, size_t length)
 Dump MQTT-SN message for debugging purpose. More...
 
error_t mqttSnDumpAdvertise (const MqttSnAdvertise *message, size_t length)
 Dump ADVERTISE message. More...
 
error_t mqttSnDumpSearchGw (const MqttSnSearchGw *message, size_t length)
 Dump SEARCHGW message. More...
 
error_t mqttSnDumpGwInfo (const MqttSnGwInfo *message, size_t length)
 Dump GWINFO message. More...
 
error_t mqttSnDumpConnect (const MqttSnConnect *message, size_t length)
 Dump CONNECT message. More...
 
error_t mqttSnDumpConnAck (const MqttSnConnAck *message, size_t length)
 Dump CONNACK message. More...
 
error_t mqttSnDumpWillTopicReq (const MqttSnWillTopicReq *message, size_t length)
 Dump WILLTOPICREQ message. More...
 
error_t mqttSnDumpWillTopic (const MqttSnWillTopic *message, size_t length)
 Dump WILLTOPIC message. More...
 
error_t mqttSnDumpWillMsgReq (const MqttSnWillMsgReq *message, size_t length)
 Dump WILLMSGREQ message. More...
 
error_t mqttSnDumpWillMsg (const MqttSnWillMsg *message, size_t length)
 Dump WILLMSG message. More...
 
error_t mqttSnDumpRegister (const MqttSnRegister *message, size_t length)
 Dump REGISTER message. More...
 
error_t mqttSnDumpRegAck (const MqttSnRegAck *message, size_t length)
 Dump REGACK message. More...
 
error_t mqttSnDumpPublish (const MqttSnPublish *message, size_t length)
 Dump PUBLISH message. More...
 
error_t mqttSnDumpPubAck (const MqttSnPubAck *message, size_t length)
 Dump PUBACK message. More...
 
error_t mqttSnDumpPubRec (const MqttSnPubRec *message, size_t length)
 Dump PUBREC message. More...
 
error_t mqttSnDumpPubRel (const MqttSnPubRel *message, size_t length)
 Dump PUBREL message. More...
 
error_t mqttSnDumpPubComp (const MqttSnPubComp *message, size_t length)
 Dump PUBCOMP message. More...
 
error_t mqttSnDumpSubscribe (const MqttSnSubscribe *message, size_t length)
 Dump SUBSCRIBE message. More...
 
error_t mqttSnDumpSubAck (const MqttSnSubAck *message, size_t length)
 Dump SUBACK message. More...
 
error_t mqttSnDumpUnsubscribe (const MqttSnUnsubscribe *message, size_t length)
 Dump UNSUBSCRIBE message. More...
 
error_t mqttSnDumpUnsubAck (const MqttSnUnsubAck *message, size_t length)
 Dump UNSUBACK message. More...
 
error_t mqttSnDumpPingReq (const MqttSnPingReq *message, size_t length)
 Dump PINGREQ message. More...
 
error_t mqttSnDumpPingResp (const MqttSnPingResp *message, size_t length)
 Dump PINGRESP message. More...
 
error_t mqttSnDumpDisconnect (const MqttSnDisconnect *message, size_t length)
 Dump DISCONNECT message. More...
 
error_t mqttSnDumpWillTopicUpd (const MqttSnWillTopicUpd *message, size_t length)
 Dump WILLTOPICUPD message. More...
 
error_t mqttSnDumpWillTopicResp (const MqttSnWillTopicResp *message, size_t length)
 Dump WILLTOPICRESP message. More...
 
error_t mqttSnDumpWillMsgUpd (const MqttSnWillMsgUpd *message, size_t length)
 Dump WILLMSGUPD message. More...
 
error_t mqttSnDumpWillMsgResp (const MqttSnWillMsgResp *message, size_t length)
 Dump WILLMSGRESP message. More...
 
void mqttSnDumpFlags (MqttSnFlags flags)
 Dump flags. More...
 
const char_tmqttSnGetMessageName (uint16_t msgType)
 Get the name of the specified MQTT-SN message. More...
 
const char_tmqttSnGetReturnCodeDesc (uint16_t returnCode)
 Get the description of the specified return code. More...
 

Variables

const char_t *const mqttSnMsgTypeLabel []
 
const char_t *const mqttSnReturnCodeLabel []
 

Detailed Description

Data logging functions for debugging purpose (MQTT-SN)

License

SPDX-License-Identifier: GPL-2.0-or-later

Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.

This file is part of CycloneTCP Open.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
2.4.0

Definition in file mqtt_sn_debug.c.

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   MQTT_SN_TRACE_LEVEL

Definition at line 32 of file mqtt_sn_debug.c.

Function Documentation

◆ mqttSnDumpAdvertise()

error_t mqttSnDumpAdvertise ( const MqttSnAdvertise message,
size_t  length 
)

Dump ADVERTISE message.

Parameters
[in]messagePointer to the message
[in]lengthLength of the message, in bytes
Returns
Error code

Definition at line 322 of file mqtt_sn_debug.c.

◆ mqttSnDumpConnAck()

error_t mqttSnDumpConnAck ( const MqttSnConnAck message,
size_t  length 
)

Dump CONNACK message.

Parameters
[in]messagePointer to the message
[in]lengthLength of the message, in bytes
Returns
Error code

Definition at line 415 of file mqtt_sn_debug.c.

◆ mqttSnDumpConnect()

error_t mqttSnDumpConnect ( const MqttSnConnect message,
size_t  length 
)

Dump CONNECT message.

Parameters
[in]messagePointer to the message
[in]lengthLength of the message, in bytes
Returns
Error code

Definition at line 391 of file mqtt_sn_debug.c.

◆ mqttSnDumpDisconnect()

error_t mqttSnDumpDisconnect ( const MqttSnDisconnect message,
size_t  length 
)

Dump DISCONNECT message.

Parameters
[in]messagePointer to the message
[in]lengthLength of the message, in bytes
Returns
Error code

Definition at line 857 of file mqtt_sn_debug.c.

◆ mqttSnDumpFlags()

void mqttSnDumpFlags ( MqttSnFlags  flags)

Dump flags.

Parameters
[in]flagsValue of the flags

Definition at line 960 of file mqtt_sn_debug.c.

◆ mqttSnDumpGwInfo()

error_t mqttSnDumpGwInfo ( const MqttSnGwInfo message,
size_t  length 
)

Dump GWINFO message.

Parameters
[in]messagePointer to the message
[in]lengthLength of the message, in bytes
Returns
Error code

Definition at line 366 of file mqtt_sn_debug.c.

◆ mqttSnDumpMessage()

error_t mqttSnDumpMessage ( const uint8_t *  message,
size_t  length 
)

Dump MQTT-SN message for debugging purpose.

Parameters
[in]messagePointer to the message
[in]lengthLength of the message, in bytes
Returns
Error code

Definition at line 95 of file mqtt_sn_debug.c.

◆ mqttSnDumpPingReq()

error_t mqttSnDumpPingReq ( const MqttSnPingReq message,
size_t  length 
)

Dump PINGREQ message.

Parameters
[in]messagePointer to the message
[in]lengthLength of the message, in bytes
Returns
Error code

Definition at line 826 of file mqtt_sn_debug.c.

◆ mqttSnDumpPingResp()

error_t mqttSnDumpPingResp ( const MqttSnPingResp message,
size_t  length 
)

Dump PINGRESP message.

Parameters
[in]messagePointer to the message
[in]lengthLength of the message, in bytes
Returns
Error code

Definition at line 843 of file mqtt_sn_debug.c.

◆ mqttSnDumpPubAck()

error_t mqttSnDumpPubAck ( const MqttSnPubAck message,
size_t  length 
)

Dump PUBACK message.

Parameters
[in]messagePointer to the message
[in]lengthLength of the message, in bytes
Returns
Error code

Definition at line 605 of file mqtt_sn_debug.c.

◆ mqttSnDumpPubComp()

error_t mqttSnDumpPubComp ( const MqttSnPubComp message,
size_t  length 
)

Dump PUBCOMP message.

Parameters
[in]messagePointer to the message
[in]lengthLength of the message, in bytes
Returns
Error code

Definition at line 671 of file mqtt_sn_debug.c.

◆ mqttSnDumpPublish()

error_t mqttSnDumpPublish ( const MqttSnPublish message,
size_t  length 
)

Dump PUBLISH message.

Parameters
[in]messagePointer to the message
[in]lengthLength of the message, in bytes
Returns
Error code

Definition at line 552 of file mqtt_sn_debug.c.

◆ mqttSnDumpPubRec()

error_t mqttSnDumpPubRec ( const MqttSnPubRec message,
size_t  length 
)

Dump PUBREC message.

Parameters
[in]messagePointer to the message
[in]lengthLength of the message, in bytes
Returns
Error code

Definition at line 629 of file mqtt_sn_debug.c.

◆ mqttSnDumpPubRel()

error_t mqttSnDumpPubRel ( const MqttSnPubRel message,
size_t  length 
)

Dump PUBREL message.

Parameters
[in]messagePointer to the message
[in]lengthLength of the message, in bytes
Returns
Error code

Definition at line 650 of file mqtt_sn_debug.c.

◆ mqttSnDumpRegAck()

error_t mqttSnDumpRegAck ( const MqttSnRegAck message,
size_t  length 
)

Dump REGACK message.

Parameters
[in]messagePointer to the message
[in]lengthLength of the message, in bytes
Returns
Error code

Definition at line 528 of file mqtt_sn_debug.c.

◆ mqttSnDumpRegister()

error_t mqttSnDumpRegister ( const MqttSnRegister message,
size_t  length 
)

Dump REGISTER message.

Parameters
[in]messagePointer to the message
[in]lengthLength of the message, in bytes
Returns
Error code

Definition at line 505 of file mqtt_sn_debug.c.

◆ mqttSnDumpSearchGw()

error_t mqttSnDumpSearchGw ( const MqttSnSearchGw message,
size_t  length 
)

Dump SEARCHGW message.

Parameters
[in]messagePointer to the message
[in]lengthLength of the message, in bytes
Returns
Error code

Definition at line 345 of file mqtt_sn_debug.c.

◆ mqttSnDumpSubAck()

error_t mqttSnDumpSubAck ( const MqttSnSubAck message,
size_t  length 
)

Dump SUBACK message.

Parameters
[in]messagePointer to the message
[in]lengthLength of the message, in bytes
Returns
Error code

Definition at line 736 of file mqtt_sn_debug.c.

◆ mqttSnDumpSubscribe()

error_t mqttSnDumpSubscribe ( const MqttSnSubscribe message,
size_t  length 
)

Dump SUBSCRIBE message.

Parameters
[in]messagePointer to the message
[in]lengthLength of the message, in bytes
Returns
Error code

Definition at line 692 of file mqtt_sn_debug.c.

◆ mqttSnDumpUnsubAck()

error_t mqttSnDumpUnsubAck ( const MqttSnUnsubAck message,
size_t  length 
)

Dump UNSUBACK message.

Parameters
[in]messagePointer to the message
[in]lengthLength of the message, in bytes
Returns
Error code

Definition at line 805 of file mqtt_sn_debug.c.

◆ mqttSnDumpUnsubscribe()

error_t mqttSnDumpUnsubscribe ( const MqttSnUnsubscribe message,
size_t  length 
)

Dump UNSUBSCRIBE message.

Parameters
[in]messagePointer to the message
[in]lengthLength of the message, in bytes
Returns
Error code

Definition at line 761 of file mqtt_sn_debug.c.

◆ mqttSnDumpWillMsg()

error_t mqttSnDumpWillMsg ( const MqttSnWillMsg message,
size_t  length 
)

Dump WILLMSG message.

Parameters
[in]messagePointer to the message
[in]lengthLength of the message, in bytes
Returns
Error code

Definition at line 487 of file mqtt_sn_debug.c.

◆ mqttSnDumpWillMsgReq()

error_t mqttSnDumpWillMsgReq ( const MqttSnWillMsgReq message,
size_t  length 
)

Dump WILLMSGREQ message.

Parameters
[in]messagePointer to the message
[in]lengthLength of the message, in bytes
Returns
Error code

Definition at line 473 of file mqtt_sn_debug.c.

◆ mqttSnDumpWillMsgResp()

error_t mqttSnDumpWillMsgResp ( const MqttSnWillMsgResp message,
size_t  length 
)

Dump WILLMSGRESP message.

Parameters
[in]messagePointer to the message
[in]lengthLength of the message, in bytes
Returns
Error code

Definition at line 940 of file mqtt_sn_debug.c.

◆ mqttSnDumpWillMsgUpd()

error_t mqttSnDumpWillMsgUpd ( const MqttSnWillMsgUpd message,
size_t  length 
)

Dump WILLMSGUPD message.

Parameters
[in]messagePointer to the message
[in]lengthLength of the message, in bytes
Returns
Error code

Definition at line 922 of file mqtt_sn_debug.c.

◆ mqttSnDumpWillTopic()

error_t mqttSnDumpWillTopic ( const MqttSnWillTopic message,
size_t  length 
)

Dump WILLTOPIC message.

Parameters
[in]messagePointer to the message
[in]lengthLength of the message, in bytes
Returns
Error code

Definition at line 451 of file mqtt_sn_debug.c.

◆ mqttSnDumpWillTopicReq()

error_t mqttSnDumpWillTopicReq ( const MqttSnWillTopicReq message,
size_t  length 
)

Dump WILLTOPICREQ message.

Parameters
[in]messagePointer to the message
[in]lengthLength of the message, in bytes
Returns
Error code

Definition at line 437 of file mqtt_sn_debug.c.

◆ mqttSnDumpWillTopicResp()

error_t mqttSnDumpWillTopicResp ( const MqttSnWillTopicResp message,
size_t  length 
)

Dump WILLTOPICRESP message.

Parameters
[in]messagePointer to the message
[in]lengthLength of the message, in bytes
Returns
Error code

Definition at line 900 of file mqtt_sn_debug.c.

◆ mqttSnDumpWillTopicUpd()

error_t mqttSnDumpWillTopicUpd ( const MqttSnWillTopicUpd message,
size_t  length 
)

Dump WILLTOPICUPD message.

Parameters
[in]messagePointer to the message
[in]lengthLength of the message, in bytes
Returns
Error code

Definition at line 878 of file mqtt_sn_debug.c.

◆ mqttSnGetMessageName()

const char_t* mqttSnGetMessageName ( uint16_t  msgType)

Get the name of the specified MQTT-SN message.

Parameters
[in]msgTypeMessage type
Returns
Message name (NULL-terminated string)

Definition at line 1045 of file mqtt_sn_debug.c.

◆ mqttSnGetReturnCodeDesc()

const char_t* mqttSnGetReturnCodeDesc ( uint16_t  returnCode)

Get the description of the specified return code.

Parameters
[in]returnCodeValue of the return code
Returns
Description of the return code (NULL-terminated string)

Definition at line 1068 of file mqtt_sn_debug.c.

Variable Documentation

◆ mqttSnMsgTypeLabel

const char_t* const mqttSnMsgTypeLabel[]

Definition at line 44 of file mqtt_sn_debug.c.

◆ mqttSnReturnCodeLabel

const char_t* const mqttSnReturnCodeLabel[]
Initial value:
=
{
"Accepted",
"Rejected: congestion",
"Rejected: invalid topic ID",
"Rejected: not supported",
}

Definition at line 79 of file mqtt_sn_debug.c.