Gleb Klochkov / Mbed OS Climatcontroll_Main

Dependencies:   esp8266-driver

Embed: (wiki syntax)

« Back to documentation index

AT_CellularStack Class Reference

AT_CellularStack Class Reference

Class AT_CellularStack. More...

#include <AT_CellularStack.h>

Inherits NetworkStack, and mbed::AT_CellularBase.

Inherited by QUECTEL_BC95_CellularStack, QUECTEL_BG96_CellularStack, and MyStack.

Public Member Functions

virtual const char * get_ip_address ()
 NetworkStack.
virtual nsapi_error_t gethostbyname (const char *host, SocketAddress *address, nsapi_version_t version=NSAPI_UNSPEC)
 Translates a hostname to an IP address with specific version.
virtual nsapi_error_t add_dns_server (const SocketAddress &address)
 Add a domain name server to list of servers to query.
ATHandlerget_at_handler ()
 Getter for at handler.
device_err_t get_device_error () const
 Gets the device error that happened when using AT commands/responses.

Protected Member Functions

virtual int get_max_socket_count ()=0
 Gets maximum number of sockets modem supports.
virtual int get_max_packet_size ()=0
 Gets maximum packet size.
virtual bool is_protocol_supported (nsapi_protocol_t protocol)=0
 Checks if modem supports the given protocol.
virtual nsapi_error_t socket_close_impl (int sock_id)=0
 Implements modem specific AT command set for socket closing.
virtual nsapi_error_t create_socket_impl (CellularSocket *socket)=0
 Implements modem specific AT command set for creating socket.
virtual nsapi_size_or_error_t socket_sendto_impl (CellularSocket *socket, const SocketAddress &address, const void *data, nsapi_size_t size)=0
 Implements modem specific AT command set for sending data.
virtual nsapi_size_or_error_t socket_recvfrom_impl (CellularSocket *socket, SocketAddress *address, void *buffer, nsapi_size_t size)=0
 Implements modem specific AT command set for receiving data.

Friends

class Socket
class UDPSocket
class TCPSocket

Detailed Description

Class AT_CellularStack.

Implements NetworkStack and introduces interface for modem specific stack implementations.

Definition at line 37 of file AT_CellularStack.h.


Member Function Documentation

nsapi_error_t add_dns_server ( const SocketAddress &  address ) [virtual, inherited]

Add a domain name server to list of servers to query.

Parameters:
addressDestination for the host address
Returns:
0 on success, negative error code on failure

Definition at line 31 of file NetworkStack_stub.cpp.

virtual nsapi_error_t create_socket_impl ( CellularSocket *  socket ) [protected, pure virtual]

Implements modem specific AT command set for creating socket.

Parameters:
socketCellular socket handle
ATHandler & get_at_handler (  ) [inherited]

Getter for at handler.

Common method for all AT-classes.

Returns:
reference to ATHandler

Definition at line 27 of file AT_CellularBase.cpp.

device_err_t get_device_error (  ) const [inherited]

Gets the device error that happened when using AT commands/responses.

This is at error returned by the device. Returned CME/CMS errors can be found from 3gpp documents 27007 and 27005.

Returns:
at error (CME/CMS) while communicating with the device

Definition at line 32 of file AT_CellularBase.cpp.

const char * get_ip_address (  ) [virtual]

NetworkStack.

Definition at line 47 of file AT_CellularStack.cpp.

virtual int get_max_packet_size (  ) [protected, pure virtual]

Gets maximum packet size.

virtual int get_max_socket_count (  ) [protected, pure virtual]

Gets maximum number of sockets modem supports.

nsapi_error_t gethostbyname ( const char *  host,
SocketAddress *  address,
nsapi_version_t  version = NSAPI_UNSPEC 
) [virtual, inherited]

Translates a hostname to an IP address with specific version.

The hostname may be either a domain name or an IP address. If the hostname is an IP address, no network transactions will be performed.

If no stack-specific DNS resolution is provided, the hostname will be resolve using a UDP socket on the stack.

Parameters:
hostHostname to resolve
addressDestination for the host SocketAddress
versionIP version of address to resolve, NSAPI_UNSPEC indicates version is chosen by the stack (defaults to NSAPI_UNSPEC)
Returns:
0 on success, negative error code on failure

Definition at line 26 of file NetworkStack_stub.cpp.

virtual bool is_protocol_supported ( nsapi_protocol_t  protocol ) [protected, pure virtual]

Checks if modem supports the given protocol.

Parameters:
protocolProtocol type
virtual nsapi_error_t socket_close_impl ( int  sock_id ) [protected, pure virtual]

Implements modem specific AT command set for socket closing.

Parameters:
sock_idSocket id
virtual nsapi_size_or_error_t socket_recvfrom_impl ( CellularSocket *  socket,
SocketAddress *  address,
void *  buffer,
nsapi_size_t  size 
) [protected, pure virtual]

Implements modem specific AT command set for receiving data.

Parameters:
socketSocket handle
addressDestination for the source address or NULL
bufferDestination buffer for data received from the host
sizeSize of the buffer in bytes
Returns:
Number of received bytes on success, negative error code on failure
virtual nsapi_size_or_error_t socket_sendto_impl ( CellularSocket *  socket,
const SocketAddress &  address,
const void *  data,
nsapi_size_t  size 
) [protected, pure virtual]

Implements modem specific AT command set for sending data.

Parameters:
socketCellular socket handle
addressThe SocketAddress of the remote host
dataBuffer of data to send to the host
sizeSize of the buffer in bytes
Returns:
Number of sent bytes on success, negative error code on failure