18 #ifndef QUECTEL_BG96_CELLULARSTACK_H_ 19 #define QUECTEL_BG96_CELLULARSTACK_H_ 21 #include "AT_CellularStack.h" 25 #define BG96_CREATE_SOCKET_TIMEOUT 150s 26 #define BG96_CLOSE_SOCKET_TIMEOUT 20s // TCP socket max timeout is >10sec 27 #define BG96_MAX_RECV_SIZE 1500 28 #define BG96_MAX_SEND_SIZE 1460 29 #define BG96_SOCKET_BIND_FAIL 556 50 #ifdef MBED_CONF_CELLULAR_OFFLOAD_DNS_QUERIES 53 const char *interface_name = NULL);
57 #if defined(MBED_CONF_NSAPI_OFFLOAD_TLSSOCKET) && (MBED_CONF_NSAPI_OFFLOAD_TLSSOCKET) 59 int optname,
const void *optval,
unsigned optlen);
76 void urc_qiurc(urc_type_t urc_type);
78 void urc_qiurc_recv();
80 void urc_qiurc_closed();
82 void handle_open_socket_response(
int &modem_connect_id,
int &err,
bool tlssocket);
84 #if defined(MBED_CONF_NSAPI_OFFLOAD_TLSSOCKET) && (MBED_CONF_NSAPI_OFFLOAD_TLSSOCKET) 85 nsapi_error_t set_to_modem_impl(
const char *filename,
const char *config,
const char *data,
size_t size);
88 #ifdef MBED_CONF_CELLULAR_OFFLOAD_DNS_QUERIES 90 void urc_qiurc_dnsgip();
92 bool read_dnsgip(
SocketAddress &address, nsapi_version_t _dns_version);
94 nsapi_version_t _dns_version;
97 uint8_t _tls_sec_level;
virtual nsapi_error_t socket_connect(nsapi_socket_t handle, const SocketAddress &address)
Connects TCP socket to a remote host.
virtual nsapi_error_t create_socket_impl(CellularSocket *socket)
Implements modem specific AT command set for creating socket.
void * nsapi_socket_t
Opaque handle for network sockets.
signed int nsapi_error_t
Type used to represent error codes.
virtual nsapi_error_t socket_listen(nsapi_socket_t handle, int backlog)
Listen for connections on a TCP socket.
virtual nsapi_error_t socket_close_impl(int sock_id)
Implements modem specific AT command set for socket closing.
signed int nsapi_size_or_error_t
Type used to represent either a size or error passed through sockets.
virtual nsapi_error_t gethostbyname_async_cancel(int id)
Cancels asynchronous hostname translation.
signed int nsapi_value_or_error_t
Type used to represent either a value or error.
virtual nsapi_error_t setsockopt(nsapi_socket_t handle, int level, int optname, const void *optval, unsigned optlen)
Set stack-specific socket options.
virtual nsapi_error_t gethostbyname(const char *host, SocketAddress *address, nsapi_version_t version=NSAPI_UNSPEC, const char *interface_name=NULL)
Translates a hostname to an IP address with specific version.
unsigned int nsapi_size_t
Type used to represent the size of data passed through sockets.
Callback class based on template specialization.
virtual nsapi_error_t socket_accept(nsapi_socket_t server, nsapi_socket_t *handle, SocketAddress *address=0)
Accepts a connection on a TCP socket.
virtual nsapi_value_or_error_t gethostbyname_async(const char *host, hostbyname_cb_t callback, nsapi_version_t version=NSAPI_UNSPEC, const char *interface_name=NULL)
Translates a hostname to multiple IP addresses (asynchronous)
virtual nsapi_size_or_error_t socket_sendto_impl(CellularSocket *socket, const SocketAddress &address, const void *data, nsapi_size_t size)
Implements modem specific AT command set for sending data.
Class for sending AT commands and parsing AT responses.
virtual nsapi_size_or_error_t socket_recvfrom_impl(CellularSocket *socket, SocketAddress *address, void *buffer, nsapi_size_t size)
Implements modem specific AT command set for receiving data.