mikroSDK Reference Manual
mqtt_client_misc.h
Go to the documentation of this file.
1
31#ifndef _MQTT_CLIENT_MISC_H
32#define _MQTT_CLIENT_MISC_H
33
34//Dependencies
35#include "core/net.h"
36#include "mqtt/mqtt_client.h"
37
38//C++ guard
39#ifdef __cplusplus
40extern "C" {
41#endif
42
43//MQTT client related functions
44void mqttClientChangeState(MqttClientContext *context,
45 MqttClientState newState);
46
47error_t mqttClientProcessEvents(MqttClientContext *context, systime_t timeout);
48error_t mqttClientCheckKeepAlive(MqttClientContext *context);
49
50error_t mqttSerializeHeader(uint8_t *buffer, size_t *pos, MqttPacketType type,
51 bool_t dup, MqttQosLevel qos, bool_t retain, size_t remainingLen);
52
53error_t mqttSerializeByte(uint8_t *buffer, size_t bufferLen,
54 size_t *pos, uint8_t value);
55
56error_t mqttSerializeShort(uint8_t *buffer, size_t bufferLen,
57 size_t *pos, uint16_t value);
58
59error_t mqttSerializeString(uint8_t *buffer, size_t bufferLen,
60 size_t *pos, const void *string, size_t stringLen);
61
62error_t mqttSerializeData(uint8_t *buffer, size_t bufferLen,
63 size_t *pos, const void *data, size_t dataLen);
64
65error_t mqttDeserializeHeader(uint8_t *buffer, size_t bufferLen, size_t *pos,
66 MqttPacketType *type, bool_t *dup, MqttQosLevel *qos, bool_t *retain, size_t *remainingLen);
67
68error_t mqttDeserializeByte(uint8_t *buffer, size_t bufferLen,
69 size_t *pos, uint8_t *value);
70
71error_t mqttDeserializeShort(uint8_t *buffer, size_t bufferLen,
72 size_t *pos, uint16_t *value);
73
74error_t mqttDeserializeString(uint8_t *buffer, size_t bufferLen,
75 size_t *pos, char_t **string, size_t *stringLen);
76
77error_t mqttClientCheckTimeout(MqttClientContext *context);
78
79//C++ guard
80#ifdef __cplusplus
81}
82#endif
83
84#endif
error_t
Error codes.
Definition error.h:43
MQTT client.
MqttClientState
MQTT client states.
Definition mqtt_client.h:160
MqttQosLevel
Quality of service level.
Definition mqtt_common.h:87
MqttPacketType
MQTT control packet type.
Definition mqtt_common.h:99
TCP/IP stack core.
uint32_t systime_t
System time.
Definition os_port_none.h:90