mqtt_sn_client_message.h
Go to the documentation of this file.
1 /**
2  * @file mqtt_sn_client_message.h
3  * @brief MQTT-SN message parsing and formatting
4  *
5  * @section License
6  *
7  * Copyright (C) 2010-2018 Oryx Embedded SARL. All rights reserved.
8  *
9  * This file is part of CycloneTCP Open.
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software Foundation,
23  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24  *
25  * @author Oryx Embedded SARL (www.oryx-embedded.com)
26  * @version 1.9.0
27  **/
28 
29 #ifndef _MQTT_SN_CLIENT_MESSAGE_H
30 #define _MQTT_SN_CLIENT_MESSAGE_H
31 
32 //Dependencies
33 #include "core/net.h"
34 #include "mqtt_sn/mqtt_sn_client.h"
35 
36 //C++ guard
37 #ifdef __cplusplus
38  extern "C" {
39 #endif
40 
41 //MQTT-SN client related functions
43  MqttSnMessage *message, const IpAddr *ipAddr, uint16_t port);
44 
46  const MqttSnMessage *message, const IpAddr *ipAddr, uint16_t port);
47 
49  const MqttSnMessage *message);
50 
52  const MqttSnMessage *message);
53 
55  const MqttSnMessage *message);
56 
58  const MqttSnMessage *message);
59 
61  const MqttSnMessage *message);
62 
64  const MqttSnMessage *message);
65 
67  const MqttSnMessage *message);
68 
70  const MqttSnMessage *message);
71 
73  const MqttSnMessage *message);
74 
76  const MqttSnMessage *message);
77 
79  const MqttSnMessage *message);
80 
82  const MqttSnMessage *message);
83 
85  const MqttSnMessage *message);
86 
88  const MqttSnMessage *message);
89 
91  const MqttSnMessage *message);
92 
94  const MqttSnMessage *message);
95 
97  const MqttSnMessage *message);
98 
100  const IpAddr *destIpAddr, uint16_t destPort);
101 
104 
107 
109  const char_t *topicName);
110 
113 
115  uint16_t msgId, const char_t *topicName, const uint8_t *data,
117 
120 
124 
127 
129  const char_t *topicName);
130 
133 
135  uint16_t duration);
136 
139 
140 //C++ guard
141 #ifdef __cplusplus
142  }
143 #endif
144 
145 #endif
uint8_t returnCode
error_t mqttSnClientSendWillMsg(MqttSnClientContext *context)
Send WILLMSG message.
error_t mqttSnClientSendPublish(MqttSnClientContext *context, uint16_t msgId, const char_t *topicName, const uint8_t *data, size_t length, MqttSnQosLevel qos, bool_t retain, bool_t dup)
Send PUBLISH message.
uint16_t destPort
Definition: tcp.h:301
char char_t
Definition: compiler_port.h:41
error_t mqttSnClientProcessPubComp(MqttSnClientContext *context, const MqttSnMessage *message)
Process incoming PUBCOMP message.
TCP/IP stack core.
uint8_t radius
error_t mqttSnClientProcessPubRel(MqttSnClientContext *context, const MqttSnMessage *message)
Process incoming PUBREL message.
error_t mqttSnClientSendWillTopicUpd(MqttSnClientContext *context)
Send WILLTOPICUPD message.
uint8_t message[]
Definition: chap.h:150
error_t mqttSnClientProcessPubAck(MqttSnClientContext *context, const MqttSnMessage *message)
Process incoming PUBACK message.
error_t mqttSnClientProcessWillTopicReq(MqttSnClientContext *context, const MqttSnMessage *message)
Process incoming WILLTOPICREQ message.
error_t mqttSnClientSendPubRel(MqttSnClientContext *context, uint16_t msgId)
Send PUBREL message.
MQTT-SN message.
IP network address.
Definition: ip.h:57
error_t mqttSnClientSendUnsubscribe(MqttSnClientContext *context, const char_t *topicName)
Send UNSUBSCRIBE message.
MqttSnQosLevel
Quality of service level.
error_t mqttSnClientSendRegAck(MqttSnClientContext *context, uint16_t msgId, uint16_t topicId, MqttSnReturnCode returnCode)
Send REGACK message.
error_t mqttSnClientProcessPingResp(MqttSnClientContext *context, const MqttSnMessage *message)
Process incoming PINGRESP message.
error_t mqttSnClientSendConnect(MqttSnClientContext *context, bool_t cleanSession)
Send CONNECT message.
uint16_t msgId
uint16_t duration
error_t mqttSnClientProcessPubRec(MqttSnClientContext *context, const MqttSnMessage *message)
Process incoming PUBREC message.
uint8_t qos
Definition: mqtt_common.h:177
error_t mqttSnClientSendSearchGw(MqttSnClientContext *context, uint8_t radius, const IpAddr *destIpAddr, uint16_t destPort)
Send SEARCHGW message.
error_t mqttSnClientProcessWillTopicResp(MqttSnClientContext *context, const MqttSnMessage *message)
Process incoming WILLTOPICRESP message.
error_t mqttSnClientProcessSubAck(MqttSnClientContext *context, const MqttSnMessage *message)
Process incoming SUBACK message.
uint8_t ipAddr[4]
Definition: mib_common.h:185
error_t mqttSnClientProcessMessage(MqttSnClientContext *context, MqttSnMessage *message, const IpAddr *ipAddr, uint16_t port)
Process incoming MQTT-SN message.
error_t mqttSnClientProcessWillMsgResp(MqttSnClientContext *context, const MqttSnMessage *message)
Process incoming WILLMSGRESP message.
error_t mqttSnClientProcessUnsubAck(MqttSnClientContext *context, const MqttSnMessage *message)
Process incoming UNSUBACK message.
#define MqttSnClientContext
error_t mqttSnClientSendWillTopic(MqttSnClientContext *context)
Send WILLTOPIC message.
uint8_t cleanSession
error_t mqttSnClientProcessGwInfo(MqttSnClientContext *context, const MqttSnMessage *message, const IpAddr *ipAddr, uint16_t port)
Process incoming GWINFO message.
error_t mqttSnClientProcessPublish(MqttSnClientContext *context, const MqttSnMessage *message)
Process incoming PUBLISH message.
char_t topicName[]
error_t mqttSnClientSendRegister(MqttSnClientContext *context, const char_t *topicName)
Send REGISTER message.
uint16_t topicId
error_t mqttSnClientProcessPingReq(MqttSnClientContext *context, const MqttSnMessage *message)
Process incoming PINGREQ message.
error_t
Error codes.
Definition: error.h:40
uint8_t retain
Definition: mqtt_common.h:176
error_t mqttSnClientProcessDisconnect(MqttSnClientContext *context, const MqttSnMessage *message)
Process incoming DISCONNECT message.
Ipv4Addr destIpAddr
Definition: ipcp.h:76
uint8_t data[]
Definition: dtls_misc.h:167
error_t mqttSnClientSendPubComp(MqttSnClientContext *context, uint16_t msgId)
Send PUBCOMP message.
error_t mqttSnClientSendPubAck(MqttSnClientContext *context, uint16_t msgId, uint16_t topicId, MqttSnReturnCode returnCode)
Send PUBACK message.
MqttSnReturnCode
MQTT-SN return codes.
error_t mqttSnClientProcessConnAck(MqttSnClientContext *context, const MqttSnMessage *message)
Process incoming CONNACK message.
uint16_t port
Definition: dns_common.h:221
error_t mqttSnClientSendPubRec(MqttSnClientContext *context, uint16_t msgId)
Send PUBREC message.
error_t mqttSnClientSendDisconnect(MqttSnClientContext *context, uint16_t duration)
Send DISCONNECT message.
uint8_t dup
Definition: mqtt_common.h:178
error_t mqttSnClientSendPingResp(MqttSnClientContext *context)
Send PINGRESP message.
error_t mqttSnClientProcessRegister(MqttSnClientContext *context, const MqttSnMessage *message)
Process incoming REGISTER message.
MQTT-SN client.
error_t mqttSnClientSendWillMsgUpd(MqttSnClientContext *context)
Send WILLMSGUPD message.
uint8_t length
Definition: dtls_misc.h:140
error_t mqttSnClientProcessWillMsgReq(MqttSnClientContext *context, const MqttSnMessage *message)
Process incoming WILLMSGREQ message.
error_t mqttSnClientSendSubscribe(MqttSnClientContext *context, const char_t *topicName, MqttSnQosLevel qos)
Send SUBSCRIBE message.
int bool_t
Definition: compiler_port.h:47
error_t mqttSnClientSendPingReq(MqttSnClientContext *context)
Send PINGREQ message.
error_t mqttSnClientProcessRegAck(MqttSnClientContext *context, const MqttSnMessage *message)
Process incoming REGACK message.