Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
MQTTNetworkMbedOs Class Reference
Implementation of the Network class template parameter of MQTTClient. More...
#include <MQTTClientMbedOs.h>
Public Member Functions | |
MQTTNetworkMbedOs (Socket *_socket) | |
Construct the network implementation. | |
int | read (unsigned char *buffer, int len, int timeout) |
Read data from the socket. | |
int | write (unsigned char *buffer, int len, int timeout) |
Write data to the socket. | |
int | connect (const char *hostname, int port) |
Connect the socket to the hostname at a given port. | |
int | disconnect () |
Disconnect from the hostname. |
Detailed Description
Implementation of the Network class template parameter of MQTTClient.
Definition at line 39 of file MQTTClientMbedOs.h.
Constructor & Destructor Documentation
MQTTNetworkMbedOs | ( | Socket * | _socket ) |
Construct the network implementation.
If TCPSocket or TLSSocket are provided, the MQTT protocol will be used. If UDPSocket or DTLSSocket are provided, the MQTT-SN protocol will be used.
- Parameters:
-
_socket socket to be used for MQTT communication.
Definition at line 49 of file MQTTClientMbedOs.h.
Member Function Documentation
int connect | ( | const char * | hostname, |
int | port | ||
) |
Connect the socket to the hostname at a given port.
The socket must have the network interface set up and connected before. This connect() is different from MQTTClient::connect, which performs the connection to a broker, over the connected socket.
- Parameters:
-
hostname Hostname to connect to. This can be a string containing IP address like "192.168.52.10" or domain address, like "mqtt.flespi.io" port port number to be used for connection
Definition at line 55 of file MQTTClientMbedOs.cpp.
int disconnect | ( | ) |
Disconnect from the hostname.
Definition at line 61 of file MQTTClientMbedOs.cpp.
int read | ( | unsigned char * | buffer, |
int | len, | ||
int | timeout | ||
) |
Read data from the socket.
- Parameters:
-
buffer buffer to store the data len expected amount of bytes timeout timeout for the operation
Definition at line 20 of file MQTTClientMbedOs.cpp.
int write | ( | unsigned char * | buffer, |
int | len, | ||
int | timeout | ||
) |
Write data to the socket.
- Parameters:
-
buffer buffer that contains data to be written len amount of bytes to write timeout timeout for the operation
Definition at line 38 of file MQTTClientMbedOs.cpp.
Generated on Thu Jul 14 2022 12:58:44 by
