![]() |
SparkFun Iridium 9604
v1.0.0
Library for the Iridium 9604 Hybrid LTE-M Cellular + Iridium Satellite (SBD) + GNSS IoT module
|
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>
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... | |
The Iridium 9604 device class: all of the AT command, URC, NMEA and satellite methods. Use SFE_IRIDIUM_9604, which adds the begin() methods.
The GNSS aiding mode type. (Retained for SARA-R5 compatibility.)
The GNSS system type. (Retained for SARA-R5 compatibility.)
The NMEA callback data type (SparkFun_Iridium_9604::nmeaCallbackDataCommon_t).
The NMEA message class (SparkFun_Iridium_9604::nmeaMessage).
| typedef SparkFun_Iridium_9604::sfe_ip_address_t DevIridium9604::sfe_ip_address_t |
The IP address type: IPAddress on Arduino; SfeIPAddress on ESP-IDF.
| typedef SparkFun_Iridium_9604::sfe_print_t DevIridium9604::sfe_print_t |
The print type: Print on Arduino; SfeOutput on ESP-IDF.
| typedef SparkFun_Iridium_9604::sfe_string_t DevIridium9604::sfe_string_t |
The string type: String on Arduino; std::string on ESP-IDF.
| typedef SparkFun_Iridium_9604::urcCallback_t DevIridium9604::urcCallback_t |
The generic URC callback type. Cast your callback to this for setURCCallback().
GPIO pin modes.
|
protected |
The initialization types used by init().
| Enumerator | |
|---|---|
| IRIDIUM_9604_INIT_STANDARD | |
| IRIDIUM_9604_INIT_AUTOBAUD | |
| IRIDIUM_9604_INIT_RESET | |
The layer 2 protocols for enterPPP().
| Enumerator | |
|---|---|
| L2P_DEFAULT | |
| L2P_PPP | |
| L2P_M_HEX | |
| L2P_M_RAW_IP | |
| L2P_M_OPT_PPP | |
| 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.
| powerPin | The GPIO connected to the module's PWR_ON pin, or -1 if not connected. |
| resetPin | The GPIO connected to the module's RESET_N pin, or -1 if not connected. |
| maxInitTries | The maximum number of initialization attempts made by begin(). |
| DevIridium9604::~DevIridium9604 | ( | void | ) |
Destroy the DevIridium9604 object, freeing the backlog and receive buffers.
| IRIDIUM_9604_error_t DevIridium9604::activatePDPcontext | ( | bool | status, |
| int | cid = -1 |
||
| ) |
Activate or deactivate a PDP context (AT+CGACT).
| status | true to activate, false to deactivate. |
| cid | The PDP context identifier. -1 = all. |
|
protected |
Add one character to the backlog. NULLs are converted to ASCII '0'.
| c | The character. |
| 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.
| filename | The file name (in the module's file system). |
| str | The data to append. |
| len | The number of bytes to append. |
| 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.
| filename | The file name (in the module's file system). |
| str | The data to append. |
| IRIDIUM_9604_error_t DevIridium9604::at | ( | void | ) |
Send "AT" and check for "OK".
|
protected |
Find the module's baud rate and change it to desiredBaud.
| desiredBaud | The desired baud rate. |
| IRIDIUM_9604_error_t DevIridium9604::automaticOperatorSelection | ( | ) |
Select the network operator automatically (AT+COPS=0).
| IRIDIUM_9604_error_t DevIridium9604::autoTimeZone | ( | bool | enable | ) |
Enable or disable the automatic time zone update from the network (AT+CTZU).
| enable | true to enable, false to disable. |
| void DevIridium9604::autoTimeZoneForBegin | ( | bool | enable = true | ) |
| 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.
| baud | The baud rate. The library autobauds the module to this rate if required. |
|
protectedvirtual |
Set the communication bus baud rate.
| baud | The baud rate. |
| 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.
| 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!
| void DevIridium9604::checkCallbacks | ( | void | ) |
Call any NMEA callbacks which are waiting. Called automatically by bufferedPoll().
|
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.
|
protected |
Check the result of an SBD session: the MO status (0 to -4 = success) and the MT status (2 = error). Used by sendReceiveSBD.
| session | The session result. |
| 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".)
| buffers | Which buffer(s) to clear. |
| 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.
| y | Returns the year (two digits: years since 2000). |
| mo | Returns the month. |
| d | Returns the day. |
| h | Returns the hour. |
| min | Returns the minute. |
| s | Returns the second. |
| tz | Returns the time zone, in quarters of an hour. |
| sfe_string_t DevIridium9604::clock | ( | void | ) |
Read the module's real time clock (AT+CCLK?).
|
protected |
Non-blocking SBD session: mark the session complete. checkSBDSession calls the callback.
| status | The status for the callback. |
| 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).
| secprofile | The security profile. -1 = default. |
| parameter | The parameter. |
| value | The value. |
| 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).
| secprofile | The security profile. -1 = default. |
| parameter | The parameter. |
| value | The value. |
| 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().
| 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().
|
inline |
Delete all the SMS messages from preferred storage, including the unread messages (AT+CMGD=1,4).
| IRIDIUM_9604_error_t DevIridium9604::deleteFile | ( | sfe_string_t | filename | ) |
Delete a file from the module's file system (AT+UDELFILE).
| filename | The file name (in the module's file system). |
|
inline |
Delete all the read and sent SMS messages from preferred storage (AT+CMGD=1,2).
|
inline |
Delete all the read, sent and unsent SMS messages from preferred storage (AT+CMGD=1,3).
|
inline |
Delete all the read SMS messages from preferred storage (AT+CMGD=1,1).
| IRIDIUM_9604_error_t DevIridium9604::deleteSMSmessage | ( | int | location, |
| int | deleteFlag = 0 |
||
| ) |
Delete SMS message(s) (AT+CMGD).
| location | The memory location. Ignored if deleteFlag is non-zero. |
| deleteFlag | 0 = delete the message at location; 1 = all read; 2 = all read and sent; 3 = all read, sent and unsent; 4 = all. |
| IRIDIUM_9604_error_t DevIridium9604::deregisterOperator | ( | void | ) |
Deregister from the network operator (AT+COPS=2).
|
inline |
Disable the output of all 13 NMEA messages.
| void DevIridium9604::disableAtDebugging | ( | void | ) |
Turn off the AT command debug messages.
| void DevIridium9604::disableDebugging | ( | void | ) |
Turn off the debug messages.
| IRIDIUM_9604_error_t DevIridium9604::disconnectFTP | ( | void | ) |
Disconnect from the FTP server (AT+UFTPC=0).
| IRIDIUM_9604_error_t DevIridium9604::disconnectMQTT | ( | void | ) |
Disconnect from the MQTT broker (AT+UMQTTC=0).
| 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.
| debugPort | Where to print the messages. Defaults to Serial (Arduino) or stdout (ESP-IDF). |
| void DevIridium9604::enableDebugging | ( | sfe_print_t & | debugPort = SparkFun_Iridium_9604::sfeStdout | ) |
Turn on the debug messages.
| debugPort | Where to print the messages. Defaults to Serial (Arduino) or stdout (ESP-IDF). |
| IRIDIUM_9604_error_t DevIridium9604::enableEcho | ( | bool | enable = true | ) |
Enable or disable the command echo (ATE1 / ATE0). The library disables echo during begin().
| enable | true to enable, false to disable. |
| 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#).
| cid | The PDP context identifier. |
| dialing_type_char | The dialing type character (optional: 0 = none). |
| dialNumber | The dial number. Default: 99. |
| l2p | The layer 2 protocol. |
|
protected |
Look for a "+CME ERROR: <err>" or "+CMS ERROR: <err>" response, one character at a time.
Saves the <err> text in _lastErrorText.
| c | The next character from the module. |
|
protected |
Reset the +CME ERROR / +CMS ERROR matching and clear _lastErrorText. Called before each command.
| void DevIridium9604::flushNMEA | ( | const char * | msgId | ) |
Mark the stored copy of an NMEA message as stale.
| msgId | The NMEA message ID, e.g. "GGA". |
|
protected |
Move any incomplete bufferedPoll() line into the backlog - so it is processed with the next data.
| 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).
| filename | The file name (in the module's file system). |
| IRIDIUM_9604_error_t DevIridium9604::functionality | ( | IRIDIUM_9604_functionality_t | function = FULL_FUNCTIONALITY | ) |
Set the module functionality (AT+CFUN).
| function | The functionality. |
| 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?).
| cid | The PDP context identifier. |
| apn | Returns the Access Point Name. |
| ip | Returns the IP address. |
| pdpType | Returns the PDP type (optional). |
| sfe_string_t DevIridium9604::getCapabilities | ( | void | ) |
Read the module's capabilities list (AT+GCAP).
| sfe_string_t DevIridium9604::getCCID | ( | void | ) |
Read the SIM card identification (AT+CCID).
| 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.
| cid | Returns the PDP context identifier. |
| preferredProtocol | Optional: returns the preferred protocol type (0 = IPv4, 1 = IPv6) used when the context is IPv4v6. |
| IRIDIUM_9604_error_t DevIridium9604::getExtSignalQuality | ( | signal_quality & | signal_quality | ) |
Read the extended signal quality (AT+CESQ). Cellular (LTE-M) only.
| signal_quality | Returns the extended signal quality. |
| 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.
| filename | The file name (in the module's file system). |
| buffer | Where to store the data. Must hold requestedLength bytes. |
| offset | The offset into the file. |
| requestedLength | The number of bytes to read. |
| bytesRead | Returns the number of bytes read. |
| 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().
| filename | The file name (in the module's file system). |
| contents | Returns the file contents. |
| 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.
| filename | The file name (in the module's file system). |
| contents | Returns the file contents. |
| 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).
| filename | The file name (in the module's file system). |
| size | Returns the file size (bytes). |
| sfe_string_t DevIridium9604::getFirmwareVersion | ( | void | ) |
Read the firmware version (AT+CGMR).
| IRIDIUM_9604_error_t DevIridium9604::getFTPprotocolError | ( | int * | error_code, |
| int * | error_code2 | ||
| ) |
Read the most recent FTP protocol error (AT+UFTPER).
| error_code | Returns the error code. |
| error_code2 | Returns the second error code. |
| DevIridium9604::IRIDIUM_9604_gpio_mode_t DevIridium9604::getGpioMode | ( | IRIDIUM_9604_gpio_t | gpio | ) |
Read the mode of a GPIO pin (AT+UGPIOC?).
| gpio | The GPIO pin. |
| 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).
| profile | The profile number. |
| error_class | Returns the error class. |
| error_code | Returns the error code. |
| sfe_string_t DevIridium9604::getIMEI | ( | void | ) |
Read the cellular IMEI (AT+GSN). See getSatelliteIMEI() for the satellite (SBD) IMEI.
| sfe_string_t DevIridium9604::getIMSI | ( | void | ) |
Read the SIM International Mobile Subscriber Identity (AT+CIMI).
| 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?).
| mode | Returns the mode. |
| signalQuality | Returns true if the signal quality indication is enabled. |
| serviceAvailability | Returns true if the service availability indication is enabled. |
| svBeamCoordinates | Returns true if the SV and beam coordinates indication is enabled. |
|
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.
|
inline |
The result of the most recent SBD session (sbdSession(), sbdSessionExtended() or the send / receive methods).
|
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.
| IRIDIUM_9604_lock_status_t DevIridium9604::getLockStatus | ( | void | ) |
Read the lock status (AT+CULK?).
| sfe_string_t DevIridium9604::getManufacturerID | ( | void | ) |
Read the manufacturer identification (AT+CGMI).
|
protected |
Read the Mobile Network Operator profile (AT+UMNOPROF?).
| mno | Returns the Mobile Network Operator profile. |
| sfe_string_t DevIridium9604::getModelID | ( | void | ) |
Read the model identification (AT+CGMM).
| IRIDIUM_9604_error_t DevIridium9604::getMQTTprotocolError | ( | int * | error_code, |
| int * | error_code2 | ||
| ) |
Read the most recent MQTT protocol error (AT+UMQTTER).
| error_code | Returns the error code. |
| error_code2 | Returns the second error code. |
| mobile_network_operator_t DevIridium9604::getNetworkProfile | ( | void | ) |
Read the Mobile Network Operator (MNO) profile (AT+UMNOPROF?).
| 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.
| msgId | The NMEA message ID, e.g. "RMC". (Without the talker ID.) |
| pollIfNoURC | If true, poll the module (AT+UGNMEA?) if no fresh data has arrived as a URC. |
| 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.
| msgId | The NMEA message ID, e.g. "RMC". (Without the talker ID.) |
| field | The field name, e.g. "lat". |
| value | Returns the field value. |
| 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.
| theMessage | The NMEA message - from getNmeaMessagePtr() or getNmeaMessageByName(). |
| blockIndex | The block index (0 = the first block). |
| fieldName | The field name, e.g. "lat". |
| 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.
| theMessage | The NMEA message - from getNmeaMessagePtr() or getNmeaMessageByName(). |
| blockIndex | The block index (0 = the first block). |
| fieldName | The field name, e.g. "lat". |
|
inline |
Find an NMEA message object by its message ID.
| msgId | The NMEA message ID, e.g. "GGA". |
| 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.
| theMessage | The NMEA message - from getNmeaMessagePtr() or getNmeaMessageByName(). |
| fieldName | The field name, e.g. "lat". |
| 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.
| theMessage | The NMEA message - from getNmeaMessagePtr() or getNmeaMessageByName(). |
| fieldName | The field name, e.g. "lat". |
| DevIridium9604::nmeaMessage * DevIridium9604::getNmeaMessagePtr | ( | nmeaCallbackDataCommon_t * | theData | ) |
Get the nmeaMessage from inside an NMEA callback.
| theData | The callback data pointer passed to the callback. |
| 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?).
| msgId | The NMEA message ID, e.g. "RMC". (Without the talker ID.) |
| rate | Returns the rate. |
| output | Returns the output. |
| IRIDIUM_9604_error_t DevIridium9604::getOperator | ( | sfe_string_t * | oper | ) |
Read the current network operator (AT+COPS?).
| oper | Returns the operator name. |
| 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.
| op | Returns the operators. An array of maxOps operator_stats. |
| maxOps | The size of the op array. |
| 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.)
| cid | The PDP context identifier. Use getDefaultPDPcontext() to find the context used by the internal TCP/IP stack. |
| address | Returns the IP address. 0.0.0.0 if the context has no IPv4 address. |
| IRIDIUM_9604_error_t DevIridium9604::getPDPcontextState | ( | int | cid, |
| bool * | active | ||
| ) |
Read whether a PDP context is active (AT+CGACT?).
| cid | The PDP context identifier. |
| active | Returns true if the context is active. False if it is not active, or not defined. |
| 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).
| used | Returns the number of used memory locations. |
| total | Returns the total number of memory locations. |
| memory | The memory: "ME" (default), "SM" or "MT". |
| IRIDIUM_9604_rat_t DevIridium9604::getRAT | ( | void | ) |
Read the selected Radio Access Technology (AT+URAT?). New for the 9604.
| DevIridium9604::sfe_string_t DevIridium9604::getSatelliteIMEI | ( | void | ) |
Read the 15 digit satellite (SBD) IMEI (AT+USATSN).
| 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.
| info | Returns the satellite system information. |
| 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).
| serialNumber | Returns the satellite serial number (6 alphanumeric characters). |
| sbdIMEI | Returns the 15 digit satellite (SBD) IMEI. |
| DevIridium9604::sfe_string_t DevIridium9604::getSatelliteSerialNumber | ( | void | ) |
Read the satellite serial number (AT+USATSN).
|
inline |
The most recent satellite signal quality (0-5 bars), from the +CIEV URCs. Call bufferedPoll() regularly to process the URCs.
|
inline |
Read the AT command timeout used for SBD sessions.
| IRIDIUM_9604_error_t DevIridium9604::getSBDAutoRegistration | ( | IRIDIUM_9604_sbdareg_mode_t * | mode | ) |
Read the SBD automatic registration mode (AT+SBDAREG?).
| mode | Returns the automatic registration mode. |
| IRIDIUM_9604_error_t DevIridium9604::getSBDDeliveryShortCode | ( | uint8_t * | dsc | ) |
Read the SBD delivery short code (AT+SBDDSC?).
| dsc | Returns the delivery short code. |
|
static |
Convert an SBD error code (+SBDIX MO status, +SBDDET error, +AREG reg error) to text. Positive or negative codes are accepted.
| error | The SBD error code. |
| IRIDIUM_9604_sbdreg_status_t DevIridium9604::getSBDRegistrationStatus | ( | void | ) |
Read the SBD registration status (AT+SBDREG?). From the Iridium 9604 Additional Commands (Beta).
| IRIDIUM_9604_error_t DevIridium9604::getSBDSessionTimeout | ( | int * | timeout | ) |
Read the SBD session timeout (AT+SBDST?).
| timeout | Returns the session timeout (s). |
| IRIDIUM_9604_error_t DevIridium9604::getSBDStatusExtended | ( | IRIDIUM_9604_sbd_status_t * | status | ) |
Read the extended SBD status (AT+SBDSX).
| status | Returns the extended SBD status. |
| IRIDIUM_9604_error_t DevIridium9604::getSBDTrafficManagementStatus | ( | int * | status, |
| unsigned long * | time | ||
| ) |
Read the SBD traffic management status (AT+SBDLOE).
| status | Returns the status: 0 = the time is valid. |
| time | Returns the time (s) until the end of the traffic management period. |
| sfe_string_t DevIridium9604::getSerialNo | ( | void | ) |
Read the product serial number (AT+CGSN).
| IRIDIUM_9604_error_t DevIridium9604::getSIMstateReportingMode | ( | int * | mode | ) |
Read the SIM state reporting mode (AT+USIMSTAT?).
| mode | Returns the mode. |
| IRIDIUM_9604_error_t DevIridium9604::getSimStatus | ( | sfe_string_t * | code | ) |
Read the SIM PIN status (AT+CPIN?).
| code | Returns the SIM PIN status, e.g. "READY". |
| sfe_string_t DevIridium9604::getSubscriberNo | ( | void | ) |
Read the subscriber number (AT+CNUM).
| IRIDIUM_9604_error_t DevIridium9604::getUtimeConfiguration | ( | int32_t * | offsetNanoseconds, |
| int32_t * | offsetSeconds | ||
| ) |
Read the time offsets (AT+UTIMECFG?).
| offsetNanoseconds | Returns the offset in nanoseconds. |
| offsetSeconds | Returns the offset in seconds. |
| IRIDIUM_9604_error_t DevIridium9604::getUtimeIndication | ( | IRIDIUM_9604_utime_urc_configuration_t * | config | ) |
Read the time indication URC configuration (AT+UTIMEIND?).
| config | Returns the configuration. |
| 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?).
| mode | Returns the mode. |
| sensor | Returns the sensor. |
|
inline |
The number of MT messages waiting at the gateway, from the most recent SBD session.
| 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).
| primaryServer | The primary server. nullptr or "" to keep the stored server (the factory-programmed server). |
| secondaryServer | The secondary server. nullptr or "" to keep the stored server. |
| authToken | The AssistNow authentication token. |
| days | The number of days of data. |
| period | The period (weeks). |
| resolution | The resolution (days). |
| gnssTypes | The GNSS systems. |
| mode | The mode. |
| dataType | The data type. |
| IRIDIUM_9604_error_t DevIridium9604::gpsGetState | ( | bool * | on, |
| int * | aiding = nullptr, |
||
| int * | systems = nullptr |
||
| ) |
Read the GNSS state (AT+UGPS?).
| on | Returns true if the GNSS is powered on. |
| aiding | If not nullptr, returns the aiding mode (IRIDIUM_9604_gnss_aiding_mode_t values added together). 0 if off. |
| systems | If not nullptr, returns the GNSS systems (IRIDIUM_9604_gnss_system_t values added together). 0 if off. |
| 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.
| enable | true to power the GNSS on, false to power it off. |
| gnss_sys | The GNSS systems to use: a combination of GNSS_SYSTEM_GPS etc. |
| gnss_aiding | The aiding mode: GNSS_AIDING_MODE_NONE etc. |
| 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().
| timeout | The timeout (s). |
| accuracy | The target accuracy (m). |
| detailed | true for detailed results. |
| sensor | The time source sensor. |
| 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()).
| request | The request: GNSS_AIDING_REQUEST_ASSISTNOW_ONLINE etc. |
| timeout | The timeout (ms). |
| 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().
| gnss_aiding | The aiding mode: IRIDIUM_9604_gnss_aiding_mode_t values added together (cast the sum). |
| gnss_sys | The GNSS systems: IRIDIUM_9604_gnss_system_t values added together (cast the sum). |
| bool DevIridium9604::hasRingAlert | ( | void | ) |
Check if an SBD ring alert has been received (the +SBDSX RA flag).
|
inlineprotected |
Check if the PWR_ON pin can be written: GPIO pin or callback.
|
inlineprotected |
Check if the RESET_N pin can be written: GPIO pin or callback.
|
protected |
The number of bytes available to be read from the module.
| 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).
|
protected |
Write a NULL-terminated string to the module, through the communication bus.
| s | The NULL-terminated string. |
| 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.
|
protected |
Write one byte to the module, through the communication bus.
| c | The byte. |
|
protected |
Write a buffer to the module, through the communication bus.
| buff | The data. |
| len | The number of bytes. |
|
protected |
Initialize the module: autobaud, disable echo, configure the URCs etc. Called by begin().
| baud | The baud rate. |
| initType | The initialization type. |
| 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).
| invert | true to invert the power pin polarity. |
|
protected |
Allocate a zeroed char buffer (with calloc). Free it with free().
| num | The number of chars. |
| bool DevIridium9604::isGPSon | ( | void | ) |
Check if the GNSS is powered on (AT+UGPS?).
|
inline |
The most recent satellite service availability, from the +CIEV URCs. Call bufferedPoll() regularly to process the URCs.
|
inline |
Check if a non-blocking SBD session is in progress (or being cancelled).
Becomes false just before the callback is called.
| sfe_ip_address_t DevIridium9604::lastRemoteIP | ( | void | ) |
The remote IP address from the most recent socket listen (+UUSOLI) URC.
| IRIDIUM_9604_error_t DevIridium9604::modulePowerOff | ( | void | ) |
Gracefully disconnect from the network and power the module off (AT+CPWROFF).
| 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).
| 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).
| topic | The topic. |
| msg | The message. |
| msg_len | The message length (bytes). |
| qos | The QoS. |
| retain | true to retain the message. |
| 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).
| topic | The topic. |
| filename | The file (in the module's file system) containing the message. |
| qos | The QoS. |
| retain | true to retain the message. |
| 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).
| topic | The topic. |
| msg | The message. |
| qos | The QoS. |
| retain | true to retain the message. |
| 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).
| parameter | The parameter. |
|
protected |
Process a +UUSOLI URC: record the IP addresses and call the socket listen callback.
| listeningSocket | The listening socket. |
| localIP | The local IP address. |
| listeningPort | The listening port. |
| socket | The socket number. |
| remoteIP | The remote IP address. |
| port | The port. |
|
protected |
Read the TCP data indicated by a +UUSORD URC and pass it to the socket read callback(s).
| socket | The socket number. |
| length | The number of bytes indicated by the URC. |
|
protected |
Read the UDP data indicated by a +UUSORF URC and pass it to the socket read callback(s).
| socket | The socket number. |
| length | The number of bytes indicated by the URC. |
| 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().
| remote_host | The remote host name or IP address. |
| retry | The number of pings. |
| p_size | The ping size (bytes). |
| timeout | The timeout (ms). |
| ttl | The time to live (hops). |
| 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.
| 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.
|
protected |
Pulse the PWR_ON pin for a long time to perform a graceful shutdown. modulePowerOff() (+CPWROFF) is preferred.
|
protected |
Pulse the PWR_ON pin briefly to turn the module on.
|
protected |
Print the SBD session result (debug).
| session | The session result. |
| 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().
| sentence | The NMEA sentence: $ to the checksum, without the CR LF. |
| length | The sentence length. |
|
protected |
Non-blocking SBD session: check an event (line) from bufferedPoll for the session result, ERROR, +CME ERROR or ABORTED.
| event | The event. |
|
protected |
Pass one event (line) to the registered URC handlers.
| event | The event: one line, with the CR LF removed. |
|
protected |
Remove everything except the URCs from the backlog.
| IRIDIUM_9604_error_t DevIridium9604::querySocketLastError | ( | int | socket, |
| int * | error | ||
| ) |
Query the last socket error (AT+USOCTL=socket,1).
| socket | The socket number. |
| error | Returns the last error. |
| 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).
| socket | The socket number. |
| total | Returns the number of unacknowledged bytes. |
| 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).
| socket | The socket number. |
| address | Returns the remote IP address. |
| port | Returns the remote port. |
| 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).
| socket | The socket number. |
| status | Returns the TCP socket status. |
| 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).
| socket | The socket number. |
| total | Returns the total number of bytes received. |
| 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).
| socket | The socket number. |
| total | Returns the total number of bytes sent. |
| 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).
| socket | The socket number. |
| protocol | Returns the socket protocol. |
|
protected |
Read all the available serial data into inString.
| inString | Where to store the data. |
|
protected |
Read one character from the module.
| 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).
| pQos | Returns the QoS. |
| pTopic | Returns the topic. |
| readDest | Where to store the message. |
| readLength | The size of readDest. |
| bytesRead | Returns the number of bytes read. |
| 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.
| data | Where to store the data. |
| maxLength | The size of the buffer. |
| length | Returns the number of bytes read. |
| IRIDIUM_9604_error_t DevIridium9604::readSBDText | ( | char * | text, |
| size_t | maxLength | ||
| ) |
Read the mobile terminated buffer (AT+SBDR) as NULL-terminated text.
| text | Where to store the text. |
| maxLength | The size of text, including the NULL. |
| 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.
| location | The memory location. |
| unread | Returns the status: "REC UNREAD", "REC READ", "STO UNSENT" or "STO SENT". |
| from | Returns the originator. |
| dateTime | Returns the date and time. |
| message | Returns the message text. |
| IRIDIUM_9604_error_t DevIridium9604::registerOperator | ( | struct operator_stats | oper | ) |
Manually register with a network operator (AT+COPS=1).
| oper | The operator - from getOperators(). |
| IRIDIUM_9604_registration_status_t DevIridium9604::registration | ( | bool | eps = true | ) |
Read the network registration status (AT+CEREG? or AT+CREG?).
| eps | true to read the EPS registration status (+CEREG); false to read +CREG. |
| 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.
| 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.
| profile | The profile number. |
| IRIDIUM_9604_error_t DevIridium9604::resetSecurityProfile | ( | int | secprofile | ) |
Reset a security profile (AT+USECPRF=profile).
| secprofile | The security profile. -1 = default. |
| 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().
| 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).
| results | Returns the RSSI results in 1/10th dBm. Must hold IRIDIUM_9604_RFSCAN_NUM_CHANNELS (252) values. |
| numResults | Returns the number of values read. |
| timeout | The AT command timeout (ms). |
| IRIDIUM_9604_error_t DevIridium9604::sbdDetach | ( | int * | error = nullptr | ) |
Detach from the SBD gateway (AT+SBDDET).
| error | Returns the +SBDDET error code: 0 or negative - see getSBDErrorString() (optional). |
| IRIDIUM_9604_error_t DevIridium9604::sbdSession | ( | IRIDIUM_9604_sbd_session_t * | result | ) |
Initiate an SBD session (AT+SBDI). No ring alert support. Always detaches.
| result | Returns the session result. |
| 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.
| result | Returns the session result. |
| answeringRingAlert | true to use +SBDIXA - when the session is in response to a ring alert. |
| location | Optional location "[+|-]DDMM.MMM,[+|-]dddmm.mmm" (the Iridium 9602/9603 format - not documented for the 9604). nullptr omits it. |
|
protected |
Send an SBD session command (+SBDI / +SBDIX / +SBDIXA) and parse the result.
| command | The AT command, without the "AT". |
| responseTag | The response prefix, e.g. "+SBDIX:". |
| result | Returns the session result. |
|
protected |
Send an AT command. Processes any waiting serial data (URCs) into the backlog first.
| command | The AT command, without the "AT". |
| at | true to prefix the command with "AT". |
|
protected |
Send an AT command and wait for the expected response. Any other data (URCs) is added to the backlog.
| command | The AT command, without the "AT". |
| expectedResponse | The expected response. |
| responseDest | Where to store the response. Must be large enough. |
| commandTimeout | The timeout (ms). |
| destSize | The size of responseDest. 0 = minimumResponseAllocation. |
| at | true to prefix the command with "AT". |
| 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.
| command | The AT command, without the "AT". |
| expectedResponse | The expected response. |
| responseDest | Where to store the response. Must be large enough. |
| commandTimeout | The timeout (ms). |
| at | true to prefix the command with "AT". |
| 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().
| profile | The profile number. |
| path | The path, e.g. "/update". |
| responseFilename | The file (in the module's file system) the response will be written to. |
| 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.
| profile | The profile number. |
| path | The path, e.g. "/update". |
| responseFilename | The file (in the module's file system) the response will be written to. |
| data | The data. |
| httpContentType | The content type. |
| 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.
| profile | The profile number. |
| path | The path, e.g. "/update". |
| responseFilename | The file (in the module's file system) the response will be written to. |
| requestFile | The file (in the module's file system) containing the data to POST. |
| httpContentType | The content type. |
|
protected |
The common code for the high-level SBD send / receive methods.
| txData | The data to send. nullptr = send nothing. |
| txLength | The number of bytes to send. |
| txIsText | true if txData is text. |
| rxBuffer | Where to store the received MT message. nullptr = do not read the MT message. |
| rxLength | In: the size of rxBuffer. Out: the number of bytes received (0 if none). |
| 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!
| txData | The data to send. nullptr = send nothing. |
| txLength | The number of bytes to send. |
| rxBuffer | Where to store the received MT message. nullptr = do not read the MT message. |
| rxLength | In: the size of rxBuffer. Out: the number of bytes received (0 if none). |
| 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!
| message | The NULL-terminated message text, or nullptr to send nothing (a mailbox check). |
| rxBuffer | Where to store the received MT message. nullptr = do not read the MT message. |
| rxLength | In: the size of rxBuffer. Out: the number of bytes received (0 if none). |
| 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!
| txData | The data to send. nullptr = send nothing. |
| txLength | The number of bytes to send. |
| 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!
| message | The NULL-terminated message text. Maximum 340 bytes. |
| IRIDIUM_9604_error_t DevIridium9604::sendSMS | ( | sfe_string_t | number, |
| sfe_string_t | message | ||
| ) |
Send an SMS message (AT+CMGS).
| number | The destination phone number. |
| message | The message text. |
| 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.
| ubxHex | The UBX message in hex: e.g. "B5620A0400000E34" (poll UBX-MON-VER). |
| responseHex | If not nullptr, returns the response message in hex (spaces removed). Empty if there is no response. |
| responseHexSize | The size of responseHex (including the NULL). |
| timeout | The timeout (ms). The module times out after 10 s. |
| 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().
| msgClass | The UBX message class: e.g. 0x0A (MON). |
| msgId | The UBX message ID: e.g. 0x04 (VER). |
| payload | The payload. nullptr if payloadLen is 0 (e.g. for a poll). |
| payloadLen | The payload length. |
| response | If not nullptr, returns the complete response message: 0xB5 0x62, class, ID, length (2 bytes, little-endian), payload, checksum (2 bytes). |
| responseSize | The size of response. |
| responseLen | If not nullptr, returns the number of bytes stored in response. 0 if there is no response. |
| timeout | The timeout (ms). |
| 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.
| rate | The output rate: every rate seconds. 0 = disabled. Default: 1. |
| output | The output: IRIDIUM_9604_NMEA_OUTPUT_DISABLED (0), IRIDIUM_9604_NMEA_OUTPUT_MEMORY (1) or IRIDIUM_9604_NMEA_OUTPUT_URC (2). |
| 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).
| apn | The Access Point Name. |
| cid | The PDP context identifier. |
| pdpType | The PDP type. |
| 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.
| baud | The new baud rate. |
| IRIDIUM_9604_error_t DevIridium9604::setClock | ( | sfe_string_t | theTime | ) |
Set the module's real time clock (AT+CCLK).
| theTime | The time: "yy/MM/dd,hh:mm:ss+TZ". |
| 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.
| y | The year (two digits: years since 2000). |
| mo | The month (1-12). |
| d | The day of the month (1-31). |
| h | The hour (0-23). |
| min | The minute (0-59). |
| s | The second (0-59). |
| tz | The time zone, in quarters of an hour. E.g. -28 is 7 hours behind UTC. |
| 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.
| 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.
| theBus | The bus object to use - e.g. an SfeSerial. |
| 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).
| epsRegistrationCallback | The callback: status, tracking area code, cell ID, access technology. |
| 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().
| mode | 0: plain ERROR; 1: +CME ERROR: <numeric error code>; 2: +CME ERROR: <verbose error text>. |
| IRIDIUM_9604_error_t DevIridium9604::setFlowControl | ( | IRIDIUM_9604_flow_control_t | value = IRIDIUM_9604_ENABLE_FLOW_CONTROL | ) |
Enable or disable RTS/CTS hardware flow control (AT&K).
| value | IRIDIUM_9604_ENABLE_FLOW_CONTROL or IRIDIUM_9604_DISABLE_FLOW_CONTROL. |
| void DevIridium9604::setFTPCommandCallback | ( | void(*)(int command, int result) | ftpCommandRequestCallback | ) |
Set the callback for the FTP command result URC (+UUFTPCR).
| ftpCommandRequestCallback | The callback: command, result (1 = success). |
| 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).
| userName | The user name. |
| pwd | The password. |
| IRIDIUM_9604_error_t DevIridium9604::setFTPserver | ( | const sfe_string_t & | serverName | ) |
Set the FTP server name (AT+UFTP=1).
| serverName | The server name. |
| 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).
| timeout | The inactivity timeout (s). |
| cmd_linger | The command linger time (s). |
| data_linger | The data linger time (s). |
| 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).
| gnssAidingCallback | The 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.) |
| IRIDIUM_9604_error_t DevIridium9604::setGNSSAidingIndication | ( | bool | enable = true | ) |
Enable or disable the assisted GNSS indication URC (AT+UGIND). See setGNSSAidingCallback().
| enable | true to enable the +UUGIND URC. |
| 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>).
| timeZone | The time zone in quarter hours (as +CCLK): -96 to 96. The factory-programmed value is 0 (UTC). |
| 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).
| gpio | The GPIO pin. |
| mode | The mode. |
| value | The output value (GPIO_OUTPUT mode only). |
| void DevIridium9604::setGpsReadCallback | ( | void(*)(ClockData time, PositionData gps, SpeedData spd, unsigned long uncertainty) | gpsRequestCallback | ) |
Set the callback for the +UULOC location URC (see gpsRequest()).
| gpsRequestCallback | The callback: time, position, speed, uncertainty. |
| IRIDIUM_9604_error_t DevIridium9604::setHTTPauthentication | ( | int | profile, |
| bool | authenticate | ||
| ) |
Enable or disable HTTP authentication (AT+UHTTP=profile,4).
| profile | The profile number. |
| authenticate | true to enable authentication. |
| void DevIridium9604::setHTTPCommandCallback | ( | void(*)(int profile, int command, int result) | httpCommandRequestCallback | ) |
Set the callback for the HTTP command result URC (+UUHTTPCR).
| httpCommandRequestCallback | The callback: profile, command, result (1 = success). |
| 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".
| profile | The profile number. |
| header | The custom header. |
| IRIDIUM_9604_error_t DevIridium9604::setHTTPpassword | ( | int | profile, |
| sfe_string_t | password | ||
| ) |
Set the HTTP password (AT+UHTTP=profile,3).
| profile | The profile number. |
| password | The password. |
| 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).
| profile | The profile number. |
| secure | true to enable SSL/TLS. |
| secprofile | The security profile. -1 = default. |
| IRIDIUM_9604_error_t DevIridium9604::setHTTPserverIPaddress | ( | int | profile, |
| sfe_ip_address_t | address | ||
| ) |
Set the HTTP server IP address (AT+UHTTP=profile,0).
| profile | The profile number. |
| address | The server IP address. |
| IRIDIUM_9604_error_t DevIridium9604::setHTTPserverName | ( | int | profile, |
| sfe_string_t | server | ||
| ) |
Set the HTTP server name (AT+UHTTP=profile,1).
| profile | The profile number. |
| server | The server name. |
| IRIDIUM_9604_error_t DevIridium9604::setHTTPserverPort | ( | int | profile, |
| int | port | ||
| ) |
Set the HTTP server port (AT+UHTTP=profile,5). Default: 80.
| profile | The profile number. |
| port | The port. |
| IRIDIUM_9604_error_t DevIridium9604::setHTTPusername | ( | int | profile, |
| sfe_string_t | username | ||
| ) |
Set the HTTP user name (AT+UHTTP=profile,2).
| profile | The profile number. |
| username | The user name. |
| 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.
| mode | IRIDIUM_9604_CIER_MODE_ENABLE to enable the +CIEV URCs. |
| signalQuality | Enable the signal quality indication (+CIEV:0). |
| serviceAvailability | Enable the service availability indication (+CIEV:1). |
| svBeamCoordinates | Enable the SV and beam coordinates indication (+CIEV:3). |
|
protected |
Set the Mobile Network Operator profile (AT+UMNOPROF).
| mno | The Mobile Network Operator profile. |
| autoReset | true to reset the module after changing the profile. |
| urcNotification | true to enable the +UMNOPROF URC. |
| IRIDIUM_9604_error_t DevIridium9604::setMQTTclientId | ( | const sfe_string_t & | clientId | ) |
Set the MQTT client ID (AT+UMQTT=0).
| clientId | The client ID. |
| void DevIridium9604::setMQTTCommandCallback | ( | void(*)(int command, int result) | mqttCommandRequestCallback | ) |
Set the callback for the MQTT command result URC (+UUMQTTC).
| mqttCommandRequestCallback | The callback: command, result (1 = success). |
| 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).
| userName | The user name. |
| pwd | The password. |
| IRIDIUM_9604_error_t DevIridium9604::setMQTTsecure | ( | bool | secure, |
| int | secprofile = -1 |
||
| ) |
Enable or disable MQTT over TLS (AT+UMQTT=11).
| secure | true to enable SSL/TLS. |
| secprofile | The security profile. -1 = default. |
| IRIDIUM_9604_error_t DevIridium9604::setMQTTserver | ( | const sfe_string_t & | serverName, |
| int | port | ||
| ) |
Set the MQTT broker name and port (AT+UMQTT=2).
| serverName | The server name. |
| port | The port. |
| 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.
| mno | The Mobile Network Operator profile, e.g. MNO_GLOBAL. |
| autoReset | true to reset the module after changing the profile. |
| urcNotification | true to enable the +UMNOPROF URC. |
| 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.
| msgId | The NMEA message ID, e.g. "RMC". (Without the talker ID.) |
| callbackPointerPtr | The callback. nullptr clears the callback. |
| 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().
| msgId | The NMEA message ID, e.g. "RMC". (Without the talker ID.) |
| rate | The output rate: every rate seconds. 0 = disabled. Default: 1. |
| output | The output: IRIDIUM_9604_NMEA_OUTPUT_DISABLED (0), IRIDIUM_9604_NMEA_OUTPUT_MEMORY (1) or IRIDIUM_9604_NMEA_OUTPUT_URC (2). |
| 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().
| pingRequestCallback | The callback: retry number, ping size, remote host name, remote IP address, time to live, round trip time (ms). |
|
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.
| callback | The 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. |
| 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.
| rat | The radio access technology: IRIDIUM_9604_RAT_LTE_CAT_M1 or IRIDIUM_9604_RAT_SATELLITE. |
| autoReboot | true to change to minimum functionality before, and to reboot after, changing the RAT. |
| 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).
| registrationCallback | The callback: status, location area code, cell ID, access technology. |
|
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.
| callback | The 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. |
| void DevIridium9604::setSatelliteServiceAvailabilityCallback | ( | void(*)(bool serviceAvailable) | serviceAvailabilityCallback | ) |
Set the callback for the +CIEV service availability indication.
| serviceAvailabilityCallback | The callback: true if the service is available. |
| void DevIridium9604::setSatelliteSignalQualityCallback | ( | void(*)(int signalQuality) | signalQualityCallback | ) |
Set the callback for the +CIEV signal quality indication.
| signalQualityCallback | The callback: the signal quality (0-5). |
| 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).
| svBeamCallback | The callback: the SV and beam coordinates. |
|
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.
| timeout_ms | The timeout (ms). |
| IRIDIUM_9604_error_t DevIridium9604::setSBDAutoRegistration | ( | IRIDIUM_9604_sbdareg_mode_t | mode | ) |
Set the SBD automatic registration mode (AT+SBDAREG).
| mode | The automatic registration mode. |
| void DevIridium9604::setSBDAutoRegistrationCallback | ( | void(*)(IRIDIUM_9604_areg_event_t event, int regError) | autoRegistrationCallback | ) |
Set the callback for the +AREG automatic registration URC.
| autoRegistrationCallback | The callback: the +AREG event and the registration error code (see getSBDErrorString()). |
|
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).
| sbdCallback | The 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. |
| 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.
| dsc | The delivery short code (0-255). |
| IRIDIUM_9604_error_t DevIridium9604::setSBDSessionTimeout | ( | int | timeout | ) |
Set the SBD session timeout (AT+SBDST).
| timeout | The session timeout (s). 0 = infinite (the default after power-cycle). |
| 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).
| opcode | The operation. |
| parameter | The parameter. |
| name | The internal name of the certificate / key. |
| data | The certificate / key data. |
| IRIDIUM_9604_error_t DevIridium9604::setSimPin | ( | sfe_string_t | pin | ) |
Enter the SIM PIN (AT+CPIN).
| pin | The SIM PIN. |
| void DevIridium9604::setSIMstateReportCallback | ( | void(*)(IRIDIUM_9604_sim_states_t state) | simStateRequestCallback | ) |
Set the callback for the SIM state URC (+UUSIMSTAT). See setSIMstateReportingMode().
| simStateRequestCallback | The callback: the SIM state. |
| 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).
| mode | The mode: a combination of bits 0 to 2. |
| IRIDIUM_9604_error_t DevIridium9604::setSMSMessageFormat | ( | IRIDIUM_9604_message_format_t | textMode = IRIDIUM_9604_MESSAGE_FORMAT_TEXT | ) |
Set the SMS message format (AT+CMGF).
| textMode | The message format. |
| void DevIridium9604::setSocketCloseCallback | ( | void(*)(int) | socketCloseCallback | ) |
Set the callback for the socket close URC (+UUSOCL).
| socketCloseCallback | The callback: socket. |
| 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.
| socketListenCallback | The callback: listening socket, local IP address, listening port, socket, remote IP address, remote port. |
| 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.
| socketReadCallback | The callback: socket, data. |
| 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.
| socketReadCallbackPlus | The callback: socket, data, data length, remote IP address, remote port. |
| 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).
| urcPrefix | The URC prefix, including the colon, e.g. IRIDIUM_9604_CLOSE_SOCKET_URC ("+UUSOCL:"). |
| callback | The callback, cast to urcCallback_t. nullptr clears the callback. |
| index | Which of the URC's callbacks to set. Usually 0. |
| IRIDIUM_9604_error_t DevIridium9604::setUtimeConfiguration | ( | int32_t | offsetNanoseconds = 0, |
| int32_t | offsetSeconds = 0 |
||
| ) |
Set the time offsets (AT+UTIMECFG).
| offsetNanoseconds | The offset in nanoseconds. |
| offsetSeconds | The offset in seconds. |
| IRIDIUM_9604_error_t DevIridium9604::setUtimeIndication | ( | IRIDIUM_9604_utime_urc_configuration_t | config = IRIDIUM_9604_UTIME_URC_CONFIGURATION_ENABLED | ) |
Configure the +UUTIME time indication URC (AT+UTIMEIND).
| config | The URC configuration. |
| IRIDIUM_9604_error_t DevIridium9604::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).
| mode | The mode. |
| sensor | The time source sensor. |
| IRIDIUM_9604_error_t DevIridium9604::socketClose | ( | int | socket, |
| unsigned long | timeout = IRIDIUM_9604_2_MIN_TIMEOUT |
||
| ) |
Close a socket (AT+USOCL).
| socket | The socket number. |
| timeout | The timeout (ms). |
| 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.
| socket | The socket number. |
| address | The remote host name or IP address. |
| port | The port. |
| 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.
| socket | The socket number. |
| address | The remote host name or IP address. |
| port | The port. |
| IRIDIUM_9604_error_t DevIridium9604::socketDirectLinkCharacterTrigger | ( | int | socket, |
| int | characterTrigger | ||
| ) |
Set the direct link character trigger (AT+UDCONF=7).
| socket | The socket number. |
| characterTrigger | The trigger character. |
| IRIDIUM_9604_error_t DevIridium9604::socketDirectLinkCongestionTimer | ( | int | socket, |
| unsigned long | congestionTimer | ||
| ) |
Set the direct link congestion timer (AT+UDCONF=8).
| socket | The socket number. |
| congestionTimer | The congestion timer (ms). |
| IRIDIUM_9604_error_t DevIridium9604::socketDirectLinkDataLengthTrigger | ( | int | socket, |
| int | dataLengthTrigger | ||
| ) |
Set the direct link data length trigger (AT+UDCONF=6).
| socket | The socket number. |
| dataLengthTrigger | The data length trigger (bytes). |
| IRIDIUM_9604_error_t DevIridium9604::socketDirectLinkMode | ( | int | socket | ) |
Switch a socket into direct link (transparent) mode (AT+USODL).
| socket | The socket number. |
| IRIDIUM_9604_error_t DevIridium9604::socketDirectLinkTimeTrigger | ( | int | socket, |
| unsigned long | timerTrigger | ||
| ) |
Set the direct link time trigger (AT+UDCONF=5).
| socket | The socket number. |
| timerTrigger | The time trigger (ms). |
| int DevIridium9604::socketGetLastError | ( | ) |
Read the last socket error (AT+USOER).
| IRIDIUM_9604_error_t DevIridium9604::socketListen | ( | int | socket, |
| unsigned int | port | ||
| ) |
Listen for incoming connections on a socket (AT+USOLI). See setSocketListenCallback().
| socket | The socket number. |
| port | The port. |
| int DevIridium9604::socketOpen | ( | IRIDIUM_9604_socket_protocol_t | protocol, |
| unsigned int | localPort = 0 |
||
| ) |
Open a TCP or UDP socket (AT+USOCR).
| protocol | The protocol: IRIDIUM_9604_TCP or IRIDIUM_9604_UDP. |
| localPort | The local port. 0 = automatic. |
| 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.
| socket | The socket number. |
| length | The number of bytes to read. |
| readDest | Where to store the data. Must be at least length bytes. |
| bytesRead | Returns the number of bytes read (optional). |
| 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).
| socket | The socket number. |
| length | Returns the number of bytes available. |
| 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).
| socket | The socket number. |
| length | Returns the number of bytes available. |
| 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.
| socket | The socket number. |
| length | The number of bytes to read. |
| readDest | Where to store the data. Must be at least length bytes. |
| remoteIPAddress | Returns the remote IP address (optional). |
| remotePort | Returns the remote port (optional). |
| bytesRead | Returns the number of bytes read (optional). |
| IRIDIUM_9604_error_t DevIridium9604::socketSetSecure | ( | int | profile, |
| bool | secure, | ||
| int | secprofile = -1 |
||
| ) |
Enable or disable SSL/TLS on a socket (AT+USOSEC).
| profile | The profile number. |
| secure | true to enable SSL/TLS. |
| secprofile | The security profile. -1 = default. |
| 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.
| socket | The socket number. |
| str | The data to write. |
| len | The number of bytes to write. -1 = strlen(str). |
| IRIDIUM_9604_error_t DevIridium9604::socketWrite | ( | int | socket, |
| sfe_string_t | str | ||
| ) |
Write data to a TCP socket (AT+USOWR). OK for binary data.
| socket | The socket number. |
| str | The data to write. |
| 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.
| socket | The socket number. |
| address | The remote host name or IP address. |
| port | The port. |
| str | The data to write. |
| len | The number of bytes to write. -1 = strlen(str). |
| 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.
| socket | The socket number. |
| address | The remote host name or IP address. |
| port | The port. |
| str | The data to write. |
| len | The number of bytes to write. -1 = strlen(str). |
| 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.
| socket | The socket number. |
| address | The remote host name or IP address. |
| port | The port. |
| str | The data to write. |
| IRIDIUM_9604_error_t DevIridium9604::subscribeMQTTtopic | ( | int | max_Qos, |
| const sfe_string_t & | topic | ||
| ) |
Subscribe to an MQTT topic (AT+UMQTTC=4).
| max_Qos | The maximum QoS. |
| topic | The topic. |
| IRIDIUM_9604_error_t DevIridium9604::unlock | ( | const char * | unlockKey, |
| IRIDIUM_9604_lock_status_t * | status = nullptr |
||
| ) |
Unlock the module (AT+CULK).
| unlockKey | The unlock key: 16 hexadecimal digits. |
| status | Returns the lock status (optional). |
| IRIDIUM_9604_error_t DevIridium9604::unsubscribeMQTTtopic | ( | const sfe_string_t & | topic | ) |
Unsubscribe from an MQTT topic (AT+UMQTTC=5).
| topic | The topic. |
|
inline |
urcHandlerInterface: the debug printer, for the URC handlers.
| int DevIridium9604::urcGetLastSocketProtocol | ( | int | socket | ) |
urcHandlerInterface: the protocol of the most recent socket operation on a socket.
| socket | The socket number. |
| void DevIridium9604::urcIndicatorEvent | ( | int | indicator, |
| int | value | ||
| ) |
urcHandlerInterface: record the latest +CIEV indicator value.
| indicator | The indicator. |
| value | The indicator value. |
|
inline |
urcHandlerInterface: process one NMEA sentence from a +UUGNMEA URC.
| sentence | The NMEA sentence: $ to the checksum, without the CR LF. |
| length | The sentence length. |
| void DevIridium9604::urcSocketListenIndication | ( | sfe_ip_address_t | localIP, |
| sfe_ip_address_t | remoteIP | ||
| ) |
urcHandlerInterface: record the IP addresses from a +UUSOLI URC (see lastRemoteIP()).
| localIP | The local IP address. |
| remoteIP | The remote IP address. |
|
inline |
urcHandlerInterface: read the TCP data indicated by a +UUSORD URC and pass it to the socket read callback(s).
| socket | The socket number. |
| length | The number of bytes indicated by the URC. |
|
inline |
urcHandlerInterface: read the UDP data indicated by a +UUSORF URC and pass it to the socket read callback(s).
| socket | The socket number. |
| length | The number of bytes indicated by the URC. |
|
protected |
Wait for an expected response (or error) from the module. Any other data (URCs) is added to the backlog.
| expectedResponse | The expected response. |
| expectedError | The expected error response. |
| timeout | The timeout (ms). |
| int DevIridium9604::waitForSatelliteSignalQuality | ( | unsigned long | timeout = 60000 | ) |
Wait (calling bufferedPoll()) for the first +CIEV signal quality indication. Enables the indicator event reporting if required.
| timeout | The timeout (ms). |
|
virtual |
Write a buffer directly to the module serial port.
| buffer | The data to write. |
| size | The number of bytes to write. |
|
virtual |
Write a NULL-terminated string directly to the module serial port.
| str | The NULL-terminated string to write. |
|
virtual |
Write one byte directly to the module serial port.
| c | The byte to write. |
|
protected |
Write the PWR_ON pin: using the callback (if set), else the GPIO pin. Never drives the pin high: true releases it.
| state | The level the PWR_ON pin should see: false = low (asserted); true = released. |
|
protected |
Write the RESET_N pin: using the callback (if set), else the GPIO pin. Never drives the pin high: true releases it.
| state | The level the RESET_N pin should see: false = low (asserted); true = released. |
| 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.
| data | The data. Maximum 340 bytes. |
| length | The number of bytes. |
| status | Returns the +SBDW status: 0 = success (optional). |
| 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.
| text | The NULL-terminated text. Maximum 340 bytes. |
| status | Returns the +SBDW status: 0 = success (optional). |
|
protected |
Enable the automatic time zone update during begin().
|
protected |
The current baud rate.
|
protected |
Prevent reentry of bufferedPoll - just in case it gets called from a callback.
|
protected |
Prevent reentry of checkCallbacks.
|
protected |
extendedErrorCheck: the number of IRIDIUM_9604_RESPONSE_CME_ERROR characters matched.
|
protected |
extendedErrorCheck: the number of IRIDIUM_9604_RESPONSE_CMS_ERROR characters matched.
|
protected |
extendedErrorCheck: true while the <err> text is being read.
|
protected |
Invert the power pin polarity.
|
protected |
The backlog: data (URCs) received while waiting for an AT command response.
|
protected |
The backlog could contain binary data so we can't use strlen to find its length.
|
protected |
Allocated in DevIridium9604::begin.
|
protected |
The <err> from the most recent +CME ERROR / +CMS ERROR response.
|
protected |
The number of characters in _lastErrorText.
|
staticprotected |
The size of _lastErrorText.
|
protected |
The local IP address from the most recent +UUSOLI URC.
|
protected |
The remote IP address from the most recent +UUSOLI URC.
|
protected |
The result of the most recent SBD session.
|
protected |
The status of the most recent SBD session.
|
protected |
Record the protocol for each socket to avoid having to call querySocketType in parseSocketReadIndication.
|
protected |
The maximum number of initialization attempts.
|
protected |
The limit on bytes that can be read in a single read.
|
protected |
An incomplete line from bufferedPoll() - processed when the rest of the line arrives.
|
protected |
The length of _partialLine.
|
protected |
Prevent reentry of poll - just in case it gets called from a callback.
|
protected |
The PWR_ON pin write callback. nullptr = use _powerPin.
|
protected |
The PWR_ON pin. -1 if not connected.
|
protected |
A temporary buffer used by pruneBacklog().
|
protected |
The RESET_N pin. -1 if not connected.
|
protected |
The RESET_N pin write callback. nullptr = use _resetPin.
|
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!
|
protected |
From +CIEV:1.
|
protected |
From +CIEV:0.
|
protected |
The AT command timeout for SBD sessions (ms).
|
protected |
The SBD session callback. nullptr = blocking sessions.
|
protected |
The session is complete: call the callback.
|
protected |
The status for the callback.
|
protected |
true for +SBDIX / +SBDIXA; false for +SBDI.
|
protected |
true if the +SBDIX result was received.
|
protected |
true if the session was started by sendReceiveSBD: check the MO / MT status and read the MT message.
|
protected |
Set by sendReceiveSBD before it starts the session.
|
protected |
sendReceiveSBD: where to store the MT message.
|
protected |
sendReceiveSBD: the size of _sbdRxBuffer.
|
protected |
sendReceiveSBD: the size of _sbdRxBuffer in, the number of bytes received out.
|
protected |
millis when the non-blocking session started (or was cancelled).
|
protected |
The state of the non-blocking SBD session.
|
protected |
The UART.
|
protected |
The original socket read callback.
|
protected |
socket, data, length, remoteAddress, remotePort
|
staticprotected |
_sbdState: cancelSBDSession has been called. Waiting for the final result code
|
staticprotected |
_sbdState: no session in progress
|
staticprotected |
_sbdState: the session command has been sent. Waiting for the result
| SparkFun_Iridium_9604::nmeaMessageVector DevIridium9604::nmeaMessages |
The NMEA message objects - one per supported NMEA message.
| SparkFun_Iridium_9604::urcHandlerVector DevIridium9604::urcHandlers |
The URC handler objects - one per registered URC handler.