mqtt_sn_client_misc.h
Go to the documentation of this file.
1 /**
2  * @file mqtt_sn_client_misc.h
3  * @brief Helper functions for MQTT-SN client
4  *
5  * @section License
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  *
9  * Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.
10  *
11  * This file is part of CycloneTCP Open.
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software Foundation,
25  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26  *
27  * @author Oryx Embedded SARL (www.oryx-embedded.com)
28  * @version 2.4.4
29  **/
30 
31 #ifndef _MQTT_SN_CLIENT_MISC_H
32 #define _MQTT_SN_CLIENT_MISC_H
33 
34 //Dependencies
35 #include "core/net.h"
36 #include "mqtt_sn/mqtt_sn_client.h"
37 
38 //C++ guard
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
43 //MQTT-SN client related functions
45  systime_t timeout);
46 
48  MqttSnFlags flags, uint16_t topicId, const uint8_t *data, size_t dataLen);
49 
51  const char_t *topicName, uint16_t topicId);
52 
54  const char_t *topicName);
55 
57  uint16_t topicId);
58 
60  const char_t *topicName);
61 
63  uint16_t topicId);
64 
66  const char_t *topicName);
67 
69 
71  uint16_t msgId);
72 
74  uint16_t msgId);
75 
77  uint16_t msgId);
78 
80 
81 //C++ guard
82 #ifdef __cplusplus
83 }
84 #endif
85 
86 #endif
int bool_t
Definition: compiler_port.h:53
MqttSnReturnCode mqttSnDeliverPublishMessage(MqttSnClientContext *context, MqttSnFlags flags, uint16_t topicId, const uint8_t *data, size_t dataLen)
Deliver a PUBLISH message to the application.
#define MqttSnClientContext
uint8_t data[]
Definition: ethernet.h:222
MqttSnReturnCode
MQTT-SN return codes.
error_t mqttSnClientStoreMessageId(MqttSnClientContext *context, uint16_t msgId)
Store message ID (QoS 2 message processing)
uint16_t msgId
bool_t mqttSnClientIsShortTopicName(const char_t *topicName)
Check whether a topic name is a short topic name.
uint16_t topicId
uint16_t mqttSnClientFindPredefTopicName(MqttSnClientContext *context, const char_t *topicName)
Retrieve the topic ID associated with a predefined topic name.
const char_t * mqttSnClientFindTopicId(MqttSnClientContext *context, uint16_t topicId)
Retrieve the topic name associated with a given topic ID.
error_t
Error codes.
Definition: error.h:43
uint16_t mqttSnClientFindTopicName(MqttSnClientContext *context, const char_t *topicName)
Retrieve the topic ID associated with a given topic name.
error_t mqttSnClientDeleteTopic(MqttSnClientContext *context, const char_t *topicName)
Remove an entry in the topic table.
uint32_t dataLen
Definition: sftp_common.h:229
uint32_t systime_t
System time.
uint8_t flags
Definition: tcp.h:351
char char_t
Definition: compiler_port.h:48
error_t mqttSnClientDiscardMessageId(MqttSnClientContext *context, uint16_t msgId)
Discard message ID (QoS 2 message processing)
char_t topicName[]
bool_t mqttSnClientIsDuplicateMessageId(MqttSnClientContext *context, uint16_t msgId)
Check whether the message ID is a duplicate (QoS 2 message processing)
error_t mqttSnClientAddTopic(MqttSnClientContext *context, const char_t *topicName, uint16_t topicId)
Add a new entry to the topic table.
error_t mqttSnClientProcessEvents(MqttSnClientContext *context, systime_t timeout)
Process MQTT-SN client events.
const char_t * mqttSnClientFindPredefTopicId(MqttSnClientContext *context, uint16_t topicId)
Retrieve the topic name associated with a predefined topic ID.
uint16_t mqttSnClientGenerateMessageId(MqttSnClientContext *context)
Generate a new message identifier.
MQTT-SN client.
TCP/IP stack core.
MqttSnFlags