17 #ifndef AT_CELLULARCONTEXT_H_ 18 #define AT_CELLULARCONTEXT_H_ 21 #include "AT_CellularBase.h" 22 #include "Semaphore.h" 24 const int MAX_APN_LENGTH = 63 + 1;
28 class AT_CellularDevice;
39 virtual const char *get_ip_address();
47 virtual void set_plmn(
const char *plmn);
51 virtual void set_credentials(
const char *apn,
const char *uname = 0,
const char *pwd = 0);
53 virtual const char *get_netmask();
55 virtual const char *get_gateway();
60 CellularContext::RateControlUplinkTimeUnit &time_unit,
int &uplink_rate);
67 #if (DEVICE_SERIAL && DEVICE_INTERRUPTIN) || defined(DOXYGEN_ONLY) 69 #endif // #if DEVICE_SERIAL 102 virtual void deactivate_non_ip_context();
103 virtual void deactivate_ip_context();
104 virtual void set_disconnect();
105 virtual void deactivate_context();
106 virtual bool get_context();
107 AT_CellularBase::CellularProperty pdp_type_t_to_cellular_property(pdp_type_t pdp_type);
108 bool set_new_context(
int cid);
110 #if NSAPI_PPP_AVAILABLE 112 void ppp_status_cb(nsapi_event_t ev, intptr_t ptr);
113 void ppp_disconnected();
114 #endif // #if NSAPI_PPP_AVAILABLE 116 virtual void activate_context();
119 void check_and_deactivate_context();
120 void delete_current_context();
122 void ciot_opt_cb(mbed::CellularNetwork::CIoT_Supported_Opt ciot_opt);
123 virtual void do_connect_with_retry();
124 void do_disconnect();
125 void set_cid(
int cid);
127 ContextOperation _current_op;
133 char _found_apn[MAX_APN_LENGTH];
141 #endif // AT_CELLULARCONTEXT_H_ Implements support for data transfer using Control Plane CIoT EPS optimization specified in 3GPP 23...
virtual void set_sim_pin(const char *sim_pin)
Set the PIN code for SIM card.
virtual char * get_interface_name(char *interface_name)
Get the network interface name.
The Semaphore class is used to manage and protect access to a set of shared resources.
virtual ControlPlane_netif * get_cp_netif()
Returns the control plane AT command interface.
virtual nsapi_error_t register_to_network()
Start the interface.
CellularContext is CellularInterface/NetworkInterface with extensions for cellular connectivity...
signed int nsapi_error_t
Type used to represent error codes.
virtual nsapi_error_t get_rate_control(CellularContext::RateControlExceptionReports &reports, CellularContext::RateControlUplinkTimeUnit &time_unit, int &uplink_rate)
Get APN rate control.
Class providing buffered UART communication functionality using separate circular buffer for send and...
virtual void do_connect()
Activates PDP context or in PPP mode opens data channel.
virtual nsapi_error_t attach_to_network()
Start the interface.
virtual nsapi_error_t disconnect()
Stop the interface.
virtual void cellular_callback(nsapi_event_t ev, intptr_t ptr)
The CellularDevice calls the status callback function on status changes on the network or CellularDev...
virtual void attach(mbed::Callback< void(nsapi_event_t, intptr_t)> status_cb)
Register callback for status reporting.
virtual void set_plmn(const char *plmn)
Set the plmn.
virtual nsapi_error_t get_apn_backoff_timer(int &backoff_timer)
Get backoff timer value.
Cellular PDP context class.
virtual nsapi_error_t set_sim_ready()
Start the interface.
virtual nsapi_error_t connect()
Attempt to connect to a cellular network.
virtual void set_file_handle(FileHandle *fh)
Set the file handle used to communicate with the modem.
virtual uint32_t get_timeout_for_operation(ContextOperation op) const
Get the operation specific timeout.
virtual nsapi_error_t set_blocking(bool blocking)
Set asynchronous operation of connect() and disconnect() calls.
virtual nsapi_error_t do_user_authentication()
Does the authentication for the PDP Context if user name and password are provided.
virtual nsapi_error_t get_pdpcontext_params(pdpContextList_t ¶ms_list)
Get the relevant information for an active nonsecondary PDP context.
virtual nsapi_error_t get_netmask(SocketAddress *address)
Get the local network mask.
virtual nsapi_error_t get_ip_address(SocketAddress *address)
Get the local IP address.
virtual void enable_hup(bool enable)
Enable or disable hang-up detection.
virtual nsapi_error_t get_gateway(SocketAddress *address)
Get the local gateway.
virtual nsapi_error_t set_device_ready()
Start the interface.
virtual bool is_connected()
Check if the connection is currently established.
Callback class based on template specialization.
virtual void set_credentials(const char *apn, const char *uname=0, const char *pwd=0)
Set the cellular network credentials.
Class for sending AT commands and parsing AT responses.
virtual nsapi_connection_status_t get_connection_status() const
Get the connection status.