CellularHelper
Public Member Functions | Data Fields
CellularHelperCommonResponse Class Referenceabstract

Common base class for response objects. More...

#include <CellularHelper.h>

Inheritance diagram for CellularHelperCommonResponse:
CellularHelperPlusStringResponse CellularHelperStringResponse CellularHelperCREGResponse CellularHelperEnvironmentResponse CellularHelperExtendedQualResponse CellularHelperLocationResponse CellularHelperRSSIQualResponse CellularHelperEnvironmentResponseStatic< MAX_NEIGHBOR_CELLS >

Public Member Functions

virtual int parse (int type, const char *buf, int len)=0
 Method to parse the output from the modem. More...
 
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

int resp = RESP_ERROR
 Response code from Cellular.command. More...
 
bool enableDebug = false
 Enables debug mode (default: false) More...
 

Detailed Description

Common base class for response objects.

All response objects inherit from this, so the parse() method can be called in the subclass, and also the resp and enableDebug members are always available.

Member Function Documentation

◆ logCellularDebug()

void CellularHelperCommonResponse::logCellularDebug ( int  type,
const char *  buf,
int  len 
) const

Used when enableDebug is true to log the Cellular.command callback data using Log.info.

Parameters
typeone of 13 different enumerated AT command response types.
bufa pointer to the character array containing the AT command response.
lenlength of the AT command response buf.

◆ parse()

virtual int CellularHelperCommonResponse::parse ( int  type,
const char *  buf,
int  len 
)
pure virtual

Method to parse the output from the modem.

Parameters
typeone of 13 different enumerated AT command response types.
bufa pointer to the character array containing the AT command response.
lenlength of the AT command response buf.

This is called from responseCallback, which is the callback to Cellular.command.

In the base class CellularHelperCommonResponse this is pure virtual and must be subclassed in your concrete subclass of CellularHelperCommonResponse.

Implemented in CellularHelperEnvironmentResponse, CellularHelperPlusStringResponse, and CellularHelperStringResponse.

Field Documentation

◆ enableDebug

bool CellularHelperCommonResponse::enableDebug = false

Enables debug mode (default: false)

If you set this to true in your response object class, additional debugging logs (Log.info, etc.) will be generated to help troubleshoot problems.

◆ resp

int CellularHelperCommonResponse::resp = RESP_ERROR

Response code from Cellular.command.

The typical return values are:

  • RESP_OK = -2
  • RESP_ERROR = -3
  • RESP_ABORTED = -5

The documentation for this class was generated from the following files: