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.
Fork of OmniWheels by
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. | |
ATHandler & | get_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:
-
address Destination 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:
-
socket Cellular 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:
-
host Hostname to resolve address Destination for the host SocketAddress version IP 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:
-
protocol Protocol 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_id Socket 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:
-
socket Socket handle address Destination for the source address or NULL buffer Destination buffer for data received from the host size Size 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:
-
socket Cellular socket handle address The SocketAddress of the remote host data Buffer of data to send to the host size Size of the buffer in bytes
- Returns:
- Number of sent bytes on success, negative error code on failure
Generated on Fri Jul 22 2022 04:54:17 by
