18#ifndef CELLULARNONIPSOCKET_H
19#define CELLULARNONIPSOCKET_H
22#include "rtos/Mutex.h"
23#include "rtos/EventFlags.h"
25#include "mbed_atomic.h"
26#include "mbed_toolchain.h"
149 uint32_t _timeout = osWaitForever;
154 uint8_t _readers = 0;
155 uint8_t _writers = 0;
159 static const int READ_FLAG = 0x1u;
160 static const int WRITE_FLAG = 0x2u;
161 static const int FINISHED_FLAG = 0x3u;
164 bool _opened =
false;
Cellular PDP context class.
Implements support for data transfer using Control Plane CIoT EPS optimization.
Abstract Socket interface.
Callback class based on template specialization.
CellularContext is CellularInterface/NetworkInterface with extensions for cellular connectivity.
Socket implementation for cellular Non-IP data delivery(NIDD).
~CellularNonIPSocket() override
Destroy the socket.
nsapi_size_or_error_t send(const void *data, nsapi_size_t size) override
Send data over a control plane cellular context.
nsapi_size_or_error_t sendto_control(const SocketAddress &address, const void *data, nsapi_size_t size, nsapi_msghdr_t *control, nsapi_size_t control_size) override
NOT APPLICABLE.
nsapi_error_t connect(const SocketAddress &address) override
NOT APPLICABLE.
nsapi_error_t bind(const SocketAddress &address) override
NOT APPLICABLE.
nsapi_error_t listen(int backlog=1) override
NOT APPLICABLE.
nsapi_error_t open(mbed::CellularContext *cellular_context)
Opens a socket on the given cellular context.
void sigio(mbed::Callback< void()> func) override
Register a callback on state change of the socket.
nsapi_size_or_error_t sendto(const SocketAddress &address, const void *data, nsapi_size_t size) override
NOT APPLICABLE.
void set_blocking(bool blocking) override
Set blocking or non-blocking mode of the socket.
nsapi_error_t open(mbed::ControlPlane_netif *cp_netif)
Opens a socket that will use the given control plane interface for data delivery.
nsapi_size_or_error_t recvfrom_control(SocketAddress *address, void *data, nsapi_size_t size, nsapi_msghdr_t *control, nsapi_size_t control_size) override
NOT APPLICABLE.
void set_timeout(int timeout) override
Set timeout on blocking socket operations.
Socket * accept(nsapi_error_t *error=NULL) override
NOT APPLICABLE.
nsapi_error_t getsockopt(int level, int optname, void *optval, unsigned *optlen) override
NOT APPLICABLE.
nsapi_error_t close() override
Closes socket.
nsapi_size_or_error_t recv(void *data, nsapi_size_t size) override
Receive data from a socket.
nsapi_size_or_error_t recvfrom(SocketAddress *address, void *data, nsapi_size_t size) override
NOT APPLICABLE.
nsapi_error_t getpeername(SocketAddress *address) override
NOT APPLICABLE.
CellularNonIPSocket()
Creates a socket.
nsapi_error_t setsockopt(int level, int optname, const void *optval, unsigned optlen) override
NOT APPLICABLE.
Implements support for data transfer using Control Plane CIoT EPS optimization specified in 3GPP 23....
The EventFlags class is used to control event flags or wait for event flags other threads control.
The Mutex class is used to synchronize the execution of threads.
signed int nsapi_size_or_error_t
Type used to represent either a size or error passed through sockets.
signed int nsapi_error_t
Type used to represent error codes.
unsigned int nsapi_size_t
Type used to represent the size of data passed through sockets.
A lock-free, primitive atomic flag.
Header structure for control info.