18#ifndef AT_CELLULAR_DEVICE_H_
19#define AT_CELLULAR_DEVICE_H_
32class AT_CellularInformation;
33class AT_CellularNetwork;
35class AT_CellularContext;
51 enum CellularProperty {
55 PROPERTY_AT_CGSN_WITH_TYPE,
62 PROPERTY_IPV4_PDP_TYPE,
63 PROPERTY_IPV6_PDP_TYPE,
64 PROPERTY_IPV4V6_PDP_TYPE,
65 PROPERTY_NON_IP_PDP_TYPE,
67 PROPERTY_AT_COPS_FALLBACK_AUTO,
68 PROPERTY_SOCKET_COUNT,
71 PROPERTY_AT_SEND_DELAY,
133#if MBED_CONF_CELLULAR_USE_SMS
178#if MBED_CONF_CELLULAR_USE_SMS
184 virtual AT_CellularSMS *open_sms_impl(
ATHandler &at);
188 void send_disconnect_to_context(
int cid);
192 virtual void set_at_urcs_impl();
195 void setup_at_handler();
200 void urc_pdn_deact();
206#if MBED_CONF_CELLULAR_USE_SMS
207 AT_CellularSMS *_sms;
214 std::chrono::duration<int, std::milli> _default_timeout;
215 bool _modem_debug_on;
216 const intptr_t *_property_array;
virtual void close_network()
Closes the opened CellularNetwork by deleting the CellularNetwork instance.
virtual nsapi_error_t is_ready()
Check whether the device is ready to accept commands.
virtual void set_ready_cb(Callback< void()> callback)
Set callback function to listen when device is ready.
virtual void delete_context(CellularContext *context)
Deletes the given CellularContext instance.
virtual void close_information()
Closes the opened CellularInformation by deleting the CellularInformation instance.
virtual nsapi_error_t clear()
Clear modem to a default initial state.
virtual nsapi_error_t shutdown()
Shutdown cellular device to minimum functionality.
void set_cellular_properties(const intptr_t *property_array)
Cellular module need to define an array of cellular properties which defines module supported propert...
virtual nsapi_error_t hard_power_off()
Sets the modem in unplugged state.
virtual nsapi_error_t set_power_save_mode(int periodic_time, int active_time=0)
Set power save mode.
intptr_t get_property(CellularProperty key)
Get value for the given key.
virtual void modem_debug_on(bool on)
Turn modem debug traces on.
virtual nsapi_error_t soft_power_on()
Powers up the modem.
virtual CellularContext * create_context(const char *apn=NULL, bool cp_req=false, bool nonip_req=false)
Creates a new CellularContext interface.
virtual void cellular_callback(nsapi_event_t ev, intptr_t ptr, CellularContext *ctx=NULL)
Cellular callback to be attached to Network and CellularStateMachine classes.
virtual AT_CellularContext * create_context_impl(ATHandler &at, const char *apn, bool cp_req=false, bool nonip_req=false)
Creates new instance of AT_CellularContext or if overridden, modem specific implementation.
virtual nsapi_error_t set_pin(const char *sim_pin)
Open the SIM card by setting the pin code for SIM.
virtual CellularInformation * open_information()
Create new CellularInformation interface.
virtual AT_CellularInformation * open_information_impl(ATHandler &at)
Create new instance of AT_CellularInformation or if overridden, modem specific implementation.
virtual AT_CellularNetwork * open_network_impl(ATHandler &at)
Create new instance of AT_CellularNetwork or if overridden, modem specific implementation.
virtual void set_timeout(int timeout)
Set the default response timeout.
virtual nsapi_error_t init()
Initialize cellular device must be called right after the module is ready.
AT_CellularDevice(FileHandle *fh, char const *delim="\r")
Create an AT_CellularDevice.
virtual ATHandler * get_at_handler()
Get the current ATHandler instance in use for debug purposes etc.
virtual CellularNetwork * open_network()
Create new CellularNetwork interface.
virtual nsapi_error_t hard_power_on()
Sets the modem up for powering on This is equivalent to plugging in the device, i....
virtual nsapi_error_t soft_power_off()
Powers down the modem.
virtual CellularContext * get_context_list() const
Get the linked list of CellularContext instances.
virtual nsapi_error_t set_baud_rate(int baud_rate)
Sets cellular modem to given baud rate.
virtual nsapi_error_t get_sim_state(SimState &state)
Get SIM card's state.
Class AT_CellularNetwork.
Class for sending AT commands and parsing AT responses.
Callback class based on template specialization.
CellularContext is CellularInterface/NetworkInterface with extensions for cellular connectivity.
virtual void close_sms()=0
Closes the opened CellularSMS by deleting the CellularSMS instance.
virtual CellularSMS * open_sms()=0
Create new CellularSMS interface.
An abstract interface for connecting to a network and getting information from it.
signed int nsapi_error_t
Type used to represent error codes.