mqtt_sn_client_transport.c File Reference

Transport protocol abstraction layer. More...

Go to the source code of this file.

Macros

#define TRACE_LEVEL   MQTT_SN_TRACE_LEVEL
 

Functions

error_t mqttSnClientOpenConnection (MqttSnClientContext *context, bool_t secure)
 Open network connection. More...
 
error_t mqttSnClientEstablishConnection (MqttSnClientContext *context)
 Establish network connection. More...
 
error_t mqttSnClientShutdownConnection (MqttSnClientContext *context)
 Shutdown network connection. More...
 
void mqttSnClientCloseConnection (MqttSnClientContext *context)
 Close network connection. More...
 
error_t mqttSnClientBroadcastDatagram (MqttSnClientContext *context, const IpAddr *destIpAddr, uint16_t destPort, const void *data, size_t length)
 Broadcast a datagram. More...
 
error_t mqttSnClientSendDatagram (MqttSnClientContext *context, const void *data, size_t length)
 Send a datagram. More...
 
error_t mqttSnClientReceiveDatagram (MqttSnClientContext *context, IpAddr *srcIpAddr, uint16_t *srcPort, void *data, size_t size, size_t *received, systime_t timeout)
 Receive a datagram. More...
 

Detailed Description

Transport protocol abstraction layer.

License

Copyright (C) 2010-2018 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
1.9.0

Definition in file mqtt_sn_client_transport.c.

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   MQTT_SN_TRACE_LEVEL

Definition at line 30 of file mqtt_sn_client_transport.c.

Function Documentation

◆ mqttSnClientBroadcastDatagram()

error_t mqttSnClientBroadcastDatagram ( MqttSnClientContext context,
const IpAddr destIpAddr,
uint16_t  destPort,
const void *  data,
size_t  length 
)

Broadcast a datagram.

Parameters
[in]contextPointer to the MQTT-SN client context
[in]destIpAddrDestination IP address
[in]destPortDestination port number
[in]dataPointer to a buffer containing the datagram to be transmitted
[in]lengthLength of the datagram, in bytes
Returns
Error code

Definition at line 238 of file mqtt_sn_client_transport.c.

◆ mqttSnClientCloseConnection()

void mqttSnClientCloseConnection ( MqttSnClientContext context)

Close network connection.

Parameters
[in]contextPointer to the MQTT-SN client context

Definition at line 202 of file mqtt_sn_client_transport.c.

◆ mqttSnClientEstablishConnection()

error_t mqttSnClientEstablishConnection ( MqttSnClientContext context)

Establish network connection.

Parameters
[in]contextPointer to the MQTT-SN client context
Returns
Error code

Definition at line 136 of file mqtt_sn_client_transport.c.

◆ mqttSnClientOpenConnection()

error_t mqttSnClientOpenConnection ( MqttSnClientContext context,
bool_t  secure 
)

Open network connection.

Parameters
[in]contextPointer to the MQTT-SN client context
[in]secureSecure/non-secure connection
Returns
Error code

Definition at line 49 of file mqtt_sn_client_transport.c.

◆ mqttSnClientReceiveDatagram()

error_t mqttSnClientReceiveDatagram ( MqttSnClientContext context,
IpAddr srcIpAddr,
uint16_t *  srcPort,
void *  data,
size_t  size,
size_t *  received,
systime_t  timeout 
)

Receive a datagram.

Parameters
[in]contextPointer to the MQTT-SN client context
[out]srcIpAddrSource IP address
[out]srcPortSource port number
[out]dataBuffer into which the received datagram will be placed
[in]sizeMaximum number of bytes that can be received
[out]receivedNumber of bytes that have been received
[in]timeoutMaximum time to wait before returning
Returns
Error code

Definition at line 294 of file mqtt_sn_client_transport.c.

◆ mqttSnClientSendDatagram()

error_t mqttSnClientSendDatagram ( MqttSnClientContext context,
const void *  data,
size_t  length 
)

Send a datagram.

Parameters
[in]contextPointer to the MQTT-SN client context
[in]dataPointer to a buffer containing the datagram to be transmitted
[in]lengthLength of the datagram, in bytes
Returns
Error code

Definition at line 256 of file mqtt_sn_client_transport.c.

◆ mqttSnClientShutdownConnection()

error_t mqttSnClientShutdownConnection ( MqttSnClientContext context)

Shutdown network connection.

Parameters
[in]contextPointer to the MQTT-SN client context
Returns
Error code

Definition at line 176 of file mqtt_sn_client_transport.c.