coreMQTT  v1.0.0
MQTT 3.1.1 Client Library
Callback Types

Callback function pointer types of the MQTT library. More...

Typedefs

typedef uint32_t(* MQTTGetCurrentTimeFunc_t) (void)
 Application provided callback to retrieve the current time in milliseconds. More...
 
typedef void(* MQTTEventCallback_t) (struct MQTTContext *pContext, struct MQTTPacketInfo *pPacketInfo, struct MQTTDeserializedInfo *pDeserializedInfo)
 Application callback for receiving incoming publishes and incoming acks. More...
 
typedef int32_t(* TransportRecv_t) (const NetworkContext_t *pNetworkContext, void *pBuffer, size_t bytesToRecv)
 Transport interface for receiving data on the network. More...
 
typedef int32_t(* TransportSend_t) (const NetworkContext_t *pNetworkContext, const void *pBuffer, size_t bytesToSend)
 Transport interface for sending data over the network. More...
 

Detailed Description

Callback function pointer types of the MQTT library.

Typedef Documentation

◆ MQTTGetCurrentTimeFunc_t

typedef uint32_t(* MQTTGetCurrentTimeFunc_t) (void)

Application provided callback to retrieve the current time in milliseconds.

Returns
The current time in milliseconds.

◆ MQTTEventCallback_t

typedef void(* MQTTEventCallback_t) (struct MQTTContext *pContext, struct MQTTPacketInfo *pPacketInfo, struct MQTTDeserializedInfo *pDeserializedInfo)

Application callback for receiving incoming publishes and incoming acks.

Note
This callback will be called only if packets are deserialized with a result of MQTTSuccess or MQTTServerRefused. The latter can be obtained when deserializing a SUBACK, indicating a broker's rejection of a subscribe.
Parameters
[in]pContextInitialized MQTT context.
[in]pPacketInfoInformation on the type of incoming MQTT packet.
[in]pDeserializedInfoDeserialized information from incoming packet.

◆ TransportRecv_t

typedef int32_t( * TransportRecv_t) (const NetworkContext_t *pNetworkContext, void *pBuffer, size_t bytesToRecv)

Transport interface for receiving data on the network.

Parameters
[in]pNetworkContextImplementation-defined network context.
[in]pBufferBuffer to receive the data into.
[in]bytesToRecvNumber of bytes requested from the network.
Returns
The number of bytes received or a negative error code.

◆ TransportSend_t

typedef int32_t( * TransportSend_t) (const NetworkContext_t *pNetworkContext, const void *pBuffer, size_t bytesToSend)

Transport interface for sending data over the network.

Parameters
[in]pNetworkContextImplementation-defined network context.
[in]pBufferBuffer containing the bytes to send over the network stack.
[in]bytesToSendNumber of bytes to send over the network.
Returns
The number of bytes sent or a negative error code.