mqtt_sn_client_transport.h File Reference

Transport protocol abstraction layer. More...

#include "core/net.h"
#include "mqtt_sn/mqtt_sn_client.h"

Go to the source code of this file.

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

SPDX-License-Identifier: GPL-2.0-or-later

Copyright (C) 2010-2024 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
2.4.0

Definition in file mqtt_sn_client_transport.h.

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 240 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 204 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 138 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 51 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 296 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 258 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 178 of file mqtt_sn_client_transport.c.