CellularHelper
|
Used to hold the results from the AT+CGED command. More...
#include <CellularHelper.h>
Public Member Functions | |
CellularHelperEnvironmentResponse () | |
Constructor for AT+CGED without neighbor data. More... | |
CellularHelperEnvironmentResponse (CellularHelperEnvironmentCellData *neighbors, size_t numNeighbors) | |
Constructor that takes an external array of CellularHelperEnvironmentCellData. More... | |
virtual int | parse (int type, const char *buf, int len) |
Method to parse the output from the modem. More... | |
void | clear () |
Clear the data so the object can be reused. | |
void | logResponse () const |
Log the decoded environment data to the debug log using Log.info. | |
size_t | getNumNeighbors () const |
Gets the number of neighboring cells that were returned. More... | |
Public Member Functions inherited from CellularHelperPlusStringResponse | |
String | getDoubleQuotedPart (bool onlyFirst=true) const |
Gets the double quoted part of a string response. More... | |
Public Member Functions inherited from CellularHelperCommonResponse | |
void | logCellularDebug (int type, const char *buf, int len) const |
Used when enableDebug is true to log the Cellular.command callback data using Log.info. More... | |
Data Fields | |
CellularHelperEnvironmentCellData | service |
Information about the service cell (the one you're connected to) More... | |
CellularHelperEnvironmentCellData * | neighbors |
Information about the neighboring cells. More... | |
size_t | numNeighbors |
Number of entries in the neighbors array. More... | |
int | curDataIndex = -1 |
Current index we're writing to. More... | |
Data Fields inherited from CellularHelperPlusStringResponse | |
String | command |
Your subclass must set this to the command requesting (not including the AT+ part) More... | |
String | string |
Returned string is stored here. | |
Data Fields inherited from CellularHelperCommonResponse | |
int | resp = RESP_ERROR |
Response code from Cellular.command. More... | |
bool | enableDebug = false |
Enables debug mode (default: false) More... | |
Used to hold the results from the AT+CGED command.
You may want to use CellularHelperEnvironmentResponseStatic<> instead of separately allocating this object and the array of CellularHelperEnvironmentCellData.
Using this class with the default contructor is handy if you are using ENVIRONMENT_SERVING_CELL mode with CellularHelper.getLocation()
CellularHelperEnvironmentResponse::CellularHelperEnvironmentResponse | ( | ) |
Constructor for AT+CGED without neighbor data.
Since only the Electron 2G (SARA-G350) supports getting neighbor data, this constructor can be used with ENVIRONMENT_SERVING_CELL to get only the serving cell.
CellularHelperEnvironmentResponse::CellularHelperEnvironmentResponse | ( | CellularHelperEnvironmentCellData * | neighbors, |
size_t | numNeighbors | ||
) |
Constructor that takes an external array of CellularHelperEnvironmentCellData.
neighbors | Pointer to array of CellularHelperEnvironmentCellData. Can be NULL. |
numNeighbors | Number of items in neighbors. Can be 0. |
The templated CellularHelperEnvironmentResponseStatic<> uses this constructor but eliminates the need to separately allocate the neighbor CellularHelperEnvironmentCellData and may be easier to use.
size_t CellularHelperEnvironmentResponse::getNumNeighbors | ( | ) | const |
Gets the number of neighboring cells that were returned.
|
virtual |
Method to parse the output from the modem.
type | one of 13 different enumerated AT command response types. |
buf | a pointer to the character array containing the AT command response. |
len | length of the AT command response buf. |
This is called from responseCallback, which is the callback to Cellular.command.
Reimplemented from CellularHelperPlusStringResponse.
int CellularHelperEnvironmentResponse::curDataIndex = -1 |
Current index we're writing to.
CellularHelperEnvironmentCellData* CellularHelperEnvironmentResponse::neighbors |
Information about the neighboring cells.
Only filled in when using ENVIRONMENT_SERVING_CELL_AND_NEIGHBORS mode, which only works on the 2G Electron (SARA-G350). Maximum number of neighboring cells is 30, however it will be further limited by the numNeighbors (the size of your array).
The value of this member is passed into the constructor.
size_t CellularHelperEnvironmentResponse::numNeighbors |
Number of entries in the neighbors array.
The value of this member is passed into the constructor.
CellularHelperEnvironmentCellData CellularHelperEnvironmentResponse::service |
Information about the service cell (the one you're connected to)
Filled in in both ENVIRONMENT_SERVING_CELL and ENVIRONMENT_SERVING_CELL_AND_NEIGHBORS modes.