SparkFun Iridium 9604  v1.0.0
Library for the Iridium 9604 Hybrid LTE-M Cellular + Iridium Satellite (SBD) + GNSS IoT module
Loading...
Searching...
No Matches
DevIridium9604 Class Reference

The Iridium 9604 device class: all of the AT command, URC, NMEA and satellite methods. Use SFE_IRIDIUM_9604, which adds the begin() methods. More...

#include <Iridium_9604.h>

Inheritance diagram for DevIridium9604:

Public Types

enum  IRIDIUM_9604_pdp_type {
  PDP_TYPE_INVALID = -1 , PDP_TYPE_IP = 0 , PDP_TYPE_NONIP = 1 , PDP_TYPE_IPV4V6 = 2 ,
  PDP_TYPE_IPV6 = 3
}
 The PDP types for setAPN() / getAPN(). More...
 
enum  IRIDIUM_9604_l2p_t {
  L2P_DEFAULT , L2P_PPP , L2P_M_HEX , L2P_M_RAW_IP ,
  L2P_M_OPT_PPP
}
 The layer 2 protocols for enterPPP(). More...
 
enum  IRIDIUM_9604_gpio_t {
  GPIO1 = 16 , GPIO2 = 23 , GPIO3 = 24 , GPIO4 = 25 ,
  GPIO5 = 42 , GPIO6 = 19
}
 GPIO pin map. More...
 
enum  IRIDIUM_9604_gpio_mode_t {
  GPIO_MODE_INVALID = -1 , GPIO_OUTPUT = 0 , GPIO_INPUT , NETWORK_STATUS ,
  GNSS_SUPPLY_ENABLE , GNSS_DATA_READY , GNSS_RTC_SHARING , JAMMING_DETECTION ,
  SIM_CARD_DETECTION , HEADSET_DETECTION , GSM_TX_BURST_INDICATION , MODULE_STATUS_INDICATION ,
  MODULE_OPERATING_MODE_INDICATION , I2S_DIGITAL_AUDIO_INTERFACE , SPI_SERIAL_INTERFACE , MASTER_CLOCK_GENRATION ,
  UART_INTERFACE , WIFI_ENABLE , RING_INDICATION = 18 , LAST_GASP_ENABLE ,
  EXTERNAL_GNSS_ANTENNA , TIME_PULSE_GNSS , TIME_PULSE_OUTPUT , TIMESTAMP ,
  FAST_POWER_OFF , LWM2M_PULSE , HARDWARE_FLOW_CONTROL , ANTENNA_TUNING ,
  EXT_GNSS_TIME_PULSE , EXT_GNSS_TIMESTAMP , DTR_MODE , KHZ_32768_OUT = 32 ,
  SAFE_MEMORY_POWER_OFF = 33 , UPSV_CONTROL = 34 , SATELLITE_GNSS_RX_INDICATION = 35 , SATELLITE_GNSS_RX_TX_INDICATION = 36 ,
  PAD_DISABLED = 255
}
 GPIO pin modes. More...
 
typedef SparkFun_Iridium_9604::sfe_string_t sfe_string_t
 The string type: String on Arduino; std::string on ESP-IDF. More...
 
typedef SparkFun_Iridium_9604::sfe_ip_address_t sfe_ip_address_t
 The IP address type: IPAddress on Arduino; SfeIPAddress on ESP-IDF. More...
 
typedef SparkFun_Iridium_9604::sfe_print_t sfe_print_t
 The print type: Print on Arduino; SfeOutput on ESP-IDF. More...
 
typedef SparkFun_Iridium_9604::nmeaMessage nmeaMessage
 The NMEA message class (SparkFun_Iridium_9604::nmeaMessage). More...
 
typedef SparkFun_Iridium_9604::nmeaCallbackDataCommon_t nmeaCallbackDataCommon_t
 The NMEA callback data type (SparkFun_Iridium_9604::nmeaCallbackDataCommon_t). More...
 
typedef SparkFun_Iridium_9604::urcCallback_t urcCallback_t
 The generic URC callback type. Cast your callback to this for setURCCallback(). More...
 
typedef IRIDIUM_9604_gnss_system_t gnss_system_t
 The GNSS system type. (Retained for SARA-R5 compatibility.) More...
 
typedef IRIDIUM_9604_gnss_aiding_mode_t gnss_aiding_mode_t
 The GNSS aiding mode type. (Retained for SARA-R5 compatibility.) More...
 

Public Member Functions

 DevIridium9604 (int powerPin=IRIDIUM_9604_POWER_PIN, int resetPin=IRIDIUM_9604_RESET_PIN, uint8_t maxInitTries=9)
 Construct a DevIridium9604 object. Use SFE_IRIDIUM_9604 (SparkFun_Iridium_9604.h), which adds the begin() methods. More...
 
 ~DevIridium9604 ()
 Destroy the DevIridium9604 object, freeing the backlog and receive buffers. More...
 
void setCommunicationBus (SparkFun_Iridium_9604::IridiumDeviceBus &theBus)
 Set the communication bus. Called by the begin() methods of SFE_IRIDIUM_9604. Call it yourself to use your own IridiumDeviceBus. More...
 
bool begin (unsigned long baud)
 Initialize the module and ensure it is connected. Autobauds the module to baud if required. Called by the begin() methods of SFE_IRIDIUM_9604 - after setCommunicationBus. More...
 
void enableDebugging (sfe_print_t &debugPort=SparkFun_Iridium_9604::sfeStdout)
 Turn on the debug messages. More...
 
void enableAtDebugging (sfe_print_t &debugPort=SparkFun_Iridium_9604::sfeStdout)
 Turn on the AT command debug messages: every AT command and response is printed. More...
 
void disableDebugging (void)
 Turn off the debug messages. More...
 
void disableAtDebugging (void)
 Turn off the AT command debug messages. More...
 
void invertPowerPin (bool invert=false)
 Invert the polarity of the power pin, if required. Normally the module's PWR_ON pin is pulled low and released to toggle the power. Some boards need it to be pulled high and released instead. More...
 
void setPowerOnPinWriteCallback (IRIDIUM_9604_pin_write_callback_t callback)
 Set a callback to write the 9604 PWR_ON pin - in place of the GPIO pin passed to the constructor. More...
 
void setResetPinWriteCallback (IRIDIUM_9604_pin_write_callback_t callback)
 Set a callback to write the 9604 RESET_N pin - in place of the GPIO pin passed to the constructor. More...
 
void hwReset (void)
 Reset (reboot) the module: hold RESET_N low for IRIDIUM_9604_RESET_PULSE_PERIOD (200 ms), then release it. More...
 
void hwEmergencyShutdown (void)
 Abrupt emergency hardware shutdown: hold PWR_ON low for IRIDIUM_9604_EMERGENCY_SHUTDOWN_PULSE_PERIOD (20 s), then release it. More...
 
IRIDIUM_9604_error_t modulePowerOff (void)
 Gracefully disconnect from the network and power the module off (AT+CPWROFF). More...
 
void modulePowerOn (void)
 Power the module on by pulsing the PWR_ON pin. Requires the powerPin to have been provided to the constructor - or a PWR_ON pin write callback (setPowerOnPinWriteCallback). More...
 
bool bufferedPoll (void)
 Process any data from the module: the backlog first, then any fresh serial data. URCs are passed to the registered URC handlers. More...
 
bool poll (void)
 The original poll function. Process one line of serial data from the module. It is 'blocking': it does not return until it receives a \n. bufferedPoll() is preferred. More...
 
void checkCallbacks (void)
 Call any NMEA callbacks which are waiting. Called automatically by bufferedPoll(). More...
 
bool setURCCallback (const char *urcPrefix, urcCallback_t callback, uint8_t index=0)
 Register (or clear) a callback for a URC - generically. The typed helpers (setSocketReadCallback() etc.) call this. More...
 
void setSocketListenCallback (void(*socketListenCallback)(int, sfe_ip_address_t, unsigned int, int, sfe_ip_address_t, unsigned int))
 Set the callback for the socket listen URC (+UUSOLI). Called when a remote client connects to a listening socket. More...
 
void setSocketReadCallback (void(*socketReadCallback)(int, sfe_string_t))
 Set the original socket read callback - called when a +UUSORD or +UUSORF URC is received. The library reads the data and passes it to the callback. More...
 
void setSocketReadCallbackPlus (void(*socketReadCallbackPlus)(int, const char *, int, sfe_ip_address_t, int))
 Set the socket read callback - called when a +UUSORD or +UUSORF URC is received. The library reads the data and passes it - with its length, the remote IP Address and the remote port - to the callback. More...
 
void setSocketCloseCallback (void(*socketCloseCallback)(int))
 Set the callback for the socket close URC (+UUSOCL). More...
 
void setGpsReadCallback (void(*gpsRequestCallback)(ClockData time, PositionData gps, SpeedData spd, unsigned long uncertainty))
 Set the callback for the +UULOC location URC (see gpsRequest()). More...
 
void setSIMstateReportCallback (void(*simStateRequestCallback)(IRIDIUM_9604_sim_states_t state))
 Set the callback for the SIM state URC (+UUSIMSTAT). See setSIMstateReportingMode(). More...
 
void setGNSSAidingCallback (void(*gnssAidingCallback)(int aidMode, int result))
 Set the callback for the assisted GNSS indication URC (+UUGIND). Enable the URC with setGNSSAidingIndication(true). More...
 
void setPingCallback (void(*pingRequestCallback)(int retry, int p_size, sfe_string_t remote_hostname, sfe_ip_address_t ip, int ttl, long rtt))
 Set the callback for the ping result URC (+UUPING). See ping(). More...
 
void setHTTPCommandCallback (void(*httpCommandRequestCallback)(int profile, int command, int result))
 Set the callback for the HTTP command result URC (+UUHTTPCR). More...
 
void setMQTTCommandCallback (void(*mqttCommandRequestCallback)(int command, int result))
 Set the callback for the MQTT command result URC (+UUMQTTC). More...
 
void setFTPCommandCallback (void(*ftpCommandRequestCallback)(int command, int result))
 Set the callback for the FTP command result URC (+UUFTPCR). More...
 
IRIDIUM_9604_error_t setRegistrationCallback (void(*registrationCallback)(IRIDIUM_9604_registration_status_t status, unsigned int lac, unsigned int ci, int Act))
 Set the callback for the network registration status URC (+CREG) and enable the URC (AT+CREG=2). More...
 
IRIDIUM_9604_error_t setEpsRegistrationCallback (void(*epsRegistrationCallback)(IRIDIUM_9604_registration_status_t status, unsigned int tac, unsigned int ci, int Act))
 Set the callback for the EPS network registration status URC (+CEREG) and enable the URC (AT+CEREG=2). More...
 
virtual size_t write (uint8_t c)
 Write one byte directly to the module serial port. More...
 
virtual size_t write (const char *str)
 Write a NULL-terminated string directly to the module serial port. More...
 
virtual size_t write (const char *buffer, size_t size)
 Write a buffer directly to the module serial port. More...
 
IRIDIUM_9604_error_t at (void)
 Send "AT" and check for "OK". More...
 
IRIDIUM_9604_error_t enableEcho (bool enable=true)
 Enable or disable the command echo (ATE1 / ATE0). The library disables echo during begin(). More...
 
IRIDIUM_9604_error_t setErrorReporting (uint8_t mode=2)
 Configure how the module reports errors (AT+CMEE). More...
 
const char * getLastErrorText (void)
 Get the reason for the most recent error. More...
 
sfe_string_t getManufacturerID (void)
 Read the manufacturer identification (AT+CGMI). More...
 
sfe_string_t getModelID (void)
 Read the model identification (AT+CGMM). More...
 
sfe_string_t getFirmwareVersion (void)
 Read the firmware version (AT+CGMR). More...
 
sfe_string_t getSerialNo (void)
 Read the product serial number (AT+CGSN). More...
 
sfe_string_t getIMEI (void)
 Read the cellular IMEI (AT+GSN). See getSatelliteIMEI() for the satellite (SBD) IMEI. More...
 
sfe_string_t getIMSI (void)
 Read the SIM International Mobile Subscriber Identity (AT+CIMI). More...
 
sfe_string_t getCCID (void)
 Read the SIM card identification (AT+CCID). More...
 
sfe_string_t getSubscriberNo (void)
 Read the subscriber number (AT+CNUM). More...
 
sfe_string_t getCapabilities (void)
 Read the module's capabilities list (AT+GCAP). More...
 
IRIDIUM_9604_error_t reset (void)
 Reset the module (AT+CFUN=16) and wait for it to restart. Bounded by IRIDIUM_9604_RESET_TIMEOUT. More...
 
sfe_string_t clock (void)
 Read the module's real time clock (AT+CCLK?). More...
 
IRIDIUM_9604_error_t clock (uint8_t *y, uint8_t *mo, uint8_t *d, uint8_t *h, uint8_t *min, uint8_t *s, int8_t *tz)
 Read the module's real time clock (AT+CCLK?) as separate values. More...
 
IRIDIUM_9604_error_t setClock (sfe_string_t theTime)
 Set the module's real time clock (AT+CCLK). More...
 
IRIDIUM_9604_error_t setClock (uint8_t y, uint8_t mo, uint8_t d, uint8_t h, uint8_t min, uint8_t s, int8_t tz)
 Set the module's real time clock (AT+CCLK) from separate values. More...
 
void autoTimeZoneForBegin (bool enable=true)
 Enable or disable the automatic time zone update during begin(). Call this before begin(). Default: enabled. More...
 
IRIDIUM_9604_error_t autoTimeZone (bool enable)
 Enable or disable the automatic time zone update from the network (AT+CTZU). More...
 
IRIDIUM_9604_error_t setUtimeMode (IRIDIUM_9604_utime_mode_t mode=IRIDIUM_9604_UTIME_MODE_PPS, IRIDIUM_9604_utime_sensor_t sensor=IRIDIUM_9604_UTIME_SENSOR_GNSS_LTE)
 Set the time mode and time source (AT+UTIME). More...
 
IRIDIUM_9604_error_t getUtimeMode (IRIDIUM_9604_utime_mode_t *mode, IRIDIUM_9604_utime_sensor_t *sensor)
 Read the time mode and time source (AT+UTIME?). More...
 
IRIDIUM_9604_error_t setUtimeIndication (IRIDIUM_9604_utime_urc_configuration_t config=IRIDIUM_9604_UTIME_URC_CONFIGURATION_ENABLED)
 Configure the +UUTIME time indication URC (AT+UTIMEIND). More...
 
IRIDIUM_9604_error_t getUtimeIndication (IRIDIUM_9604_utime_urc_configuration_t *config)
 Read the time indication URC configuration (AT+UTIMEIND?). More...
 
IRIDIUM_9604_error_t setUtimeConfiguration (int32_t offsetNanoseconds=0, int32_t offsetSeconds=0)
 Set the time offsets (AT+UTIMECFG). More...
 
IRIDIUM_9604_error_t getUtimeConfiguration (int32_t *offsetNanoseconds, int32_t *offsetSeconds)
 Read the time offsets (AT+UTIMECFG?). More...
 
int8_t rssi (void)
 Read the received signal strength (AT+CSQ). Cellular (LTE-M) only. More...
 
IRIDIUM_9604_error_t getExtSignalQuality (signal_quality &signal_quality)
 Read the extended signal quality (AT+CESQ). Cellular (LTE-M) only. More...
 
IRIDIUM_9604_registration_status_t registration (bool eps=true)
 Read the network registration status (AT+CEREG? or AT+CREG?). More...
 
bool setNetworkProfile (mobile_network_operator_t mno, bool autoReset=false, bool urcNotification=false)
 Set the Mobile Network Operator (MNO) profile (AT+UMNOPROF). Checks the current profile first and only changes it if required. More...
 
mobile_network_operator_t getNetworkProfile (void)
 Read the Mobile Network Operator (MNO) profile (AT+UMNOPROF?). More...
 
IRIDIUM_9604_error_t setAPN (sfe_string_t apn, uint8_t cid=1, IRIDIUM_9604_pdp_type pdpType=PDP_TYPE_IP)
 Set the Access Point Name for a PDP context (AT+CGDCONT). More...
 
IRIDIUM_9604_error_t getAPN (int cid, sfe_string_t *apn, sfe_ip_address_t *ip, IRIDIUM_9604_pdp_type *pdpType=nullptr)
 Read the Access Point Name and IP address for a PDP context (AT+CGDCONT?). More...
 
IRIDIUM_9604_error_t getSimStatus (sfe_string_t *code)
 Read the SIM PIN status (AT+CPIN?). More...
 
IRIDIUM_9604_error_t setSimPin (sfe_string_t pin)
 Enter the SIM PIN (AT+CPIN). More...
 
IRIDIUM_9604_error_t setSIMstateReportingMode (int mode)
 Set the SIM state reporting mode (AT+USIMSTAT). Bit 0 reports the (U)SIM initialization status (states 0 to 6). Bit 1 reports the phonebook initialization status (states 7 and 8). Bit 2 reports the SIM toolkit REFRESH result (states 9 to 13). More...
 
IRIDIUM_9604_error_t getSIMstateReportingMode (int *mode)
 Read the SIM state reporting mode (AT+USIMSTAT?). More...
 
IRIDIUM_9604_error_t enterPPP (uint8_t cid=1, char dialing_type_char=0, unsigned long dialNumber=99, IRIDIUM_9604_l2p_t l2p=L2P_DEFAULT)
 Enter PPP mode (ATD*99***cid#). More...
 
uint8_t getOperators (struct operator_stats *op, int maxOps=3)
 Scan for the available network operators (AT+COPS=?). This can take up to 3 minutes. More...
 
IRIDIUM_9604_error_t registerOperator (struct operator_stats oper)
 Manually register with a network operator (AT+COPS=1). More...
 
IRIDIUM_9604_error_t automaticOperatorSelection ()
 Select the network operator automatically (AT+COPS=0). More...
 
IRIDIUM_9604_error_t getOperator (sfe_string_t *oper)
 Read the current network operator (AT+COPS?). More...
 
IRIDIUM_9604_error_t deregisterOperator (void)
 Deregister from the network operator (AT+COPS=2). More...
 
IRIDIUM_9604_error_t setRAT (IRIDIUM_9604_rat_t rat, bool autoReboot=true)
 Select the Radio Access Technology (AT+URAT): LTE Cat M1 or satellite. New for the 9604. More...
 
IRIDIUM_9604_rat_t getRAT (void)
 Read the selected Radio Access Technology (AT+URAT?). New for the 9604. More...
 
IRIDIUM_9604_error_t setSMSMessageFormat (IRIDIUM_9604_message_format_t textMode=IRIDIUM_9604_MESSAGE_FORMAT_TEXT)
 Set the SMS message format (AT+CMGF). More...
 
IRIDIUM_9604_error_t sendSMS (sfe_string_t number, sfe_string_t message)
 Send an SMS message (AT+CMGS). More...
 
IRIDIUM_9604_error_t getPreferredMessageStorage (int *used, int *total, sfe_string_t memory="ME")
 Read the number of used and total SMS memory locations (AT+CPMS). More...
 
IRIDIUM_9604_error_t readSMSmessage (int location, sfe_string_t *unread, sfe_string_t *from, sfe_string_t *dateTime, sfe_string_t *message)
 Read an SMS message (AT+CMGR). Reading an empty location returns IRIDIUM_9604_ERROR_UNEXPECTED_RESPONSE. More...
 
IRIDIUM_9604_error_t deleteSMSmessage (int location, int deleteFlag=0)
 Delete SMS message(s) (AT+CMGD). More...
 
IRIDIUM_9604_error_t deleteReadSMSmessages (void)
 Delete all the read SMS messages from preferred storage (AT+CMGD=1,1). More...
 
IRIDIUM_9604_error_t deleteReadSentSMSmessages (void)
 Delete all the read and sent SMS messages from preferred storage (AT+CMGD=1,2). More...
 
IRIDIUM_9604_error_t deleteReadSentUnsentSMSmessages (void)
 Delete all the read, sent and unsent SMS messages from preferred storage (AT+CMGD=1,3). More...
 
IRIDIUM_9604_error_t deleteAllSMSmessages (void)
 Delete all the SMS messages from preferred storage, including the unread messages (AT+CMGD=1,4). More...
 
IRIDIUM_9604_error_t setBaud (unsigned long baud)
 Change the module's baud rate (AT+IPR). The library changes its own baud rate to match. More...
 
IRIDIUM_9604_error_t setFlowControl (IRIDIUM_9604_flow_control_t value=IRIDIUM_9604_ENABLE_FLOW_CONTROL)
 Enable or disable RTS/CTS hardware flow control (AT&K). More...
 
IRIDIUM_9604_error_t setGpioMode (IRIDIUM_9604_gpio_t gpio, IRIDIUM_9604_gpio_mode_t mode, int value=0)
 Set the mode of a GPIO pin (AT+UGPIOC). More...
 
IRIDIUM_9604_gpio_mode_t getGpioMode (IRIDIUM_9604_gpio_t gpio)
 Read the mode of a GPIO pin (AT+UGPIOC?). More...
 
int socketOpen (IRIDIUM_9604_socket_protocol_t protocol, unsigned int localPort=0)
 Open a TCP or UDP socket (AT+USOCR). More...
 
IRIDIUM_9604_error_t socketClose (int socket, unsigned long timeout=IRIDIUM_9604_2_MIN_TIMEOUT)
 Close a socket (AT+USOCL). More...
 
IRIDIUM_9604_error_t socketConnect (int socket, const char *address, unsigned int port)
 Connect a TCP socket to a remote host (AT+USOCO). Not required for UDP sockets. More...
 
IRIDIUM_9604_error_t socketConnect (int socket, sfe_ip_address_t address, unsigned int port)
 Connect a TCP socket to a remote IP address (AT+USOCO). Not required for UDP sockets. More...
 
IRIDIUM_9604_error_t socketWrite (int socket, const char *str, int len=-1)
 Write data to a TCP socket (AT+USOWR). OK for binary data if len is provided. More...
 
IRIDIUM_9604_error_t socketWrite (int socket, sfe_string_t str)
 Write data to a TCP socket (AT+USOWR). OK for binary data. More...
 
IRIDIUM_9604_error_t socketWriteUDP (int socket, const char *address, int port, const char *str, int len=-1)
 Write data to a UDP socket (AT+USOST). OK for binary data if len is provided. More...
 
IRIDIUM_9604_error_t socketWriteUDP (int socket, sfe_ip_address_t address, int port, const char *str, int len=-1)
 Write data to a UDP socket (AT+USOST). OK for binary data if len is provided. More...
 
IRIDIUM_9604_error_t socketWriteUDP (int socket, sfe_string_t address, int port, sfe_string_t str)
 Write data to a UDP socket (AT+USOST). OK for binary data. More...
 
IRIDIUM_9604_error_t socketRead (int socket, int length, char *readDest, int *bytesRead=nullptr)
 Read data from a TCP socket (AT+USORD). Large reads are split into multiple AT commands. More...
 
IRIDIUM_9604_error_t socketReadAvailable (int socket, int *length)
 Read the number of bytes waiting to be read from a TCP socket (AT+USORD=socket,0). More...
 
IRIDIUM_9604_error_t socketReadUDP (int socket, int length, char *readDest, sfe_ip_address_t *remoteIPAddress=nullptr, int *remotePort=nullptr, int *bytesRead=nullptr)
 Read data from a UDP socket (AT+USORF), plus the remote IP address and port. Large reads are split into multiple AT commands. More...
 
IRIDIUM_9604_error_t socketReadAvailableUDP (int socket, int *length)
 Read the number of bytes waiting to be read from a UDP socket (AT+USORF=socket,0). More...
 
IRIDIUM_9604_error_t socketListen (int socket, unsigned int port)
 Listen for incoming connections on a socket (AT+USOLI). See setSocketListenCallback(). More...
 
IRIDIUM_9604_error_t socketDirectLinkMode (int socket)
 Switch a socket into direct link (transparent) mode (AT+USODL). More...
 
IRIDIUM_9604_error_t socketDirectLinkTimeTrigger (int socket, unsigned long timerTrigger)
 Set the direct link time trigger (AT+UDCONF=5). More...
 
IRIDIUM_9604_error_t socketDirectLinkDataLengthTrigger (int socket, int dataLengthTrigger)
 Set the direct link data length trigger (AT+UDCONF=6). More...
 
IRIDIUM_9604_error_t socketDirectLinkCharacterTrigger (int socket, int characterTrigger)
 Set the direct link character trigger (AT+UDCONF=7). More...
 
IRIDIUM_9604_error_t socketDirectLinkCongestionTimer (int socket, unsigned long congestionTimer)
 Set the direct link congestion timer (AT+UDCONF=8). More...
 
IRIDIUM_9604_error_t querySocketType (int socket, IRIDIUM_9604_socket_protocol_t *protocol)
 Query the socket type: TCP or UDP (AT+USOCTL=socket,0). More...
 
IRIDIUM_9604_error_t querySocketLastError (int socket, int *error)
 Query the last socket error (AT+USOCTL=socket,1). More...
 
IRIDIUM_9604_error_t querySocketTotalBytesSent (int socket, uint32_t *total)
 Query the total number of bytes sent on a socket (AT+USOCTL=socket,2). More...
 
IRIDIUM_9604_error_t querySocketTotalBytesReceived (int socket, uint32_t *total)
 Query the total number of bytes received on a socket (AT+USOCTL=socket,3). More...
 
IRIDIUM_9604_error_t querySocketRemoteIPAddress (int socket, sfe_ip_address_t *address, int *port)
 Query the remote IP address and port of a socket (AT+USOCTL=socket,4). More...
 
IRIDIUM_9604_error_t querySocketStatusTCP (int socket, IRIDIUM_9604_tcp_socket_status_t *status)
 Query the status of a TCP socket (AT+USOCTL=socket,10). More...
 
IRIDIUM_9604_error_t querySocketOutUnackData (int socket, uint32_t *total)
 Query the number of unacknowledged outgoing bytes on a TCP socket (AT+USOCTL=socket,11). More...
 
IRIDIUM_9604_error_t socketSetSecure (int profile, bool secure, int secprofile=-1)
 Enable or disable SSL/TLS on a socket (AT+USOSEC). More...
 
int socketGetLastError ()
 Read the last socket error (AT+USOER). More...
 
sfe_ip_address_t lastRemoteIP (void)
 The remote IP address from the most recent socket listen (+UUSOLI) URC. More...
 
IRIDIUM_9604_error_t ping (sfe_string_t remote_host, int retry=4, int p_size=32, unsigned long timeout=5000, int ttl=32)
 Ping a remote host (AT+UPING). The results are delivered by the +UUPING URC: see setPingCallback(). More...
 
IRIDIUM_9604_error_t resetHTTPprofile (int profile)
 Reset an HTTP profile (AT+UHTTP=profile). The HTTP profile parameters are not saved in the non volatile memory. More...
 
IRIDIUM_9604_error_t setHTTPserverIPaddress (int profile, sfe_ip_address_t address)
 Set the HTTP server IP address (AT+UHTTP=profile,0). More...
 
IRIDIUM_9604_error_t setHTTPserverName (int profile, sfe_string_t server)
 Set the HTTP server name (AT+UHTTP=profile,1). More...
 
IRIDIUM_9604_error_t setHTTPusername (int profile, sfe_string_t username)
 Set the HTTP user name (AT+UHTTP=profile,2). More...
 
IRIDIUM_9604_error_t setHTTPpassword (int profile, sfe_string_t password)
 Set the HTTP password (AT+UHTTP=profile,3). More...
 
IRIDIUM_9604_error_t setHTTPauthentication (int profile, bool authenticate)
 Enable or disable HTTP authentication (AT+UHTTP=profile,4). More...
 
IRIDIUM_9604_error_t setHTTPserverPort (int profile, int port)
 Set the HTTP server port (AT+UHTTP=profile,5). Default: 80. More...
 
IRIDIUM_9604_error_t setHTTPcustomHeader (int profile, sfe_string_t header)
 Set an HTTP custom request header (AT+UHTTP=profile,9). Format: "0:Content-Type:application/json". More...
 
IRIDIUM_9604_error_t setHTTPsecure (int profile, bool secure, int secprofile=-1)
 Enable or disable HTTPS (AT+UHTTP=profile,6). Default: disabled (HTTP on port 80). More...
 
IRIDIUM_9604_error_t getHTTPprotocolError (int profile, int *error_class, int *error_code)
 Read the most recent HTTP protocol error for a profile (AT+UHTTPER). More...
 
IRIDIUM_9604_error_t sendHTTPGET (int profile, sfe_string_t path, sfe_string_t responseFilename)
 Send an HTTP GET request (AT+UHTTPC=profile,1). The response is written to a file in the module's file system. The result is delivered by the +UUHTTPCR URC: see setHTTPCommandCallback(). More...
 
IRIDIUM_9604_error_t sendHTTPPOSTdata (int profile, sfe_string_t path, sfe_string_t responseFilename, sfe_string_t data, IRIDIUM_9604_http_content_types_t httpContentType)
 Send an HTTP POST request with data (AT+UHTTPC=profile,5). The response is written to a file in the module's file system. The result is delivered by the +UUHTTPCR URC. More...
 
IRIDIUM_9604_error_t sendHTTPPOSTfile (int profile, sfe_string_t path, sfe_string_t responseFilename, sfe_string_t requestFile, IRIDIUM_9604_http_content_types_t httpContentType)
 Send an HTTP POST request with the contents of a file (AT+UHTTPC=profile,4). The response is written to a file in the module's file system. The result is delivered by the +UUHTTPCR URC. More...
 
IRIDIUM_9604_error_t nvMQTT (IRIDIUM_9604_mqtt_nv_parameter_t parameter)
 Save, restore or reset the MQTT profile in non volatile memory (AT+UMQTTNV). More...
 
IRIDIUM_9604_error_t setMQTTclientId (const sfe_string_t &clientId)
 Set the MQTT client ID (AT+UMQTT=0). More...
 
IRIDIUM_9604_error_t setMQTTserver (const sfe_string_t &serverName, int port)
 Set the MQTT broker name and port (AT+UMQTT=2). More...
 
IRIDIUM_9604_error_t setMQTTcredentials (const sfe_string_t &userName, const sfe_string_t &pwd)
 Set the MQTT user name and password (AT+UMQTT=4). More...
 
IRIDIUM_9604_error_t setMQTTsecure (bool secure, int secprofile=-1)
 Enable or disable MQTT over TLS (AT+UMQTT=11). More...
 
IRIDIUM_9604_error_t connectMQTT (void)
 Connect to the MQTT broker (AT+UMQTTC=1). The result is delivered by the +UUMQTTC URC: see setMQTTCommandCallback(). More...
 
IRIDIUM_9604_error_t disconnectMQTT (void)
 Disconnect from the MQTT broker (AT+UMQTTC=0). More...
 
IRIDIUM_9604_error_t subscribeMQTTtopic (int max_Qos, const sfe_string_t &topic)
 Subscribe to an MQTT topic (AT+UMQTTC=4). More...
 
IRIDIUM_9604_error_t unsubscribeMQTTtopic (const sfe_string_t &topic)
 Unsubscribe from an MQTT topic (AT+UMQTTC=5). More...
 
IRIDIUM_9604_error_t readMQTT (int *pQos, sfe_string_t *pTopic, uint8_t *readDest, int readLength, int *bytesRead)
 Read an MQTT message which has been received on a subscribed topic (AT+UMQTTC=6). More...
 
IRIDIUM_9604_error_t mqttPublishTextMsg (const sfe_string_t &topic, const char *const msg, uint8_t qos=0, bool retain=false)
 Publish a text message to an MQTT topic (AT+UMQTTC=2). More...
 
IRIDIUM_9604_error_t mqttPublishBinaryMsg (const sfe_string_t &topic, const char *const msg, size_t msg_len, uint8_t qos=0, bool retain=false)
 Publish a binary message to an MQTT topic (AT+UMQTTC=9). More...
 
IRIDIUM_9604_error_t mqttPublishFromFile (const sfe_string_t &topic, const sfe_string_t &filename, uint8_t qos=0, bool retain=false)
 Publish the contents of a file to an MQTT topic (AT+UMQTTC=3). More...
 
IRIDIUM_9604_error_t getMQTTprotocolError (int *error_code, int *error_code2)
 Read the most recent MQTT protocol error (AT+UMQTTER). More...
 
IRIDIUM_9604_error_t setFTPserver (const sfe_string_t &serverName)
 Set the FTP server name (AT+UFTP=1). More...
 
IRIDIUM_9604_error_t setFTPtimeouts (const unsigned int timeout, const unsigned int cmd_linger, const unsigned int data_linger)
 Set the FTP inactivity timeout and the command and data linger times (AT+UFTP). More...
 
IRIDIUM_9604_error_t setFTPcredentials (const sfe_string_t &userName, const sfe_string_t &pwd)
 Set the FTP user name and password (AT+UFTP=2,3). More...
 
IRIDIUM_9604_error_t connectFTP (void)
 Connect to the FTP server (AT+UFTPC=1). The result is delivered by the +UUFTPCR URC: see setFTPCommandCallback(). More...
 
IRIDIUM_9604_error_t disconnectFTP (void)
 Disconnect from the FTP server (AT+UFTPC=0). More...
 
IRIDIUM_9604_error_t ftpGetFile (const sfe_string_t &filename)
 Download a file from the FTP server into the module's file system (AT+UFTPC=4). More...
 
IRIDIUM_9604_error_t getFTPprotocolError (int *error_code, int *error_code2)
 Read the most recent FTP protocol error (AT+UFTPER). More...
 
IRIDIUM_9604_error_t resetSecurityProfile (int secprofile)
 Reset a security profile (AT+USECPRF=profile). More...
 
IRIDIUM_9604_error_t configSecurityProfileString (int secprofile, IRIDIUM_9604_sec_profile_parameter_t parameter, sfe_string_t value)
 Configure a security profile parameter with a string value (AT+USECPRF). More...
 
IRIDIUM_9604_error_t configSecurityProfile (int secprofile, IRIDIUM_9604_sec_profile_parameter_t parameter, int value)
 Configure a security profile parameter with an integer value (AT+USECPRF). More...
 
IRIDIUM_9604_error_t setSecurityManager (IRIDIUM_9604_sec_manager_opcode_t opcode, IRIDIUM_9604_sec_manager_parameter_t parameter, sfe_string_t name, sfe_string_t data)
 Import or remove a certificate or key (AT+USECMNG). More...
 
IRIDIUM_9604_error_t getDefaultPDPcontext (int *cid, int *preferredProtocol=nullptr)
 Read the PDP context used by the internal TCP/IP stack (AT+UDCONF=19). More...
 
IRIDIUM_9604_error_t getPDPcontextState (int cid, bool *active)
 Read whether a PDP context is active (AT+CGACT?). More...
 
IRIDIUM_9604_error_t activatePDPcontext (bool status, int cid=-1)
 Activate or deactivate a PDP context (AT+CGACT). More...
 
IRIDIUM_9604_error_t getPDPaddress (int cid, sfe_ip_address_t *address)
 Read the IP address of a PDP context (AT+CGPADDR=<cid>). More...
 
bool isGPSon (void)
 Check if the GNSS is powered on (AT+UGPS?). More...
 
IRIDIUM_9604_error_t gpsPower (bool enable=true, gnss_system_t gnss_sys=GNSS_SYSTEM_GPS, gnss_aiding_mode_t gnss_aiding=GNSS_AIDING_MODE_AUTOMATIC)
 Power the GNSS on or off (AT+UGPS). On the Iridium 9604 the GNSS may already be on - the satellite stack uses it to find its location. gpsPower does nothing if the GNSS is already in the requested state. More...
 
IRIDIUM_9604_error_t gpsRequest (unsigned int timeout, uint32_t accuracy, bool detailed=true, unsigned int sensor=3)
 Request the location (AT+ULOC). The result is delivered by the +UULOC URC: see setGpsReadCallback(). More...
 
IRIDIUM_9604_error_t gpsAidingServerConf (const char *primaryServer, const char *secondaryServer, const char *authToken, unsigned int days=14, unsigned int period=4, unsigned int resolution=1, unsigned int gnssTypes=65, unsigned int mode=0, unsigned int dataType=15)
 Configure the u-blox AssistNow aiding server (AT+UGSRV). More...
 
IRIDIUM_9604_error_t gpsGetState (bool *on, int *aiding=nullptr, int *systems=nullptr)
 Read the GNSS state (AT+UGPS?). More...
 
IRIDIUM_9604_error_t gpsSetAiding (gnss_aiding_mode_t gnss_aiding, gnss_system_t gnss_sys=(gnss_system_t)(GNSS_SYSTEM_GPS|GNSS_SYSTEM_SBAS))
 Power the GNSS on with the chosen aiding mode and GNSS systems (AT+UGPS=1,<aid_mode>,<GNSS_systems>). More...
 
IRIDIUM_9604_error_t gpsRequestAiding (IRIDIUM_9604_gnss_aiding_request_t request, unsigned long timeout=IRIDIUM_9604_2_MIN_TIMEOUT)
 Request a GNSS aiding operation (AT+UGAOS): e.g. download the AssistNow Online data into the GNSS. More...
 
IRIDIUM_9604_error_t setGNSSAidingIndication (bool enable=true)
 Enable or disable the assisted GNSS indication URC (AT+UGIND). See setGNSSAidingCallback(). More...
 
IRIDIUM_9604_error_t sendUBX (const char *ubxHex, char *responseHex=nullptr, size_t responseHexSize=0, unsigned long timeout=IRIDIUM_9604_10_SEC_TIMEOUT+1000)
 Send a UBX message to the GNSS, as a hex string, and return its response (AT+UGUBX). More...
 
IRIDIUM_9604_error_t sendUBXmessage (uint8_t msgClass, uint8_t msgId, const uint8_t *payload, uint16_t payloadLen, uint8_t *response=nullptr, size_t responseSize=0, size_t *responseLen=nullptr, unsigned long timeout=IRIDIUM_9604_10_SEC_TIMEOUT+1000)
 Send a UBX message to the GNSS and return its response, as bytes (AT+UGUBX). See sendUBX(). More...
 
IRIDIUM_9604_error_t getFileContents (sfe_string_t filename, sfe_string_t *contents)
 Read the contents of a file from the module's file system (AT+URDFILE). OK for text files, but will fail with binary files (containing NULLs) on some platforms. More...
 
IRIDIUM_9604_error_t getFileContents (sfe_string_t filename, char *contents)
 Read the contents of a file from the module's file system (AT+URDFILE). OK for binary files. Make sure contents can hold the entire file: get the size first with getFileSize(). More...
 
IRIDIUM_9604_error_t getFileBlock (const sfe_string_t &filename, char *buffer, size_t offset, size_t requestedLength, size_t &bytesRead)
 Read a block of data from a file in the module's file system (AT+URDBLOCK). OK for binary files. Make sure buffer can hold requestedLength bytes. More...
 
IRIDIUM_9604_error_t appendFileContents (sfe_string_t filename, sfe_string_t str)
 Append data to a file in the module's file system (AT+UDWNFILE). The file is created if it does not exist. More...
 
IRIDIUM_9604_error_t appendFileContents (sfe_string_t filename, const char *str, int len)
 Append binary data to a file in the module's file system (AT+UDWNFILE). The file is created if it does not exist. More...
 
IRIDIUM_9604_error_t getFileSize (sfe_string_t filename, int *size)
 Read the size of a file in the module's file system (AT+ULSTFILE). More...
 
IRIDIUM_9604_error_t deleteFile (sfe_string_t filename)
 Delete a file from the module's file system (AT+UDELFILE). More...
 
IRIDIUM_9604_error_t functionality (IRIDIUM_9604_functionality_t function=FULL_FUNCTIONALITY)
 Set the module functionality (AT+CFUN). More...
 
IRIDIUM_9604_error_t sendCustomCommandWithResponse (const char *command, const char *expectedResponse, char *responseDest, unsigned long commandTimeout=IRIDIUM_9604_STANDARD_RESPONSE_TIMEOUT, bool at=true)
 Send a custom AT command and wait for the expected response. More...
 
IRIDIUM_9604_error_t setNMEAoutput (const char *msgId, uint8_t rate=1, uint8_t output=IRIDIUM_9604_NMEA_OUTPUT_URC)
 Configure the output of one NMEA message (AT+UGNMEA). New for the 9604. More...
 
IRIDIUM_9604_error_t setAllNMEAoutput (uint8_t rate=1, uint8_t output=IRIDIUM_9604_NMEA_OUTPUT_URC)
 Configure the output of all 13 NMEA messages (AT+UGNMEA). Returns the first error, but tries every message. More...
 
IRIDIUM_9604_error_t disableAllNMEA (void)
 Disable the output of all 13 NMEA messages. More...
 
IRIDIUM_9604_error_t getNMEAoutput (const char *msgId, uint8_t *rate, uint8_t *output)
 Read the output configuration of one NMEA message (AT+UGNMEA?). More...
 
IRIDIUM_9604_error_t pollNMEA (void)
 Poll the NMEA messages stored in the module memory (AT+UGNMEA?). The messages are processed as if they had arrived as URCs. More...
 
IRIDIUM_9604_error_t setClockFromGNSS (void)
 Set the module clock (+CCLK) from the GNSS UTC time (AT+UGTMR). More...
 
IRIDIUM_9604_error_t setGNSSTimeZone (int timeZone)
 Set the time zone used when the module clock is set from the GNSS (AT+UGTMR=<time_zone>). More...
 
bool getNMEA (const char *msgId, bool pollIfNoURC=true)
 Get a fresh copy of an NMEA message. Returns true if fresh data has arrived (as a URC, or by polling) since the last call. More...
 
bool getNMEAfield (const char *msgId, const char *field, sfe_string_t &value)
 Get one field of an NMEA message, by name. Calls getNMEA() first. More...
 
void flushNMEA (const char *msgId)
 Mark the stored copy of an NMEA message as stale. More...
 
bool setNmeaCallbackPtr (const char *msgId, void(*callbackPointerPtr)(nmeaCallbackDataCommon_t *))
 Register (or clear, with nullptr) the callback for an NMEA message. The callback is called by checkCallbacks() / bufferedPoll() when the message arrives. More...
 
nmeaMessage * getNmeaMessagePtr (nmeaCallbackDataCommon_t *theData)
 Get the nmeaMessage from inside an NMEA callback. More...
 
sfe_string_t getNmeaMessageFieldCallback (nmeaMessage *theMessage, const char *fieldName)
 Get one field of an NMEA message, by name, from inside an NMEA callback. More...
 
sfe_string_t getNmeaMessageField (nmeaMessage *theMessage, const char *fieldName)
 Get one field of the stored copy of an NMEA message, by name. Call getNMEA() first. More...
 
sfe_string_t getNmeaMessageBlockFieldCallback (nmeaMessage *theMessage, uint16_t blockIndex, const char *fieldName)
 Get one field from a repeated block of an NMEA message (e.g. GSV), by name, from inside an NMEA callback. More...
 
sfe_string_t getNmeaMessageBlockField (nmeaMessage *theMessage, uint16_t blockIndex, const char *fieldName)
 Get one field from a repeated block of the stored copy of an NMEA message (e.g. GSV), by name. More...
 
nmeaMessage * getNmeaMessageByName (const char *msgId)
 Find an NMEA message object by its message ID. More...
 
bool processNMEA (const char *sentence, size_t length)
 Process one NMEA sentence: check the checksum, store it and queue it for the callback. Called by the +UUGNMEA URC handler and by pollNMEA(). More...
 
IRIDIUM_9604_error_t getSatelliteSerialNumber (sfe_string_t *serialNumber, sfe_string_t *sbdIMEI)
 Read the satellite serial number and the satellite (SBD) IMEI (AT+USATSN). More...
 
sfe_string_t getSatelliteIMEI (void)
 Read the 15 digit satellite (SBD) IMEI (AT+USATSN). More...
 
sfe_string_t getSatelliteSerialNumber (void)
 Read the satellite serial number (AT+USATSN). More...
 
IRIDIUM_9604_error_t getSatelliteInfo (IRIDIUM_9604_sat_info_t *info)
 Read the satellite system information (AT+USATINFO). Only available in the satellite RAT. More...
 
IRIDIUM_9604_error_t setIndicatorEventReporting (IRIDIUM_9604_cier_mode_t mode=IRIDIUM_9604_CIER_MODE_ENABLE, bool signalQuality=true, bool serviceAvailability=true, bool svBeamCoordinates=false)
 Configure the indicator event reporting (AT+CIER): the +CIEV signal quality, service availability and SV / beam coordinate URCs. More...
 
IRIDIUM_9604_error_t getIndicatorEventReporting (IRIDIUM_9604_cier_mode_t *mode, bool *signalQuality, bool *serviceAvailability, bool *svBeamCoordinates)
 Read the indicator event reporting configuration (AT+CIER?). More...
 
int getSatelliteSignalQuality (void)
 The most recent satellite signal quality (0-5 bars), from the +CIEV URCs. Call bufferedPoll() regularly to process the URCs. More...
 
int isSatelliteServiceAvailable (void)
 The most recent satellite service availability, from the +CIEV URCs. Call bufferedPoll() regularly to process the URCs. More...
 
int waitForSatelliteSignalQuality (unsigned long timeout=60000)
 Wait (calling bufferedPoll()) for the first +CIEV signal quality indication. Enables the indicator event reporting if required. More...
 
void setSatelliteSignalQualityCallback (void(*signalQualityCallback)(int signalQuality))
 Set the callback for the +CIEV signal quality indication. More...
 
void setSatelliteServiceAvailabilityCallback (void(*serviceAvailabilityCallback)(bool serviceAvailable))
 Set the callback for the +CIEV service availability indication. More...
 
void setSatelliteSVBeamCallback (void(*svBeamCallback)(IRIDIUM_9604_sv_beam_coords_t coords))
 Set the callback for the +CIEV SV and beam coordinates indication. Enable it with setIndicatorEventReporting(IRIDIUM_9604_CIER_MODE_ENABLE, false, false, true). More...
 
IRIDIUM_9604_error_t unlock (const char *unlockKey, IRIDIUM_9604_lock_status_t *status=nullptr)
 Unlock the module (AT+CULK). More...
 
IRIDIUM_9604_lock_status_t getLockStatus (void)
 Read the lock status (AT+CULK?). More...
 
IRIDIUM_9604_error_t setSBDAutoRegistration (IRIDIUM_9604_sbdareg_mode_t mode)
 Set the SBD automatic registration mode (AT+SBDAREG). More...
 
IRIDIUM_9604_error_t getSBDAutoRegistration (IRIDIUM_9604_sbdareg_mode_t *mode)
 Read the SBD automatic registration mode (AT+SBDAREG?). More...
 
void setSBDAutoRegistrationCallback (void(*autoRegistrationCallback)(IRIDIUM_9604_areg_event_t event, int regError))
 Set the callback for the +AREG automatic registration URC. More...
 
IRIDIUM_9604_error_t clearSBDBuffers (IRIDIUM_9604_sbd_clear_t buffers=IRIDIUM_9604_SBD_CLEAR_MO)
 Clear the mobile originated and/or mobile terminated SBD buffers (AT+SBDD). More...
 
IRIDIUM_9604_error_t sbdDetach (int *error=nullptr)
 Detach from the SBD gateway (AT+SBDDET). More...
 
IRIDIUM_9604_error_t setSBDDeliveryShortCode (uint8_t dsc)
 Set the SBD delivery short code (AT+SBDDSC). See IRIDIUM_9604_SBDDSC_HOLD_MT_DELIVERY etc. More...
 
IRIDIUM_9604_error_t getSBDDeliveryShortCode (uint8_t *dsc)
 Read the SBD delivery short code (AT+SBDDSC?). More...
 
IRIDIUM_9604_error_t sbdSession (IRIDIUM_9604_sbd_session_t *result)
 Initiate an SBD session (AT+SBDI). No ring alert support. Always detaches. More...
 
IRIDIUM_9604_error_t sbdSessionExtended (IRIDIUM_9604_sbd_session_t *result, bool answeringRingAlert=false, const char *location=nullptr)
 Initiate an extended SBD session (AT+SBDIX, or AT+SBDIXA when answering a ring alert). This also registers for ring alerts. More...
 
IRIDIUM_9604_error_t getSBDTrafficManagementStatus (int *status, unsigned long *time)
 Read the SBD traffic management status (AT+SBDLOE). More...
 
IRIDIUM_9604_error_t readSBDData (uint8_t *data, size_t maxLength, size_t *length)
 Read the mobile terminated buffer (AT+SBDR). The library HEX-decodes the data. More...
 
IRIDIUM_9604_error_t readSBDText (char *text, size_t maxLength)
 Read the mobile terminated buffer (AT+SBDR) as NULL-terminated text. More...
 
IRIDIUM_9604_error_t setSBDSessionTimeout (int timeout)
 Set the SBD session timeout (AT+SBDST). More...
 
IRIDIUM_9604_error_t getSBDSessionTimeout (int *timeout)
 Read the SBD session timeout (AT+SBDST?). More...
 
IRIDIUM_9604_error_t getSBDStatusExtended (IRIDIUM_9604_sbd_status_t *status)
 Read the extended SBD status (AT+SBDSX). More...
 
IRIDIUM_9604_error_t writeSBDData (const uint8_t *data, size_t length, int *status=nullptr)
 Write binary data to the mobile originated buffer (AT+SBDW). The library HEX-encodes the data. More...
 
IRIDIUM_9604_error_t writeSBDText (const char *text, int *status=nullptr)
 Write text to the mobile originated buffer (AT+SBDW). The library HEX-encodes the text. More...
 
IRIDIUM_9604_sbdreg_status_t getSBDRegistrationStatus (void)
 Read the SBD registration status (AT+SBDREG?). From the Iridium 9604 Additional Commands (Beta). More...
 
IRIDIUM_9604_error_t satelliteRFScan (int16_t *results, int *numResults, unsigned long timeout=IRIDIUM_9604_3_MIN_TIMEOUT)
 Perform a satellite RF scan (AT+RFSCAN): the RSSI of all 252 channels. From the Iridium 9604 Additional Commands (Beta). More...
 
IRIDIUM_9604_error_t sendSBDText (const char *message)
 Send a text message using SBD: write the MO buffer (+SBDW), start an extended SBD session (+SBDIX) and check the result. Similar to the SparkFun IridiumSBD library. Sending messages uses credits! More...
 
IRIDIUM_9604_error_t sendSBDBinary (const uint8_t *txData, size_t txLength)
 Send a binary message using SBD: write the MO buffer (+SBDW), start an extended SBD session (+SBDIX) and check the result. Sending messages uses credits! More...
 
IRIDIUM_9604_error_t sendReceiveSBDText (const char *message, uint8_t *rxBuffer, size_t *rxLength)
 Send a text message (or nothing) and receive any waiting MT message using SBD: write the MO buffer (+SBDW), start an extended SBD session (+SBDIX), check the result and read the MT message (+SBDR). Sending messages uses credits! More...
 
IRIDIUM_9604_error_t sendReceiveSBDBinary (const uint8_t *txData, size_t txLength, uint8_t *rxBuffer, size_t *rxLength)
 Send a binary message (or nothing) and receive any waiting MT message using SBD: write the MO buffer (+SBDW), start an extended SBD session (+SBDIX), check the result and read the MT message (+SBDR). Sending messages uses credits! More...
 
IRIDIUM_9604_sbd_session_t getLastSBDSession (void)
 The result of the most recent SBD session (sbdSession(), sbdSessionExtended() or the send / receive methods). More...
 
int getWaitingMessageCount (void)
 The number of MT messages waiting at the gateway, from the most recent SBD session. More...
 
bool hasRingAlert (void)
 Check if an SBD ring alert has been received (the +SBDSX RA flag). More...
 
void setSBDATTimeout (unsigned long timeout_ms)
 Set the AT command timeout used for SBD sessions (+SBDI, +SBDIX, +SBDDET). Default: 5 minutes. Use setSBDSessionTimeout() to set the module's own session timeout - which should be shorter than this. More...
 
unsigned long getSBDATTimeout (void)
 Read the AT command timeout used for SBD sessions. More...
 
void setSBDCallback (IRIDIUM_9604_sbd_callback_t sbdCallback)
 Set the SBD session callback - and make the SBD sessions non-blocking. More...
 
bool isSBDSessionInProgress (void)
 Check if a non-blocking SBD session is in progress (or being cancelled). More...
 
IRIDIUM_9604_error_t getLastSBDSessionStatus (void)
 The status of the most recent SBD session - the status passed to the callback. More...
 
IRIDIUM_9604_error_t cancelSBDSession (void)
 Cancel the non-blocking SBD session (the equivalent of ISBDCallback returning false in the SparkFun IridiumSBD library). More...
 
SparkFun_Iridium_9604::SfeDebugPrint & urcDebug (void)
 urcHandlerInterface: the debug printer, for the URC handlers. More...
 
int urcGetLastSocketProtocol (int socket)
 urcHandlerInterface: the protocol of the most recent socket operation on a socket. More...
 
IRIDIUM_9604_error_t urcSocketReadIndication (int socket, int length)
 urcHandlerInterface: read the TCP data indicated by a +UUSORD URC and pass it to the socket read callback(s). More...
 
IRIDIUM_9604_error_t urcSocketReadIndicationUDP (int socket, int length)
 urcHandlerInterface: read the UDP data indicated by a +UUSORF URC and pass it to the socket read callback(s). More...
 
void urcSocketListenIndication (sfe_ip_address_t localIP, sfe_ip_address_t remoteIP)
 urcHandlerInterface: record the IP addresses from a +UUSOLI URC (see lastRemoteIP()). More...
 
void urcProcessNMEA (const char *sentence, size_t length)
 urcHandlerInterface: process one NMEA sentence from a +UUGNMEA URC. More...
 
void urcIndicatorEvent (int indicator, int value)
 urcHandlerInterface: record the latest +CIEV indicator value. More...
 

Static Public Member Functions

static const char * getSBDErrorString (int error)
 Convert an SBD error code (+SBDIX MO status, +SBDDET error, +AREG reg error) to text. Positive or negative codes are accepted. More...
 

Public Attributes

SparkFun_Iridium_9604::nmeaMessageVector nmeaMessages
 The NMEA message objects - one per supported NMEA message. More...
 
SparkFun_Iridium_9604::urcHandlerVector urcHandlers
 The URC handler objects - one per registered URC handler. More...
 

Protected Types

enum  IRIDIUM_9604_init_type_t { IRIDIUM_9604_INIT_STANDARD , IRIDIUM_9604_INIT_AUTOBAUD , IRIDIUM_9604_INIT_RESET }
 The initialization types used by init(). More...
 

Protected Member Functions

IRIDIUM_9604_error_t sbdSessionInternal (const char *command, const char *responseTag, IRIDIUM_9604_sbd_session_t *result)
 Send an SBD session command (+SBDI / +SBDIX / +SBDIXA) and parse the result. More...
 
IRIDIUM_9604_error_t checkSBDSessionResult (const IRIDIUM_9604_sbd_session_t &session)
 Check the result of an SBD session: the MO status (0 to -4 = success) and the MT status (2 = error). Used by sendReceiveSBD. More...
 
bool processSBDSessionEvent (const char *event)
 Non-blocking SBD session: check an event (line) from bufferedPoll for the session result, ERROR, +CME ERROR or ABORTED. More...
 
void completeSBDSession (IRIDIUM_9604_error_t status)
 Non-blocking SBD session: mark the session complete. checkSBDSession calls the callback. More...
 
void checkSBDSession (void)
 Non-blocking SBD session: check for a timeout; read the MT message (sendReceiveSBD) and call the callback when the session is complete. Called by bufferedPoll. More...
 
void printSBDSession (const IRIDIUM_9604_sbd_session_t &session)
 Print the SBD session result (debug). More...
 
IRIDIUM_9604_error_t sendReceiveSBD (const uint8_t *txData, size_t txLength, bool txIsText, uint8_t *rxBuffer, size_t *rxLength)
 The common code for the high-level SBD send / receive methods. More...
 
IRIDIUM_9604_error_t init (unsigned long baud, IRIDIUM_9604_init_type_t initType=IRIDIUM_9604_INIT_STANDARD)
 Initialize the module: autobaud, disable echo, configure the URCs etc. Called by begin(). More...
 
void powerOn (void)
 Pulse the PWR_ON pin briefly to turn the module on. More...
 
void powerOff (void)
 Pulse the PWR_ON pin for a long time to perform a graceful shutdown. modulePowerOff() (+CPWROFF) is preferred. More...
 
void writePowerOnPin (bool state)
 Write the PWR_ON pin: using the callback (if set), else the GPIO pin. Never drives the pin high: true releases it. More...
 
void writeResetPin (bool state)
 Write the RESET_N pin: using the callback (if set), else the GPIO pin. Never drives the pin high: true releases it. More...
 
bool havePowerOnPin (void)
 Check if the PWR_ON pin can be written: GPIO pin or callback. More...
 
bool haveResetPin (void)
 Check if the RESET_N pin can be written: GPIO pin or callback. More...
 
IRIDIUM_9604_error_t setMNOprofile (mobile_network_operator_t mno, bool autoReset=false, bool urcNotification=false)
 Set the Mobile Network Operator profile (AT+UMNOPROF). More...
 
IRIDIUM_9604_error_t getMNOprofile (mobile_network_operator_t *mno)
 Read the Mobile Network Operator profile (AT+UMNOPROF?). More...
 
IRIDIUM_9604_error_t waitForResponse (const char *expectedResponse, const char *expectedError, uint16_t timeout)
 Wait for an expected response (or error) from the module. Any other data (URCs) is added to the backlog. More...
 
IRIDIUM_9604_error_t sendCommandWithResponse (const char *command, const char *expectedResponse, char *responseDest, unsigned long commandTimeout, int destSize=minimumResponseAllocation, bool at=true)
 Send an AT command and wait for the expected response. Any other data (URCs) is added to the backlog. More...
 
void sendCommand (const char *command, bool at)
 Send an AT command. Processes any waiting serial data (URCs) into the backlog first. More...
 
IRIDIUM_9604_error_t parseSocketReadIndication (int socket, int length)
 Read the TCP data indicated by a +UUSORD URC and pass it to the socket read callback(s). More...
 
IRIDIUM_9604_error_t parseSocketReadIndicationUDP (int socket, int length)
 Read the UDP data indicated by a +UUSORF URC and pass it to the socket read callback(s). More...
 
IRIDIUM_9604_error_t parseSocketListenIndication (int listeningSocket, sfe_ip_address_t localIP, unsigned int listeningPort, int socket, sfe_ip_address_t remoteIP, unsigned int port)
 Process a +UUSOLI URC: record the IP addresses and call the socket listen callback. More...
 
size_t hwPrint (const char *s)
 Write a NULL-terminated string to the module, through the communication bus. More...
 
size_t hwWriteData (const char *buff, int len)
 Write a buffer to the module, through the communication bus. More...
 
size_t hwWrite (const char c)
 Write one byte to the module, through the communication bus. More...
 
int readAvailable (char *inString)
 Read all the available serial data into inString. More...
 
char readChar (void)
 Read one character from the module. More...
 
int hwAvailable (void)
 The number of bytes available to be read from the module. More...
 
virtual void beginSerial (unsigned long baud)
 Set the communication bus baud rate. More...
 
IRIDIUM_9604_error_t autobaud (unsigned long desiredBaud)
 Find the module's baud rate and change it to desiredBaud. More...
 
void extendedErrorReset (void)
 Reset the +CME ERROR / +CMS ERROR matching and clear _lastErrorText. Called before each command. More...
 
bool extendedErrorCheck (char c)
 Look for a "+CME ERROR: <err>" or "+CMS ERROR: <err>" response, one character at a time. More...
 
char * iridium_calloc_char (size_t num)
 Allocate a zeroed char buffer (with calloc). Free it with free(). More...
 
bool processURCEvent (const char *event)
 Pass one event (line) to the registered URC handlers. More...
 
void pruneBacklog (void)
 Remove everything except the URCs from the backlog. More...
 
void addToBacklog (char c)
 Add one character to the backlog. NULLs are converted to ASCII '0'. More...
 
void flushPartialLineToBacklog (void)
 Move any incomplete bufferedPoll() line into the backlog - so it is processed with the next data. More...
 

Protected Attributes

SparkFun_Iridium_9604::IridiumDeviceBus * _sfeBus
 The UART. More...
 
int _powerPin
 The PWR_ON pin. -1 if not connected. More...
 
int _resetPin
 The RESET_N pin. -1 if not connected. More...
 
bool _invertPowerPin = false
 Invert the power pin polarity. More...
 
IRIDIUM_9604_pin_write_callback_t _powerOnPinWriteCallback = nullptr
 The PWR_ON pin write callback. nullptr = use _powerPin. More...
 
IRIDIUM_9604_pin_write_callback_t _resetPinWriteCallback = nullptr
 The RESET_N pin write callback. nullptr = use _resetPin. More...
 
unsigned long _baud
 The current baud rate. More...
 
sfe_ip_address_t _lastRemoteIP
 The remote IP address from the most recent +UUSOLI URC. More...
 
sfe_ip_address_t _lastLocalIP
 The local IP address from the most recent +UUSOLI URC. More...
 
uint8_t _maxInitTries
 The maximum number of initialization attempts. More...
 
bool _autoTimeZoneForBegin = true
 Enable the automatic time zone update during begin(). More...
 
char _lastErrorText [_lastErrorTextSize] = {0}
 The <err> from the most recent +CME ERROR / +CMS ERROR response. More...
 
size_t _lastErrorTextLength = 0
 The number of characters in _lastErrorText. More...
 
int _cmeErrorIndex = 0
 extendedErrorCheck: the number of IRIDIUM_9604_RESPONSE_CME_ERROR characters matched. More...
 
int _cmsErrorIndex = 0
 extendedErrorCheck: the number of IRIDIUM_9604_RESPONSE_CMS_ERROR characters matched. More...
 
bool _extendedErrorCapturing = false
 extendedErrorCheck: true while the <err> text is being read. More...
 
bool _bufferedPollReentrant = false
 Prevent reentry of bufferedPoll - just in case it gets called from a callback. More...
 
bool _pollReentrant = false
 Prevent reentry of poll - just in case it gets called from a callback. More...
 
bool _checkCallbacksReentrant = false
 Prevent reentry of checkCallbacks. More...
 
const unsigned long _rxWindowMillis = 2
 1ms is not quite long enough for a single char at 9600 baud. millis roll over much less often than micros. See notes in .cpp re. ESP32! More...
 
char * _iridiumRXBuffer
 Allocated in DevIridium9604::begin. More...
 
char * _pruneBuffer
 A temporary buffer used by pruneBacklog(). More...
 
char * _iridiumResponseBacklog
 The backlog: data (URCs) received while waiting for an AT command response. More...
 
int _iridiumResponseBacklogLength = 0
 The backlog could contain binary data so we can't use strlen to find its length. More...
 
char * _partialLine
 An incomplete line from bufferedPoll() - processed when the rest of the line arrives. More...
 
int _partialLineLength = 0
 The length of _partialLine. More...
 
void(* _socketReadCallback )(int, sfe_string_t)
 The original socket read callback. More...
 
void(* _socketReadCallbackPlus )(int, const char *, int, sfe_ip_address_t, int)
 socket, data, length, remoteAddress, remotePort More...
 
int _lastSocketProtocol [IRIDIUM_9604_NUM_SOCKETS]
 Record the protocol for each socket to avoid having to call querySocketType in parseSocketReadIndication. More...
 
int _satelliteSignalQuality = -1
 From +CIEV:0. More...
 
int _satelliteServiceAvailable = -1
 From +CIEV:1. More...
 
IRIDIUM_9604_sbd_session_t _lastSBDSession
 The result of the most recent SBD session. More...
 
unsigned long _sbdATTimeout = IRIDIUM_9604_SBD_SESSION_DEFAULT_TIMEOUT
 The AT command timeout for SBD sessions (ms). More...
 
IRIDIUM_9604_sbd_callback_t _sbdCallback = nullptr
 The SBD session callback. nullptr = blocking sessions. More...
 
uint8_t _sbdState = IRIDIUM_9604_SBD_STATE_IDLE
 The state of the non-blocking SBD session. More...
 
unsigned long _sbdStartTime = 0
 millis when the non-blocking session started (or was cancelled). More...
 
bool _sbdExtended = true
 true for +SBDIX / +SBDIXA; false for +SBDI. More...
 
bool _sbdHighLevel = false
 true if the session was started by sendReceiveSBD: check the MO / MT status and read the MT message. More...
 
bool _sbdHighLevelNext = false
 Set by sendReceiveSBD before it starts the session. More...
 
uint8_t * _sbdRxBuffer = nullptr
 sendReceiveSBD: where to store the MT message. More...
 
size_t * _sbdRxLength = nullptr
 sendReceiveSBD: the size of _sbdRxBuffer in, the number of bytes received out. More...
 
size_t _sbdRxBufferSize = 0
 sendReceiveSBD: the size of _sbdRxBuffer. More...
 
bool _sbdComplete = false
 The session is complete: call the callback. More...
 
IRIDIUM_9604_error_t _sbdCompleteStatus = IRIDIUM_9604_ERROR_SUCCESS
 The status for the callback. More...
 
bool _sbdHaveResult = false
 true if the +SBDIX result was received. More...
 
IRIDIUM_9604_error_t _lastSBDSessionStatus = IRIDIUM_9604_ERROR_INVALID
 The status of the most recent SBD session. More...
 
const int _maxSocketRead = 1024
 The limit on bytes that can be read in a single read. More...
 

Static Protected Attributes

static const size_t _lastErrorTextSize = 64
 The size of _lastErrorText. More...
 
static const uint8_t IRIDIUM_9604_SBD_STATE_IDLE = 0
 _sbdState: no session in progress More...
 
static const uint8_t IRIDIUM_9604_SBD_STATE_IN_PROGRESS = 1
 _sbdState: the session command has been sent. Waiting for the result More...
 
static const uint8_t IRIDIUM_9604_SBD_STATE_CANCELLING = 2
 _sbdState: cancelSBDSession has been called. Waiting for the final result code More...
 

Detailed Description

The Iridium 9604 device class: all of the AT command, URC, NMEA and satellite methods. Use SFE_IRIDIUM_9604, which adds the begin() methods.

Member Typedef Documentation

◆ gnss_aiding_mode_t

The GNSS aiding mode type. (Retained for SARA-R5 compatibility.)

◆ gnss_system_t

The GNSS system type. (Retained for SARA-R5 compatibility.)

◆ nmeaCallbackDataCommon_t

◆ nmeaMessage

◆ sfe_ip_address_t

typedef SparkFun_Iridium_9604::sfe_ip_address_t DevIridium9604::sfe_ip_address_t

The IP address type: IPAddress on Arduino; SfeIPAddress on ESP-IDF.

◆ sfe_print_t

typedef SparkFun_Iridium_9604::sfe_print_t DevIridium9604::sfe_print_t

The print type: Print on Arduino; SfeOutput on ESP-IDF.

◆ sfe_string_t

typedef SparkFun_Iridium_9604::sfe_string_t DevIridium9604::sfe_string_t

The string type: String on Arduino; std::string on ESP-IDF.

◆ urcCallback_t

typedef SparkFun_Iridium_9604::urcCallback_t DevIridium9604::urcCallback_t

The generic URC callback type. Cast your callback to this for setURCCallback().

Member Enumeration Documentation

◆ IRIDIUM_9604_gpio_mode_t

GPIO pin modes.

Enumerator
GPIO_MODE_INVALID 
GPIO_OUTPUT 
GPIO_INPUT 
NETWORK_STATUS 
GNSS_SUPPLY_ENABLE 
GNSS_DATA_READY 
GNSS_RTC_SHARING 
JAMMING_DETECTION 
SIM_CARD_DETECTION 
HEADSET_DETECTION 
GSM_TX_BURST_INDICATION 
MODULE_STATUS_INDICATION 
MODULE_OPERATING_MODE_INDICATION 
I2S_DIGITAL_AUDIO_INTERFACE 
SPI_SERIAL_INTERFACE 
MASTER_CLOCK_GENRATION 
UART_INTERFACE 
WIFI_ENABLE 
RING_INDICATION 
LAST_GASP_ENABLE 
EXTERNAL_GNSS_ANTENNA 
TIME_PULSE_GNSS 
TIME_PULSE_OUTPUT 
TIMESTAMP 
FAST_POWER_OFF 
LWM2M_PULSE 
HARDWARE_FLOW_CONTROL 
ANTENNA_TUNING 
EXT_GNSS_TIME_PULSE 
EXT_GNSS_TIMESTAMP 
DTR_MODE 
KHZ_32768_OUT 
SAFE_MEMORY_POWER_OFF 

New for the 9604.

UPSV_CONTROL 

New for the 9604.

SATELLITE_GNSS_RX_INDICATION 

New for the 9604: Satellite / GNSS Rx indication.

SATELLITE_GNSS_RX_TX_INDICATION 

New for the 9604: Satellite / GNSS Rx/Tx indication.

PAD_DISABLED 

◆ IRIDIUM_9604_gpio_t

GPIO pin map.

Enumerator
GPIO1 
GPIO2 
GPIO3 
GPIO4 
GPIO5 
GPIO6 

◆ IRIDIUM_9604_init_type_t

The initialization types used by init().

Enumerator
IRIDIUM_9604_INIT_STANDARD 
IRIDIUM_9604_INIT_AUTOBAUD 
IRIDIUM_9604_INIT_RESET 

◆ IRIDIUM_9604_l2p_t

The layer 2 protocols for enterPPP().

Enumerator
L2P_DEFAULT 
L2P_PPP 
L2P_M_HEX 
L2P_M_RAW_IP 
L2P_M_OPT_PPP 

◆ IRIDIUM_9604_pdp_type

The PDP types for setAPN() / getAPN().

Enumerator
PDP_TYPE_INVALID 
PDP_TYPE_IP 
PDP_TYPE_NONIP 
PDP_TYPE_IPV4V6 
PDP_TYPE_IPV6 

Constructor & Destructor Documentation

◆ DevIridium9604()

DevIridium9604::DevIridium9604 ( int  powerPin = IRIDIUM_9604_POWER_PIN,
int  resetPin = IRIDIUM_9604_RESET_PIN,
uint8_t  maxInitTries = 9 
)

Construct a DevIridium9604 object. Use SFE_IRIDIUM_9604 (SparkFun_Iridium_9604.h), which adds the begin() methods.

The library uses powerPin and resetPin (if provided) to power the module off / on and to perform an emergency reset.

Parameters
powerPinThe GPIO connected to the module's PWR_ON pin, or -1 if not connected.
resetPinThe GPIO connected to the module's RESET_N pin, or -1 if not connected.
maxInitTriesThe maximum number of initialization attempts made by begin().

◆ ~DevIridium9604()

DevIridium9604::~DevIridium9604 ( void  )

Destroy the DevIridium9604 object, freeing the backlog and receive buffers.

Member Function Documentation

◆ activatePDPcontext()

IRIDIUM_9604_error_t DevIridium9604::activatePDPcontext ( bool  status,
int  cid = -1 
)

Activate or deactivate a PDP context (AT+CGACT).

Parameters
statustrue to activate, false to deactivate.
cidThe PDP context identifier. -1 = all.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ addToBacklog()

void DevIridium9604::addToBacklog ( char  c)
protected

Add one character to the backlog. NULLs are converted to ASCII '0'.

Parameters
cThe character.

◆ appendFileContents() [1/2]

IRIDIUM_9604_error_t DevIridium9604::appendFileContents ( sfe_string_t  filename,
const char *  str,
int  len 
)

Append binary data to a file in the module's file system (AT+UDWNFILE). The file is created if it does not exist.

Parameters
filenameThe file name (in the module's file system).
strThe data to append.
lenThe number of bytes to append.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ appendFileContents() [2/2]

IRIDIUM_9604_error_t DevIridium9604::appendFileContents ( sfe_string_t  filename,
sfe_string_t  str 
)

Append data to a file in the module's file system (AT+UDWNFILE). The file is created if it does not exist.

Parameters
filenameThe file name (in the module's file system).
strThe data to append.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ at()

IRIDIUM_9604_error_t DevIridium9604::at ( void  )

Send "AT" and check for "OK".

Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ autobaud()

IRIDIUM_9604_error_t DevIridium9604::autobaud ( unsigned long  desiredBaud)
protected

Find the module's baud rate and change it to desiredBaud.

Parameters
desiredBaudThe desired baud rate.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ automaticOperatorSelection()

IRIDIUM_9604_error_t DevIridium9604::automaticOperatorSelection ( )

Select the network operator automatically (AT+COPS=0).

Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ autoTimeZone()

IRIDIUM_9604_error_t DevIridium9604::autoTimeZone ( bool  enable)

Enable or disable the automatic time zone update from the network (AT+CTZU).

Parameters
enabletrue to enable, false to disable.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ autoTimeZoneForBegin()

void DevIridium9604::autoTimeZoneForBegin ( bool  enable = true)

Enable or disable the automatic time zone update during begin(). Call this before begin(). Default: enabled.

Parameters
enabletrue to enable, false to disable.

◆ begin()

bool DevIridium9604::begin ( unsigned long  baud)

Initialize the module and ensure it is connected. Autobauds the module to baud if required. Called by the begin() methods of SFE_IRIDIUM_9604 - after setCommunicationBus.

Parameters
baudThe baud rate. The library autobauds the module to this rate if required.
Returns
true if the module responded and was initialized.

◆ beginSerial()

void DevIridium9604::beginSerial ( unsigned long  baud)
protectedvirtual

Set the communication bus baud rate.

Parameters
baudThe baud rate.

◆ bufferedPoll()

bool DevIridium9604::bufferedPoll ( void  )

Process any data from the module: the backlog first, then any fresh serial data. URCs are passed to the registered URC handlers.

Call this regularly. It does the same job as poll() but processes any 'old' data stored in the backlog first, and it has a timeout. It also calls checkCallbacks() - to call any NMEA callbacks which are waiting.

Originally written by Matthew Menze for the LTE Shield (SARA-R4) library.

Returns
true if any data was processed.

◆ cancelSBDSession()

IRIDIUM_9604_error_t DevIridium9604::cancelSBDSession ( void  )

Cancel the non-blocking SBD session (the equivalent of ISBDCallback returning false in the SparkFun IridiumSBD library).

Sends a single CR to the module, to abort AT+SBDIX. (The "Can be aborted" attribute of the satellite commands is not documented in the 9604 AT manual v1.5 BETA: if the module does not abort the session, it ends normally.) The library waits (non-blocking) for the module's final result code - for up to IRIDIUM_9604_SBD_CANCEL_TIMEOUT - then calls the callback with IRIDIUM_9604_ERROR_SBD_CANCELLED. If the +SBDIX result arrives first, it is passed to the callback: the MO message may have been sent!

Returns
IRIDIUM_9604_SUCCESS if the cancellation has started. IRIDIUM_9604_ERROR_INVALID if no session is in progress.

◆ checkCallbacks()

void DevIridium9604::checkCallbacks ( void  )

Call any NMEA callbacks which are waiting. Called automatically by bufferedPoll().

◆ checkSBDSession()

void DevIridium9604::checkSBDSession ( void  )
protected

Non-blocking SBD session: check for a timeout; read the MT message (sendReceiveSBD) and call the callback when the session is complete. Called by bufferedPoll.

◆ checkSBDSessionResult()

IRIDIUM_9604_error_t DevIridium9604::checkSBDSessionResult ( const IRIDIUM_9604_sbd_session_t &  session)
protected

Check the result of an SBD session: the MO status (0 to -4 = success) and the MT status (2 = error). Used by sendReceiveSBD.

Parameters
sessionThe session result.
Returns
IRIDIUM_9604_SUCCESS or IRIDIUM_9604_ERROR_SBD_SESSION_FAILED.

◆ clearSBDBuffers()

IRIDIUM_9604_error_t DevIridium9604::clearSBDBuffers ( IRIDIUM_9604_sbd_clear_t  buffers = IRIDIUM_9604_SBD_CLEAR_MO)

Clear the mobile originated and/or mobile terminated SBD buffers (AT+SBDD).

The 9604 needs an equals (AT+SBDD=0) and replies +SBDD:<result>. (AT+SBDD0 - the 9602 / 9603 format, and the format in the 9604 AT manual v1.5 BETA - returns "+CME ERROR: unknown".)

Parameters
buffersWhich buffer(s) to clear.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ clock() [1/2]

IRIDIUM_9604_error_t DevIridium9604::clock ( uint8_t *  y,
uint8_t *  mo,
uint8_t *  d,
uint8_t *  h,
uint8_t *  min,
uint8_t *  s,
int8_t *  tz 
)

Read the module's real time clock (AT+CCLK?) as separate values.

Parameters
yReturns the year (two digits: years since 2000).
moReturns the month.
dReturns the day.
hReturns the hour.
minReturns the minute.
sReturns the second.
tzReturns the time zone, in quarters of an hour.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ clock() [2/2]

sfe_string_t DevIridium9604::clock ( void  )

Read the module's real time clock (AT+CCLK?).

Returns
The time: "yy/MM/dd,hh:mm:ss+TZ". Empty on failure.

◆ completeSBDSession()

void DevIridium9604::completeSBDSession ( IRIDIUM_9604_error_t  status)
protected

Non-blocking SBD session: mark the session complete. checkSBDSession calls the callback.

Parameters
statusThe status for the callback.

◆ configSecurityProfile()

IRIDIUM_9604_error_t DevIridium9604::configSecurityProfile ( int  secprofile,
IRIDIUM_9604_sec_profile_parameter_t  parameter,
int  value 
)

Configure a security profile parameter with an integer value (AT+USECPRF).

Note
+USECPRF is referenced, but has no section of its own, in the Iridium 9604 AT commands manual.
Parameters
secprofileThe security profile. -1 = default.
parameterThe parameter.
valueThe value.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ configSecurityProfileString()

IRIDIUM_9604_error_t DevIridium9604::configSecurityProfileString ( int  secprofile,
IRIDIUM_9604_sec_profile_parameter_t  parameter,
sfe_string_t  value 
)

Configure a security profile parameter with a string value (AT+USECPRF).

Note
+USECPRF is referenced, but has no section of its own, in the Iridium 9604 AT commands manual.
Parameters
secprofileThe security profile. -1 = default.
parameterThe parameter.
valueThe value.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ connectFTP()

IRIDIUM_9604_error_t DevIridium9604::connectFTP ( void  )

Connect to the FTP server (AT+UFTPC=1). The result is delivered by the +UUFTPCR URC: see setFTPCommandCallback().

Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ connectMQTT()

IRIDIUM_9604_error_t DevIridium9604::connectMQTT ( void  )

Connect to the MQTT broker (AT+UMQTTC=1). The result is delivered by the +UUMQTTC URC: see setMQTTCommandCallback().

Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ deleteAllSMSmessages()

IRIDIUM_9604_error_t DevIridium9604::deleteAllSMSmessages ( void  )
inline

Delete all the SMS messages from preferred storage, including the unread messages (AT+CMGD=1,4).

Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ deleteFile()

IRIDIUM_9604_error_t DevIridium9604::deleteFile ( sfe_string_t  filename)

Delete a file from the module's file system (AT+UDELFILE).

Parameters
filenameThe file name (in the module's file system).
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ deleteReadSentSMSmessages()

IRIDIUM_9604_error_t DevIridium9604::deleteReadSentSMSmessages ( void  )
inline

Delete all the read and sent SMS messages from preferred storage (AT+CMGD=1,2).

Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ deleteReadSentUnsentSMSmessages()

IRIDIUM_9604_error_t DevIridium9604::deleteReadSentUnsentSMSmessages ( void  )
inline

Delete all the read, sent and unsent SMS messages from preferred storage (AT+CMGD=1,3).

Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ deleteReadSMSmessages()

IRIDIUM_9604_error_t DevIridium9604::deleteReadSMSmessages ( void  )
inline

Delete all the read SMS messages from preferred storage (AT+CMGD=1,1).

Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ deleteSMSmessage()

IRIDIUM_9604_error_t DevIridium9604::deleteSMSmessage ( int  location,
int  deleteFlag = 0 
)

Delete SMS message(s) (AT+CMGD).

Parameters
locationThe memory location. Ignored if deleteFlag is non-zero.
deleteFlag0 = delete the message at location; 1 = all read; 2 = all read and sent; 3 = all read, sent and unsent; 4 = all.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ deregisterOperator()

IRIDIUM_9604_error_t DevIridium9604::deregisterOperator ( void  )

Deregister from the network operator (AT+COPS=2).

Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ disableAllNMEA()

IRIDIUM_9604_error_t DevIridium9604::disableAllNMEA ( void  )
inline

Disable the output of all 13 NMEA messages.

Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ disableAtDebugging()

void DevIridium9604::disableAtDebugging ( void  )

Turn off the AT command debug messages.

◆ disableDebugging()

void DevIridium9604::disableDebugging ( void  )

Turn off the debug messages.

◆ disconnectFTP()

IRIDIUM_9604_error_t DevIridium9604::disconnectFTP ( void  )

Disconnect from the FTP server (AT+UFTPC=0).

Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ disconnectMQTT()

IRIDIUM_9604_error_t DevIridium9604::disconnectMQTT ( void  )

Disconnect from the MQTT broker (AT+UMQTTC=0).

Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ enableAtDebugging()

void DevIridium9604::enableAtDebugging ( sfe_print_t &  debugPort = SparkFun_Iridium_9604::sfeStdout)

Turn on the AT command debug messages: every AT command and response is printed.

Parameters
debugPortWhere to print the messages. Defaults to Serial (Arduino) or stdout (ESP-IDF).

◆ enableDebugging()

void DevIridium9604::enableDebugging ( sfe_print_t &  debugPort = SparkFun_Iridium_9604::sfeStdout)

Turn on the debug messages.

Parameters
debugPortWhere to print the messages. Defaults to Serial (Arduino) or stdout (ESP-IDF).

◆ enableEcho()

IRIDIUM_9604_error_t DevIridium9604::enableEcho ( bool  enable = true)

Enable or disable the command echo (ATE1 / ATE0). The library disables echo during begin().

Parameters
enabletrue to enable, false to disable.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ enterPPP()

IRIDIUM_9604_error_t DevIridium9604::enterPPP ( uint8_t  cid = 1,
char  dialing_type_char = 0,
unsigned long  dialNumber = 99,
DevIridium9604::IRIDIUM_9604_l2p_t  l2p = L2P_DEFAULT 
)

Enter PPP mode (ATD*99***cid#).

Parameters
cidThe PDP context identifier.
dialing_type_charThe dialing type character (optional: 0 = none).
dialNumberThe dial number. Default: 99.
l2pThe layer 2 protocol.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ extendedErrorCheck()

bool DevIridium9604::extendedErrorCheck ( char  c)
protected

Look for a "+CME ERROR: <err>" or "+CMS ERROR: <err>" response, one character at a time.

Saves the <err> text in _lastErrorText.

Parameters
cThe next character from the module.
Returns
true when a complete +CME ERROR / +CMS ERROR line has been received.

◆ extendedErrorReset()

void DevIridium9604::extendedErrorReset ( void  )
protected

Reset the +CME ERROR / +CMS ERROR matching and clear _lastErrorText. Called before each command.

◆ flushNMEA()

void DevIridium9604::flushNMEA ( const char *  msgId)

Mark the stored copy of an NMEA message as stale.

Parameters
msgIdThe NMEA message ID, e.g. "GGA".

◆ flushPartialLineToBacklog()

void DevIridium9604::flushPartialLineToBacklog ( void  )
protected

Move any incomplete bufferedPoll() line into the backlog - so it is processed with the next data.

◆ ftpGetFile()

IRIDIUM_9604_error_t DevIridium9604::ftpGetFile ( const sfe_string_t &  filename)

Download a file from the FTP server into the module's file system (AT+UFTPC=4).

Parameters
filenameThe file name (in the module's file system).
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ functionality()

IRIDIUM_9604_error_t DevIridium9604::functionality ( IRIDIUM_9604_functionality_t  function = FULL_FUNCTIONALITY)

Set the module functionality (AT+CFUN).

Parameters
functionThe functionality.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ getAPN()

IRIDIUM_9604_error_t DevIridium9604::getAPN ( int  cid,
sfe_string_t *  apn,
sfe_ip_address_t *  ip,
IRIDIUM_9604_pdp_type *  pdpType = nullptr 
)

Read the Access Point Name and IP address for a PDP context (AT+CGDCONT?).

Parameters
cidThe PDP context identifier.
apnReturns the Access Point Name.
ipReturns the IP address.
pdpTypeReturns the PDP type (optional).
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ getCapabilities()

sfe_string_t DevIridium9604::getCapabilities ( void  )

Read the module's capabilities list (AT+GCAP).

Returns
The capabilities. Empty on failure.

◆ getCCID()

sfe_string_t DevIridium9604::getCCID ( void  )

Read the SIM card identification (AT+CCID).

Returns
The CCID. Empty on failure.

◆ getDefaultPDPcontext()

IRIDIUM_9604_error_t DevIridium9604::getDefaultPDPcontext ( int *  cid,
int *  preferredProtocol = nullptr 
)

Read the PDP context used by the internal TCP/IP stack (AT+UDCONF=19).

The factory value is cid 1: the default EPS bearer, activated during the LTE attach.

Parameters
cidReturns the PDP context identifier.
preferredProtocolOptional: returns the preferred protocol type (0 = IPv4, 1 = IPv6) used when the context is IPv4v6.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ getExtSignalQuality()

IRIDIUM_9604_error_t DevIridium9604::getExtSignalQuality ( signal_quality &  signal_quality)

Read the extended signal quality (AT+CESQ). Cellular (LTE-M) only.

Parameters
signal_qualityReturns the extended signal quality.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ getFileBlock()

IRIDIUM_9604_error_t DevIridium9604::getFileBlock ( const sfe_string_t &  filename,
char *  buffer,
size_t  offset,
size_t  requestedLength,
size_t &  bytesRead 
)

Read a block of data from a file in the module's file system (AT+URDBLOCK). OK for binary files. Make sure buffer can hold requestedLength bytes.

Parameters
filenameThe file name (in the module's file system).
bufferWhere to store the data. Must hold requestedLength bytes.
offsetThe offset into the file.
requestedLengthThe number of bytes to read.
bytesReadReturns the number of bytes read.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ getFileContents() [1/2]

IRIDIUM_9604_error_t DevIridium9604::getFileContents ( sfe_string_t  filename,
char *  contents 
)

Read the contents of a file from the module's file system (AT+URDFILE). OK for binary files. Make sure contents can hold the entire file: get the size first with getFileSize().

Parameters
filenameThe file name (in the module's file system).
contentsReturns the file contents.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ getFileContents() [2/2]

IRIDIUM_9604_error_t DevIridium9604::getFileContents ( sfe_string_t  filename,
sfe_string_t *  contents 
)

Read the contents of a file from the module's file system (AT+URDFILE). OK for text files, but will fail with binary files (containing NULLs) on some platforms.

Parameters
filenameThe file name (in the module's file system).
contentsReturns the file contents.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ getFileSize()

IRIDIUM_9604_error_t DevIridium9604::getFileSize ( sfe_string_t  filename,
int *  size 
)

Read the size of a file in the module's file system (AT+ULSTFILE).

Parameters
filenameThe file name (in the module's file system).
sizeReturns the file size (bytes).
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ getFirmwareVersion()

sfe_string_t DevIridium9604::getFirmwareVersion ( void  )

Read the firmware version (AT+CGMR).

Returns
The firmware version. Empty on failure.

◆ getFTPprotocolError()

IRIDIUM_9604_error_t DevIridium9604::getFTPprotocolError ( int *  error_code,
int *  error_code2 
)

Read the most recent FTP protocol error (AT+UFTPER).

Parameters
error_codeReturns the error code.
error_code2Returns the second error code.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ getGpioMode()

DevIridium9604::IRIDIUM_9604_gpio_mode_t DevIridium9604::getGpioMode ( IRIDIUM_9604_gpio_t  gpio)

Read the mode of a GPIO pin (AT+UGPIOC?).

Parameters
gpioThe GPIO pin.
Returns
The GPIO mode. GPIO_MODE_INVALID on failure.

◆ getHTTPprotocolError()

IRIDIUM_9604_error_t DevIridium9604::getHTTPprotocolError ( int  profile,
int *  error_class,
int *  error_code 
)

Read the most recent HTTP protocol error for a profile (AT+UHTTPER).

Parameters
profileThe profile number.
error_classReturns the error class.
error_codeReturns the error code.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ getIMEI()

sfe_string_t DevIridium9604::getIMEI ( void  )

Read the cellular IMEI (AT+GSN). See getSatelliteIMEI() for the satellite (SBD) IMEI.

Returns
The IMEI. Empty on failure.

◆ getIMSI()

sfe_string_t DevIridium9604::getIMSI ( void  )

Read the SIM International Mobile Subscriber Identity (AT+CIMI).

Returns
The IMSI. Empty on failure.

◆ getIndicatorEventReporting()

IRIDIUM_9604_error_t DevIridium9604::getIndicatorEventReporting ( IRIDIUM_9604_cier_mode_t *  mode,
bool *  signalQuality,
bool *  serviceAvailability,
bool *  svBeamCoordinates 
)

Read the indicator event reporting configuration (AT+CIER?).

Parameters
modeReturns the mode.
signalQualityReturns true if the signal quality indication is enabled.
serviceAvailabilityReturns true if the service availability indication is enabled.
svBeamCoordinatesReturns true if the SV and beam coordinates indication is enabled.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ getLastErrorText()

const char * DevIridium9604::getLastErrorText ( void  )
inline

Get the reason for the most recent error.

The <err> text from the most recent "+CME ERROR: \<err\>" or "+CMS ERROR: \<err\>" response, e.g. "Wrong RAT" or "operation not supported" (or a number, if AT+CMEE=1). Cleared when the next command is sent. Empty if the most recent command succeeded, or failed with a plain ERROR.

Returns
The error text.

◆ getLastSBDSession()

IRIDIUM_9604_sbd_session_t DevIridium9604::getLastSBDSession ( void  )
inline

The result of the most recent SBD session (sbdSession(), sbdSessionExtended() or the send / receive methods).

Returns
The session result.

◆ getLastSBDSessionStatus()

IRIDIUM_9604_error_t DevIridium9604::getLastSBDSessionStatus ( void  )
inline

The status of the most recent SBD session - the status passed to the callback.

For blocking sessions, the value returned by the session method.

Returns
The status. IRIDIUM_9604_ERROR_INVALID if no session has been started.

◆ getLockStatus()

IRIDIUM_9604_lock_status_t DevIridium9604::getLockStatus ( void  )

Read the lock status (AT+CULK?).

Returns
The lock status. IRIDIUM_9604_LOCK_STATUS_INVALID on failure.

◆ getManufacturerID()

sfe_string_t DevIridium9604::getManufacturerID ( void  )

Read the manufacturer identification (AT+CGMI).

Returns
The manufacturer ID. Empty on failure.

◆ getMNOprofile()

IRIDIUM_9604_error_t DevIridium9604::getMNOprofile ( mobile_network_operator_t *  mno)
protected

Read the Mobile Network Operator profile (AT+UMNOPROF?).

Parameters
mnoReturns the Mobile Network Operator profile.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ getModelID()

sfe_string_t DevIridium9604::getModelID ( void  )

Read the model identification (AT+CGMM).

Returns
The model ID. Empty on failure.

◆ getMQTTprotocolError()

IRIDIUM_9604_error_t DevIridium9604::getMQTTprotocolError ( int *  error_code,
int *  error_code2 
)

Read the most recent MQTT protocol error (AT+UMQTTER).

Parameters
error_codeReturns the error code.
error_code2Returns the second error code.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ getNetworkProfile()

mobile_network_operator_t DevIridium9604::getNetworkProfile ( void  )

Read the Mobile Network Operator (MNO) profile (AT+UMNOPROF?).

Returns
The MNO profile. MNO_INVALID on failure.

◆ getNMEA()

bool DevIridium9604::getNMEA ( const char *  msgId,
bool  pollIfNoURC = true 
)

Get a fresh copy of an NMEA message. Returns true if fresh data has arrived (as a URC, or by polling) since the last call.

Parameters
msgIdThe NMEA message ID, e.g. "RMC". (Without the talker ID.)
pollIfNoURCIf true, poll the module (AT+UGNMEA?) if no fresh data has arrived as a URC.
Returns
true if fresh data is available.

◆ getNMEAfield()

bool DevIridium9604::getNMEAfield ( const char *  msgId,
const char *  field,
sfe_string_t &  value 
)

Get one field of an NMEA message, by name. Calls getNMEA() first.

Parameters
msgIdThe NMEA message ID, e.g. "RMC". (Without the talker ID.)
fieldThe field name, e.g. "lat".
valueReturns the field value.
Returns
true if fresh data is available and the field was found.

◆ getNmeaMessageBlockField()

DevIridium9604::sfe_string_t DevIridium9604::getNmeaMessageBlockField ( nmeaMessage *  theMessage,
uint16_t  blockIndex,
const char *  fieldName 
)

Get one field from a repeated block of the stored copy of an NMEA message (e.g. GSV), by name.

Parameters
theMessageThe NMEA message - from getNmeaMessagePtr() or getNmeaMessageByName().
blockIndexThe block index (0 = the first block).
fieldNameThe field name, e.g. "lat".
Returns
The field value. Empty if the field was not found.

◆ getNmeaMessageBlockFieldCallback()

DevIridium9604::sfe_string_t DevIridium9604::getNmeaMessageBlockFieldCallback ( nmeaMessage *  theMessage,
uint16_t  blockIndex,
const char *  fieldName 
)

Get one field from a repeated block of an NMEA message (e.g. GSV), by name, from inside an NMEA callback.

Parameters
theMessageThe NMEA message - from getNmeaMessagePtr() or getNmeaMessageByName().
blockIndexThe block index (0 = the first block).
fieldNameThe field name, e.g. "lat".
Returns
The field value. Empty if the field was not found.

◆ getNmeaMessageByName()

nmeaMessage * DevIridium9604::getNmeaMessageByName ( const char *  msgId)
inline

Find an NMEA message object by its message ID.

Parameters
msgIdThe NMEA message ID, e.g. "GGA".
Returns
The nmeaMessage, or nullptr if msgId is not supported.

◆ getNmeaMessageField()

DevIridium9604::sfe_string_t DevIridium9604::getNmeaMessageField ( nmeaMessage *  theMessage,
const char *  fieldName 
)

Get one field of the stored copy of an NMEA message, by name. Call getNMEA() first.

Parameters
theMessageThe NMEA message - from getNmeaMessagePtr() or getNmeaMessageByName().
fieldNameThe field name, e.g. "lat".
Returns
The field value. Empty if the field was not found.

◆ getNmeaMessageFieldCallback()

DevIridium9604::sfe_string_t DevIridium9604::getNmeaMessageFieldCallback ( nmeaMessage *  theMessage,
const char *  fieldName 
)

Get one field of an NMEA message, by name, from inside an NMEA callback.

Parameters
theMessageThe NMEA message - from getNmeaMessagePtr() or getNmeaMessageByName().
fieldNameThe field name, e.g. "lat".
Returns
The field value. Empty if the field was not found.

◆ getNmeaMessagePtr()

DevIridium9604::nmeaMessage * DevIridium9604::getNmeaMessagePtr ( nmeaCallbackDataCommon_t *  theData)

Get the nmeaMessage from inside an NMEA callback.

Parameters
theDataThe callback data pointer passed to the callback.
Returns
The nmeaMessage.

◆ getNMEAoutput()

IRIDIUM_9604_error_t DevIridium9604::getNMEAoutput ( const char *  msgId,
uint8_t *  rate,
uint8_t *  output 
)

Read the output configuration of one NMEA message (AT+UGNMEA?).

Parameters
msgIdThe NMEA message ID, e.g. "RMC". (Without the talker ID.)
rateReturns the rate.
outputReturns the output.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ getOperator()

IRIDIUM_9604_error_t DevIridium9604::getOperator ( sfe_string_t *  oper)

Read the current network operator (AT+COPS?).

Parameters
operReturns the operator name.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ getOperators()

uint8_t DevIridium9604::getOperators ( struct operator_stats *  op,
int  maxOps = 3 
)

Scan for the available network operators (AT+COPS=?). This can take up to 3 minutes.

Parameters
opReturns the operators. An array of maxOps operator_stats.
maxOpsThe size of the op array.
Returns
The number of operators found.

◆ getPDPaddress()

IRIDIUM_9604_error_t DevIridium9604::getPDPaddress ( int  cid,
sfe_ip_address_t *  address 
)

Read the IP address of a PDP context (AT+CGPADDR=<cid>).

Replaces the SARA-R5 library's getNetworkAssignedIPAddress() (AT+UPSND), which the Iridium 9604 does not support. Only an IPv4 address is returned. (For an IPv4v6 context, the IPv4 address is the first one.)

Parameters
cidThe PDP context identifier. Use getDefaultPDPcontext() to find the context used by the internal TCP/IP stack.
addressReturns the IP address. 0.0.0.0 if the context has no IPv4 address.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ getPDPcontextState()

IRIDIUM_9604_error_t DevIridium9604::getPDPcontextState ( int  cid,
bool *  active 
)

Read whether a PDP context is active (AT+CGACT?).

Parameters
cidThe PDP context identifier.
activeReturns true if the context is active. False if it is not active, or not defined.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ getPreferredMessageStorage()

IRIDIUM_9604_error_t DevIridium9604::getPreferredMessageStorage ( int *  used,
int *  total,
sfe_string_t  memory = "ME" 
)

Read the number of used and total SMS memory locations (AT+CPMS).

Parameters
usedReturns the number of used memory locations.
totalReturns the total number of memory locations.
memoryThe memory: "ME" (default), "SM" or "MT".
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ getRAT()

IRIDIUM_9604_rat_t DevIridium9604::getRAT ( void  )

Read the selected Radio Access Technology (AT+URAT?). New for the 9604.

Returns
The RAT. IRIDIUM_9604_RAT_INVALID on failure.

◆ getSatelliteIMEI()

DevIridium9604::sfe_string_t DevIridium9604::getSatelliteIMEI ( void  )

Read the 15 digit satellite (SBD) IMEI (AT+USATSN).

Returns
The 15 digit satellite IMEI. Empty on failure.

◆ getSatelliteInfo()

IRIDIUM_9604_error_t DevIridium9604::getSatelliteInfo ( IRIDIUM_9604_sat_info_t *  info)

Read the satellite system information (AT+USATINFO). Only available in the satellite RAT.

Parameters
infoReturns the satellite system information.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ getSatelliteSerialNumber() [1/2]

IRIDIUM_9604_error_t DevIridium9604::getSatelliteSerialNumber ( sfe_string_t *  serialNumber,
sfe_string_t *  sbdIMEI 
)

Read the satellite serial number and the satellite (SBD) IMEI (AT+USATSN).

Parameters
serialNumberReturns the satellite serial number (6 alphanumeric characters).
sbdIMEIReturns the 15 digit satellite (SBD) IMEI.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ getSatelliteSerialNumber() [2/2]

DevIridium9604::sfe_string_t DevIridium9604::getSatelliteSerialNumber ( void  )

Read the satellite serial number (AT+USATSN).

Returns
The satellite serial number. Empty on failure.

◆ getSatelliteSignalQuality()

int DevIridium9604::getSatelliteSignalQuality ( void  )
inline

The most recent satellite signal quality (0-5 bars), from the +CIEV URCs. Call bufferedPoll() regularly to process the URCs.

Returns
The signal quality (0-5), or -1 if not yet known.

◆ getSBDATTimeout()

unsigned long DevIridium9604::getSBDATTimeout ( void  )
inline

Read the AT command timeout used for SBD sessions.

Returns
The timeout (ms).

◆ getSBDAutoRegistration()

IRIDIUM_9604_error_t DevIridium9604::getSBDAutoRegistration ( IRIDIUM_9604_sbdareg_mode_t *  mode)

Read the SBD automatic registration mode (AT+SBDAREG?).

Parameters
modeReturns the automatic registration mode.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ getSBDDeliveryShortCode()

IRIDIUM_9604_error_t DevIridium9604::getSBDDeliveryShortCode ( uint8_t *  dsc)

Read the SBD delivery short code (AT+SBDDSC?).

Parameters
dscReturns the delivery short code.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ getSBDErrorString()

const char * DevIridium9604::getSBDErrorString ( int  error)
static

Convert an SBD error code (+SBDIX MO status, +SBDDET error, +AREG reg error) to text. Positive or negative codes are accepted.

Parameters
errorThe SBD error code.
Returns
The error text.

◆ getSBDRegistrationStatus()

IRIDIUM_9604_sbdreg_status_t DevIridium9604::getSBDRegistrationStatus ( void  )

Read the SBD registration status (AT+SBDREG?). From the Iridium 9604 Additional Commands (Beta).

Returns
The registration status. IRIDIUM_9604_SBDREG_INVALID on failure.

◆ getSBDSessionTimeout()

IRIDIUM_9604_error_t DevIridium9604::getSBDSessionTimeout ( int *  timeout)

Read the SBD session timeout (AT+SBDST?).

Parameters
timeoutReturns the session timeout (s).
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ getSBDStatusExtended()

IRIDIUM_9604_error_t DevIridium9604::getSBDStatusExtended ( IRIDIUM_9604_sbd_status_t *  status)

Read the extended SBD status (AT+SBDSX).

Parameters
statusReturns the extended SBD status.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ getSBDTrafficManagementStatus()

IRIDIUM_9604_error_t DevIridium9604::getSBDTrafficManagementStatus ( int *  status,
unsigned long *  time 
)

Read the SBD traffic management status (AT+SBDLOE).

Parameters
statusReturns the status: 0 = the time is valid.
timeReturns the time (s) until the end of the traffic management period.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ getSerialNo()

sfe_string_t DevIridium9604::getSerialNo ( void  )

Read the product serial number (AT+CGSN).

Returns
The serial number. Empty on failure.

◆ getSIMstateReportingMode()

IRIDIUM_9604_error_t DevIridium9604::getSIMstateReportingMode ( int *  mode)

Read the SIM state reporting mode (AT+USIMSTAT?).

Parameters
modeReturns the mode.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ getSimStatus()

IRIDIUM_9604_error_t DevIridium9604::getSimStatus ( sfe_string_t *  code)

Read the SIM PIN status (AT+CPIN?).

Parameters
codeReturns the SIM PIN status, e.g. "READY".
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ getSubscriberNo()

sfe_string_t DevIridium9604::getSubscriberNo ( void  )

Read the subscriber number (AT+CNUM).

Returns
The subscriber number. Empty on failure.

◆ getUtimeConfiguration()

IRIDIUM_9604_error_t DevIridium9604::getUtimeConfiguration ( int32_t *  offsetNanoseconds,
int32_t *  offsetSeconds 
)

Read the time offsets (AT+UTIMECFG?).

Parameters
offsetNanosecondsReturns the offset in nanoseconds.
offsetSecondsReturns the offset in seconds.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ getUtimeIndication()

IRIDIUM_9604_error_t DevIridium9604::getUtimeIndication ( IRIDIUM_9604_utime_urc_configuration_t *  config)

Read the time indication URC configuration (AT+UTIMEIND?).

Parameters
configReturns the configuration.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ getUtimeMode()

IRIDIUM_9604_error_t DevIridium9604::getUtimeMode ( IRIDIUM_9604_utime_mode_t *  mode,
IRIDIUM_9604_utime_sensor_t *  sensor 
)

Read the time mode and time source (AT+UTIME?).

Parameters
modeReturns the mode.
sensorReturns the sensor.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ getWaitingMessageCount()

int DevIridium9604::getWaitingMessageCount ( void  )
inline

The number of MT messages waiting at the gateway, from the most recent SBD session.

Returns
The number of waiting messages, or -1 if unknown.

◆ gpsAidingServerConf()

IRIDIUM_9604_error_t DevIridium9604::gpsAidingServerConf ( const char *  primaryServer,
const char *  secondaryServer,
const char *  authToken,
unsigned int  days = 14,
unsigned int  period = 4,
unsigned int  resolution = 1,
unsigned int  gnssTypes = 65,
unsigned int  mode = 0,
unsigned int  dataType = 15 
)

Configure the u-blox AssistNow aiding server (AT+UGSRV).

Parameters
primaryServerThe primary server. nullptr or "" to keep the stored server (the factory-programmed server).
secondaryServerThe secondary server. nullptr or "" to keep the stored server.
authTokenThe AssistNow authentication token.
daysThe number of days of data.
periodThe period (weeks).
resolutionThe resolution (days).
gnssTypesThe GNSS systems.
modeThe mode.
dataTypeThe data type.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ gpsGetState()

IRIDIUM_9604_error_t DevIridium9604::gpsGetState ( bool *  on,
int *  aiding = nullptr,
int *  systems = nullptr 
)

Read the GNSS state (AT+UGPS?).

Parameters
onReturns true if the GNSS is powered on.
aidingIf not nullptr, returns the aiding mode (IRIDIUM_9604_gnss_aiding_mode_t values added together). 0 if off.
systemsIf not nullptr, returns the GNSS systems (IRIDIUM_9604_gnss_system_t values added together). 0 if off.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ gpsPower()

IRIDIUM_9604_error_t DevIridium9604::gpsPower ( bool  enable = true,
gnss_system_t  gnss_sys = GNSS_SYSTEM_GPS,
gnss_aiding_mode_t  gnss_aiding = GNSS_AIDING_MODE_AUTOMATIC 
)

Power the GNSS on or off (AT+UGPS). On the Iridium 9604 the GNSS may already be on - the satellite stack uses it to find its location. gpsPower does nothing if the GNSS is already in the requested state.

The NMEA messages are sent to the UART which started the GNSS.

Parameters
enabletrue to power the GNSS on, false to power it off.
gnss_sysThe GNSS systems to use: a combination of GNSS_SYSTEM_GPS etc.
gnss_aidingThe aiding mode: GNSS_AIDING_MODE_NONE etc.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ gpsRequest()

IRIDIUM_9604_error_t DevIridium9604::gpsRequest ( unsigned int  timeout,
uint32_t  accuracy,
bool  detailed = true,
unsigned int  sensor = 3 
)

Request the location (AT+ULOC). The result is delivered by the +UULOC URC: see setGpsReadCallback().

Note
This command is not documented in the Iridium 9604 AT commands manual. It is retained from the SARA-R5 library.
Parameters
timeoutThe timeout (s).
accuracyThe target accuracy (m).
detailedtrue for detailed results.
sensorThe time source sensor.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ gpsRequestAiding()

IRIDIUM_9604_error_t DevIridium9604::gpsRequestAiding ( IRIDIUM_9604_gnss_aiding_request_t  request,
unsigned long  timeout = IRIDIUM_9604_2_MIN_TIMEOUT 
)

Request a GNSS aiding operation (AT+UGAOS): e.g. download the AssistNow Online data into the GNSS.

The AssistNow requests need the LTE-M connection, and the token set with gpsAidingServerConf(). The command returns when the data is valid or an error occurs. With setGNSSAidingIndication(true), the result is also reported by the +UUGIND URC (see setGNSSAidingCallback()).

Parameters
requestThe request: GNSS_AIDING_REQUEST_ASSISTNOW_ONLINE etc.
timeoutThe timeout (ms).
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ gpsSetAiding()

IRIDIUM_9604_error_t DevIridium9604::gpsSetAiding ( gnss_aiding_mode_t  gnss_aiding,
gnss_system_t  gnss_sys = (gnss_system_t)(GNSS_SYSTEM_GPS | GNSS_SYSTEM_SBAS) 
)

Power the GNSS on with the chosen aiding mode and GNSS systems (AT+UGPS=1,<aid_mode>,<GNSS_systems>).

Unlike gpsPower(), this changes the aiding mode and systems if the GNSS is already on. (The aiding mode can be changed without powering off the GNSS. If only the systems are changing, the GNSS is powered off and on again: the module does not allow that while the GNSS is on.) Does nothing if the GNSS is already on with the same aiding mode and systems. (The module may add QZSS L1S (256) itself: it is ignored in that check, unless requested.) Note: the u-blox M10 can track up to four major GNSS, but (firmware SPG 5.10) GLONASS and BeiDou B1I can not be used together. If the combination is not supported, the module selects its own. Check with gpsGetState().

Parameters
gnss_aidingThe aiding mode: IRIDIUM_9604_gnss_aiding_mode_t values added together (cast the sum).
gnss_sysThe GNSS systems: IRIDIUM_9604_gnss_system_t values added together (cast the sum).
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ hasRingAlert()

bool DevIridium9604::hasRingAlert ( void  )

Check if an SBD ring alert has been received (the +SBDSX RA flag).

Returns
true if a ring alert has been received.

◆ havePowerOnPin()

bool DevIridium9604::havePowerOnPin ( void  )
inlineprotected

Check if the PWR_ON pin can be written: GPIO pin or callback.

Returns
true if the PWR_ON pin can be written.

◆ haveResetPin()

bool DevIridium9604::haveResetPin ( void  )
inlineprotected

Check if the RESET_N pin can be written: GPIO pin or callback.

Returns
true if the RESET_N pin can be written.

◆ hwAvailable()

int DevIridium9604::hwAvailable ( void  )
protected

The number of bytes available to be read from the module.

Returns
The number of bytes available.

◆ hwEmergencyShutdown()

void DevIridium9604::hwEmergencyShutdown ( void  )

Abrupt emergency hardware shutdown: hold PWR_ON low for IRIDIUM_9604_EMERGENCY_SHUTDOWN_PULSE_PERIOD (20 s), then release it.

Blocks for 20 seconds. Use modulePowerOff() (+CPWROFF) - or hwReset() - in preference to this. Needs the power pin (constructor) or a PWR_ON pin write callback (setPowerOnPinWriteCallback).

◆ hwPrint()

size_t DevIridium9604::hwPrint ( const char *  s)
protected

Write a NULL-terminated string to the module, through the communication bus.

Parameters
sThe NULL-terminated string.
Returns
The number of bytes written.

◆ hwReset()

void DevIridium9604::hwReset ( void  )

Reset (reboot) the module: hold RESET_N low for IRIDIUM_9604_RESET_PULSE_PERIOD (200 ms), then release it.

An abrupt software reset: the current parameter settings are not saved in NVM and there is no network detach. Needs the reset pin (constructor) or a RESET_N pin write callback (setResetPinWriteCallback). The module takes a few seconds to restart: call begin() again afterwards.

◆ hwWrite()

size_t DevIridium9604::hwWrite ( const char  c)
protected

Write one byte to the module, through the communication bus.

Parameters
cThe byte.
Returns
The number of bytes written.

◆ hwWriteData()

size_t DevIridium9604::hwWriteData ( const char *  buff,
int  len 
)
protected

Write a buffer to the module, through the communication bus.

Parameters
buffThe data.
lenThe number of bytes.
Returns
The number of bytes written.

◆ init()

IRIDIUM_9604_error_t DevIridium9604::init ( unsigned long  baud,
DevIridium9604::IRIDIUM_9604_init_type_t  initType = IRIDIUM_9604_INIT_STANDARD 
)
protected

Initialize the module: autobaud, disable echo, configure the URCs etc. Called by begin().

Parameters
baudThe baud rate.
initTypeThe initialization type.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ invertPowerPin()

void DevIridium9604::invertPowerPin ( bool  invert = false)

Invert the polarity of the power pin, if required. Normally the module's PWR_ON pin is pulled low and released to toggle the power. Some boards need it to be pulled high and released instead.

Ignored if a PWR_ON pin write callback has been set (see setPowerOnPinWriteCallback).

Parameters
inverttrue to invert the power pin polarity.

◆ iridium_calloc_char()

char * DevIridium9604::iridium_calloc_char ( size_t  num)
protected

Allocate a zeroed char buffer (with calloc). Free it with free().

Parameters
numThe number of chars.
Returns
The buffer, or nullptr if the allocation failed.

◆ isGPSon()

bool DevIridium9604::isGPSon ( void  )

Check if the GNSS is powered on (AT+UGPS?).

Returns
true if the GNSS is on.

◆ isSatelliteServiceAvailable()

int DevIridium9604::isSatelliteServiceAvailable ( void  )
inline

The most recent satellite service availability, from the +CIEV URCs. Call bufferedPoll() regularly to process the URCs.

Returns
1 if the service is available, 0 if not, or -1 if not yet known.

◆ isSBDSessionInProgress()

bool DevIridium9604::isSBDSessionInProgress ( void  )
inline

Check if a non-blocking SBD session is in progress (or being cancelled).

Becomes false just before the callback is called.

Returns
true if a session is in progress.

◆ lastRemoteIP()

sfe_ip_address_t DevIridium9604::lastRemoteIP ( void  )

The remote IP address from the most recent socket listen (+UUSOLI) URC.

Returns
The remote IP address.

◆ modulePowerOff()

IRIDIUM_9604_error_t DevIridium9604::modulePowerOff ( void  )

Gracefully disconnect from the network and power the module off (AT+CPWROFF).

Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ modulePowerOn()

void DevIridium9604::modulePowerOn ( void  )

Power the module on by pulsing the PWR_ON pin. Requires the powerPin to have been provided to the constructor - or a PWR_ON pin write callback (setPowerOnPinWriteCallback).

◆ mqttPublishBinaryMsg()

IRIDIUM_9604_error_t DevIridium9604::mqttPublishBinaryMsg ( const sfe_string_t &  topic,
const char *const  msg,
size_t  msg_len,
uint8_t  qos = 0,
bool  retain = false 
)

Publish a binary message to an MQTT topic (AT+UMQTTC=9).

Parameters
topicThe topic.
msgThe message.
msg_lenThe message length (bytes).
qosThe QoS.
retaintrue to retain the message.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ mqttPublishFromFile()

IRIDIUM_9604_error_t DevIridium9604::mqttPublishFromFile ( const sfe_string_t &  topic,
const sfe_string_t &  filename,
uint8_t  qos = 0,
bool  retain = false 
)

Publish the contents of a file to an MQTT topic (AT+UMQTTC=3).

Parameters
topicThe topic.
filenameThe file (in the module's file system) containing the message.
qosThe QoS.
retaintrue to retain the message.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ mqttPublishTextMsg()

IRIDIUM_9604_error_t DevIridium9604::mqttPublishTextMsg ( const sfe_string_t &  topic,
const char *const  msg,
uint8_t  qos = 0,
bool  retain = false 
)

Publish a text message to an MQTT topic (AT+UMQTTC=2).

Parameters
topicThe topic.
msgThe message.
qosThe QoS.
retaintrue to retain the message.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ nvMQTT()

IRIDIUM_9604_error_t DevIridium9604::nvMQTT ( IRIDIUM_9604_mqtt_nv_parameter_t  parameter)

Save, restore or reset the MQTT profile in non volatile memory (AT+UMQTTNV).

Parameters
parameterThe parameter.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ parseSocketListenIndication()

IRIDIUM_9604_error_t DevIridium9604::parseSocketListenIndication ( int  listeningSocket,
sfe_ip_address_t  localIP,
unsigned int  listeningPort,
int  socket,
sfe_ip_address_t  remoteIP,
unsigned int  port 
)
protected

Process a +UUSOLI URC: record the IP addresses and call the socket listen callback.

Parameters
listeningSocketThe listening socket.
localIPThe local IP address.
listeningPortThe listening port.
socketThe socket number.
remoteIPThe remote IP address.
portThe port.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ parseSocketReadIndication()

IRIDIUM_9604_error_t DevIridium9604::parseSocketReadIndication ( int  socket,
int  length 
)
protected

Read the TCP data indicated by a +UUSORD URC and pass it to the socket read callback(s).

Parameters
socketThe socket number.
lengthThe number of bytes indicated by the URC.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ parseSocketReadIndicationUDP()

IRIDIUM_9604_error_t DevIridium9604::parseSocketReadIndicationUDP ( int  socket,
int  length 
)
protected

Read the UDP data indicated by a +UUSORF URC and pass it to the socket read callback(s).

Parameters
socketThe socket number.
lengthThe number of bytes indicated by the URC.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ ping()

IRIDIUM_9604_error_t DevIridium9604::ping ( sfe_string_t  remote_host,
int  retry = 4,
int  p_size = 32,
unsigned long  timeout = 5000,
int  ttl = 32 
)

Ping a remote host (AT+UPING). The results are delivered by the +UUPING URC: see setPingCallback().

Parameters
remote_hostThe remote host name or IP address.
retryThe number of pings.
p_sizeThe ping size (bytes).
timeoutThe timeout (ms).
ttlThe time to live (hops).
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ poll()

bool DevIridium9604::poll ( void  )

The original poll function. Process one line of serial data from the module. It is 'blocking': it does not return until it receives a \n. bufferedPoll() is preferred.

Returns
true if any data was processed.

◆ pollNMEA()

IRIDIUM_9604_error_t DevIridium9604::pollNMEA ( void  )

Poll the NMEA messages stored in the module memory (AT+UGNMEA?). The messages are processed as if they had arrived as URCs.

The module empties its NMEA buffer each time it is read. The buffer can hold many messages: each one is processed as it arrives, so there is no size limit and the newest message is always the one stored.

Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ powerOff()

void DevIridium9604::powerOff ( void  )
protected

Pulse the PWR_ON pin for a long time to perform a graceful shutdown. modulePowerOff() (+CPWROFF) is preferred.

◆ powerOn()

void DevIridium9604::powerOn ( void  )
protected

Pulse the PWR_ON pin briefly to turn the module on.

◆ printSBDSession()

void DevIridium9604::printSBDSession ( const IRIDIUM_9604_sbd_session_t &  session)
protected

Print the SBD session result (debug).

Parameters
sessionThe session result.

◆ processNMEA()

bool DevIridium9604::processNMEA ( const char *  sentence,
size_t  length 
)

Process one NMEA sentence: check the checksum, store it and queue it for the callback. Called by the +UUGNMEA URC handler and by pollNMEA().

Parameters
sentenceThe NMEA sentence: $ to the checksum, without the CR LF.
lengthThe sentence length.
Returns
true if the sentence was valid and was processed.

◆ processSBDSessionEvent()

bool DevIridium9604::processSBDSessionEvent ( const char *  event)
protected

Non-blocking SBD session: check an event (line) from bufferedPoll for the session result, ERROR, +CME ERROR or ABORTED.

Parameters
eventThe event.
Returns
true if the event was the session result / final result code.

◆ processURCEvent()

bool DevIridium9604::processURCEvent ( const char *  event)
protected

Pass one event (line) to the registered URC handlers.

Parameters
eventThe event: one line, with the CR LF removed.
Returns
true if a handler decoded the event.

◆ pruneBacklog()

void DevIridium9604::pruneBacklog ( void  )
protected

Remove everything except the URCs from the backlog.

◆ querySocketLastError()

IRIDIUM_9604_error_t DevIridium9604::querySocketLastError ( int  socket,
int *  error 
)

Query the last socket error (AT+USOCTL=socket,1).

Parameters
socketThe socket number.
errorReturns the last error.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ querySocketOutUnackData()

IRIDIUM_9604_error_t DevIridium9604::querySocketOutUnackData ( int  socket,
uint32_t *  total 
)

Query the number of unacknowledged outgoing bytes on a TCP socket (AT+USOCTL=socket,11).

Parameters
socketThe socket number.
totalReturns the number of unacknowledged bytes.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ querySocketRemoteIPAddress()

IRIDIUM_9604_error_t DevIridium9604::querySocketRemoteIPAddress ( int  socket,
sfe_ip_address_t *  address,
int *  port 
)

Query the remote IP address and port of a socket (AT+USOCTL=socket,4).

Parameters
socketThe socket number.
addressReturns the remote IP address.
portReturns the remote port.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ querySocketStatusTCP()

IRIDIUM_9604_error_t DevIridium9604::querySocketStatusTCP ( int  socket,
IRIDIUM_9604_tcp_socket_status_t *  status 
)

Query the status of a TCP socket (AT+USOCTL=socket,10).

Parameters
socketThe socket number.
statusReturns the TCP socket status.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ querySocketTotalBytesReceived()

IRIDIUM_9604_error_t DevIridium9604::querySocketTotalBytesReceived ( int  socket,
uint32_t *  total 
)

Query the total number of bytes received on a socket (AT+USOCTL=socket,3).

Parameters
socketThe socket number.
totalReturns the total number of bytes received.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ querySocketTotalBytesSent()

IRIDIUM_9604_error_t DevIridium9604::querySocketTotalBytesSent ( int  socket,
uint32_t *  total 
)

Query the total number of bytes sent on a socket (AT+USOCTL=socket,2).

Parameters
socketThe socket number.
totalReturns the total number of bytes sent.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ querySocketType()

IRIDIUM_9604_error_t DevIridium9604::querySocketType ( int  socket,
IRIDIUM_9604_socket_protocol_t *  protocol 
)

Query the socket type: TCP or UDP (AT+USOCTL=socket,0).

Parameters
socketThe socket number.
protocolReturns the socket protocol.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ readAvailable()

int DevIridium9604::readAvailable ( char *  inString)
protected

Read all the available serial data into inString.

Parameters
inStringWhere to store the data.
Returns
The number of bytes read.

◆ readChar()

char DevIridium9604::readChar ( void  )
protected

Read one character from the module.

Returns
The character.

◆ readMQTT()

IRIDIUM_9604_error_t DevIridium9604::readMQTT ( int *  pQos,
sfe_string_t *  pTopic,
uint8_t *  readDest,
int  readLength,
int *  bytesRead 
)

Read an MQTT message which has been received on a subscribed topic (AT+UMQTTC=6).

Parameters
pQosReturns the QoS.
pTopicReturns the topic.
readDestWhere to store the message.
readLengthThe size of readDest.
bytesReadReturns the number of bytes read.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ readSBDData()

IRIDIUM_9604_error_t DevIridium9604::readSBDData ( uint8_t *  data,
size_t  maxLength,
size_t *  length 
)

Read the mobile terminated buffer (AT+SBDR). The library HEX-decodes the data.

Parameters
dataWhere to store the data.
maxLengthThe size of the buffer.
lengthReturns the number of bytes read.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ readSBDText()

IRIDIUM_9604_error_t DevIridium9604::readSBDText ( char *  text,
size_t  maxLength 
)

Read the mobile terminated buffer (AT+SBDR) as NULL-terminated text.

Parameters
textWhere to store the text.
maxLengthThe size of text, including the NULL.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ readSMSmessage()

IRIDIUM_9604_error_t DevIridium9604::readSMSmessage ( int  location,
sfe_string_t *  unread,
sfe_string_t *  from,
sfe_string_t *  dateTime,
sfe_string_t *  message 
)

Read an SMS message (AT+CMGR). Reading an empty location returns IRIDIUM_9604_ERROR_UNEXPECTED_RESPONSE.

Parameters
locationThe memory location.
unreadReturns the status: "REC UNREAD", "REC READ", "STO UNSENT" or "STO SENT".
fromReturns the originator.
dateTimeReturns the date and time.
messageReturns the message text.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ registerOperator()

IRIDIUM_9604_error_t DevIridium9604::registerOperator ( struct operator_stats  oper)

Manually register with a network operator (AT+COPS=1).

Parameters
operThe operator - from getOperators().
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ registration()

IRIDIUM_9604_registration_status_t DevIridium9604::registration ( bool  eps = true)

Read the network registration status (AT+CEREG? or AT+CREG?).

Parameters
epstrue to read the EPS registration status (+CEREG); false to read +CREG.
Returns
The registration status. IRIDIUM_9604_REGISTRATION_INVALID on failure.

◆ reset()

IRIDIUM_9604_error_t DevIridium9604::reset ( void  )

Reset the module (AT+CFUN=16) and wait for it to restart. Bounded by IRIDIUM_9604_RESET_TIMEOUT.

The module is set to minimum functionality (AT+CFUN=0) first: in the satellite RAT, the 9604 refuses AT+CFUN=16 ("+CME ERROR: operation not supported") unless it is in minimum functionality. init() is called after the reset.

Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ resetHTTPprofile()

IRIDIUM_9604_error_t DevIridium9604::resetHTTPprofile ( int  profile)

Reset an HTTP profile (AT+UHTTP=profile). The HTTP profile parameters are not saved in the non volatile memory.

Parameters
profileThe profile number.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ resetSecurityProfile()

IRIDIUM_9604_error_t DevIridium9604::resetSecurityProfile ( int  secprofile)

Reset a security profile (AT+USECPRF=profile).

Note
+USECPRF is referenced, but has no section of its own, in the Iridium 9604 AT commands manual.
Parameters
secprofileThe security profile. -1 = default.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ rssi()

int8_t DevIridium9604::rssi ( void  )

Read the received signal strength (AT+CSQ). Cellular (LTE-M) only.

For the satellite signal quality, see setIndicatorEventReporting() and getSatelliteSignalQuality().

Returns
The RSSI (0-31, or 99 if unknown), or -1 on failure.

◆ satelliteRFScan()

IRIDIUM_9604_error_t DevIridium9604::satelliteRFScan ( int16_t *  results,
int *  numResults,
unsigned long  timeout = IRIDIUM_9604_3_MIN_TIMEOUT 
)

Perform a satellite RF scan (AT+RFSCAN): the RSSI of all 252 channels. From the Iridium 9604 Additional Commands (Beta).

Warning
This enters a test mode. The module must be rebooted (e.g. reset()) to enter normal operation again.
Parameters
resultsReturns the RSSI results in 1/10th dBm. Must hold IRIDIUM_9604_RFSCAN_NUM_CHANNELS (252) values.
numResultsReturns the number of values read.
timeoutThe AT command timeout (ms).
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ sbdDetach()

IRIDIUM_9604_error_t DevIridium9604::sbdDetach ( int *  error = nullptr)

Detach from the SBD gateway (AT+SBDDET).

Parameters
errorReturns the +SBDDET error code: 0 or negative - see getSBDErrorString() (optional).
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ sbdSession()

IRIDIUM_9604_error_t DevIridium9604::sbdSession ( IRIDIUM_9604_sbd_session_t *  result)

Initiate an SBD session (AT+SBDI). No ring alert support. Always detaches.

Parameters
resultReturns the session result.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ sbdSessionExtended()

IRIDIUM_9604_error_t DevIridium9604::sbdSessionExtended ( IRIDIUM_9604_sbd_session_t *  result,
bool  answeringRingAlert = false,
const char *  location = nullptr 
)

Initiate an extended SBD session (AT+SBDIX, or AT+SBDIXA when answering a ring alert). This also registers for ring alerts.

Parameters
resultReturns the session result.
answeringRingAlerttrue to use +SBDIXA - when the session is in response to a ring alert.
locationOptional location "[+|-]DDMM.MMM,[+|-]dddmm.mmm" (the Iridium 9602/9603 format - not documented for the 9604). nullptr omits it.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ sbdSessionInternal()

IRIDIUM_9604_error_t DevIridium9604::sbdSessionInternal ( const char *  command,
const char *  responseTag,
IRIDIUM_9604_sbd_session_t *  result 
)
protected

Send an SBD session command (+SBDI / +SBDIX / +SBDIXA) and parse the result.

Parameters
commandThe AT command, without the "AT".
responseTagThe response prefix, e.g. "+SBDIX:".
resultReturns the session result.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ sendCommand()

void DevIridium9604::sendCommand ( const char *  command,
bool  at 
)
protected

Send an AT command. Processes any waiting serial data (URCs) into the backlog first.

Parameters
commandThe AT command, without the "AT".
attrue to prefix the command with "AT".

◆ sendCommandWithResponse()

IRIDIUM_9604_error_t DevIridium9604::sendCommandWithResponse ( const char *  command,
const char *  expectedResponse,
char *  responseDest,
unsigned long  commandTimeout,
int  destSize = minimumResponseAllocation,
bool  at = true 
)
protected

Send an AT command and wait for the expected response. Any other data (URCs) is added to the backlog.

Parameters
commandThe AT command, without the "AT".
expectedResponseThe expected response.
responseDestWhere to store the response. Must be large enough.
commandTimeoutThe timeout (ms).
destSizeThe size of responseDest. 0 = minimumResponseAllocation.
attrue to prefix the command with "AT".
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ sendCustomCommandWithResponse()

IRIDIUM_9604_error_t DevIridium9604::sendCustomCommandWithResponse ( const char *  command,
const char *  expectedResponse,
char *  responseDest,
unsigned long  commandTimeout = IRIDIUM_9604_STANDARD_RESPONSE_TIMEOUT,
bool  at = true 
)

Send a custom AT command and wait for the expected response.

Parameters
commandThe AT command, without the "AT".
expectedResponseThe expected response.
responseDestWhere to store the response. Must be large enough.
commandTimeoutThe timeout (ms).
attrue to prefix the command with "AT".
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ sendHTTPGET()

IRIDIUM_9604_error_t DevIridium9604::sendHTTPGET ( int  profile,
sfe_string_t  path,
sfe_string_t  responseFilename 
)

Send an HTTP GET request (AT+UHTTPC=profile,1). The response is written to a file in the module's file system. The result is delivered by the +UUHTTPCR URC: see setHTTPCommandCallback().

Parameters
profileThe profile number.
pathThe path, e.g. "/update".
responseFilenameThe file (in the module's file system) the response will be written to.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ sendHTTPPOSTdata()

IRIDIUM_9604_error_t DevIridium9604::sendHTTPPOSTdata ( int  profile,
sfe_string_t  path,
sfe_string_t  responseFilename,
sfe_string_t  data,
IRIDIUM_9604_http_content_types_t  httpContentType 
)

Send an HTTP POST request with data (AT+UHTTPC=profile,5). The response is written to a file in the module's file system. The result is delivered by the +UUHTTPCR URC.

Parameters
profileThe profile number.
pathThe path, e.g. "/update".
responseFilenameThe file (in the module's file system) the response will be written to.
dataThe data.
httpContentTypeThe content type.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ sendHTTPPOSTfile()

IRIDIUM_9604_error_t DevIridium9604::sendHTTPPOSTfile ( int  profile,
sfe_string_t  path,
sfe_string_t  responseFilename,
sfe_string_t  requestFile,
IRIDIUM_9604_http_content_types_t  httpContentType 
)

Send an HTTP POST request with the contents of a file (AT+UHTTPC=profile,4). The response is written to a file in the module's file system. The result is delivered by the +UUHTTPCR URC.

Parameters
profileThe profile number.
pathThe path, e.g. "/update".
responseFilenameThe file (in the module's file system) the response will be written to.
requestFileThe file (in the module's file system) containing the data to POST.
httpContentTypeThe content type.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ sendReceiveSBD()

IRIDIUM_9604_error_t DevIridium9604::sendReceiveSBD ( const uint8_t *  txData,
size_t  txLength,
bool  txIsText,
uint8_t *  rxBuffer,
size_t *  rxLength 
)
protected

The common code for the high-level SBD send / receive methods.

Parameters
txDataThe data to send. nullptr = send nothing.
txLengthThe number of bytes to send.
txIsTexttrue if txData is text.
rxBufferWhere to store the received MT message. nullptr = do not read the MT message.
rxLengthIn: the size of rxBuffer. Out: the number of bytes received (0 if none).
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ sendReceiveSBDBinary()

IRIDIUM_9604_error_t DevIridium9604::sendReceiveSBDBinary ( const uint8_t *  txData,
size_t  txLength,
uint8_t *  rxBuffer,
size_t *  rxLength 
)

Send a binary message (or nothing) and receive any waiting MT message using SBD: write the MO buffer (+SBDW), start an extended SBD session (+SBDIX), check the result and read the MT message (+SBDR). Sending messages uses credits!

Parameters
txDataThe data to send. nullptr = send nothing.
txLengthThe number of bytes to send.
rxBufferWhere to store the received MT message. nullptr = do not read the MT message.
rxLengthIn: the size of rxBuffer. Out: the number of bytes received (0 if none).
Returns
IRIDIUM_9604_SUCCESS on success. IRIDIUM_9604_ERROR_SBD_SESSION_FAILED if the session failed. IRIDIUM_9604_ERROR_SBD_RX_OVERFLOW if the MT message did not fit in rxBuffer.

◆ sendReceiveSBDText()

IRIDIUM_9604_error_t DevIridium9604::sendReceiveSBDText ( const char *  message,
uint8_t *  rxBuffer,
size_t *  rxLength 
)

Send a text message (or nothing) and receive any waiting MT message using SBD: write the MO buffer (+SBDW), start an extended SBD session (+SBDIX), check the result and read the MT message (+SBDR). Sending messages uses credits!

Parameters
messageThe NULL-terminated message text, or nullptr to send nothing (a mailbox check).
rxBufferWhere to store the received MT message. nullptr = do not read the MT message.
rxLengthIn: the size of rxBuffer. Out: the number of bytes received (0 if none).
Returns
IRIDIUM_9604_SUCCESS on success. IRIDIUM_9604_ERROR_SBD_SESSION_FAILED if the session failed. IRIDIUM_9604_ERROR_SBD_RX_OVERFLOW if the MT message did not fit in rxBuffer.

◆ sendSBDBinary()

IRIDIUM_9604_error_t DevIridium9604::sendSBDBinary ( const uint8_t *  txData,
size_t  txLength 
)

Send a binary message using SBD: write the MO buffer (+SBDW), start an extended SBD session (+SBDIX) and check the result. Sending messages uses credits!

Parameters
txDataThe data to send. nullptr = send nothing.
txLengthThe number of bytes to send.
Returns
IRIDIUM_9604_SUCCESS on success. IRIDIUM_9604_ERROR_SBD_SESSION_FAILED if the session failed: see getLastSBDSession().moStatus and getSBDErrorString().

◆ sendSBDText()

IRIDIUM_9604_error_t DevIridium9604::sendSBDText ( const char *  message)

Send a text message using SBD: write the MO buffer (+SBDW), start an extended SBD session (+SBDIX) and check the result. Similar to the SparkFun IridiumSBD library. Sending messages uses credits!

Parameters
messageThe NULL-terminated message text. Maximum 340 bytes.
Returns
IRIDIUM_9604_SUCCESS on success. IRIDIUM_9604_ERROR_SBD_SESSION_FAILED if the session failed: see getLastSBDSession().moStatus and getSBDErrorString().

◆ sendSMS()

IRIDIUM_9604_error_t DevIridium9604::sendSMS ( sfe_string_t  number,
sfe_string_t  message 
)

Send an SMS message (AT+CMGS).

Parameters
numberThe destination phone number.
messageThe message text.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ sendUBX()

IRIDIUM_9604_error_t DevIridium9604::sendUBX ( const char *  ubxHex,
char *  responseHex = nullptr,
size_t  responseHexSize = 0,
unsigned long  timeout = IRIDIUM_9604_10_SEC_TIMEOUT + 1000 
)

Send a UBX message to the GNSS, as a hex string, and return its response (AT+UGUBX).

The GNSS must be on. The module calculates the checksum, so the last two bytes can be anything. Spaces are allowed. A poll returns the requested message; a configuration message returns UBX-ACK-ACK or -NAK; an input message returns nothing ("no message"). If the GNSS returns more than one message, only the first is returned. The length of ubxHex is limited by the AT command line length.

Parameters
ubxHexThe UBX message in hex: e.g. "B5620A0400000E34" (poll UBX-MON-VER).
responseHexIf not nullptr, returns the response message in hex (spaces removed). Empty if there is no response.
responseHexSizeThe size of responseHex (including the NULL).
timeoutThe timeout (ms). The module times out after 10 s.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ sendUBXmessage()

IRIDIUM_9604_error_t DevIridium9604::sendUBXmessage ( uint8_t  msgClass,
uint8_t  msgId,
const uint8_t *  payload,
uint16_t  payloadLen,
uint8_t *  response = nullptr,
size_t  responseSize = 0,
size_t *  responseLen = nullptr,
unsigned long  timeout = IRIDIUM_9604_10_SEC_TIMEOUT + 1000 
)

Send a UBX message to the GNSS and return its response, as bytes (AT+UGUBX). See sendUBX().

Parameters
msgClassThe UBX message class: e.g. 0x0A (MON).
msgIdThe UBX message ID: e.g. 0x04 (VER).
payloadThe payload. nullptr if payloadLen is 0 (e.g. for a poll).
payloadLenThe payload length.
responseIf not nullptr, returns the complete response message: 0xB5 0x62, class, ID, length (2 bytes, little-endian), payload, checksum (2 bytes).
responseSizeThe size of response.
responseLenIf not nullptr, returns the number of bytes stored in response. 0 if there is no response.
timeoutThe timeout (ms).
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ setAllNMEAoutput()

IRIDIUM_9604_error_t DevIridium9604::setAllNMEAoutput ( uint8_t  rate = 1,
uint8_t  output = IRIDIUM_9604_NMEA_OUTPUT_URC 
)

Configure the output of all 13 NMEA messages (AT+UGNMEA). Returns the first error, but tries every message.

Parameters
rateThe output rate: every rate seconds. 0 = disabled. Default: 1.
outputThe output: IRIDIUM_9604_NMEA_OUTPUT_DISABLED (0), IRIDIUM_9604_NMEA_OUTPUT_MEMORY (1) or IRIDIUM_9604_NMEA_OUTPUT_URC (2).
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ setAPN()

IRIDIUM_9604_error_t DevIridium9604::setAPN ( sfe_string_t  apn,
uint8_t  cid = 1,
IRIDIUM_9604_pdp_type  pdpType = PDP_TYPE_IP 
)

Set the Access Point Name for a PDP context (AT+CGDCONT).

Parameters
apnThe Access Point Name.
cidThe PDP context identifier.
pdpTypeThe PDP type.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ setBaud()

IRIDIUM_9604_error_t DevIridium9604::setBaud ( unsigned long  baud)

Change the module's baud rate (AT+IPR). The library changes its own baud rate to match.

Parameters
baudThe new baud rate.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ setClock() [1/2]

IRIDIUM_9604_error_t DevIridium9604::setClock ( sfe_string_t  theTime)

Set the module's real time clock (AT+CCLK).

Parameters
theTimeThe time: "yy/MM/dd,hh:mm:ss+TZ".
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ setClock() [2/2]

IRIDIUM_9604_error_t DevIridium9604::setClock ( uint8_t  y,
uint8_t  mo,
uint8_t  d,
uint8_t  h,
uint8_t  min,
uint8_t  s,
int8_t  tz 
)

Set the module's real time clock (AT+CCLK) from separate values.

Parameters
yThe year (two digits: years since 2000).
moThe month (1-12).
dThe day of the month (1-31).
hThe hour (0-23).
minThe minute (0-59).
sThe second (0-59).
tzThe time zone, in quarters of an hour. E.g. -28 is 7 hours behind UTC.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ setClockFromGNSS()

IRIDIUM_9604_error_t DevIridium9604::setClockFromGNSS ( void  )

Set the module clock (+CCLK) from the GNSS UTC time (AT+UGTMR).

In the satellite RAT, nothing else sets the module clock: the cellular network time (NITZ) is not available. The GNSS must be on and must have a valid time. Set the time zone first with setGNSSTimeZone() if required.

Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ setCommunicationBus()

void DevIridium9604::setCommunicationBus ( SparkFun_Iridium_9604::IridiumDeviceBus &  theBus)

Set the communication bus. Called by the begin() methods of SFE_IRIDIUM_9604. Call it yourself to use your own IridiumDeviceBus.

Parameters
theBusThe bus object to use - e.g. an SfeSerial.

◆ setEpsRegistrationCallback()

IRIDIUM_9604_error_t DevIridium9604::setEpsRegistrationCallback ( void(*)(IRIDIUM_9604_registration_status_t status, unsigned int tac, unsigned int ci, int Act)  epsRegistrationCallback)

Set the callback for the EPS network registration status URC (+CEREG) and enable the URC (AT+CEREG=2).

Parameters
epsRegistrationCallbackThe callback: status, tracking area code, cell ID, access technology.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ setErrorReporting()

IRIDIUM_9604_error_t DevIridium9604::setErrorReporting ( uint8_t  mode = 2)

Configure how the module reports errors (AT+CMEE).

begin() selects verbose error reporting (AT+CMEE=2), so a failed command returns (e.g.) "+CME ERROR: Wrong RAT" instead of "ERROR". The library treats "+CME ERROR: <err>" and "+CMS ERROR: <err>" as errors and saves the reason: see getLastErrorText().

Parameters
mode0: plain ERROR; 1: +CME ERROR: <numeric error code>; 2: +CME ERROR: <verbose error text>.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ setFlowControl()

Enable or disable RTS/CTS hardware flow control (AT&K).

Parameters
valueIRIDIUM_9604_ENABLE_FLOW_CONTROL or IRIDIUM_9604_DISABLE_FLOW_CONTROL.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ setFTPCommandCallback()

void DevIridium9604::setFTPCommandCallback ( void(*)(int command, int result)  ftpCommandRequestCallback)

Set the callback for the FTP command result URC (+UUFTPCR).

Parameters
ftpCommandRequestCallbackThe callback: command, result (1 = success).

◆ setFTPcredentials()

IRIDIUM_9604_error_t DevIridium9604::setFTPcredentials ( const sfe_string_t &  userName,
const sfe_string_t &  pwd 
)

Set the FTP user name and password (AT+UFTP=2,3).

Parameters
userNameThe user name.
pwdThe password.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ setFTPserver()

IRIDIUM_9604_error_t DevIridium9604::setFTPserver ( const sfe_string_t &  serverName)

Set the FTP server name (AT+UFTP=1).

Parameters
serverNameThe server name.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ setFTPtimeouts()

IRIDIUM_9604_error_t DevIridium9604::setFTPtimeouts ( const unsigned int  timeout,
const unsigned int  cmd_linger,
const unsigned int  data_linger 
)

Set the FTP inactivity timeout and the command and data linger times (AT+UFTP).

Parameters
timeoutThe inactivity timeout (s).
cmd_lingerThe command linger time (s).
data_lingerThe data linger time (s).
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ setGNSSAidingCallback()

void DevIridium9604::setGNSSAidingCallback ( void(*)(int aidMode, int result)  gnssAidingCallback)

Set the callback for the assisted GNSS indication URC (+UUGIND). Enable the URC with setGNSSAidingIndication(true).

Parameters
gnssAidingCallbackThe callback: aidMode, result. aidMode 0: result is the activated GNSS systems (IRIDIUM_9604_gnss_system_t values added together). Otherwise aidMode is the aiding mode (1 = local aiding, 2 = AssistNow Offline, 4 = AssistNow Online, 8 = AssistNow Autonomous) and result is the result of the aiding operation: 0 = no error. (1 = wrong URL; 2 = HTTP error; 3 to 7 = socket / connection / DNS errors; 8 = file system error; 9 = generic error; 10 = no answer from GNSS; 16 = authentication token missing. See the 9604 AT commands manual, +UGIND.)

◆ setGNSSAidingIndication()

IRIDIUM_9604_error_t DevIridium9604::setGNSSAidingIndication ( bool  enable = true)

Enable or disable the assisted GNSS indication URC (AT+UGIND). See setGNSSAidingCallback().

Parameters
enabletrue to enable the +UUGIND URC.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ setGNSSTimeZone()

IRIDIUM_9604_error_t DevIridium9604::setGNSSTimeZone ( int  timeZone)

Set the time zone used when the module clock is set from the GNSS (AT+UGTMR=<time_zone>).

Parameters
timeZoneThe time zone in quarter hours (as +CCLK): -96 to 96. The factory-programmed value is 0 (UTC).
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ setGpioMode()

IRIDIUM_9604_error_t DevIridium9604::setGpioMode ( IRIDIUM_9604_gpio_t  gpio,
IRIDIUM_9604_gpio_mode_t  mode,
int  value = 0 
)

Set the mode of a GPIO pin (AT+UGPIOC).

Parameters
gpioThe GPIO pin.
modeThe mode.
valueThe output value (GPIO_OUTPUT mode only).
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ setGpsReadCallback()

void DevIridium9604::setGpsReadCallback ( void(*)(ClockData time, PositionData gps, SpeedData spd, unsigned long uncertainty)  gpsRequestCallback)

Set the callback for the +UULOC location URC (see gpsRequest()).

Note
This command is not documented in the Iridium 9604 AT commands manual. It is retained from the SARA-R5 library.
Parameters
gpsRequestCallbackThe callback: time, position, speed, uncertainty.

◆ setHTTPauthentication()

IRIDIUM_9604_error_t DevIridium9604::setHTTPauthentication ( int  profile,
bool  authenticate 
)

Enable or disable HTTP authentication (AT+UHTTP=profile,4).

Parameters
profileThe profile number.
authenticatetrue to enable authentication.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ setHTTPCommandCallback()

void DevIridium9604::setHTTPCommandCallback ( void(*)(int profile, int command, int result)  httpCommandRequestCallback)

Set the callback for the HTTP command result URC (+UUHTTPCR).

Parameters
httpCommandRequestCallbackThe callback: profile, command, result (1 = success).

◆ setHTTPcustomHeader()

IRIDIUM_9604_error_t DevIridium9604::setHTTPcustomHeader ( int  profile,
sfe_string_t  header 
)

Set an HTTP custom request header (AT+UHTTP=profile,9). Format: "0:Content-Type:application/json".

Parameters
profileThe profile number.
headerThe custom header.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ setHTTPpassword()

IRIDIUM_9604_error_t DevIridium9604::setHTTPpassword ( int  profile,
sfe_string_t  password 
)

Set the HTTP password (AT+UHTTP=profile,3).

Parameters
profileThe profile number.
passwordThe password.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ setHTTPsecure()

IRIDIUM_9604_error_t DevIridium9604::setHTTPsecure ( int  profile,
bool  secure,
int  secprofile = -1 
)

Enable or disable HTTPS (AT+UHTTP=profile,6). Default: disabled (HTTP on port 80).

Parameters
profileThe profile number.
securetrue to enable SSL/TLS.
secprofileThe security profile. -1 = default.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ setHTTPserverIPaddress()

IRIDIUM_9604_error_t DevIridium9604::setHTTPserverIPaddress ( int  profile,
sfe_ip_address_t  address 
)

Set the HTTP server IP address (AT+UHTTP=profile,0).

Parameters
profileThe profile number.
addressThe server IP address.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ setHTTPserverName()

IRIDIUM_9604_error_t DevIridium9604::setHTTPserverName ( int  profile,
sfe_string_t  server 
)

Set the HTTP server name (AT+UHTTP=profile,1).

Parameters
profileThe profile number.
serverThe server name.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ setHTTPserverPort()

IRIDIUM_9604_error_t DevIridium9604::setHTTPserverPort ( int  profile,
int  port 
)

Set the HTTP server port (AT+UHTTP=profile,5). Default: 80.

Parameters
profileThe profile number.
portThe port.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ setHTTPusername()

IRIDIUM_9604_error_t DevIridium9604::setHTTPusername ( int  profile,
sfe_string_t  username 
)

Set the HTTP user name (AT+UHTTP=profile,2).

Parameters
profileThe profile number.
usernameThe user name.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ setIndicatorEventReporting()

IRIDIUM_9604_error_t DevIridium9604::setIndicatorEventReporting ( IRIDIUM_9604_cier_mode_t  mode = IRIDIUM_9604_CIER_MODE_ENABLE,
bool  signalQuality = true,
bool  serviceAvailability = true,
bool  svBeamCoordinates = false 
)

Configure the indicator event reporting (AT+CIER): the +CIEV signal quality, service availability and SV / beam coordinate URCs.

Parameters
modeIRIDIUM_9604_CIER_MODE_ENABLE to enable the +CIEV URCs.
signalQualityEnable the signal quality indication (+CIEV:0).
serviceAvailabilityEnable the service availability indication (+CIEV:1).
svBeamCoordinatesEnable the SV and beam coordinates indication (+CIEV:3).
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ setMNOprofile()

IRIDIUM_9604_error_t DevIridium9604::setMNOprofile ( mobile_network_operator_t  mno,
bool  autoReset = false,
bool  urcNotification = false 
)
protected

Set the Mobile Network Operator profile (AT+UMNOPROF).

Parameters
mnoThe Mobile Network Operator profile.
autoResettrue to reset the module after changing the profile.
urcNotificationtrue to enable the +UMNOPROF URC.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ setMQTTclientId()

IRIDIUM_9604_error_t DevIridium9604::setMQTTclientId ( const sfe_string_t &  clientId)

Set the MQTT client ID (AT+UMQTT=0).

Parameters
clientIdThe client ID.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ setMQTTCommandCallback()

void DevIridium9604::setMQTTCommandCallback ( void(*)(int command, int result)  mqttCommandRequestCallback)

Set the callback for the MQTT command result URC (+UUMQTTC).

Parameters
mqttCommandRequestCallbackThe callback: command, result (1 = success).

◆ setMQTTcredentials()

IRIDIUM_9604_error_t DevIridium9604::setMQTTcredentials ( const sfe_string_t &  userName,
const sfe_string_t &  pwd 
)

Set the MQTT user name and password (AT+UMQTT=4).

Parameters
userNameThe user name.
pwdThe password.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ setMQTTsecure()

IRIDIUM_9604_error_t DevIridium9604::setMQTTsecure ( bool  secure,
int  secprofile = -1 
)

Enable or disable MQTT over TLS (AT+UMQTT=11).

Parameters
securetrue to enable SSL/TLS.
secprofileThe security profile. -1 = default.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ setMQTTserver()

IRIDIUM_9604_error_t DevIridium9604::setMQTTserver ( const sfe_string_t &  serverName,
int  port 
)

Set the MQTT broker name and port (AT+UMQTT=2).

Parameters
serverNameThe server name.
portThe port.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ setNetworkProfile()

bool DevIridium9604::setNetworkProfile ( mobile_network_operator_t  mno,
bool  autoReset = false,
bool  urcNotification = false 
)

Set the Mobile Network Operator (MNO) profile (AT+UMNOPROF). Checks the current profile first and only changes it if required.

Parameters
mnoThe Mobile Network Operator profile, e.g. MNO_GLOBAL.
autoResettrue to reset the module after changing the profile.
urcNotificationtrue to enable the +UMNOPROF URC.
Returns
true on success.

◆ setNmeaCallbackPtr()

bool DevIridium9604::setNmeaCallbackPtr ( const char *  msgId,
void(*)(nmeaCallbackDataCommon_t *)  callbackPointerPtr 
)

Register (or clear, with nullptr) the callback for an NMEA message. The callback is called by checkCallbacks() / bufferedPoll() when the message arrives.

Parameters
msgIdThe NMEA message ID, e.g. "RMC". (Without the talker ID.)
callbackPointerPtrThe callback. nullptr clears the callback.
Returns
true on success; false if msgId is not supported.

◆ setNMEAoutput()

IRIDIUM_9604_error_t DevIridium9604::setNMEAoutput ( const char *  msgId,
uint8_t  rate = 1,
uint8_t  output = IRIDIUM_9604_NMEA_OUTPUT_URC 
)

Configure the output of one NMEA message (AT+UGNMEA). New for the 9604.

Output IRIDIUM_9604_NMEA_OUTPUT_URC (2) sends the message as a +UUGNMEA URC. Output IRIDIUM_9604_NMEA_OUTPUT_MEMORY (1) stores it in the module memory, for polling with pollNMEA() / getNMEA().

Parameters
msgIdThe NMEA message ID, e.g. "RMC". (Without the talker ID.)
rateThe output rate: every rate seconds. 0 = disabled. Default: 1.
outputThe output: IRIDIUM_9604_NMEA_OUTPUT_DISABLED (0), IRIDIUM_9604_NMEA_OUTPUT_MEMORY (1) or IRIDIUM_9604_NMEA_OUTPUT_URC (2).
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ setPingCallback()

void DevIridium9604::setPingCallback ( void(*)(int retry, int p_size, sfe_string_t remote_hostname, sfe_ip_address_t ip, int ttl, long rtt)  pingRequestCallback)

Set the callback for the ping result URC (+UUPING). See ping().

Parameters
pingRequestCallbackThe callback: retry number, ping size, remote host name, remote IP address, time to live, round trip time (ms).

◆ setPowerOnPinWriteCallback()

void DevIridium9604::setPowerOnPinWriteCallback ( IRIDIUM_9604_pin_write_callback_t  callback)
inline

Set a callback to write the 9604 PWR_ON pin - in place of the GPIO pin passed to the constructor.

Use this if PWR_ON is not driven by a GPIO pin. E.g. on the SparkFun RockBLOCK 9604 Shield, PWR_ON is driven through a TCA9555 I2C port expander: driving the expander pin high pulls PWR_ON low (through a FET on the RockBLOCK). powerOn, powerOff, modulePowerOn and hwEmergencyShutdown call the callback. The powerPin passed to the constructor can be -1. invertPowerPin is ignored.

Parameters
callbackThe callback: void callback(bool state). state is the level the PWR_ON pin should see: false = pull PWR_ON low (asserted); true = release PWR_ON (high, via the module's internal pull-up). nullptr to use the GPIO pin again.

◆ setRAT()

IRIDIUM_9604_error_t DevIridium9604::setRAT ( IRIDIUM_9604_rat_t  rat,
bool  autoReboot = true 
)

Select the Radio Access Technology (AT+URAT): LTE Cat M1 or satellite. New for the 9604.

The 9604 supports one RAT at a time. To change the RAT, the module must be in minimum functionality and must be rebooted for the change to take effect. If autoReboot is true, setRAT does this for you (AT+CFUN=0, AT+URAT, AT+CFUN=16). setRAT does nothing if the RAT is already selected.

Parameters
ratThe radio access technology: IRIDIUM_9604_RAT_LTE_CAT_M1 or IRIDIUM_9604_RAT_SATELLITE.
autoReboottrue to change to minimum functionality before, and to reboot after, changing the RAT.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ setRegistrationCallback()

IRIDIUM_9604_error_t DevIridium9604::setRegistrationCallback ( void(*)(IRIDIUM_9604_registration_status_t status, unsigned int lac, unsigned int ci, int Act)  registrationCallback)

Set the callback for the network registration status URC (+CREG) and enable the URC (AT+CREG=2).

Parameters
registrationCallbackThe callback: status, location area code, cell ID, access technology.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ setResetPinWriteCallback()

void DevIridium9604::setResetPinWriteCallback ( IRIDIUM_9604_pin_write_callback_t  callback)
inline

Set a callback to write the 9604 RESET_N pin - in place of the GPIO pin passed to the constructor.

Use this if RESET_N is not driven by a GPIO pin. E.g. on the SparkFun RockBLOCK 9604 Shield, RESET_N is driven through a TCA9555 I2C port expander: driving the expander pin high pulls RESET_N low (through a FET on the Shield and the TPS3808 supervisor on the RockBLOCK). hwReset calls the callback. The resetPin passed to the constructor can be -1.

Parameters
callbackThe callback: void callback(bool state). state is the level the RESET_N pin should see: false = pull RESET_N low (asserted); true = release RESET_N (high, via the module's internal pull-up). nullptr to use the GPIO pin again.

◆ setSatelliteServiceAvailabilityCallback()

void DevIridium9604::setSatelliteServiceAvailabilityCallback ( void(*)(bool serviceAvailable)  serviceAvailabilityCallback)

Set the callback for the +CIEV service availability indication.

Parameters
serviceAvailabilityCallbackThe callback: true if the service is available.

◆ setSatelliteSignalQualityCallback()

void DevIridium9604::setSatelliteSignalQualityCallback ( void(*)(int signalQuality)  signalQualityCallback)

Set the callback for the +CIEV signal quality indication.

Parameters
signalQualityCallbackThe callback: the signal quality (0-5).

◆ setSatelliteSVBeamCallback()

void DevIridium9604::setSatelliteSVBeamCallback ( void(*)(IRIDIUM_9604_sv_beam_coords_t coords)  svBeamCallback)

Set the callback for the +CIEV SV and beam coordinates indication. Enable it with setIndicatorEventReporting(IRIDIUM_9604_CIER_MODE_ENABLE, false, false, true).

Parameters
svBeamCallbackThe callback: the SV and beam coordinates.

◆ setSBDATTimeout()

void DevIridium9604::setSBDATTimeout ( unsigned long  timeout_ms)
inline

Set the AT command timeout used for SBD sessions (+SBDI, +SBDIX, +SBDDET). Default: 5 minutes. Use setSBDSessionTimeout() to set the module's own session timeout - which should be shorter than this.

Parameters
timeout_msThe timeout (ms).

◆ setSBDAutoRegistration()

IRIDIUM_9604_error_t DevIridium9604::setSBDAutoRegistration ( IRIDIUM_9604_sbdareg_mode_t  mode)

Set the SBD automatic registration mode (AT+SBDAREG).

Parameters
modeThe automatic registration mode.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ setSBDAutoRegistrationCallback()

void DevIridium9604::setSBDAutoRegistrationCallback ( void(*)(IRIDIUM_9604_areg_event_t event, int regError)  autoRegistrationCallback)

Set the callback for the +AREG automatic registration URC.

Parameters
autoRegistrationCallbackThe callback: the +AREG event and the registration error code (see getSBDErrorString()).

◆ setSBDCallback()

void DevIridium9604::setSBDCallback ( IRIDIUM_9604_sbd_callback_t  sbdCallback)
inline

Set the SBD session callback - and make the SBD sessions non-blocking.

Without a callback (the default), the SBD session methods (sendSBDText, sendSBDBinary, sendReceiveSBDText, sendReceiveSBDBinary, sbdSession, sbdSessionExtended) are blocking: they return when the session is complete, which can take several minutes.

With a callback, they are non-blocking: they write the MO buffer (+SBDW), send the session command (AT+SBDIX) and return IRIDIUM_9604_SUCCESS straight away. Call bufferedPoll() regularly (e.g. in loop()). bufferedPoll() watches for the +SBDIX response and calls the callback when the session is complete. The callback is called from bufferedPoll() - after the URCs have been processed - so it can call other library methods (e.g. readSBDData, clearSBDBuffers), or start the next session.

While the session is in progress, the module cannot accept AT commands: the other library methods return IRIDIUM_9604_ERROR_SBD_BUSY. Use isSBDSessionInProgress() to check if a session is in progress, and getLastSBDSessionStatus() / getLastSBDSession() for the result of the most recent session. cancelSBDSession() cancels the session. The session is timed out after getSBDATTimeout() (default 5 minutes).

sendReceiveSBDText / sendReceiveSBDBinary: if a message was received (MT status 1), it is read (+SBDR) into rxBuffer before the callback is called, and *rxLength is updated. rxBuffer and rxLength must stay valid until the callback is called (e.g. make them global or static).

Parameters
sbdCallbackThe callback, or nullptr to make the SBD sessions blocking again. status: IRIDIUM_9604_SUCCESS; IRIDIUM_9604_ERROR_SBD_SESSION_FAILED (see session->moStatus and getSBDErrorString()); IRIDIUM_9604_ERROR_SBD_RX_OVERFLOW; IRIDIUM_9604_ERROR_ERROR (ERROR / +CME ERROR - see getLastErrorText()); IRIDIUM_9604_ERROR_TIMEOUT; IRIDIUM_9604_ERROR_SBD_CANCELLED. session: the +SBDIX result (all six fields), or nullptr if no result was received.

◆ setSBDDeliveryShortCode()

IRIDIUM_9604_error_t DevIridium9604::setSBDDeliveryShortCode ( uint8_t  dsc)

Set the SBD delivery short code (AT+SBDDSC). See IRIDIUM_9604_SBDDSC_HOLD_MT_DELIVERY etc.

Parameters
dscThe delivery short code (0-255).
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ setSBDSessionTimeout()

IRIDIUM_9604_error_t DevIridium9604::setSBDSessionTimeout ( int  timeout)

Set the SBD session timeout (AT+SBDST).

Parameters
timeoutThe session timeout (s). 0 = infinite (the default after power-cycle).
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ setSecurityManager()

IRIDIUM_9604_error_t DevIridium9604::setSecurityManager ( IRIDIUM_9604_sec_manager_opcode_t  opcode,
IRIDIUM_9604_sec_manager_parameter_t  parameter,
sfe_string_t  name,
sfe_string_t  data 
)

Import or remove a certificate or key (AT+USECMNG).

Note
+USECMNG is referenced, but has no section of its own, in the Iridium 9604 AT commands manual.
Parameters
opcodeThe operation.
parameterThe parameter.
nameThe internal name of the certificate / key.
dataThe certificate / key data.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ setSimPin()

IRIDIUM_9604_error_t DevIridium9604::setSimPin ( sfe_string_t  pin)

Enter the SIM PIN (AT+CPIN).

Parameters
pinThe SIM PIN.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ setSIMstateReportCallback()

void DevIridium9604::setSIMstateReportCallback ( void(*)(IRIDIUM_9604_sim_states_t state)  simStateRequestCallback)

Set the callback for the SIM state URC (+UUSIMSTAT). See setSIMstateReportingMode().

Parameters
simStateRequestCallbackThe callback: the SIM state.

◆ setSIMstateReportingMode()

IRIDIUM_9604_error_t DevIridium9604::setSIMstateReportingMode ( int  mode)

Set the SIM state reporting mode (AT+USIMSTAT). Bit 0 reports the (U)SIM initialization status (states 0 to 6). Bit 1 reports the phonebook initialization status (states 7 and 8). Bit 2 reports the SIM toolkit REFRESH result (states 9 to 13).

Parameters
modeThe mode: a combination of bits 0 to 2.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ setSMSMessageFormat()

IRIDIUM_9604_error_t DevIridium9604::setSMSMessageFormat ( IRIDIUM_9604_message_format_t  textMode = IRIDIUM_9604_MESSAGE_FORMAT_TEXT)

Set the SMS message format (AT+CMGF).

Parameters
textModeThe message format.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ setSocketCloseCallback()

void DevIridium9604::setSocketCloseCallback ( void(*)(int)  socketCloseCallback)

Set the callback for the socket close URC (+UUSOCL).

Parameters
socketCloseCallbackThe callback: socket.

◆ setSocketListenCallback()

void DevIridium9604::setSocketListenCallback ( void(*)(int, sfe_ip_address_t, unsigned int, int, sfe_ip_address_t, unsigned int)  socketListenCallback)

Set the callback for the socket listen URC (+UUSOLI). Called when a remote client connects to a listening socket.

Parameters
socketListenCallbackThe callback: listening socket, local IP address, listening port, socket, remote IP address, remote port.

◆ setSocketReadCallback()

void DevIridium9604::setSocketReadCallback ( void(*)(int, sfe_string_t)  socketReadCallback)

Set the original socket read callback - called when a +UUSORD or +UUSORF URC is received. The library reads the data and passes it to the callback.

This handles binary data correctly, but the remote IP Address and Port are lost for UDP connections. setSocketReadCallbackPlus() is preferred.

Parameters
socketReadCallbackThe callback: socket, data.

◆ setSocketReadCallbackPlus()

void DevIridium9604::setSocketReadCallbackPlus ( void(*)(int, const char *, int, sfe_ip_address_t, int)  socketReadCallbackPlus)

Set the socket read callback - called when a +UUSORD or +UUSORF URC is received. The library reads the data and passes it - with its length, the remote IP Address and the remote port - to the callback.

Parameters
socketReadCallbackPlusThe callback: socket, data, data length, remote IP address, remote port.

◆ setURCCallback()

bool DevIridium9604::setURCCallback ( const char *  urcPrefix,
urcCallback_t  callback,
uint8_t  index = 0 
)

Register (or clear) a callback for a URC - generically. The typed helpers (setSocketReadCallback() etc.) call this.

See urcHandler.h and the urcHandlers folder for each URC's callback signature(s).

Parameters
urcPrefixThe URC prefix, including the colon, e.g. IRIDIUM_9604_CLOSE_SOCKET_URC ("+UUSOCL:").
callbackThe callback, cast to urcCallback_t. nullptr clears the callback.
indexWhich of the URC's callbacks to set. Usually 0.
Returns
true on success; false if no handler is registered for urcPrefix or index is out of range.

◆ setUtimeConfiguration()

IRIDIUM_9604_error_t DevIridium9604::setUtimeConfiguration ( int32_t  offsetNanoseconds = 0,
int32_t  offsetSeconds = 0 
)

Set the time offsets (AT+UTIMECFG).

Parameters
offsetNanosecondsThe offset in nanoseconds.
offsetSecondsThe offset in seconds.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ setUtimeIndication()

Configure the +UUTIME time indication URC (AT+UTIMEIND).

Parameters
configThe URC configuration.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ setUtimeMode()

Set the time mode and time source (AT+UTIME).

Parameters
modeThe mode.
sensorThe time source sensor.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ socketClose()

IRIDIUM_9604_error_t DevIridium9604::socketClose ( int  socket,
unsigned long  timeout = IRIDIUM_9604_2_MIN_TIMEOUT 
)

Close a socket (AT+USOCL).

Parameters
socketThe socket number.
timeoutThe timeout (ms).
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ socketConnect() [1/2]

IRIDIUM_9604_error_t DevIridium9604::socketConnect ( int  socket,
const char *  address,
unsigned int  port 
)

Connect a TCP socket to a remote host (AT+USOCO). Not required for UDP sockets.

Parameters
socketThe socket number.
addressThe remote host name or IP address.
portThe port.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ socketConnect() [2/2]

IRIDIUM_9604_error_t DevIridium9604::socketConnect ( int  socket,
sfe_ip_address_t  address,
unsigned int  port 
)

Connect a TCP socket to a remote IP address (AT+USOCO). Not required for UDP sockets.

Parameters
socketThe socket number.
addressThe remote host name or IP address.
portThe port.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ socketDirectLinkCharacterTrigger()

IRIDIUM_9604_error_t DevIridium9604::socketDirectLinkCharacterTrigger ( int  socket,
int  characterTrigger 
)

Set the direct link character trigger (AT+UDCONF=7).

Parameters
socketThe socket number.
characterTriggerThe trigger character.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ socketDirectLinkCongestionTimer()

IRIDIUM_9604_error_t DevIridium9604::socketDirectLinkCongestionTimer ( int  socket,
unsigned long  congestionTimer 
)

Set the direct link congestion timer (AT+UDCONF=8).

Parameters
socketThe socket number.
congestionTimerThe congestion timer (ms).
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ socketDirectLinkDataLengthTrigger()

IRIDIUM_9604_error_t DevIridium9604::socketDirectLinkDataLengthTrigger ( int  socket,
int  dataLengthTrigger 
)

Set the direct link data length trigger (AT+UDCONF=6).

Parameters
socketThe socket number.
dataLengthTriggerThe data length trigger (bytes).
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ socketDirectLinkMode()

IRIDIUM_9604_error_t DevIridium9604::socketDirectLinkMode ( int  socket)

Switch a socket into direct link (transparent) mode (AT+USODL).

Parameters
socketThe socket number.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ socketDirectLinkTimeTrigger()

IRIDIUM_9604_error_t DevIridium9604::socketDirectLinkTimeTrigger ( int  socket,
unsigned long  timerTrigger 
)

Set the direct link time trigger (AT+UDCONF=5).

Parameters
socketThe socket number.
timerTriggerThe time trigger (ms).
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ socketGetLastError()

int DevIridium9604::socketGetLastError ( )

Read the last socket error (AT+USOER).

Returns
The last socket error code.

◆ socketListen()

IRIDIUM_9604_error_t DevIridium9604::socketListen ( int  socket,
unsigned int  port 
)

Listen for incoming connections on a socket (AT+USOLI). See setSocketListenCallback().

Parameters
socketThe socket number.
portThe port.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ socketOpen()

int DevIridium9604::socketOpen ( IRIDIUM_9604_socket_protocol_t  protocol,
unsigned int  localPort = 0 
)

Open a TCP or UDP socket (AT+USOCR).

Parameters
protocolThe protocol: IRIDIUM_9604_TCP or IRIDIUM_9604_UDP.
localPortThe local port. 0 = automatic.
Returns
The socket number, or -1 on failure.

◆ socketRead()

IRIDIUM_9604_error_t DevIridium9604::socketRead ( int  socket,
int  length,
char *  readDest,
int *  bytesRead = nullptr 
)

Read data from a TCP socket (AT+USORD). Large reads are split into multiple AT commands.

Parameters
socketThe socket number.
lengthThe number of bytes to read.
readDestWhere to store the data. Must be at least length bytes.
bytesReadReturns the number of bytes read (optional).
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ socketReadAvailable()

IRIDIUM_9604_error_t DevIridium9604::socketReadAvailable ( int  socket,
int *  length 
)

Read the number of bytes waiting to be read from a TCP socket (AT+USORD=socket,0).

Parameters
socketThe socket number.
lengthReturns the number of bytes available.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ socketReadAvailableUDP()

IRIDIUM_9604_error_t DevIridium9604::socketReadAvailableUDP ( int  socket,
int *  length 
)

Read the number of bytes waiting to be read from a UDP socket (AT+USORF=socket,0).

Parameters
socketThe socket number.
lengthReturns the number of bytes available.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ socketReadUDP()

IRIDIUM_9604_error_t DevIridium9604::socketReadUDP ( int  socket,
int  length,
char *  readDest,
sfe_ip_address_t *  remoteIPAddress = nullptr,
int *  remotePort = nullptr,
int *  bytesRead = nullptr 
)

Read data from a UDP socket (AT+USORF), plus the remote IP address and port. Large reads are split into multiple AT commands.

Parameters
socketThe socket number.
lengthThe number of bytes to read.
readDestWhere to store the data. Must be at least length bytes.
remoteIPAddressReturns the remote IP address (optional).
remotePortReturns the remote port (optional).
bytesReadReturns the number of bytes read (optional).
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ socketSetSecure()

IRIDIUM_9604_error_t DevIridium9604::socketSetSecure ( int  profile,
bool  secure,
int  secprofile = -1 
)

Enable or disable SSL/TLS on a socket (AT+USOSEC).

Parameters
profileThe profile number.
securetrue to enable SSL/TLS.
secprofileThe security profile. -1 = default.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ socketWrite() [1/2]

IRIDIUM_9604_error_t DevIridium9604::socketWrite ( int  socket,
const char *  str,
int  len = -1 
)

Write data to a TCP socket (AT+USOWR). OK for binary data if len is provided.

Parameters
socketThe socket number.
strThe data to write.
lenThe number of bytes to write. -1 = strlen(str).
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ socketWrite() [2/2]

IRIDIUM_9604_error_t DevIridium9604::socketWrite ( int  socket,
sfe_string_t  str 
)

Write data to a TCP socket (AT+USOWR). OK for binary data.

Parameters
socketThe socket number.
strThe data to write.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ socketWriteUDP() [1/3]

IRIDIUM_9604_error_t DevIridium9604::socketWriteUDP ( int  socket,
const char *  address,
int  port,
const char *  str,
int  len = -1 
)

Write data to a UDP socket (AT+USOST). OK for binary data if len is provided.

Parameters
socketThe socket number.
addressThe remote host name or IP address.
portThe port.
strThe data to write.
lenThe number of bytes to write. -1 = strlen(str).
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ socketWriteUDP() [2/3]

IRIDIUM_9604_error_t DevIridium9604::socketWriteUDP ( int  socket,
sfe_ip_address_t  address,
int  port,
const char *  str,
int  len = -1 
)

Write data to a UDP socket (AT+USOST). OK for binary data if len is provided.

Parameters
socketThe socket number.
addressThe remote host name or IP address.
portThe port.
strThe data to write.
lenThe number of bytes to write. -1 = strlen(str).
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ socketWriteUDP() [3/3]

IRIDIUM_9604_error_t DevIridium9604::socketWriteUDP ( int  socket,
sfe_string_t  address,
int  port,
sfe_string_t  str 
)

Write data to a UDP socket (AT+USOST). OK for binary data.

Parameters
socketThe socket number.
addressThe remote host name or IP address.
portThe port.
strThe data to write.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ subscribeMQTTtopic()

IRIDIUM_9604_error_t DevIridium9604::subscribeMQTTtopic ( int  max_Qos,
const sfe_string_t &  topic 
)

Subscribe to an MQTT topic (AT+UMQTTC=4).

Parameters
max_QosThe maximum QoS.
topicThe topic.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ unlock()

IRIDIUM_9604_error_t DevIridium9604::unlock ( const char *  unlockKey,
IRIDIUM_9604_lock_status_t *  status = nullptr 
)

Unlock the module (AT+CULK).

Parameters
unlockKeyThe unlock key: 16 hexadecimal digits.
statusReturns the lock status (optional).
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ unsubscribeMQTTtopic()

IRIDIUM_9604_error_t DevIridium9604::unsubscribeMQTTtopic ( const sfe_string_t &  topic)

Unsubscribe from an MQTT topic (AT+UMQTTC=5).

Parameters
topicThe topic.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ urcDebug()

SparkFun_Iridium_9604::SfeDebugPrint & DevIridium9604::urcDebug ( void  )
inline

urcHandlerInterface: the debug printer, for the URC handlers.

Returns
The debug printer.

◆ urcGetLastSocketProtocol()

int DevIridium9604::urcGetLastSocketProtocol ( int  socket)

urcHandlerInterface: the protocol of the most recent socket operation on a socket.

Parameters
socketThe socket number.
Returns
IRIDIUM_9604_TCP, IRIDIUM_9604_UDP or 0.

◆ urcIndicatorEvent()

void DevIridium9604::urcIndicatorEvent ( int  indicator,
int  value 
)

urcHandlerInterface: record the latest +CIEV indicator value.

Parameters
indicatorThe indicator.
valueThe indicator value.

◆ urcProcessNMEA()

void DevIridium9604::urcProcessNMEA ( const char *  sentence,
size_t  length 
)
inline

urcHandlerInterface: process one NMEA sentence from a +UUGNMEA URC.

Parameters
sentenceThe NMEA sentence: $ to the checksum, without the CR LF.
lengthThe sentence length.

◆ urcSocketListenIndication()

void DevIridium9604::urcSocketListenIndication ( sfe_ip_address_t  localIP,
sfe_ip_address_t  remoteIP 
)

urcHandlerInterface: record the IP addresses from a +UUSOLI URC (see lastRemoteIP()).

Parameters
localIPThe local IP address.
remoteIPThe remote IP address.

◆ urcSocketReadIndication()

IRIDIUM_9604_error_t DevIridium9604::urcSocketReadIndication ( int  socket,
int  length 
)
inline

urcHandlerInterface: read the TCP data indicated by a +UUSORD URC and pass it to the socket read callback(s).

Parameters
socketThe socket number.
lengthThe number of bytes indicated by the URC.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ urcSocketReadIndicationUDP()

IRIDIUM_9604_error_t DevIridium9604::urcSocketReadIndicationUDP ( int  socket,
int  length 
)
inline

urcHandlerInterface: read the UDP data indicated by a +UUSORF URC and pass it to the socket read callback(s).

Parameters
socketThe socket number.
lengthThe number of bytes indicated by the URC.
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ waitForResponse()

IRIDIUM_9604_error_t DevIridium9604::waitForResponse ( const char *  expectedResponse,
const char *  expectedError,
uint16_t  timeout 
)
protected

Wait for an expected response (or error) from the module. Any other data (URCs) is added to the backlog.

Parameters
expectedResponseThe expected response.
expectedErrorThe expected error response.
timeoutThe timeout (ms).
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ waitForSatelliteSignalQuality()

int DevIridium9604::waitForSatelliteSignalQuality ( unsigned long  timeout = 60000)

Wait (calling bufferedPoll()) for the first +CIEV signal quality indication. Enables the indicator event reporting if required.

Parameters
timeoutThe timeout (ms).
Returns
The signal quality (0-5), or -1 on timeout.

◆ write() [1/3]

size_t DevIridium9604::write ( const char *  buffer,
size_t  size 
)
virtual

Write a buffer directly to the module serial port.

Parameters
bufferThe data to write.
sizeThe number of bytes to write.
Returns
The number of bytes written.

◆ write() [2/3]

size_t DevIridium9604::write ( const char *  str)
virtual

Write a NULL-terminated string directly to the module serial port.

Parameters
strThe NULL-terminated string to write.
Returns
The number of bytes written.

◆ write() [3/3]

size_t DevIridium9604::write ( uint8_t  c)
virtual

Write one byte directly to the module serial port.

Parameters
cThe byte to write.
Returns
The number of bytes written.

◆ writePowerOnPin()

void DevIridium9604::writePowerOnPin ( bool  state)
protected

Write the PWR_ON pin: using the callback (if set), else the GPIO pin. Never drives the pin high: true releases it.

Parameters
stateThe level the PWR_ON pin should see: false = low (asserted); true = released.

◆ writeResetPin()

void DevIridium9604::writeResetPin ( bool  state)
protected

Write the RESET_N pin: using the callback (if set), else the GPIO pin. Never drives the pin high: true releases it.

Parameters
stateThe level the RESET_N pin should see: false = low (asserted); true = released.

◆ writeSBDData()

IRIDIUM_9604_error_t DevIridium9604::writeSBDData ( const uint8_t *  data,
size_t  length,
int *  status = nullptr 
)

Write binary data to the mobile originated buffer (AT+SBDW). The library HEX-encodes the data.

Parameters
dataThe data. Maximum 340 bytes.
lengthThe number of bytes.
statusReturns the +SBDW status: 0 = success (optional).
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

◆ writeSBDText()

IRIDIUM_9604_error_t DevIridium9604::writeSBDText ( const char *  text,
int *  status = nullptr 
)

Write text to the mobile originated buffer (AT+SBDW). The library HEX-encodes the text.

Parameters
textThe NULL-terminated text. Maximum 340 bytes.
statusReturns the +SBDW status: 0 = success (optional).
Returns
IRIDIUM_9604_SUCCESS on success, or an IRIDIUM_9604_error_t error code.

Member Data Documentation

◆ _autoTimeZoneForBegin

bool DevIridium9604::_autoTimeZoneForBegin = true
protected

Enable the automatic time zone update during begin().

◆ _baud

unsigned long DevIridium9604::_baud
protected

The current baud rate.

◆ _bufferedPollReentrant

bool DevIridium9604::_bufferedPollReentrant = false
protected

Prevent reentry of bufferedPoll - just in case it gets called from a callback.

◆ _checkCallbacksReentrant

bool DevIridium9604::_checkCallbacksReentrant = false
protected

Prevent reentry of checkCallbacks.

◆ _cmeErrorIndex

int DevIridium9604::_cmeErrorIndex = 0
protected

extendedErrorCheck: the number of IRIDIUM_9604_RESPONSE_CME_ERROR characters matched.

◆ _cmsErrorIndex

int DevIridium9604::_cmsErrorIndex = 0
protected

extendedErrorCheck: the number of IRIDIUM_9604_RESPONSE_CMS_ERROR characters matched.

◆ _extendedErrorCapturing

bool DevIridium9604::_extendedErrorCapturing = false
protected

extendedErrorCheck: true while the <err> text is being read.

◆ _invertPowerPin

bool DevIridium9604::_invertPowerPin = false
protected

Invert the power pin polarity.

◆ _iridiumResponseBacklog

char* DevIridium9604::_iridiumResponseBacklog
protected

The backlog: data (URCs) received while waiting for an AT command response.

◆ _iridiumResponseBacklogLength

int DevIridium9604::_iridiumResponseBacklogLength = 0
protected

The backlog could contain binary data so we can't use strlen to find its length.

◆ _iridiumRXBuffer

char* DevIridium9604::_iridiumRXBuffer
protected

Allocated in DevIridium9604::begin.

◆ _lastErrorText

char DevIridium9604::_lastErrorText[_lastErrorTextSize] = {0}
protected

The <err> from the most recent +CME ERROR / +CMS ERROR response.

◆ _lastErrorTextLength

size_t DevIridium9604::_lastErrorTextLength = 0
protected

The number of characters in _lastErrorText.

◆ _lastErrorTextSize

const size_t DevIridium9604::_lastErrorTextSize = 64
staticprotected

The size of _lastErrorText.

◆ _lastLocalIP

sfe_ip_address_t DevIridium9604::_lastLocalIP
protected

The local IP address from the most recent +UUSOLI URC.

◆ _lastRemoteIP

sfe_ip_address_t DevIridium9604::_lastRemoteIP
protected

The remote IP address from the most recent +UUSOLI URC.

◆ _lastSBDSession

IRIDIUM_9604_sbd_session_t DevIridium9604::_lastSBDSession
protected

The result of the most recent SBD session.

◆ _lastSBDSessionStatus

IRIDIUM_9604_error_t DevIridium9604::_lastSBDSessionStatus = IRIDIUM_9604_ERROR_INVALID
protected

The status of the most recent SBD session.

◆ _lastSocketProtocol

int DevIridium9604::_lastSocketProtocol[IRIDIUM_9604_NUM_SOCKETS]
protected

Record the protocol for each socket to avoid having to call querySocketType in parseSocketReadIndication.

◆ _maxInitTries

uint8_t DevIridium9604::_maxInitTries
protected

The maximum number of initialization attempts.

◆ _maxSocketRead

const int DevIridium9604::_maxSocketRead = 1024
protected

The limit on bytes that can be read in a single read.

◆ _partialLine

char* DevIridium9604::_partialLine
protected

An incomplete line from bufferedPoll() - processed when the rest of the line arrives.

◆ _partialLineLength

int DevIridium9604::_partialLineLength = 0
protected

The length of _partialLine.

◆ _pollReentrant

bool DevIridium9604::_pollReentrant = false
protected

Prevent reentry of poll - just in case it gets called from a callback.

◆ _powerOnPinWriteCallback

IRIDIUM_9604_pin_write_callback_t DevIridium9604::_powerOnPinWriteCallback = nullptr
protected

The PWR_ON pin write callback. nullptr = use _powerPin.

◆ _powerPin

int DevIridium9604::_powerPin
protected

The PWR_ON pin. -1 if not connected.

◆ _pruneBuffer

char* DevIridium9604::_pruneBuffer
protected

A temporary buffer used by pruneBacklog().

◆ _resetPin

int DevIridium9604::_resetPin
protected

The RESET_N pin. -1 if not connected.

◆ _resetPinWriteCallback

IRIDIUM_9604_pin_write_callback_t DevIridium9604::_resetPinWriteCallback = nullptr
protected

The RESET_N pin write callback. nullptr = use _resetPin.

◆ _rxWindowMillis

const unsigned long DevIridium9604::_rxWindowMillis = 2
protected

1ms is not quite long enough for a single char at 9600 baud. millis roll over much less often than micros. See notes in .cpp re. ESP32!

◆ _satelliteServiceAvailable

int DevIridium9604::_satelliteServiceAvailable = -1
protected

From +CIEV:1.

◆ _satelliteSignalQuality

int DevIridium9604::_satelliteSignalQuality = -1
protected

From +CIEV:0.

◆ _sbdATTimeout

unsigned long DevIridium9604::_sbdATTimeout = IRIDIUM_9604_SBD_SESSION_DEFAULT_TIMEOUT
protected

The AT command timeout for SBD sessions (ms).

◆ _sbdCallback

IRIDIUM_9604_sbd_callback_t DevIridium9604::_sbdCallback = nullptr
protected

The SBD session callback. nullptr = blocking sessions.

◆ _sbdComplete

bool DevIridium9604::_sbdComplete = false
protected

The session is complete: call the callback.

◆ _sbdCompleteStatus

IRIDIUM_9604_error_t DevIridium9604::_sbdCompleteStatus = IRIDIUM_9604_ERROR_SUCCESS
protected

The status for the callback.

◆ _sbdExtended

bool DevIridium9604::_sbdExtended = true
protected

true for +SBDIX / +SBDIXA; false for +SBDI.

◆ _sbdHaveResult

bool DevIridium9604::_sbdHaveResult = false
protected

true if the +SBDIX result was received.

◆ _sbdHighLevel

bool DevIridium9604::_sbdHighLevel = false
protected

true if the session was started by sendReceiveSBD: check the MO / MT status and read the MT message.

◆ _sbdHighLevelNext

bool DevIridium9604::_sbdHighLevelNext = false
protected

Set by sendReceiveSBD before it starts the session.

◆ _sbdRxBuffer

uint8_t* DevIridium9604::_sbdRxBuffer = nullptr
protected

sendReceiveSBD: where to store the MT message.

◆ _sbdRxBufferSize

size_t DevIridium9604::_sbdRxBufferSize = 0
protected

sendReceiveSBD: the size of _sbdRxBuffer.

◆ _sbdRxLength

size_t* DevIridium9604::_sbdRxLength = nullptr
protected

sendReceiveSBD: the size of _sbdRxBuffer in, the number of bytes received out.

◆ _sbdStartTime

unsigned long DevIridium9604::_sbdStartTime = 0
protected

millis when the non-blocking session started (or was cancelled).

◆ _sbdState

uint8_t DevIridium9604::_sbdState = IRIDIUM_9604_SBD_STATE_IDLE
protected

The state of the non-blocking SBD session.

◆ _sfeBus

SparkFun_Iridium_9604::IridiumDeviceBus* DevIridium9604::_sfeBus
protected

The UART.

◆ _socketReadCallback

void(* DevIridium9604::_socketReadCallback) (int, sfe_string_t)
protected

The original socket read callback.

◆ _socketReadCallbackPlus

void(* DevIridium9604::_socketReadCallbackPlus) (int, const char *, int, sfe_ip_address_t, int)
protected

socket, data, length, remoteAddress, remotePort

◆ IRIDIUM_9604_SBD_STATE_CANCELLING

const uint8_t DevIridium9604::IRIDIUM_9604_SBD_STATE_CANCELLING = 2
staticprotected

_sbdState: cancelSBDSession has been called. Waiting for the final result code

◆ IRIDIUM_9604_SBD_STATE_IDLE

const uint8_t DevIridium9604::IRIDIUM_9604_SBD_STATE_IDLE = 0
staticprotected

_sbdState: no session in progress

◆ IRIDIUM_9604_SBD_STATE_IN_PROGRESS

const uint8_t DevIridium9604::IRIDIUM_9604_SBD_STATE_IN_PROGRESS = 1
staticprotected

_sbdState: the session command has been sent. Waiting for the result

◆ nmeaMessages

SparkFun_Iridium_9604::nmeaMessageVector DevIridium9604::nmeaMessages

The NMEA message objects - one per supported NMEA message.

◆ urcHandlers

SparkFun_Iridium_9604::urcHandlerVector DevIridium9604::urcHandlers

The URC handler objects - one per registered URC handler.


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