BA / Mbed OS BaBoRo_test2
Embed: (wiki syntax)

« Back to documentation index

CellularConnectionFSM Class Reference

CellularConnectionFSM Class Reference

CellularConnectionFSM class. More...

#include <CellularConnectionFSM.h>

Public Types

enum  CellularState
 

Cellular connection states.

More...

Public Member Functions

nsapi_error_t init ()
 Initialize cellular device.
void set_serial (UARTSerial *serial)
 Set serial connection for cellular device.
void set_callback (mbed::Callback< bool(int, int)> status_callback)
 Set callback for state update.
virtual void attach (mbed::Callback< void(nsapi_event_t, intptr_t)> status_cb)
 Register callback for status reporting.
events::EventQueueget_queue ()
 Get event queue that can be chained to main event queue (or use start_dispatch)
nsapi_error_t start_dispatch ()
 Start event queue dispatching.
void stop ()
 Stop event queue dispatching and close cellular interfaces.
CellularNetworkget_network ()
 Get cellular network interface.
CellularDeviceget_device ()
 Get cellular device interface.
CellularSIMget_sim ()
 Get cellular sim interface.
nsapi_error_t continue_to_state (CellularState state=STATE_CONNECTED)
 Change cellular connection to the target state.
void set_sim_pin (const char *sim_pin)
 Set cellular device SIM PIN code.
void set_retry_timeout_array (uint16_t timeout[], int array_len)
 Sets the timeout array for network rejects.

Detailed Description

CellularConnectionFSM class.

Finite State Machine for connecting to cellular network

Definition at line 46 of file CellularConnectionFSM.h.


Member Enumeration Documentation

Cellular connection states.

Definition at line 55 of file CellularConnectionFSM.h.


Member Function Documentation

void attach ( mbed::Callback< void(nsapi_event_t, intptr_t)>  status_cb ) [virtual]

Register callback for status reporting.

The specified status callback function will be called on status changes on the network. The parameters on the callback are the event type and event-type dependent reason parameter.

Parameters:
status_cbThe callback for status changes

Definition at line 585 of file CellularConnectionFSM.cpp.

nsapi_error_t continue_to_state ( CellularState  state = STATE_CONNECTED )

Change cellular connection to the target state.

Parameters:
stateto continue. Default is to connect.
Returns:
see nsapi_error_t, 0 on success

Definition at line 326 of file CellularConnectionFSM.cpp.

CellularDevice * get_device (  )

Get cellular device interface.

Returns:
device interface, NULL on failure

Definition at line 630 of file CellularConnectionFSM.cpp.

CellularNetwork * get_network (  )

Get cellular network interface.

Returns:
network interface, NULL on failure

Definition at line 625 of file CellularConnectionFSM.cpp.

events::EventQueue * get_queue (  )

Get event queue that can be chained to main event queue (or use start_dispatch)

Returns:
event queue

Definition at line 620 of file CellularConnectionFSM.cpp.

CellularSIM * get_sim (  )

Get cellular sim interface.

Returns:
sim interface, NULL on failure

Definition at line 635 of file CellularConnectionFSM.cpp.

nsapi_error_t init (  )

Initialize cellular device.

Remarks:
Must be called before any other methods
Returns:
see nsapi_error_t, 0 on success

Definition at line 94 of file CellularConnectionFSM.cpp.

void set_callback ( mbed::Callback< bool(int, int)>  status_callback )

Set callback for state update.

Parameters:
status_callbackfunction to call on state changes

Definition at line 580 of file CellularConnectionFSM.cpp.

void set_retry_timeout_array ( uint16_t  timeout[],
int  array_len 
)

Sets the timeout array for network rejects.

After reject next item is tried and after all items are waited and still fails then current network event will fail.

Parameters:
timeouttimeout array using seconds
array_lenlength of the array

Definition at line 645 of file CellularConnectionFSM.cpp.

void set_serial ( UARTSerial serial )

Set serial connection for cellular device.

Parameters:
serialUART driver

Definition at line 575 of file CellularConnectionFSM.cpp.

void set_sim_pin ( const char *  sim_pin )

Set cellular device SIM PIN code.

Parameters:
sim_pinPIN code

Definition at line 143 of file CellularConnectionFSM.cpp.

nsapi_error_t start_dispatch (  )

Start event queue dispatching.

Returns:
see nsapi_error_t, 0 on success

Definition at line 558 of file CellularConnectionFSM.cpp.

void stop ( void   )

Stop event queue dispatching and close cellular interfaces.

Definition at line 76 of file CellularConnectionFSM.cpp.