SparkFun Iridium 9604  v1.0.0
Library for the Iridium 9604 Hybrid LTE-M Cellular + Iridium Satellite (SBD) + GNSS IoT module
Loading...
Searching...
No Matches
Iridium_9604.h
Go to the documentation of this file.
1
38#pragma once
39
40#include "sfe_platform.h"
41#include "sfe_bus.h"
42#include "sfe_debug.h"
43#include "sfe_ip_address.h"
46#include "nmeaMessageVector.h"
47#include "urcHandlerVector.h"
48
49#include <stdio.h>
50#include <stdlib.h>
51#include <string.h>
52#include <math.h>
53
54#if defined(SFE_IRIDIUM_ARDUINO)
55#define IRIDIUM_9604_DEVICE_BASE_CLASSES public Print, public SparkFun_Iridium_9604::SfeDebugPrint, public SparkFun_Iridium_9604::urcHandlerInterface
56#else
57#define IRIDIUM_9604_DEVICE_BASE_CLASSES public SparkFun_Iridium_9604::SfeDebugPrint, public SparkFun_Iridium_9604::urcHandlerInterface
58#endif
59
62{
63public:
64 // The library's portable types. On Arduino: sfe_string_t is String; sfe_ip_address_t is IPAddress;
65 // sfe_print_t is Print. On ESP-IDF: std::string; SparkFun_Iridium_9604::SfeIPAddress; SparkFun_Iridium_9604::SfeOutput.
66 typedef SparkFun_Iridium_9604::sfe_string_t sfe_string_t;
67 typedef SparkFun_Iridium_9604::sfe_ip_address_t sfe_ip_address_t;
68 typedef SparkFun_Iridium_9604::sfe_print_t sfe_print_t;
72
73 // Constructor
74 // The library will use the powerPin and resetPin (if provided) to power the module off/on and perform an emergency reset
75 // maxInitTries sets the maximum number of initialization attempts. init is called by begin.
85 DevIridium9604(int powerPin = IRIDIUM_9604_POWER_PIN, int resetPin = IRIDIUM_9604_RESET_PIN, uint8_t maxInitTries = 9);
86
91
92 // Communication bus. Called by the begin() methods of SFE_IRIDIUM_9604 (see SparkFun_Iridium_9604.h)
99 // Initialize the module and ensure it's connected. Called by the begin() methods of SFE_IRIDIUM_9604
106 bool begin(unsigned long baud);
107
108 // Debug prints
109#if defined(SFE_IRIDIUM_ARDUINO)
115 void enableDebugging(sfe_print_t &debugPort = Serial); // Turn on debug printing. If user doesn't specify then Serial will be used.
121 void enableAtDebugging(sfe_print_t &debugPort = Serial); // Turn on AT debug printing. If user doesn't specify then Serial will be used.
122#else
128 void enableDebugging(sfe_print_t &debugPort = SparkFun_Iridium_9604::sfeStdout); // Turn on debug printing. If user doesn't specify then stdout will be used.
134 void enableAtDebugging(sfe_print_t &debugPort = SparkFun_Iridium_9604::sfeStdout); // Turn on AT debug printing. If user doesn't specify then stdout will be used.
135#endif
139 void disableDebugging(void); // Turn off debug printing
143 void disableAtDebugging(void); // Turn off AT debug printing
144
145 // Invert the polarity of the power pin - if required
146 // Normally the module's power pin is pulled low and released to toggle the power
147 // But the Asset Tracker needs this to be pulled high and released instead
155 void invertPowerPin(bool invert = false);
156
190 void hwReset(void);
197 void hwEmergencyShutdown(void);
198
204 IRIDIUM_9604_error_t modulePowerOff(void); // Graceful disconnect and shutdown using +CPWROFF.
208 void modulePowerOn(void); // Requires access to the PWR_ON pin
209
210 // Loop polling and polling setup - process URC's etc. from the module
211
212 // This function was originally written by Matthew Menze for the LTE Shield (SARA-R4) library
213 // See: https://github.com/sparkfun/SparkFun_LTE_Shield_Arduino_Library/pull/8
214 // It does the same job as ::poll but also processes any 'old' data stored in the backlog first
215 // It also has a built-in timeout - which ::poll does not
216 // Use this - it is way better than ::poll. Thank you Matthew!
217 // bufferedPoll also calls checkCallbacks - to call any NMEA callbacks which are waiting
227 bool bufferedPoll(void);
228
229 // This is the original poll function.
230 // It is 'blocking' - it does not return when serial data is available until it receives a `\n`.
231 // ::bufferedPoll is the new improved version. It processes any data in the backlog and includes a timeout.
232 // Retained for backward-compatibility and just in case you do want to (temporarily) ignore any data in the backlog
238 bool poll(void);
239
240 // Check if any (NMEA) callbacks are waiting to be processed. Called automatically by bufferedPoll
244 void checkCallbacks(void);
245
246 // Callbacks (called during polling)
247 // Generic URC callback registration: urcPrefix is the URC prefix, including the colon, e.g. IRIDIUM_9604_CLOSE_SOCKET_URC ("+UUSOCL:")
248 // index selects which of the URC's callbacks to set (usually 0). See urcHandler.h and the urcHandlers folder for the callback signatures.
249 // Returns false if no handler is registered for urcPrefix.
260 bool setURCCallback(const char *urcPrefix, urcCallback_t callback, uint8_t index = 0);
261
267 void setSocketListenCallback(void (*socketListenCallback)(int, sfe_ip_address_t, unsigned int, int, sfe_ip_address_t, unsigned int)); // listen Socket, local IP Address, listen Port, socket, remote IP Address, port
268 // This is the original read socket callback - called when a +UUSORD or +UUSORF URC is received
269 // It works - and handles binary data correctly - but the remote IP Address and Port are lost for UDP connections
270 // setSocketReadCallbackPlus is preferred!
278 void setSocketReadCallback(void (*socketReadCallback)(int, sfe_string_t)); // socket, read data
284 void setSocketReadCallbackPlus(void (*socketReadCallbackPlus)(int, const char *, int, sfe_ip_address_t, int)); // socket, read data, length, remoteAddress, remotePort
290 void setSocketCloseCallback(void (*socketCloseCallback)(int)); // socket
298 void setGpsReadCallback(void (*gpsRequestCallback)(ClockData time,
299 PositionData gps, SpeedData spd, unsigned long uncertainty));
305 void setSIMstateReportCallback(void (*simStateRequestCallback)(IRIDIUM_9604_sim_states_t state));
316 void setGNSSAidingCallback(void (*gnssAidingCallback)(int aidMode, int result));
322 void setPingCallback(void (*pingRequestCallback)(int retry, int p_size, sfe_string_t remote_hostname, sfe_ip_address_t ip, int ttl, long rtt));
328 void setHTTPCommandCallback(void (*httpCommandRequestCallback)(int profile, int command, int result));
334 void setMQTTCommandCallback(void (*mqttCommandRequestCallback)(int command, int result));
340 void setFTPCommandCallback(void (*ftpCommandRequestCallback)(int command, int result));
341
349 unsigned int lac, unsigned int ci, int Act));
357 unsigned int tac, unsigned int ci, int Act));
358
359 // Direct write/print to the module serial port
360 // On Arduino, DevIridium9604 is a Print - so you can also use print() and println()
367 virtual size_t write(uint8_t c);
374 virtual size_t write(const char *str);
382 virtual size_t write(const char *buffer, size_t size);
383#if defined(SFE_IRIDIUM_ARDUINO)
384 using Print::write;
385#endif
386
387 // General AT Commands
400 IRIDIUM_9604_error_t enableEcho(bool enable = true);
411 IRIDIUM_9604_error_t setErrorReporting(uint8_t mode = 2);
421 const char *getLastErrorText(void) { return _lastErrorText; }
451 sfe_string_t getIMEI(void); // The cellular IMEI. See getSatelliteIMEI for the satellite IMEI
457 sfe_string_t getIMSI(void);
463 sfe_string_t getCCID(void);
476
477 // Control and status AT commands
492 sfe_string_t clock(void);
493 // TODO: Return a clock struct
506 IRIDIUM_9604_error_t clock(uint8_t *y, uint8_t *mo, uint8_t *d,
507 uint8_t *h, uint8_t *min, uint8_t *s, int8_t *tz); // TZ can be +/- and is in increments of 15 minutes. -28 == 7 hours behind UTC/GMT
527 IRIDIUM_9604_error_t setClock(uint8_t y, uint8_t mo, uint8_t d,
528 uint8_t h, uint8_t min, uint8_t s, int8_t tz); // TZ can be +/- and is in increments of 15 minutes. -28 == 7 hours behind UTC/GMT
534 void autoTimeZoneForBegin(bool enable = true); // Call autoTimeZoneForBegin(false) _before_ .begin if you want to disable the automatic time zone
541 IRIDIUM_9604_error_t autoTimeZone(bool enable); // Enable/disable automatic time zone adjustment
579 IRIDIUM_9604_error_t setUtimeConfiguration(int32_t offsetNanoseconds = 0, int32_t offsetSeconds = 0); // +UTIMECFG
587 IRIDIUM_9604_error_t getUtimeConfiguration(int32_t *offsetNanoseconds, int32_t *offsetSeconds);
588
589 // Network service AT commands
597 int8_t rssi(void); // Receive signal strength (+CSQ). Cellular (LTE-M) only. For the satellite signal quality, see setIndicatorEventReporting
605
621 bool setNetworkProfile(mobile_network_operator_t mno, bool autoReset = false, bool urcNotification = false);
629 typedef enum
630 {
635 PDP_TYPE_IPV6 = 3
645 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
655 IRIDIUM_9604_error_t getAPN(int cid, sfe_string_t *apn, sfe_ip_address_t *ip, IRIDIUM_9604_pdp_type *pdpType = nullptr); // Return the apn and IP address for the chosen context identifier
656
671
672 // SIM
673 // Status report Mode:
674 // Bit States reported
675 // 0 Reports the (U)SIM initialization status (<state>'s from 0 to 6 may be reported)
676 // 1 Reports the (U)SIM phonebook initialization status (<state>'s from 7 to 8 may be reported)
677 // 2 Reports the (U)SIM toolkit REFRESH proactive command execution result (<state>'s from 9 to 13 may be reported)
678 // Note: For the SARA-R5: <state>=7, 8, 9, 10, 11, 12 and 13 are not reported.
693
695 typedef enum
696 {
712 IRIDIUM_9604_error_t enterPPP(uint8_t cid = 1, char dialing_type_char = 0,
713 unsigned long dialNumber = 99, IRIDIUM_9604_l2p_t l2p = L2P_DEFAULT);
714
722 uint8_t getOperators(struct operator_stats *op, int maxOps = 3);
749
750 // Radio Access Technology (+URAT). New for the 9604
751 // The module must be in minimum functionality (functionality(MINIMUM_FUNCTIONALITY)) to change the RAT,
752 // and must be rebooted (functionality(SILENT_RESET_WITH_SIM) / reset()) for the change to take effect.
753 // setRAT does all of this for you if autoReboot is true.
763 IRIDIUM_9604_error_t setRAT(IRIDIUM_9604_rat_t rat, bool autoReboot = true);
770
771 // SMS -- Short Messages Service
795 IRIDIUM_9604_error_t getPreferredMessageStorage(int *used, int *total, sfe_string_t memory = "ME");
806 IRIDIUM_9604_error_t readSMSmessage(int location, sfe_string_t *unread, sfe_string_t *from, sfe_string_t *dateTime, sfe_string_t *message);
814 IRIDIUM_9604_error_t deleteSMSmessage(int location, int deleteFlag = 0); // Default to deleting the single message at the specified location
820 IRIDIUM_9604_error_t deleteReadSMSmessages(void) { return (deleteSMSmessage( 1, 1 )); }; // Delete all the read messages from preferred storage
826 IRIDIUM_9604_error_t deleteReadSentSMSmessages(void) { return (deleteSMSmessage( 1, 2 )); }; // Delete the read and sent messages from preferred storage
832 IRIDIUM_9604_error_t deleteReadSentUnsentSMSmessages(void) { return (deleteSMSmessage( 1, 3 )); }; // Delete the read, sent and unsent messages from preferred storage
838 IRIDIUM_9604_error_t deleteAllSMSmessages(void) { return (deleteSMSmessage( 1, 4 )); }; // Delete the read, sent, unsent and unread messages from preferred storage
839
840 // V24 Control and V25ter (UART interface) AT commands
847 IRIDIUM_9604_error_t setBaud(unsigned long baud);
855
859 typedef enum
860 {
861 GPIO1 = 16,
862 GPIO2 = 23,
863 GPIO3 = 24,
864 GPIO4 = 25,
865 GPIO5 = 42,
866 GPIO6 = 19
871 typedef enum
872 {
909 PAD_DISABLED = 255
927
928 // IP Transport Layer
936 int socketOpen(IRIDIUM_9604_socket_protocol_t protocol, unsigned int localPort = 0); // Open a socket. Returns the socket number.
944 IRIDIUM_9604_error_t socketClose(int socket, unsigned long timeout = IRIDIUM_9604_2_MIN_TIMEOUT); // Close the socket
953 IRIDIUM_9604_error_t socketConnect(int socket, const char *address, unsigned int port); // TCP - connect to a remote IP Address using the specified port. Not required for UDP sockets.
962 IRIDIUM_9604_error_t socketConnect(int socket, sfe_ip_address_t address, unsigned int port);
963 // Write data to the specified socket. Works with binary data - but you must specify the data length when using the const char * version
964 // Works with both TCP and UDP sockets - but socketWriteUDP is preferred for UDP and doesn't require socketOpen to be called first
973 IRIDIUM_9604_error_t socketWrite(int socket, const char *str, int len = -1);
981 IRIDIUM_9604_error_t socketWrite(int socket, sfe_string_t str); // OK for binary data
982 // Write UDP data to the specified IP Address and port.
983 // Works with binary data - but you must specify the data length when using the const char * versions
984 // If you let len default to -1, strlen is used to calculate the data length - and will be incorrect for binary data
995 IRIDIUM_9604_error_t socketWriteUDP(int socket, const char *address, int port, const char *str, int len = -1);
1006 IRIDIUM_9604_error_t socketWriteUDP(int socket, sfe_ip_address_t address, int port, const char *str, int len = -1);
1016 IRIDIUM_9604_error_t socketWriteUDP(int socket, sfe_string_t address, int port, sfe_string_t str);
1017 // Read data from the specified socket
1018 // Call socketReadAvailable first to determine how much data is available - or use the callbacks (triggered by URC's)
1019 // Works for both TCP and UDP - but socketReadUDP is preferred for UDP as it records the remote IP Address and port
1020 // bytesRead - if provided - will be updated with the number of bytes actually read. This could be less than length!
1030 IRIDIUM_9604_error_t socketRead(int socket, int length, char *readDest, int *bytesRead = nullptr);
1031 // Return the number of bytes available (waiting to be read) on the chosen socket
1032 // Uses +USORD. Valid for both TCP and UDP sockets - but socketReadAvailableUDP is preferred for UDP
1040 IRIDIUM_9604_error_t socketReadAvailable(int socket, int *length);
1041 // Read data from the specified UDP port
1042 // Call socketReadAvailableUDP first to determine how much data is available - or use the callbacks (triggered by URC's)
1043 // The remote IP Address and port are returned via *remoteIPAddress and *remotePort (if not nullptr)
1044 // bytesRead - if provided - will be updated with the number of bytes actually read. This could be less than length!
1056 IRIDIUM_9604_error_t socketReadUDP(int socket, int length, char *readDest, sfe_ip_address_t *remoteIPAddress = nullptr, int *remotePort = nullptr, int *bytesRead = nullptr);
1057 // Return the number of bytes available (waiting to be read) on the chosen UDP socket
1065 IRIDIUM_9604_error_t socketReadAvailableUDP(int socket, int *length);
1066 // Start listening for a connection on the specified port. The connection is reported via the socket listen callback
1074 IRIDIUM_9604_error_t socketListen(int socket, unsigned int port);
1075 // Place the socket into direct link mode - making it easy to transfer binary data. Wait two seconds and then send +++ to exit the link.
1083 // Configure when direct link data is sent
1091 IRIDIUM_9604_error_t socketDirectLinkTimeTrigger(int socket, unsigned long timerTrigger);
1099 IRIDIUM_9604_error_t socketDirectLinkDataLengthTrigger(int socket, int dataLengthTrigger);
1107 IRIDIUM_9604_error_t socketDirectLinkCharacterTrigger(int socket, int characterTrigger);
1115 IRIDIUM_9604_error_t socketDirectLinkCongestionTimer(int socket, unsigned long congestionTimer);
1116 // Use +USOCTL (Socket control) to query the socket parameters
1132 IRIDIUM_9604_error_t querySocketLastError(int socket, int *error);
1140 IRIDIUM_9604_error_t querySocketTotalBytesSent(int socket, uint32_t *total);
1148 IRIDIUM_9604_error_t querySocketTotalBytesReceived(int socket, uint32_t *total);
1157 IRIDIUM_9604_error_t querySocketRemoteIPAddress(int socket, sfe_ip_address_t *address, int *port);
1173 IRIDIUM_9604_error_t querySocketOutUnackData(int socket, uint32_t *total);
1174 // enable / disable socket securoty
1183 IRIDIUM_9604_error_t socketSetSecure(int profile, bool secure, int secprofile = -1);
1184 // Return the most recent socket error
1190 int socketGetLastError();
1191 // Return the remote IP Address from the most recent socket listen indication (socket connection)
1192 // Use the socket listen callback to get the full address and port information
1199
1200 // Ping
1211 IRIDIUM_9604_error_t ping(sfe_string_t remote_host, int retry = 4, int p_size = 32, unsigned long timeout = 5000, int ttl = 32);
1212
1213 // HTTP
1220 IRIDIUM_9604_error_t resetHTTPprofile(int profile); // Reset the HTTP profile. Note: The configured HTTP profile parameters are not saved in the non volatile memory.
1228 IRIDIUM_9604_error_t setHTTPserverIPaddress(int profile, sfe_ip_address_t address); // Default: empty string
1236 IRIDIUM_9604_error_t setHTTPserverName(int profile, sfe_string_t server); // Default: empty string
1244 IRIDIUM_9604_error_t setHTTPusername(int profile, sfe_string_t username); // Default: empty string
1252 IRIDIUM_9604_error_t setHTTPpassword(int profile, sfe_string_t password); // Default: empty string
1260 IRIDIUM_9604_error_t setHTTPauthentication(int profile, bool authenticate); // Default: no authentication
1268 IRIDIUM_9604_error_t setHTTPserverPort(int profile, int port); // Default: 80
1276 IRIDIUM_9604_error_t setHTTPcustomHeader(int profile, sfe_string_t header); // Default: format 0:Content-Type:application/json"
1285 IRIDIUM_9604_error_t setHTTPsecure(int profile, bool secure, int secprofile = -1); // Default: disabled (HTTP on port 80). Set to true for HTTPS on port 443
1286 // TO DO: Add custom request headers
1295 IRIDIUM_9604_error_t getHTTPprotocolError(int profile, int *error_class, int *error_code); // Read the most recent HTTP protocol error for this profile
1304 IRIDIUM_9604_error_t sendHTTPGET(int profile, sfe_string_t path, sfe_string_t responseFilename);
1315 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);
1326 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);
1327
1349 IRIDIUM_9604_error_t setMQTTserver(const sfe_string_t& serverName, int port);
1365 IRIDIUM_9604_error_t setMQTTsecure(bool secure, int secprofile = -1);
1385 IRIDIUM_9604_error_t subscribeMQTTtopic(int max_Qos, const sfe_string_t& topic);
1403 IRIDIUM_9604_error_t readMQTT(int* pQos, sfe_string_t* pTopic, uint8_t *readDest, int readLength, int *bytesRead);
1413 IRIDIUM_9604_error_t mqttPublishTextMsg(const sfe_string_t& topic, const char * const msg, uint8_t qos = 0, bool retain = false);
1424 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);
1434 IRIDIUM_9604_error_t mqttPublishFromFile(const sfe_string_t& topic, const sfe_string_t& filename, uint8_t qos = 0, bool retain = false);
1442 IRIDIUM_9604_error_t getMQTTprotocolError(int *error_code, int *error_code2);
1443
1444 // FTP
1460 IRIDIUM_9604_error_t setFTPtimeouts(const unsigned int timeout, const unsigned int cmd_linger, const unsigned int data_linger);
1495 IRIDIUM_9604_error_t getFTPprotocolError(int *error_code, int *error_code2);
1496
1497 // Configure security profiles
1541
1542 // PDP (Packet Data Protocol) contexts - the cellular data connection
1543 // The Iridium 9604 does not support the SARA-R5's u-blox data profiles (AT+UPSD, AT+UPSDA and AT+UPSND), so the
1544 // SARA-R5 library's setPDPconfiguration(), performPDPaction(), getNetworkAssignedIPAddress() and setPSDActionCallback()
1545 // have been removed. The 9604's internal TCP/IP stack (sockets, ping, DNS, HTTP, MQTT) uses a single PDP context: the one
1546 // set by AT+UDCONF=19 (factory value: cid 1, the default EPS bearer, which the network activates during the LTE attach).
1547 // Use getDefaultPDPcontext(), getPDPcontextState(), activatePDPcontext() and getPDPaddress() instead.
1557 IRIDIUM_9604_error_t getDefaultPDPcontext(int *cid, int *preferredProtocol = nullptr);
1565 IRIDIUM_9604_error_t getPDPcontextState(int cid, bool *active);
1573 IRIDIUM_9604_error_t activatePDPcontext(bool status, int cid = -1); // Activates or deactivates the specified PDP context. Default to all (cid = -1)
1585
1586 // GNSS
1587 // The gnss_system_t and gnss_aiding_mode_t enums are now global (IRIDIUM_9604_gnss_system_t and
1588 // IRIDIUM_9604_gnss_aiding_mode_t - see Iridium_9604_typedefs.h). These typedefs keep the old names.
1589 // To combine GNSS systems, cast the sum: (gnss_system_t)(GNSS_SYSTEM_GPS | GNSS_SYSTEM_GALILEO)
1597 bool isGPSon(void);
1608 IRIDIUM_9604_error_t gpsPower(bool enable = true,
1609 gnss_system_t gnss_sys = GNSS_SYSTEM_GPS,
1611
1612 // Note: gpsEnableRmc(), gpsGetRmc() and parseGPRMCString() have been removed. They used the deprecated +UGRMC command.
1613 // Use the NMEA methods instead (see "GNSS NMEA" below): e.g. setNMEAoutput("RMC", 1, IRIDIUM_9604_NMEA_OUTPUT_URC) and
1614 // setNmeaCallbackPtr("RMC", &callback); or getNMEA("RMC") and getNMEAfield("RMC", "lat", value).
1615
1616 // +ULOC is not documented in the Iridium 9604 AT commands manual (v1.5 BETA). gpsRequest is retained but may not be supported.
1628 IRIDIUM_9604_error_t gpsRequest(unsigned int timeout, uint32_t accuracy, bool detailed = true, unsigned int sensor = 3);
1629
1630 //CellLocate
1645 IRIDIUM_9604_error_t gpsAidingServerConf(const char *primaryServer, const char *secondaryServer, const char *authToken,
1646 unsigned int days = 14, unsigned int period = 4, unsigned int resolution = 1,
1647 unsigned int gnssTypes = 65, unsigned int mode = 0, unsigned int dataType = 15);
1648
1649 // GNSS state, aiding and UBX - new for the Iridium 9604 library. The 9604 contains a u-blox M10 GNSS
1658 IRIDIUM_9604_error_t gpsGetState(bool *on, int *aiding = nullptr, int *systems = nullptr);
1708 IRIDIUM_9604_error_t sendUBX(const char *ubxHex, char *responseHex = nullptr, size_t responseHexSize = 0,
1709 unsigned long timeout = IRIDIUM_9604_10_SEC_TIMEOUT + 1000);
1724 IRIDIUM_9604_error_t sendUBXmessage(uint8_t msgClass, uint8_t msgId, const uint8_t *payload, uint16_t payloadLen,
1725 uint8_t *response = nullptr, size_t responseSize = 0, size_t *responseLen = nullptr,
1726 unsigned long timeout = IRIDIUM_9604_10_SEC_TIMEOUT + 1000);
1727
1728 // File system
1729 // TO DO: add full support for file tags. Default tag to USER
1737 IRIDIUM_9604_error_t getFileContents(sfe_string_t filename, sfe_string_t *contents); // OK for text files. But will fail with binary files (containing \0) on some platforms.
1745 IRIDIUM_9604_error_t getFileContents(sfe_string_t filename, char *contents); // OK for binary files. Make sure contents can hold the entire file. Get the size first with getFileSize.
1756 IRIDIUM_9604_error_t getFileBlock(const sfe_string_t& filename, char* buffer, size_t offset, size_t requestedLength, size_t& bytesRead); // OK for binary files. Make sure buffer can hold the requested block size.
1757
1758 // Append data to a file, delete file first to not appends the data.
1775 IRIDIUM_9604_error_t appendFileContents(sfe_string_t filename, const char *str, int len);
1783 IRIDIUM_9604_error_t getFileSize(sfe_string_t filename, int *size);
1791
1792
1793 // Functionality
1801
1802 // Send a custom command with an expected (potentially partial) response, store entire response
1813 IRIDIUM_9604_error_t sendCustomCommandWithResponse(const char *command, const char *expectedResponse,
1814 char *responseDest, unsigned long commandTimeout = IRIDIUM_9604_STANDARD_RESPONSE_TIMEOUT, bool at = true);
1815
1816 // ===========================================================================================
1817 // GNSS NMEA (+UGNMEA and the +UUGNMEA URC) - new for the 9604
1818 //
1819 // The NMEA message classes (DTM, GBS, GGA, GLL, GNS, GRS, GSA, GST, GSV, RMC, VLW, VTG, ZDA) are
1820 // based on the GNSS v4 NMEA message classes: each field can be extracted by name. See the
1821 // src/nmeaMessages folder for the field names.
1822 //
1823 // The GNSS must be powered on (gpsPower()) on the same UART as the library: the module sends the
1824 // +UUGNMEA URCs to the terminal on which GNSS was started with AT+UGPS.
1825 // ===========================================================================================
1826
1827 // Configure one NMEA message: AT+UGNMEA=<tag>,<rate>,<output>
1828 // msgId: "DTM", "GBS", "GGA", "GLL", "GNS", "GRS", "GSA", "GST", "GSV", "RMC", "VLW", "VTG" or "ZDA"
1829 // rate: the number of navigation solutions per message. 0 disables the message
1830 // output: a combination of IRIDIUM_9604_NMEA_OUTPUT_MEMORY (1), IRIDIUM_9604_NMEA_OUTPUT_URC (2) and IRIDIUM_9604_NMEA_OUTPUT_UART (4)
1841 IRIDIUM_9604_error_t setNMEAoutput(const char *msgId, uint8_t rate = 1, uint8_t output = IRIDIUM_9604_NMEA_OUTPUT_URC);
1842 // Configure all thirteen NMEA messages with the same rate and output
1850 IRIDIUM_9604_error_t setAllNMEAoutput(uint8_t rate = 1, uint8_t output = IRIDIUM_9604_NMEA_OUTPUT_URC);
1851 // Disable all thirteen NMEA messages
1858 // Read the configuration of one NMEA message: AT+UGNMEA=<tag>
1867 IRIDIUM_9604_error_t getNMEAoutput(const char *msgId, uint8_t *rate, uint8_t *output);
1868
1869 // Read (and empty) the module's NMEA memory buffer: AT+UGNMEA?
1870 // Every valid NMEA message in the buffer is processed: stored for getNMEA / getNMEAfield and passed to any callbacks.
1879
1896
1897 // Has fresh data arrived for this NMEA message? ("One-shot": returns true once per message)
1898 // If the message is not enabled for URC output (setNMEAoutput) and pollIfNoURC is true, pollNMEA is called first.
1899 // Call bufferedPoll regularly to process the +UUGNMEA URCs.
1907 bool getNMEA(const char *msgId, bool pollIfNoURC = true);
1908 // Extract one field (by name) from the most recent copy of the message. Returns false if the field is empty or not found
1917 bool getNMEAfield(const char *msgId, const char *field, sfe_string_t &value);
1918 // Mark the message data as stale
1924 void flushNMEA(const char *msgId);
1925
1926 // NMEA callbacks - as GNSS v4. The callback is called by checkCallbacks (and so by bufferedPoll) each time the message arrives
1927 // Note: this does not enable the message. Call setNMEAoutput too.
1935 bool setNmeaCallbackPtr(const char *msgId, void (*callbackPointerPtr)(nmeaCallbackDataCommon_t *));
1936 // Factory: hands back the opaque per-message object a callback's nmeaCallbackDataCommon_t* points at
1944 // Extract a named field from the message a callback just fired for (reads its callback copy)
1952 sfe_string_t getNmeaMessageFieldCallback(nmeaMessage *theMessage, const char *fieldName);
1953 // Extract a named field from the message's most recent copy
1961 sfe_string_t getNmeaMessageField(nmeaMessage *theMessage, const char *fieldName);
1962 // Extract a named field from repeated block 'blockIndex' of a variable-length message (GSV) - callback copy
1971 sfe_string_t getNmeaMessageBlockFieldCallback(nmeaMessage *theMessage, uint16_t blockIndex, const char *fieldName);
1972 // Extract a named field from repeated block 'blockIndex' of a variable-length message (GSV) - most recent copy
1981 sfe_string_t getNmeaMessageBlockField(nmeaMessage *theMessage, uint16_t blockIndex, const char *fieldName);
1982 // Find the registered message object by name ("GGA" etc.). nullptr if not found
1989 nmeaMessage *getNmeaMessageByName(const char *msgId) { return nmeaMessages.find(msgId); }
1990
1991 // Process one NMEA sentence: check the checksum, store it, queue the callback. Called by the +UUGNMEA URC handler
1992 // and by pollNMEA. You can call this yourself to process NMEA data from another source.
2000 bool processNMEA(const char *sentence, size_t length);
2001
2002 // ===========================================================================================
2003 // Satellite (Iridium SBD) - section 26 of the 9604 AT commands manual - new for the 9604
2004 //
2005 // Select the satellite RAT first: setRAT(IRIDIUM_9604_RAT_SATELLITE)
2006 // ===========================================================================================
2007
2008 // +USATSN: the satellite serial number (6 alphanumeric characters) and the 15 digit satellite (SBD) IMEI
2022 sfe_string_t getSatelliteIMEI(void); // The 15 digit SBD IMEI. Empty if the read fails
2028 sfe_string_t getSatelliteSerialNumber(void); // The satellite serial number. Empty if the read fails
2029
2030 // +USATINFO: satellite system information. Only available in the satellite RAT
2038
2039 // +CIER: indicator event reporting (+CIEV URCs)
2050 bool signalQuality = true, bool serviceAvailability = true,
2051 bool svBeamCoordinates = false);
2062 bool *serviceAvailability, bool *svBeamCoordinates);
2063 // The most recent satellite signal quality (0-5 bars) and service availability, from the +CIEV URCs.
2064 // -1 if not yet known. Call bufferedPoll regularly to process the URCs.
2077 // Wait (calling bufferedPoll) for the first +CIEV signal quality indication. Returns the signal quality (0-5) or -1 on timeout.
2078 // Enables the indicator event reporting (setIndicatorEventReporting) if needed.
2085 int waitForSatelliteSignalQuality(unsigned long timeout = 60000);
2086 // +CIEV callbacks
2092 void setSatelliteSignalQualityCallback(void (*signalQualityCallback)(int signalQuality));
2098 void setSatelliteServiceAvailabilityCallback(void (*serviceAvailabilityCallback)(bool serviceAvailable));
2104 void setSatelliteSVBeamCallback(void (*svBeamCallback)(IRIDIUM_9604_sv_beam_coords_t coords));
2105
2106 // +CULK: unlock (unlockKey is 16 hexadecimal digits) and lock status
2114 IRIDIUM_9604_error_t unlock(const char *unlockKey, IRIDIUM_9604_lock_status_t *status = nullptr);
2121
2122 // +SBDAREG: automatic registration
2142 void setSBDAutoRegistrationCallback(void (*autoRegistrationCallback)(IRIDIUM_9604_areg_event_t event, int regError));
2143
2144 // +SBDD: clear the MO and/or MT buffers
2155
2156 // +SBDDET: detach. error (if not nullptr) returns the <error> code: 0 or negative - see getSBDErrorString
2163 IRIDIUM_9604_error_t sbdDetach(int *error = nullptr);
2164
2165 // +SBDDSC: delivery short code (0-255). See IRIDIUM_9604_SBDDSC_HOLD_MT_DELIVERY etc.
2180
2181 // +SBDI: initiate an SBD session (no ring alert support, always detaches)
2189 // +SBDIX / +SBDIXA: initiate an extended SBD session (registers for ring alerts)
2190 // answeringRingAlert: true uses +SBDIXA - use this when the session is in response to a ring alert
2191 // location: optional "[+|-]DDMM.MMM,[+|-]dddmm.mmm" (the Iridium 9602/9603 format). Not documented for the 9604. nullptr omits it
2200 IRIDIUM_9604_error_t sbdSessionExtended(IRIDIUM_9604_sbd_session_t *result, bool answeringRingAlert = false, const char *location = nullptr);
2201
2202 // +SBDLOE: traffic management status. status: 0 = time is valid. time: seconds to the end of the traffic management period
2210 IRIDIUM_9604_error_t getSBDTrafficManagementStatus(int *status, unsigned long *time);
2211
2212 // +SBDR: read the MT buffer. The data is HEX-decoded. length is the number of bytes read
2221 IRIDIUM_9604_error_t readSBDData(uint8_t *data, size_t maxLength, size_t *length);
2222 // +SBDR: read the MT buffer as NULL-terminated text. maxLength includes the NULL
2230 IRIDIUM_9604_error_t readSBDText(char *text, size_t maxLength);
2231
2232 // +SBDST: SBD session timeout in seconds. 0 = infinite (default after power-cycle)
2247
2248 // +SBDSX: SBD status extended
2256
2257 // +SBDW: write the MO buffer. The data is HEX-encoded by the library. status (if not nullptr) returns the <status>: 0 = success
2266 IRIDIUM_9604_error_t writeSBDData(const uint8_t *data, size_t length, int *status = nullptr);
2274 IRIDIUM_9604_error_t writeSBDText(const char *text, int *status = nullptr);
2275
2276 // +SBDREG?: SBD registration status (Additional Commands Beta)
2283
2284 // +RFSCAN: satellite RF scan (Additional Commands Beta). results must hold IRIDIUM_9604_RFSCAN_NUM_CHANNELS (252) values,
2285 // in 1/10th dBm. numResults returns the number of values read.
2286 // WARNING: this enters a test mode. The module must be rebooted (e.g. reset()) to enter normal operation again.
2297 IRIDIUM_9604_error_t satelliteRFScan(int16_t *results, int *numResults, unsigned long timeout = IRIDIUM_9604_3_MIN_TIMEOUT);
2298
2299 // Convert an SBD error code (+SBDIX <MO status>, +SBDDET <error>, +AREG <reg error>) to text. Positive or negative codes are accepted
2306 static const char *getSBDErrorString(int error);
2307
2308 // High-level SBD send / receive - similar to the SparkFun IridiumSBD library
2309 // These write the MO buffer (if txData is not nullptr), start an extended SBD session (+SBDIX), check the result
2310 // and read the MT message (if one was received and rxBuffer is not nullptr).
2311 // On return, *rxLength holds the number of bytes received (0 if none). Call getLastSBDSession() for the full session result.
2318 IRIDIUM_9604_error_t sendSBDText(const char *message);
2326 IRIDIUM_9604_error_t sendSBDBinary(const uint8_t *txData, size_t txLength);
2335 IRIDIUM_9604_error_t sendReceiveSBDText(const char *message, uint8_t *rxBuffer, size_t *rxLength); // rxLength: in = rxBuffer size; out = bytes received
2345 IRIDIUM_9604_error_t sendReceiveSBDBinary(const uint8_t *txData, size_t txLength, uint8_t *rxBuffer, size_t *rxLength); // rxLength: in = rxBuffer size; out = bytes received
2346 // The result of the most recent SBD session (sbdSession, sbdSessionExtended, or the send/receive methods)
2353 // The number of MT messages waiting at the gateway, from the most recent SBD session. -1 if unknown
2360 // Has an SBD ring alert been received? (+SBDSX <RA flag>)
2366 bool hasRingAlert(void);
2367 // The AT command timeout used for SBD sessions (+SBDI, +SBDIX, +SBDDET). Default 5 minutes.
2368 // Use setSBDSessionTimeout (+SBDST) to set the module's own session timeout - shorter than this.
2374 void setSBDATTimeout(unsigned long timeout_ms) { _sbdATTimeout = timeout_ms; }
2380 unsigned long getSBDATTimeout(void) { return _sbdATTimeout; }
2381
2382 // Non-blocking SBD sessions
2411 void setSBDCallback(IRIDIUM_9604_sbd_callback_t sbdCallback) { _sbdCallback = sbdCallback; }
2441
2442 // ===========================================================================================
2443 // The URC handler interface - see urcHandler.h. Used by the URC handler classes. Not for general use.
2444 // ===========================================================================================
2457 int urcGetLastSocketProtocol(int socket);
2465 IRIDIUM_9604_error_t urcSocketReadIndication(int socket, int length) { return parseSocketReadIndication(socket, length); }
2473 IRIDIUM_9604_error_t urcSocketReadIndicationUDP(int socket, int length) { return parseSocketReadIndicationUDP(socket, length); }
2487 void urcProcessNMEA(const char *sentence, size_t length) { processNMEA(sentence, length); }
2494 void urcIndicatorEvent(int indicator, int value);
2495
2496 // The registered NMEA messages and URC handlers
2499
2500protected:
2502
2505 bool _invertPowerPin = false;
2508
2509 unsigned long _baud;
2514 static const size_t _lastErrorTextSize = 64;
2521 bool _pollReentrant = false;
2523
2524#define _RXBuffSize 2056
2525 const unsigned long _rxWindowMillis = 2;
2530 // bufferedPoll keeps any incomplete line (no CR LF yet) here, and prepends it next time. New for the 9604 library -
2531 // a burst of +UUGNMEA URCs can easily be split across two bufferedPoll calls.
2532#define _partialLineSize 256
2535
2536 // The socket read callbacks are shared by the +UUSORD and +UUSORF URCs - so they are stored here, not in the URC handlers
2538 void (*_socketReadCallbackPlus)(int, const char *, int, sfe_ip_address_t, int);
2539
2541
2542 // Satellite
2547
2548 // Non-blocking SBD sessions
2549 static const uint8_t IRIDIUM_9604_SBD_STATE_IDLE = 0;
2550 static const uint8_t IRIDIUM_9604_SBD_STATE_IN_PROGRESS = 1;
2551 static const uint8_t IRIDIUM_9604_SBD_STATE_CANCELLING = 2;
2554 unsigned long _sbdStartTime = 0;
2555 bool _sbdExtended = true;
2556 bool _sbdHighLevel = false;
2557 bool _sbdHighLevelNext = false;
2558 uint8_t *_sbdRxBuffer = nullptr;
2559 size_t *_sbdRxLength = nullptr;
2560 size_t _sbdRxBufferSize = 0;
2561 bool _sbdComplete = false;
2563 bool _sbdHaveResult = false;
2573 IRIDIUM_9604_error_t sbdSessionInternal(const char *command, const char *responseTag, IRIDIUM_9604_sbd_session_t *result);
2587 bool processSBDSessionEvent(const char *event);
2597 void checkSBDSession(void);
2603 void printSBDSession(const IRIDIUM_9604_sbd_session_t &session);
2614 IRIDIUM_9604_error_t sendReceiveSBD(const uint8_t *txData, size_t txLength, bool txIsText, uint8_t *rxBuffer, size_t *rxLength);
2615
2617 typedef enum
2618 {
2623
2632
2636 void powerOn(void); // Brief pulse on PWR_ON to turn module back on
2640 void powerOff(void); // Long pulse on PWR_ON to do a graceful shutdown. Note modulePowerOff (+CPWROFF) is preferred.
2641
2647 void writePowerOnPin(bool state);
2653 void writeResetPin(bool state);
2659 bool havePowerOnPin(void) { return ((_powerOnPinWriteCallback != nullptr) || (_powerPin >= 0)); }
2665 bool haveResetPin(void) { return ((_resetPinWriteCallback != nullptr) || (_resetPin >= 0)); }
2666
2675 IRIDIUM_9604_error_t setMNOprofile(mobile_network_operator_t mno, bool autoReset = false, bool urcNotification = false);
2683
2684 // Wait for an expected response (don't send a command)
2693 IRIDIUM_9604_error_t waitForResponse(const char *expectedResponse, const char *expectedError, uint16_t timeout);
2694
2695 // Send command with an expected (potentially partial) response, store entire response
2707 IRIDIUM_9604_error_t sendCommandWithResponse(const char *command, const char *expectedResponse,
2708 char *responseDest, unsigned long commandTimeout, int destSize = minimumResponseAllocation, bool at = true);
2709
2710 // Send a command -- prepend AT if at is true
2717 void sendCommand(const char *command, bool at);
2718
2719 const int _maxSocketRead = 1024;
2720
2728 IRIDIUM_9604_error_t parseSocketReadIndication(int socket, int length);
2736 IRIDIUM_9604_error_t parseSocketReadIndicationUDP(int socket, int length);
2748 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);
2749
2750 // UART Functions - these use the IridiumDeviceBus
2757 size_t hwPrint(const char *s);
2765 size_t hwWriteData(const char *buff, int len);
2772 size_t hwWrite(const char c);
2779 int readAvailable(char *inString);
2785 char readChar(void);
2791 int hwAvailable(void);
2797 virtual void beginSerial(unsigned long baud);
2798
2805 IRIDIUM_9604_error_t autobaud(unsigned long desiredBaud);
2806
2810 void extendedErrorReset(void);
2819 bool extendedErrorCheck(char c);
2826 char *iridium_calloc_char(size_t num);
2827
2834 bool processURCEvent(const char *event);
2838 void pruneBacklog(void);
2844 void addToBacklog(char c); // Add one character to the backlog (NULLs are converted to ASCII '0')
2848 void flushPartialLineToBacklog(void); // Move any incomplete bufferedPoll line into the backlog
2849};
#define IRIDIUM_9604_DEVICE_BASE_CLASSES
The base classes of DevIridium9604. On Arduino, DevIridium9604 is also a Print.
Definition: Iridium_9604.h:57
IRIDIUM_9604_cier_mode_t
+CIER <mode>
Definition: Iridium_9604_typedefs.h:580
@ IRIDIUM_9604_CIER_MODE_ENABLE
Enable indicator event reporting (+CIEV URCs)
Definition: Iridium_9604_typedefs.h:582
IRIDIUM_9604_tcp_socket_status_t
The TCP socket status (+USOCTL=socket,10).
Definition: Iridium_9604_typedefs.h:239
const uint8_t IRIDIUM_9604_NMEA_OUTPUT_DISABLED
The module sets <output> to 0 when <rate> is 0.
Definition: Iridium_9604_typedefs.h:547
IRIDIUM_9604_mqtt_nv_parameter_t
The +UMQTTNV operations.
Definition: Iridium_9604_typedefs.h:346
IRIDIUM_9604_rat_t
The radio access technologies (+URAT). New for the 9604.
Definition: Iridium_9604_typedefs.h:496
IRIDIUM_9604_utime_urc_configuration_t
The +UTIMEIND time indication URC configuration.
Definition: Iridium_9604_typedefs.h:279
@ IRIDIUM_9604_UTIME_URC_CONFIGURATION_ENABLED
Definition: Iridium_9604_typedefs.h:281
IRIDIUM_9604_flow_control_t
Flow control definitions for AT&K Note: SW (XON/XOFF) flow control is not supported on the Iridium 96...
Definition: Iridium_9604_typedefs.h:76
@ IRIDIUM_9604_ENABLE_FLOW_CONTROL
Definition: Iridium_9604_typedefs.h:78
IRIDIUM_9604_sbdreg_status_t
+SBDREG registration status (Additional Commands Beta)
Definition: Iridium_9604_typedefs.h:709
IRIDIUM_9604_sbd_clear_t
+SBDD buffer selection
Definition: Iridium_9604_typedefs.h:647
@ IRIDIUM_9604_SBD_CLEAR_MO
Clear the mobile originated buffer.
Definition: Iridium_9604_typedefs.h:648
IRIDIUM_9604_sim_states_t
The SIM states reported by the +UUSIMSTAT URC.
Definition: Iridium_9604_typedefs.h:286
#define IRIDIUM_9604_10_SEC_TIMEOUT
Timeout (ms).
Definition: Iridium_9604_typedefs.h:29
IRIDIUM_9604_functionality_t
The module functionality levels (+CFUN).
Definition: Iridium_9604_typedefs.h:476
@ FULL_FUNCTIONALITY
Definition: Iridium_9604_typedefs.h:478
IRIDIUM_9604_gnss_system_t
The GNSS systems (+UGPS). Values can be added together.
Definition: Iridium_9604_typedefs.h:509
@ GNSS_SYSTEM_SBAS
Definition: Iridium_9604_typedefs.h:511
@ GNSS_SYSTEM_GPS
Definition: Iridium_9604_typedefs.h:510
IRIDIUM_9604_message_format_t
The SMS message formats (+CMGF).
Definition: Iridium_9604_typedefs.h:255
@ IRIDIUM_9604_MESSAGE_FORMAT_TEXT
Definition: Iridium_9604_typedefs.h:257
IRIDIUM_9604_gnss_aiding_request_t
The GNSS aiding requests (+UGAOS). New for the 9604 library.
Definition: Iridium_9604_typedefs.h:534
void(* IRIDIUM_9604_sbd_callback_t)(IRIDIUM_9604_error_t status, const IRIDIUM_9604_sbd_session_t *session)
The SBD session callback - see setSBDCallback()
Definition: Iridium_9604_typedefs.h:690
IRIDIUM_9604_registration_status_t
The network registration status (+CREG / +CEREG).
Definition: Iridium_9604_typedefs.h:150
IRIDIUM_9604_http_content_types_t
The HTTP POST content types.
Definition: Iridium_9604_typedefs.h:334
#define IRIDIUM_9604_RESET_PIN
The default reset pin: not connected.
Definition: Iridium_9604_typedefs.h:25
#define minimumResponseAllocation
The minimum response buffer size (bytes).
Definition: Iridium_9604_typedefs.h:53
#define IRIDIUM_9604_2_MIN_TIMEOUT
Timeout (ms).
Definition: Iridium_9604_typedefs.h:31
IRIDIUM_9604_sec_profile_parameter_t
The +USECPRF security profile parameters.
Definition: Iridium_9604_typedefs.h:420
#define IRIDIUM_9604_STANDARD_RESPONSE_TIMEOUT
Timeout (ms).
Definition: Iridium_9604_typedefs.h:28
IRIDIUM_9604_utime_sensor_t
The +UTIME time source sensors.
Definition: Iridium_9604_typedefs.h:271
@ IRIDIUM_9604_UTIME_SENSOR_GNSS_LTE
Definition: Iridium_9604_typedefs.h:273
#define IRIDIUM_9604_POWER_PIN
Default to no pin.
Definition: Iridium_9604_typedefs.h:24
IRIDIUM_9604_utime_mode_t
The +UTIME time modes.
Definition: Iridium_9604_typedefs.h:262
@ IRIDIUM_9604_UTIME_MODE_PPS
Definition: Iridium_9604_typedefs.h:264
IRIDIUM_9604_error_t
The library error codes.
Definition: Iridium_9604_typedefs.h:129
@ IRIDIUM_9604_ERROR_SUCCESS
0
Definition: Iridium_9604_typedefs.h:131
@ IRIDIUM_9604_ERROR_INVALID
-1
Definition: Iridium_9604_typedefs.h:130
IRIDIUM_9604_socket_protocol_t
The socket protocols.
Definition: Iridium_9604_typedefs.h:232
IRIDIUM_9604_sec_manager_opcode_t
The +USECMNG operations.
Definition: Iridium_9604_typedefs.h:461
#define IRIDIUM_9604_NUM_SOCKETS
The number of sockets: 0-6 (9604 AT manual, <socket> range).
Definition: Iridium_9604_typedefs.h:55
const uint8_t IRIDIUM_9604_NMEA_OUTPUT_URC
Output the NMEA string as a +UUGNMEA URC. Process it with bufferedPoll()
Definition: Iridium_9604_typedefs.h:549
void(* IRIDIUM_9604_pin_write_callback_t)(bool state)
The PWR_ON / RESET_N pin write callback - see setPowerOnPinWriteCallback() and setResetPinWriteCallba...
Definition: Iridium_9604_typedefs.h:679
mobile_network_operator_t
The standard Europe profile should be used as the basis for all other MNOs in Europe outside of Vodaf...
Definition: Iridium_9604_typedefs.h:88
IRIDIUM_9604_lock_status_t
+CULK lock status
Definition: Iridium_9604_typedefs.h:613
#define IRIDIUM_9604_SBD_SESSION_DEFAULT_TIMEOUT
Default timeout for an SBD session (+SBDI / +SBDIX / +SBDDET / +SBDREG): 5 minutes.
Definition: Iridium_9604_typedefs.h:43
#define IRIDIUM_9604_3_MIN_TIMEOUT
Timeout (ms).
Definition: Iridium_9604_typedefs.h:32
IRIDIUM_9604_gnss_aiding_mode_t
The GNSS aiding modes (+UGPS). Values can be added together.
Definition: Iridium_9604_typedefs.h:523
@ GNSS_AIDING_MODE_AUTOMATIC
Definition: Iridium_9604_typedefs.h:525
IRIDIUM_9604_sec_manager_parameter_t
The +USECMNG certificate / key types.
Definition: Iridium_9604_typedefs.h:467
IRIDIUM_9604_sbdareg_mode_t
+SBDAREG automatic registration mode
Definition: Iridium_9604_typedefs.h:624
IRIDIUM_9604_areg_event_t
+AREG <event>
Definition: Iridium_9604_typedefs.h:636
The Iridium 9604 device class: all of the AT command, URC, NMEA and satellite methods....
Definition: Iridium_9604.h:62
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...
Definition: Iridium_9604_Satellite.cpp:183
void setSBDAutoRegistrationCallback(void(*autoRegistrationCallback)(IRIDIUM_9604_areg_event_t event, int regError))
Set the callback for the +AREG automatic registration URC.
Definition: Iridium_9604_Satellite.cpp:442
SparkFun_Iridium_9604::IridiumDeviceBus * _sfeBus
The UART.
Definition: Iridium_9604.h:2501
IRIDIUM_9604_error_t autobaud(unsigned long desiredBaud)
Find the module's baud rate and change it to desiredBaud.
Definition: Iridium_9604.cpp:685
bool _pollReentrant
Prevent reentry of poll - just in case it gets called from a callback.
Definition: Iridium_9604.h:2521
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).
Definition: Iridium_9604_Network.cpp:217
int _lastSocketProtocol[IRIDIUM_9604_NUM_SOCKETS]
Record the protocol for each socket to avoid having to call querySocketType in parseSocketReadIndicat...
Definition: Iridium_9604.h:2540
uint8_t _sbdState
The state of the non-blocking SBD session.
Definition: Iridium_9604.h:2553
SparkFun_Iridium_9604::nmeaMessageVector nmeaMessages
The NMEA message objects - one per supported NMEA message.
Definition: Iridium_9604.h:2497
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.
Definition: Iridium_9604_Satellite.cpp:1147
unsigned long _sbdStartTime
millis when the non-blocking session started (or was cancelled).
Definition: Iridium_9604.h:2554
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).
Definition: Iridium_9604.cpp:1312
void(* _socketReadCallbackPlus)(int, const char *, int, sfe_ip_address_t, int)
socket, data, length, remoteAddress, remotePort
Definition: Iridium_9604.h:2538
IRIDIUM_9604_init_type_t
The initialization types used by init().
Definition: Iridium_9604.h:2618
@ IRIDIUM_9604_INIT_AUTOBAUD
Definition: Iridium_9604.h:2620
@ IRIDIUM_9604_INIT_RESET
Definition: Iridium_9604.h:2621
@ IRIDIUM_9604_INIT_STANDARD
Definition: Iridium_9604.h:2619
IRIDIUM_9604_error_t socketDirectLinkCongestionTimer(int socket, unsigned long congestionTimer)
Set the direct link congestion timer (AT+UDCONF=8).
Definition: Iridium_9604_Sockets.cpp:866
IRIDIUM_9604_error_t setSBDAutoRegistration(IRIDIUM_9604_sbdareg_mode_t mode)
Set the SBD automatic registration mode (AT+SBDAREG).
Definition: Iridium_9604_Satellite.cpp:386
bool _invertPowerPin
Invert the power pin polarity.
Definition: Iridium_9604.h:2505
IRIDIUM_9604_error_t _lastSBDSessionStatus
The status of the most recent SBD session.
Definition: Iridium_9604.h:2564
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).
Definition: Iridium_9604_Internet.cpp:663
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.
Definition: Iridium_9604_Satellite.cpp:945
IRIDIUM_9604_error_t deleteReadSentSMSmessages(void)
Delete all the read and sent SMS messages from preferred storage (AT+CMGD=1,2).
Definition: Iridium_9604.h:826
char * iridium_calloc_char(size_t num)
Allocate a zeroed char buffer (with calloc). Free it with free().
Definition: Iridium_9604.cpp:1476
IRIDIUM_9604_error_t getMNOprofile(mobile_network_operator_t *mno)
Read the Mobile Network Operator profile (AT+UMNOPROF?).
Definition: Iridium_9604_General.cpp:729
IRIDIUM_9604_rat_t getRAT(void)
Read the selected Radio Access Technology (AT+URAT?). New for the 9604.
Definition: Iridium_9604_General.cpp:902
IRIDIUM_9604_error_t querySocketTotalBytesSent(int socket, uint32_t *total)
Query the total number of bytes sent on a socket (AT+USOCTL=socket,2).
Definition: Iridium_9604_Sockets.cpp:999
IRIDIUM_9604_error_t deleteAllSMSmessages(void)
Delete all the SMS messages from preferred storage, including the unread messages (AT+CMGD=1,...
Definition: Iridium_9604.h:838
SparkFun_Iridium_9604::sfe_string_t sfe_string_t
The string type: String on Arduino; std::string on ESP-IDF.
Definition: Iridium_9604.h:66
sfe_string_t getModelID(void)
Read the model identification (AT+CGMM).
Definition: Iridium_9604_General.cpp:78
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.
Definition: Iridium_9604_GNSS.cpp:249
int socketOpen(IRIDIUM_9604_socket_protocol_t protocol, unsigned int localPort=0)
Open a TCP or UDP socket (AT+USOCR).
Definition: Iridium_9604_Sockets.cpp:24
IRIDIUM_9604_error_t setHTTPpassword(int profile, sfe_string_t password)
Set the HTTP password (AT+UHTTP=profile,3).
Definition: Iridium_9604_Internet.cpp:127
IRIDIUM_9604_error_t resetSecurityProfile(int secprofile)
Reset a security profile (AT+USECPRF=profile).
Definition: Iridium_9604_Internet.cpp:850
void addToBacklog(char c)
Add one character to the backlog. NULLs are converted to ASCII '0'.
Definition: Iridium_9604.cpp:1238
bool _sbdHaveResult
true if the +SBDIX result was received.
Definition: Iridium_9604.h:2563
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().
Definition: Iridium_9604.cpp:709
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).
Definition: Iridium_9604_Internet.cpp:897
IRIDIUM_9604_error_t getPDPaddress(int cid, sfe_ip_address_t *address)
Read the IP address of a PDP context (AT+CGPADDR=<cid>).
Definition: Iridium_9604_Network.cpp:897
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).
Definition: Iridium_9604.cpp:531
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).
Definition: Iridium_9604_SMS.cpp:89
bool processSBDSessionEvent(const char *event)
Non-blocking SBD session: check an event (line) from bufferedPoll for the session result,...
Definition: Iridium_9604_Satellite.cpp:720
sfe_string_t clock(void)
Read the module's real time clock (AT+CCLK?).
Definition: Iridium_9604_General.cpp:264
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#).
Definition: Iridium_9604_Network.cpp:492
void urcSocketListenIndication(sfe_ip_address_t localIP, sfe_ip_address_t remoteIP)
urcHandlerInterface: record the IP addresses from a +UUSOLI URC (see lastRemoteIP()).
Definition: Iridium_9604.cpp:583
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().
Definition: Iridium_9604.cpp:511
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...
Definition: Iridium_9604.cpp:813
bool hasRingAlert(void)
Check if an SBD ring alert has been received (the +SBDSX RA flag).
Definition: Iridium_9604_Satellite.cpp:1135
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 (+...
Definition: Iridium_9604_Satellite.cpp:1499
int socketGetLastError()
Read the last socket error (AT+USOER).
Definition: Iridium_9604_Sockets.cpp:1280
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 backl...
Definition: Iridium_9604.cpp:955
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).
Definition: Iridium_9604_Internet.cpp:303
IRIDIUM_9604_error_t querySocketLastError(int socket, int *error)
Query the last socket error (AT+USOCTL=socket,1).
Definition: Iridium_9604_Sockets.cpp:944
IRIDIUM_9604_error_t querySocketOutUnackData(int socket, uint32_t *total)
Query the number of unacknowledged outgoing bytes on a TCP socket (AT+USOCTL=socket,...
Definition: Iridium_9604_Sockets.cpp:1224
void flushNMEA(const char *msgId)
Mark the stored copy of an NMEA message as stale.
Definition: Iridium_9604_GNSS.cpp:795
mobile_network_operator_t getNetworkProfile(void)
Read the Mobile Network Operator (MNO) profile (AT+UMNOPROF?).
Definition: Iridium_9604_Network.cpp:204
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).
Definition: Iridium_9604_Internet.cpp:351
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.
Definition: Iridium_9604.h:182
size_t _sbdRxBufferSize
sendReceiveSBD: the size of _sbdRxBuffer.
Definition: Iridium_9604.h:2560
int _powerPin
The PWR_ON pin. -1 if not connected.
Definition: Iridium_9604.h:2503
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...
Definition: Iridium_9604.cpp:92
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).
Definition: Iridium_9604_Internet.cpp:211
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?).
Definition: Iridium_9604_General.cpp:419
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).
Definition: Iridium_9604_Satellite.cpp:451
bool isSBDSessionInProgress(void)
Check if a non-blocking SBD session is in progress (or being cancelled).
Definition: Iridium_9604.h:2419
bool processURCEvent(const char *event)
Pass one event (line) to the registered URC handlers.
Definition: Iridium_9604.cpp:371
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).
Definition: Iridium_9604_FileSystem.cpp:456
SparkFun_Iridium_9604::SfeDebugPrint & urcDebug(void)
urcHandlerInterface: the debug printer, for the URC handlers.
Definition: Iridium_9604.h:2450
~DevIridium9604()
Destroy the DevIridium9604 object, freeing the backlog and receive buffers.
Definition: Iridium_9604.cpp:68
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).
Definition: Iridium_9604_GNSS.cpp:129
IRIDIUM_9604_gnss_aiding_mode_t gnss_aiding_mode_t
The GNSS aiding mode type. (Retained for SARA-R5 compatibility.)
Definition: Iridium_9604.h:1591
IRIDIUM_9604_error_t unlock(const char *unlockKey, IRIDIUM_9604_lock_status_t *status=nullptr)
Unlock the module (AT+CULK).
Definition: Iridium_9604_Satellite.cpp:295
size_t _lastErrorTextLength
The number of characters in _lastErrorText.
Definition: Iridium_9604.h:2516
int readAvailable(char *inString)
Read all the available serial data into inString.
Definition: Iridium_9604.cpp:1419
void disableDebugging(void)
Turn off the debug messages.
Definition: Iridium_9604.cpp:172
size_t hwPrint(const char *s)
Write a NULL-terminated string to the module, through the communication bus.
Definition: Iridium_9604.cpp:1376
IRIDIUM_9604_error_t deleteFile(sfe_string_t filename)
Delete a file from the module's file system (AT+UDELFILE).
Definition: Iridium_9604_FileSystem.cpp:515
IRIDIUM_9604_error_t setMQTTclientId(const sfe_string_t &clientId)
Set the MQTT client ID (AT+UMQTT=0).
Definition: Iridium_9604_Internet.cpp:365
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".
Definition: Iridium_9604_Internet.cpp:190
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.
Definition: Iridium_9604_Sockets.cpp:182
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 ...
Definition: Iridium_9604_Internet.cpp:280
IRIDIUM_9604_error_t getSBDStatusExtended(IRIDIUM_9604_sbd_status_t *status)
Read the extended SBD status (AT+SBDSX).
Definition: Iridium_9604_Satellite.cpp:1102
bool begin(unsigned long baud)
Initialize the module and ensure it is connected. Autobauds the module to baud if required....
Definition: Iridium_9604.cpp:97
bool _extendedErrorCapturing
extendedErrorCheck: true while the <err> text is being read.
Definition: Iridium_9604.h:2519
static const uint8_t IRIDIUM_9604_SBD_STATE_CANCELLING
_sbdState: cancelSBDSession has been called. Waiting for the final result code
Definition: Iridium_9604.h:2551
int8_t rssi(void)
Read the received signal strength (AT+CSQ). Cellular (LTE-M) only.
Definition: Iridium_9604_Network.cpp:24
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.
Definition: Iridium_9604_Network.cpp:544
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 e...
Definition: Iridium_9604_FileSystem.cpp:79
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).
Definition: Iridium_9604_Internet.cpp:577
void setSBDATTimeout(unsigned long timeout_ms)
Set the AT command timeout used for SBD sessions (+SBDI, +SBDIX, +SBDDET). Default: 5 minutes....
Definition: Iridium_9604.h:2374
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).
Definition: Iridium_9604_Sockets.cpp:476
static const char * getSBDErrorString(int error)
Convert an SBD error code (+SBDIX MO status, +SBDDET error, +AREG reg error) to text....
Definition: Iridium_9604_Satellite.cpp:1320
const char * getLastErrorText(void)
Get the reason for the most recent error.
Definition: Iridium_9604.h:421
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).
Definition: Iridium_9604_Internet.cpp:746
SparkFun_Iridium_9604::sfe_ip_address_t sfe_ip_address_t
The IP address type: IPAddress on Arduino; SfeIPAddress on ESP-IDF.
Definition: Iridium_9604.h:67
char * _partialLine
An incomplete line from bufferedPoll() - processed when the rest of the line arrives.
Definition: Iridium_9604.h:2533
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,...
Definition: Iridium_9604_GNSS.cpp:469
IRIDIUM_9604_error_t setSimPin(sfe_string_t pin)
Enter the SIM PIN (AT+CPIN).
Definition: Iridium_9604_Network.cpp:408
IRIDIUM_9604_error_t sbdSession(IRIDIUM_9604_sbd_session_t *result)
Initiate an SBD session (AT+SBDI). No ring alert support. Always detaches.
Definition: Iridium_9604_Satellite.cpp:871
IRIDIUM_9604_error_t connectMQTT(void)
Connect to the MQTT broker (AT+UMQTTC=1). The result is delivered by the +UUMQTTC URC: see setMQTTCom...
Definition: Iridium_9604_Internet.cpp:423
unsigned long _baud
The current baud rate.
Definition: Iridium_9604.h:2509
IRIDIUM_9604_error_t getExtSignalQuality(signal_quality &signal_quality)
Read the extended signal quality (AT+CESQ). Cellular (LTE-M) only.
Definition: Iridium_9604_Network.cpp:71
void setGNSSAidingCallback(void(*gnssAidingCallback)(int aidMode, int result))
Set the callback for the assisted GNSS indication URC (+UUGIND). Enable the URC with setGNSSAidingInd...
Definition: Iridium_9604.cpp:506
IRIDIUM_9604_error_t socketDirectLinkTimeTrigger(int socket, unsigned long timerTrigger)
Set the direct link time trigger (AT+UDCONF=5).
Definition: Iridium_9604_Sockets.cpp:803
IRIDIUM_9604_error_t querySocketType(int socket, IRIDIUM_9604_socket_protocol_t *protocol)
Query the socket type: TCP or UDP (AT+USOCTL=socket,0).
Definition: Iridium_9604_Sockets.cpp:887
IRIDIUM_9604_error_t setHTTPserverName(int profile, sfe_string_t server)
Set the HTTP server name (AT+UHTTP=profile,1).
Definition: Iridium_9604_Internet.cpp:85
int _cmsErrorIndex
extendedErrorCheck: the number of IRIDIUM_9604_RESPONSE_CMS_ERROR characters matched.
Definition: Iridium_9604.h:2518
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).
Definition: Iridium_9604_General.cpp:400
bool _autoTimeZoneForBegin
Enable the automatic time zone update during begin().
Definition: Iridium_9604.h:2513
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) an...
Definition: Iridium_9604_Satellite.cpp:1485
IRIDIUM_9604_error_t pollNMEA(void)
Poll the NMEA messages stored in the module memory (AT+UGNMEA?). The messages are processed as if the...
Definition: Iridium_9604_GNSS.cpp:536
void flushPartialLineToBacklog(void)
Move any incomplete bufferedPoll() line into the backlog - so it is processed with the next data.
Definition: Iridium_9604.cpp:1253
void setMQTTCommandCallback(void(*mqttCommandRequestCallback)(int command, int result))
Set the callback for the MQTT command result URC (+UUMQTTC).
Definition: Iridium_9604.cpp:521
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).
Definition: Iridium_9604_Internet.cpp:479
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?).
Definition: Iridium_9604_Satellite.cpp:202
sfe_string_t getSerialNo(void)
Read the product serial number (AT+CGSN).
Definition: Iridium_9604_General.cpp:120
void printSBDSession(const IRIDIUM_9604_sbd_session_t &session)
Print the SBD session result (debug).
Definition: Iridium_9604_Satellite.cpp:694
IRIDIUM_9604_error_t setClockFromGNSS(void)
Set the module clock (+CCLK) from the GNSS UTC time (AT+UGTMR).
Definition: Iridium_9604_GNSS.cpp:678
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).
Definition: Iridium_9604_Sockets.cpp:1109
bool bufferedPoll(void)
Process any data from the module: the backlog first, then any fresh serial data. URCs are passed to t...
Definition: Iridium_9604.cpp:200
IRIDIUM_9604_error_t setClock(sfe_string_t theTime)
Set the module's real time clock (AT+CCLK).
Definition: Iridium_9604_General.cpp:378
nmeaMessage * getNmeaMessagePtr(nmeaCallbackDataCommon_t *theData)
Get the nmeaMessage from inside an NMEA callback.
Definition: Iridium_9604_GNSS.cpp:818
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.
Definition: Iridium_9604_Sockets.cpp:152
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).
Definition: Iridium_9604_Sockets.cpp:714
IRIDIUM_9604_error_t setHTTPserverIPaddress(int profile, sfe_ip_address_t address)
Set the HTTP server IP address (AT+UHTTP=profile,0).
Definition: Iridium_9604_Internet.cpp:64
IRIDIUM_9604_sbdreg_status_t getSBDRegistrationStatus(void)
Read the SBD registration status (AT+SBDREG?). From the Iridium 9604 Additional Commands (Beta).
Definition: Iridium_9604_Satellite.cpp:1225
void powerOn(void)
Pulse the PWR_ON pin briefly to turn the module on.
Definition: Iridium_9604.cpp:876
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 st...
Definition: Iridium_9604_GNSS.cpp:66
IRIDIUM_9604_l2p_t
The layer 2 protocols for enterPPP().
Definition: Iridium_9604.h:696
@ L2P_DEFAULT
Definition: Iridium_9604.h:697
@ L2P_M_OPT_PPP
Definition: Iridium_9604.h:701
@ L2P_M_HEX
Definition: Iridium_9604.h:699
@ L2P_M_RAW_IP
Definition: Iridium_9604.h:700
@ L2P_PPP
Definition: Iridium_9604.h:698
void powerOff(void)
Pulse the PWR_ON pin for a long time to perform a graceful shutdown. modulePowerOff() (+CPWROFF) is p...
Definition: Iridium_9604.cpp:864
size_t * _sbdRxLength
sendReceiveSBD: the size of _sbdRxBuffer in, the number of bytes received out.
Definition: Iridium_9604.h:2559
IRIDIUM_9604_error_t setSBDSessionTimeout(int timeout)
Set the SBD session timeout (AT+SBDST).
Definition: Iridium_9604_Satellite.cpp:1039
IRIDIUM_9604_error_t querySocketTotalBytesReceived(int socket, uint32_t *total)
Query the total number of bytes received on a socket (AT+USOCTL=socket,3).
Definition: Iridium_9604_Sockets.cpp:1054
void modulePowerOn(void)
Power the module on by pulsing the PWR_ON pin. Requires the powerPin to have been provided to the con...
Definition: Iridium_9604.cpp:660
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) ...
Definition: Iridium_9604_Satellite.cpp:1492
void setSatelliteServiceAvailabilityCallback(void(*serviceAvailabilityCallback)(bool serviceAvailable))
Set the callback for the +CIEV service availability indication.
Definition: Iridium_9604_Satellite.cpp:281
IRIDIUM_9604_error_t getSIMstateReportingMode(int *mode)
Read the SIM state reporting mode (AT+USIMSTAT?).
Definition: Iridium_9604_Network.cpp:438
IRIDIUM_9604_error_t automaticOperatorSelection()
Select the network operator automatically (AT+COPS=0).
Definition: Iridium_9604_Network.cpp:665
IRIDIUM_9604_error_t socketSetSecure(int profile, bool secure, int secprofile=-1)
Enable or disable SSL/TLS on a socket (AT+USOSEC).
Definition: Iridium_9604_Sockets.cpp:103
IRIDIUM_9604_error_t functionality(IRIDIUM_9604_functionality_t function=FULL_FUNCTIONALITY)
Set the module functionality (AT+CFUN).
Definition: Iridium_9604_General.cpp:690
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.
Definition: Iridium_9604_General.cpp:791
sfe_string_t getIMEI(void)
Read the cellular IMEI (AT+GSN). See getSatelliteIMEI() for the satellite (SBD) IMEI.
Definition: Iridium_9604_General.cpp:141
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).
Definition: Iridium_9604_Internet.cpp:868
const int _maxSocketRead
The limit on bytes that can be read in a single read.
Definition: Iridium_9604.h:2719
void enableAtDebugging(sfe_print_t &debugPort=SparkFun_Iridium_9604::sfeStdout)
Turn on the AT command debug messages: every AT command and response is printed.
Definition: Iridium_9604.cpp:181
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 fil...
Definition: Iridium_9604_Internet.cpp:235
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 onl...
Definition: Iridium_9604_Network.cpp:170
int isSatelliteServiceAvailable(void)
The most recent satellite service availability, from the +CIEV URCs. Call bufferedPoll() regularly to...
Definition: Iridium_9604.h:2076
IRIDIUM_9604_error_t deregisterOperator(void)
Deregister from the network operator (AT+COPS=2).
Definition: Iridium_9604_Network.cpp:749
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.
Definition: Iridium_9604_GNSS.cpp:840
IRIDIUM_9604_error_t setMNOprofile(mobile_network_operator_t mno, bool autoReset=false, bool urcNotification=false)
Set the Mobile Network Operator profile (AT+UMNOPROF).
Definition: Iridium_9604_General.cpp:708
void setSatelliteSignalQualityCallback(void(*signalQualityCallback)(int signalQuality))
Set the callback for the +CIEV signal quality indication.
Definition: Iridium_9604_Satellite.cpp:276
IRIDIUM_9604_lock_status_t getLockStatus(void)
Read the lock status (AT+CULK?).
Definition: Iridium_9604_Satellite.cpp:346
sfe_string_t getFirmwareVersion(void)
Read the firmware version (AT+CGMR).
Definition: Iridium_9604_General.cpp:99
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 call...
Definition: Iridium_9604.h:2465
void extendedErrorReset(void)
Reset the +CME ERROR / +CMS ERROR matching and clear _lastErrorText. Called before each command.
Definition: Iridium_9604.cpp:1481
IRIDIUM_9604_error_t setHTTPusername(int profile, sfe_string_t username)
Set the HTTP user name (AT+UHTTP=profile,2).
Definition: Iridium_9604_Internet.cpp:106
IRIDIUM_9604_error_t subscribeMQTTtopic(int max_Qos, const sfe_string_t &topic)
Subscribe to an MQTT topic (AT+UMQTTC=4).
Definition: Iridium_9604_Internet.cpp:451
IRIDIUM_9604_error_t getSimStatus(sfe_string_t *code)
Read the SIM PIN status (AT+CPIN?).
Definition: Iridium_9604_Network.cpp:365
int hwAvailable(void)
The number of bytes available to be read from the module.
Definition: Iridium_9604.cpp:1456
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)....
Definition: Iridium_9604_Satellite.cpp:1394
int getSatelliteSignalQuality(void)
The most recent satellite signal quality (0-5 bars), from the +CIEV URCs. Call bufferedPoll() regular...
Definition: Iridium_9604.h:2070
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).
Definition: Iridium_9604_Internet.cpp:626
IRIDIUM_9604_error_t setUtimeConfiguration(int32_t offsetNanoseconds=0, int32_t offsetSeconds=0)
Set the time offsets (AT+UTIMECFG).
Definition: Iridium_9604_General.cpp:539
IRIDIUM_9604_error_t sendSMS(sfe_string_t number, sfe_string_t message)
Send an SMS message (AT+CMGS).
Definition: Iridium_9604_SMS.cpp:42
bool extendedErrorCheck(char c)
Look for a "+CME ERROR: <err>" or "+CMS ERROR: <err>" response, one character at a time.
Definition: Iridium_9604.cpp:1492
IRIDIUM_9604_error_t getUtimeConfiguration(int32_t *offsetNanoseconds, int32_t *offsetSeconds)
Read the time offsets (AT+UTIMECFG?).
Definition: Iridium_9604_General.cpp:555
void autoTimeZoneForBegin(bool enable=true)
Enable or disable the automatic time zone update during begin(). Call this before begin()....
Definition: Iridium_9604_General.cpp:395
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,...
Definition: Iridium_9604_GNSS.cpp:755
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().
Definition: Iridium_9604_GNSS.cpp:99
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....
Definition: Iridium_9604_FileSystem.cpp:326
IRIDIUM_9604_error_t setHTTPauthentication(int profile, bool authenticate)
Enable or disable HTTP authentication (AT+UHTTP=profile,4).
Definition: Iridium_9604_Internet.cpp:148
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 ...
Definition: Iridium_9604_Satellite.cpp:1504
void setSBDCallback(IRIDIUM_9604_sbd_callback_t sbdCallback)
Set the SBD session callback - and make the SBD sessions non-blocking.
Definition: Iridium_9604.h:2411
bool _bufferedPollReentrant
Prevent reentry of bufferedPoll - just in case it gets called from a callback.
Definition: Iridium_9604.h:2520
IRIDIUM_9604_error_t deleteSMSmessage(int location, int deleteFlag=0)
Delete SMS message(s) (AT+CMGD).
Definition: Iridium_9604_SMS.cpp:285
int getWaitingMessageCount(void)
The number of MT messages waiting at the gateway, from the most recent SBD session.
Definition: Iridium_9604.h:2359
IRIDIUM_9604_error_t sbdDetach(int *error=nullptr)
Detach from the SBD gateway (AT+SBDDET).
Definition: Iridium_9604_Satellite.cpp:497
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).
Definition: Iridium_9604.cpp:1263
sfe_ip_address_t _lastRemoteIP
The remote IP address from the most recent +UUSOLI URC.
Definition: Iridium_9604.h:2510
void writePowerOnPin(bool state)
Write the PWR_ON pin: using the callback (if set), else the GPIO pin. Never drives the pin high: true...
Definition: Iridium_9604.cpp:822
IRIDIUM_9604_sbd_callback_t _sbdCallback
The SBD session callback. nullptr = blocking sessions.
Definition: Iridium_9604.h:2552
void completeSBDSession(IRIDIUM_9604_error_t status)
Non-blocking SBD session: mark the session complete. checkSBDSession calls the callback.
Definition: Iridium_9604_Satellite.cpp:791
void writeResetPin(bool state)
Write the RESET_N pin: using the callback (if set), else the GPIO pin. Never drives the pin high: tru...
Definition: Iridium_9604.cpp:843
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 th...
Definition: Iridium_9604.cpp:485
int _iridiumResponseBacklogLength
The backlog could contain binary data so we can't use strlen to find its length.
Definition: Iridium_9604.h:2529
SparkFun_Iridium_9604::nmeaCallbackDataCommon_t nmeaCallbackDataCommon_t
The NMEA callback data type (SparkFun_Iridium_9604::nmeaCallbackDataCommon_t).
Definition: Iridium_9604.h:70
bool _sbdHighLevelNext
Set by sendReceiveSBD before it starts the session.
Definition: Iridium_9604.h:2557
virtual void beginSerial(unsigned long baud)
Set the communication bus baud rate.
Definition: Iridium_9604.cpp:1466
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?).
Definition: Iridium_9604_Network.cpp:281
IRIDIUM_9604_error_t getSBDTrafficManagementStatus(int *status, unsigned long *time)
Read the SBD traffic management status (AT+SBDLOE).
Definition: Iridium_9604_Satellite.cpp:904
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().
Definition: Iridium_9604_GNSS.cpp:336
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).
Definition: Iridium_9604_General.cpp:475
IRIDIUM_9604_error_t setMQTTsecure(bool secure, int secprofile=-1)
Enable or disable MQTT over TLS (AT+UMQTT=11).
Definition: Iridium_9604_Internet.cpp:408
IRIDIUM_9604_error_t setHTTPserverPort(int profile, int port)
Set the HTTP server port (AT+UHTTP=profile,5). Default: 80.
Definition: Iridium_9604_Internet.cpp:169
unsigned long _sbdATTimeout
The AT command timeout for SBD sessions (ms).
Definition: Iridium_9604.h:2546
bool haveResetPin(void)
Check if the RESET_N pin can be written: GPIO pin or callback.
Definition: Iridium_9604.h:2665
IRIDIUM_9604_error_t modulePowerOff(void)
Gracefully disconnect from the network and power the module off (AT+CPWROFF).
Definition: Iridium_9604.cpp:642
int urcGetLastSocketProtocol(int socket)
urcHandlerInterface: the protocol of the most recent socket operation on a socket.
Definition: Iridium_9604.cpp:576
IRIDIUM_9604_error_t resetHTTPprofile(int profile)
Reset an HTTP profile (AT+UHTTP=profile). The HTTP profile parameters are not saved in the non volati...
Definition: Iridium_9604_Internet.cpp:44
IRIDIUM_9604_error_t getSatelliteInfo(IRIDIUM_9604_sat_info_t *info)
Read the satellite system information (AT+USATINFO). Only available in the satellite RAT.
Definition: Iridium_9604_Satellite.cpp:136
IRIDIUM_9604_error_t autoTimeZone(bool enable)
Enable or disable the automatic time zone update from the network (AT+CTZU).
Definition: Iridium_9604_General.cpp:604
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.
Definition: Iridium_9604.cpp:678
IRIDIUM_9604_error_t setSIMstateReportingMode(int mode)
Set the SIM state reporting mode (AT+USIMSTAT). Bit 0 reports the (U)SIM initialization status (state...
Definition: Iridium_9604_Network.cpp:422
IRIDIUM_9604_error_t gpsGetState(bool *on, int *aiding=nullptr, int *systems=nullptr)
Read the GNSS state (AT+UGPS?).
Definition: Iridium_9604_GNSS.cpp:164
void hwEmergencyShutdown(void)
Abrupt emergency hardware shutdown: hold PWR_ON low for IRIDIUM_9604_EMERGENCY_SHUTDOWN_PULSE_PERIOD ...
Definition: Iridium_9604.cpp:905
void setFTPCommandCallback(void(*ftpCommandRequestCallback)(int command, int result))
Set the callback for the FTP command result URC (+UUFTPCR).
Definition: Iridium_9604.cpp:526
int _resetPin
The RESET_N pin. -1 if not connected.
Definition: Iridium_9604.h:2504
unsigned long getSBDATTimeout(void)
Read the AT command timeout used for SBD sessions.
Definition: Iridium_9604.h:2380
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>,...
Definition: Iridium_9604_GNSS.cpp:214
IRIDIUM_9604_pdp_type
The PDP types for setAPN() / getAPN().
Definition: Iridium_9604.h:630
@ PDP_TYPE_NONIP
Definition: Iridium_9604.h:633
@ PDP_TYPE_INVALID
Definition: Iridium_9604.h:631
@ PDP_TYPE_IPV4V6
Definition: Iridium_9604.h:634
@ PDP_TYPE_IPV6
Definition: Iridium_9604.h:635
@ PDP_TYPE_IP
Definition: Iridium_9604.h:632
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).
Definition: Iridium_9604_General.cpp:620
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().
Definition: Iridium_9604_Internet.cpp:24
IRIDIUM_9604_error_t socketDirectLinkCharacterTrigger(int socket, int characterTrigger)
Set the direct link character trigger (AT+UDCONF=7).
Definition: Iridium_9604_Sockets.cpp:845
bool _checkCallbacksReentrant
Prevent reentry of checkCallbacks.
Definition: Iridium_9604.h:2522
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).
Definition: Iridium_9604_GNSS.cpp:276
sfe_string_t getSubscriberNo(void)
Read the subscriber number (AT+CNUM).
Definition: Iridium_9604_General.cpp:210
int _cmeErrorIndex
extendedErrorCheck: the number of IRIDIUM_9604_RESPONSE_CME_ERROR characters matched.
Definition: Iridium_9604.h:2517
IRIDIUM_9604_error_t getSBDSessionTimeout(int *timeout)
Read the SBD session timeout (AT+SBDST?).
Definition: Iridium_9604_Satellite.cpp:1058
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 setIndicatorEventRe...
Definition: Iridium_9604_Satellite.cpp:286
char * _iridiumRXBuffer
Allocated in DevIridium9604::begin.
Definition: Iridium_9604.h:2526
SparkFun_Iridium_9604::urcCallback_t urcCallback_t
The generic URC callback type. Cast your callback to this for setURCCallback().
Definition: Iridium_9604.h:71
void enableDebugging(sfe_print_t &debugPort=SparkFun_Iridium_9604::sfeStdout)
Turn on the debug messages.
Definition: Iridium_9604.cpp:163
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>).
Definition: Iridium_9604_GNSS.cpp:684
IRIDIUM_9604_error_t getFTPprotocolError(int *error_code, int *error_code2)
Read the most recent FTP protocol error (AT+UFTPER).
Definition: Iridium_9604_Internet.cpp:805
sfe_string_t getSatelliteSerialNumber(void)
Read the satellite serial number (AT+USATSN).
Definition: Iridium_9604_Satellite.cpp:123
SparkFun_Iridium_9604::nmeaMessage nmeaMessage
The NMEA message class (SparkFun_Iridium_9604::nmeaMessage).
Definition: Iridium_9604.h:69
IRIDIUM_9604_error_t readSBDText(char *text, size_t maxLength)
Read the mobile terminated buffer (AT+SBDR) as NULL-terminated text.
Definition: Iridium_9604_Satellite.cpp:1024
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 Addition...
Definition: Iridium_9604_Satellite.cpp:1265
IRIDIUM_9604_error_t getMQTTprotocolError(int *error_code, int *error_code2)
Read the most recent MQTT protocol error (AT+UMQTTER).
Definition: Iridium_9604_Internet.cpp:686
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).
Definition: Iridium_9604_General.cpp:824
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.
Definition: Iridium_9604_Satellite.cpp:1214
void pruneBacklog(void)
Remove everything except the URCs from the backlog.
Definition: Iridium_9604.cpp:1537
void sendCommand(const char *command, bool at)
Send an AT command. Processes any waiting serial data (URCs) into the backlog first.
Definition: Iridium_9604.cpp:1189
IRIDIUM_9604_error_t activatePDPcontext(bool status, int cid=-1)
Activate or deactivate a PDP context (AT+CGACT).
Definition: Iridium_9604_Network.cpp:766
IRIDIUM_9604_error_t disableAllNMEA(void)
Disable the output of all 13 NMEA messages.
Definition: Iridium_9604.h:1857
IRIDIUM_9604_error_t setSBDDeliveryShortCode(uint8_t dsc)
Set the SBD delivery short code (AT+SBDDSC). See IRIDIUM_9604_SBDDSC_HOLD_MT_DELIVERY etc.
Definition: Iridium_9604_Satellite.cpp:536
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.
Definition: Iridium_9604_Satellite.cpp:1420
int waitForSatelliteSignalQuality(unsigned long timeout=60000)
Wait (calling bufferedPoll()) for the first +CIEV signal quality indication. Enables the indicator ev...
Definition: Iridium_9604_Satellite.cpp:252
IRIDIUM_9604_error_t registerOperator(struct operator_stats oper)
Manually register with a network operator (AT+COPS=1).
Definition: Iridium_9604_Network.cpp:647
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 in...
Definition: Iridium_9604_Sockets.cpp:531
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.
Definition: Iridium_9604_Sockets.cpp:316
char * _pruneBuffer
A temporary buffer used by pruneBacklog().
Definition: Iridium_9604.h:2527
IRIDIUM_9604_error_t setErrorReporting(uint8_t mode=2)
Configure how the module reports errors (AT+CMEE).
Definition: Iridium_9604_General.cpp:39
bool _sbdExtended
true for +SBDIX / +SBDIXA; false for +SBDI.
Definition: Iridium_9604.h:2555
void disableAtDebugging(void)
Turn off the AT command debug messages.
Definition: Iridium_9604.cpp:189
IRIDIUM_9604_error_t setFTPserver(const sfe_string_t &serverName)
Set the FTP server name (AT+UFTP=1).
Definition: Iridium_9604_Internet.cpp:726
IRIDIUM_9604_error_t setGNSSAidingIndication(bool enable=true)
Enable or disable the assisted GNSS indication URC (AT+UGIND). See setGNSSAidingCallback().
Definition: Iridium_9604_GNSS.cpp:262
IRIDIUM_9604_error_t setMQTTserver(const sfe_string_t &serverName, int port)
Set the MQTT broker name and port (AT+UMQTT=2).
Definition: Iridium_9604_Internet.cpp:379
SparkFun_Iridium_9604::sfe_print_t sfe_print_t
The print type: Print on Arduino; SfeOutput on ESP-IDF.
Definition: Iridium_9604.h:68
IRIDIUM_9604_error_t socketListen(int socket, unsigned int port)
Listen for incoming connections on a socket (AT+USOLI). See setSocketListenCallback().
Definition: Iridium_9604_Sockets.cpp:769
virtual size_t write(uint8_t c)
Write one byte directly to the module serial port.
Definition: Iridium_9604.cpp:559
bool poll(void)
The original poll function. Process one line of serial data from the module. It is 'blocking': it doe...
Definition: Iridium_9604.cpp:379
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 m...
Definition: Iridium_9604_Internet.cpp:257
IRIDIUM_9604_error_t reset(void)
Reset the module (AT+CFUN=16) and wait for it to restart. Bounded by IRIDIUM_9604_RESET_TIMEOUT.
Definition: Iridium_9604.cpp:607
void urcIndicatorEvent(int indicator, int value)
urcHandlerInterface: record the latest +CIEV indicator value.
Definition: Iridium_9604.cpp:589
IRIDIUM_9604_error_t getOperator(sfe_string_t *oper)
Read the current network operator (AT+COPS?).
Definition: Iridium_9604_Network.cpp:683
const unsigned long _rxWindowMillis
1ms is not quite long enough for a single char at 9600 baud. millis roll over much less often than mi...
Definition: Iridium_9604.h:2525
static const uint8_t IRIDIUM_9604_SBD_STATE_IN_PROGRESS
_sbdState: the session command has been sent. Waiting for the result
Definition: Iridium_9604.h:2550
IRIDIUM_9604_error_t socketClose(int socket, unsigned long timeout=IRIDIUM_9604_2_MIN_TIMEOUT)
Close a socket (AT+USOCL).
Definition: Iridium_9604_Sockets.cpp:117
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() et...
Definition: Iridium_9604.cpp:464
IRIDIUM_9604_error_t setSMSMessageFormat(IRIDIUM_9604_message_format_t textMode=IRIDIUM_9604_MESSAGE_FORMAT_TEXT)
Set the SMS message format (AT+CMGF).
Definition: Iridium_9604_SMS.cpp:24
IRIDIUM_9604_error_t _sbdCompleteStatus
The status for the callback.
Definition: Iridium_9604.h:2562
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 checkCa...
Definition: Iridium_9604_GNSS.cpp:802
IRIDIUM_9604_error_t disconnectFTP(void)
Disconnect from the FTP server (AT+UFTPC=0).
Definition: Iridium_9604_Internet.cpp:777
void urcProcessNMEA(const char *sentence, size_t length)
urcHandlerInterface: process one NMEA sentence from a +UUGNMEA URC.
Definition: Iridium_9604.h:2487
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 liste...
Definition: Iridium_9604.cpp:475
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)...
Definition: Iridium_9604.cpp:545
void setSocketReadCallback(void(*socketReadCallback)(int, sfe_string_t))
Set the original socket read callback - called when a +UUSORD or +UUSORF URC is received....
Definition: Iridium_9604.cpp:480
IRIDIUM_9604_error_t disconnectMQTT(void)
Disconnect from the MQTT broker (AT+UMQTTC=0).
Definition: Iridium_9604_Internet.cpp:437
static const size_t _lastErrorTextSize
The size of _lastErrorText.
Definition: Iridium_9604.h:2514
IRIDIUM_9604_error_t cancelSBDSession(void)
Cancel the non-blocking SBD session (the equivalent of ISBDCallback returning false in the SparkFun I...
Definition: Iridium_9604_Satellite.cpp:854
void setHTTPCommandCallback(void(*httpCommandRequestCallback)(int profile, int command, int result))
Set the callback for the HTTP command result URC (+UUHTTPCR).
Definition: Iridium_9604.cpp:516
bool _sbdComplete
The session is complete: call the callback.
Definition: Iridium_9604.h:2561
IRIDIUM_9604_registration_status_t registration(bool eps=true)
Read the network registration status (AT+CEREG? or AT+CREG?).
Definition: Iridium_9604_Network.cpp:124
IRIDIUM_9604_error_t deleteReadSentUnsentSMSmessages(void)
Delete all the read, sent and unsent SMS messages from preferred storage (AT+CMGD=1,...
Definition: Iridium_9604.h:832
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.
Definition: Iridium_9604_General.cpp:846
IRIDIUM_9604_gpio_mode_t getGpioMode(IRIDIUM_9604_gpio_t gpio)
Read the mode of a GPIO pin (AT+UGPIOC?).
Definition: Iridium_9604_General.cpp:644
size_t hwWriteData(const char *buff, int len)
Write a buffer to the module, through the communication bus.
Definition: Iridium_9604.cpp:1391
IRIDIUM_9604_error_t socketDirectLinkMode(int socket)
Switch a socket into direct link (transparent) mode (AT+USODL).
Definition: Iridium_9604_Sockets.cpp:786
IRIDIUM_9604_gpio_t
GPIO pin map.
Definition: Iridium_9604.h:860
@ GPIO6
Definition: Iridium_9604.h:866
@ GPIO4
Definition: Iridium_9604.h:864
@ GPIO1
Definition: Iridium_9604.h:861
@ GPIO2
Definition: Iridium_9604.h:862
@ GPIO3
Definition: Iridium_9604.h:863
@ GPIO5
Definition: Iridium_9604.h:865
IRIDIUM_9604_error_t at(void)
Send "AT" and check for "OK".
Definition: Iridium_9604.cpp:597
char * _iridiumResponseBacklog
The backlog: data (URCs) received while waiting for an AT command response.
Definition: Iridium_9604.h:2528
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).
Definition: Iridium_9604_Internet.cpp:736
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).
Definition: Iridium_9604_Internet.cpp:393
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)....
Definition: Iridium_9604_Satellite.cpp:876
char readChar(void)
Read one character from the module.
Definition: Iridium_9604.cpp:1444
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.
Definition: Iridium_9604.cpp:1039
bool _sbdHighLevel
true if the session was started by sendReceiveSBD: check the MO / MT status and read the MT message.
Definition: Iridium_9604.h:2556
IRIDIUM_9604_error_t socketDirectLinkDataLengthTrigger(int socket, int dataLengthTrigger)
Set the direct link data length trigger (AT+UDCONF=6).
Definition: Iridium_9604_Sockets.cpp:824
IRIDIUM_9604_gnss_system_t gnss_system_t
The GNSS system type. (Retained for SARA-R5 compatibility.)
Definition: Iridium_9604.h:1590
char _lastErrorText[_lastErrorTextSize]
The <err> from the most recent +CME ERROR / +CMS ERROR response.
Definition: Iridium_9604.h:2515
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.
Definition: Iridium_9604_Satellite.cpp:627
void setSIMstateReportCallback(void(*simStateRequestCallback)(IRIDIUM_9604_sim_states_t state))
Set the callback for the SIM state URC (+UUSIMSTAT). See setSIMstateReportingMode().
Definition: Iridium_9604.cpp:501
IRIDIUM_9604_sbd_session_t getLastSBDSession(void)
The result of the most recent SBD session (sbdSession(), sbdSessionExtended() or the send / receive m...
Definition: Iridium_9604.h:2352
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).
Definition: Iridium_9604_Internet.cpp:883
sfe_string_t getIMSI(void)
Read the SIM International Mobile Subscriber Identity (AT+CIMI).
Definition: Iridium_9604_General.cpp:162
void setGpsReadCallback(void(*gpsRequestCallback)(ClockData time, PositionData gps, SpeedData spd, unsigned long uncertainty))
Set the callback for the +UULOC location URC (see gpsRequest()).
Definition: Iridium_9604.cpp:495
IRIDIUM_9604_error_t getPDPcontextState(int cid, bool *active)
Read whether a PDP context is active (AT+CGACT?).
Definition: Iridium_9604_Network.cpp:848
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_RESPON...
Definition: Iridium_9604_SMS.cpp:151
sfe_string_t getCapabilities(void)
Read the module's capabilities list (AT+GCAP).
Definition: Iridium_9604_General.cpp:237
IRIDIUM_9604_pin_write_callback_t _resetPinWriteCallback
The RESET_N pin write callback. nullptr = use _resetPin.
Definition: Iridium_9604.h:2507
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.
Definition: Iridium_9604.h:169
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,...
Definition: Iridium_9604_FileSystem.cpp:85
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),...
Definition: Iridium_9604_GNSS.cpp:863
int _satelliteSignalQuality
From +CIEV:0.
Definition: Iridium_9604.h:2543
uint8_t _maxInitTries
The maximum number of initialization attempts.
Definition: Iridium_9604.h:2512
IRIDIUM_9604_sbd_session_t _lastSBDSession
The result of the most recent SBD session.
Definition: Iridium_9604.h:2545
sfe_string_t getNmeaMessageFieldCallback(nmeaMessage *theMessage, const char *fieldName)
Get one field of an NMEA message, by name, from inside an NMEA callback.
Definition: Iridium_9604_GNSS.cpp:828
nmeaMessage * getNmeaMessageByName(const char *msgId)
Find an NMEA message object by its message ID.
Definition: Iridium_9604.h:1989
sfe_string_t getManufacturerID(void)
Read the manufacturer identification (AT+CGMI).
Definition: Iridium_9604_General.cpp:57
void(* _socketReadCallback)(int, sfe_string_t)
The original socket read callback.
Definition: Iridium_9604.h:2537
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.
Definition: Iridium_9604_GNSS.cpp:432
IRIDIUM_9604_error_t getLastSBDSessionStatus(void)
The status of the most recent SBD session - the status passed to the callback.
Definition: Iridium_9604.h:2427
int _satelliteServiceAvailable
From +CIEV:1.
Definition: Iridium_9604.h:2544
sfe_ip_address_t lastRemoteIP(void)
The remote IP address from the most recent socket listen (+UUSOLI) URC.
Definition: Iridium_9604_Sockets.cpp:1320
IRIDIUM_9604_pin_write_callback_t _powerOnPinWriteCallback
The PWR_ON pin write callback. nullptr = use _powerPin.
Definition: Iridium_9604.h:2506
uint8_t * _sbdRxBuffer
sendReceiveSBD: where to store the MT message.
Definition: Iridium_9604.h:2558
size_t hwWrite(const char c)
Write one byte to the module, through the communication bus.
Definition: Iridium_9604.cpp:1406
IRIDIUM_9604_error_t getDefaultPDPcontext(int *cid, int *preferredProtocol=nullptr)
Read the PDP context used by the internal TCP/IP stack (AT+UDCONF=19).
Definition: Iridium_9604_Network.cpp:789
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 call...
Definition: Iridium_9604.h:2473
int _partialLineLength
The length of _partialLine.
Definition: Iridium_9604.h:2534
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).
Definition: Iridium_9604_Sockets.cpp:1169
bool isGPSon(void)
Check if the GNSS is powered on (AT+UGPS?).
Definition: Iridium_9604_GNSS.cpp:25
static const uint8_t IRIDIUM_9604_SBD_STATE_IDLE
_sbdState: no session in progress
Definition: Iridium_9604.h:2549
sfe_ip_address_t _lastLocalIP
The local IP address from the most recent +UUSOLI URC.
Definition: Iridium_9604.h:2511
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.
Definition: Iridium_9604_Sockets.cpp:254
void checkCallbacks(void)
Call any NMEA callbacks which are waiting. Called automatically by bufferedPoll().
Definition: Iridium_9604.cpp:436
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).
Definition: Iridium_9604_Internet.cpp:787
bool getNMEAfield(const char *msgId, const char *field, sfe_string_t &value)
Get one field of an NMEA message, by name. Calls getNMEA() first.
Definition: Iridium_9604_GNSS.cpp:787
IRIDIUM_9604_error_t connectFTP(void)
Connect to the FTP server (AT+UFTPC=1). The result is delivered by the +UUFTPCR URC: see setFTPComman...
Definition: Iridium_9604_Internet.cpp:767
IRIDIUM_9604_error_t getNMEAoutput(const char *msgId, uint8_t *rate, uint8_t *output)
Read the output configuration of one NMEA message (AT+UGNMEA?).
Definition: Iridium_9604_GNSS.cpp:481
IRIDIUM_9604_gpio_mode_t
GPIO pin modes.
Definition: Iridium_9604.h:872
@ LAST_GASP_ENABLE
Definition: Iridium_9604.h:892
@ KHZ_32768_OUT
Definition: Iridium_9604.h:904
@ UART_INTERFACE
Definition: Iridium_9604.h:889
@ FAST_POWER_OFF
Definition: Iridium_9604.h:897
@ TIMESTAMP
Definition: Iridium_9604.h:896
@ RING_INDICATION
Definition: Iridium_9604.h:891
@ UPSV_CONTROL
New for the 9604.
Definition: Iridium_9604.h:906
@ GNSS_DATA_READY
Definition: Iridium_9604.h:878
@ SATELLITE_GNSS_RX_TX_INDICATION
New for the 9604: Satellite / GNSS Rx/Tx indication.
Definition: Iridium_9604.h:908
@ MASTER_CLOCK_GENRATION
Definition: Iridium_9604.h:888
@ GNSS_SUPPLY_ENABLE
Definition: Iridium_9604.h:877
@ EXT_GNSS_TIME_PULSE
Definition: Iridium_9604.h:901
@ SATELLITE_GNSS_RX_INDICATION
New for the 9604: Satellite / GNSS Rx indication.
Definition: Iridium_9604.h:907
@ EXTERNAL_GNSS_ANTENNA
Definition: Iridium_9604.h:893
@ SPI_SERIAL_INTERFACE
Definition: Iridium_9604.h:887
@ DTR_MODE
Definition: Iridium_9604.h:903
@ GPIO_MODE_INVALID
Definition: Iridium_9604.h:873
@ MODULE_STATUS_INDICATION
Definition: Iridium_9604.h:884
@ ANTENNA_TUNING
Definition: Iridium_9604.h:900
@ MODULE_OPERATING_MODE_INDICATION
Definition: Iridium_9604.h:885
@ NETWORK_STATUS
Definition: Iridium_9604.h:876
@ JAMMING_DETECTION
Definition: Iridium_9604.h:880
@ SAFE_MEMORY_POWER_OFF
New for the 9604.
Definition: Iridium_9604.h:905
@ TIME_PULSE_OUTPUT
Definition: Iridium_9604.h:895
@ GPIO_OUTPUT
Definition: Iridium_9604.h:874
@ I2S_DIGITAL_AUDIO_INTERFACE
Definition: Iridium_9604.h:886
@ LWM2M_PULSE
Definition: Iridium_9604.h:898
@ HEADSET_DETECTION
Definition: Iridium_9604.h:882
@ GNSS_RTC_SHARING
Definition: Iridium_9604.h:879
@ TIME_PULSE_GNSS
Definition: Iridium_9604.h:894
@ WIFI_ENABLE
Definition: Iridium_9604.h:890
@ GSM_TX_BURST_INDICATION
Definition: Iridium_9604.h:883
@ HARDWARE_FLOW_CONTROL
Definition: Iridium_9604.h:899
@ PAD_DISABLED
Definition: Iridium_9604.h:909
@ EXT_GNSS_TIMESTAMP
Definition: Iridium_9604.h:902
@ GPIO_INPUT
Definition: Iridium_9604.h:875
@ SIM_CARD_DETECTION
Definition: Iridium_9604.h:881
IRIDIUM_9604_error_t getSBDAutoRegistration(IRIDIUM_9604_sbdareg_mode_t *mode)
Read the SBD automatic registration mode (AT+SBDAREG?).
Definition: Iridium_9604_Satellite.cpp:402
void setSocketCloseCallback(void(*socketCloseCallback)(int))
Set the callback for the socket close URC (+UUSOCL).
Definition: Iridium_9604.cpp:490
IRIDIUM_9604_error_t unsubscribeMQTTtopic(const sfe_string_t &topic)
Unsubscribe from an MQTT topic (AT+UMQTTC=5).
Definition: Iridium_9604_Internet.cpp:465
sfe_string_t getCCID(void)
Read the SIM card identification (AT+CCID).
Definition: Iridium_9604_General.cpp:183
bool processNMEA(const char *sentence, size_t length)
Process one NMEA sentence: check the checksum, store it and queue it for the callback....
Definition: Iridium_9604_GNSS.cpp:695
SparkFun_Iridium_9604::urcHandlerVector urcHandlers
The URC handler objects - one per registered URC handler.
Definition: Iridium_9604.h:2498
IRIDIUM_9604_error_t deleteReadSMSmessages(void)
Delete all the read SMS messages from preferred storage (AT+CMGD=1,1).
Definition: Iridium_9604.h:820
sfe_string_t getSatelliteIMEI(void)
Read the 15 digit satellite (SBD) IMEI (AT+USATSN).
Definition: Iridium_9604_Satellite.cpp:114
IRIDIUM_9604_error_t getSBDDeliveryShortCode(uint8_t *dsc)
Read the SBD delivery short code (AT+SBDDSC?).
Definition: Iridium_9604_Satellite.cpp:574
void checkSBDSession(void)
Non-blocking SBD session: check for a timeout; read the MT message (sendReceiveSBD) and call the call...
Definition: Iridium_9604_Satellite.cpp:798
void hwReset(void)
Reset (reboot) the module: hold RESET_N low for IRIDIUM_9604_RESET_PULSE_PERIOD (200 ms),...
Definition: Iridium_9604.cpp:890
IRIDIUM_9604_error_t enableEcho(bool enable=true)
Enable or disable the command echo (ATE1 / ATE0). The library disables echo during begin().
Definition: Iridium_9604_General.cpp:24
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.
Definition: Iridium_9604.cpp:1362
IRIDIUM_9604_error_t getUtimeIndication(IRIDIUM_9604_utime_urc_configuration_t *config)
Read the time indication URC configuration (AT+UTIMEIND?).
Definition: Iridium_9604_General.cpp:491
bool havePowerOnPin(void)
Check if the PWR_ON pin can be written: GPIO pin or callback.
Definition: Iridium_9604.h:2659
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 callb...
Definition: Iridium_9604_GNSS.cpp:851
The following abstract class is used as an interface for the platform-specific implementations....
Definition: sfe_bus.h:37
Debug printing: replaces the SARA-R5 library _debugPort prints. A base class of DevIridium9604 and th...
Definition: sfe_debug.h:38
The base class for the NMEA messages. Each message stores its latest copy and a ring buffer of copies...
Definition: nmeaMessage.h:88
The collection of NMEA message objects.
Definition: nmeaMessageVector.h:59
nmeaMessage * find(const char *msgId)
Find the registered message object for a given NMEA message identifier.
Definition: nmeaMessageVector.h:89
The collection of registered URC handlers. Replaces the SARA-R5 processURCEvent().
Definition: urcHandlerVector.h:61
void(* urcCallback_t)(void)
The generic URC callback type. Cast your callback to this for setURCCallback().
Definition: urcHandler.h:59
The date and time.
Definition: Iridium_9604_typedefs.h:186
Satellite system information (+USATINFO)
Definition: Iridium_9604_typedefs.h:570
The result of an SBD session (+SBDI / +SBDIX)
Definition: Iridium_9604_typedefs.h:663
int mtQueued
<MT queued>: count of MT messages waiting at the gateway
Definition: Iridium_9604_typedefs.h:669
The result of +SBDSX.
Definition: Iridium_9604_typedefs.h:696
The +CIEV:3 SV and beam coordinates.
Definition: Iridium_9604_typedefs.h:600
A position.
Definition: Iridium_9604_typedefs.h:193
Forward declaration - see nmeaCallbackDataCommon_t below.
Definition: nmeaMessage.h:80
A speed and course.
Definition: Iridium_9604_typedefs.h:204
The extended signal quality (+CESQ).
Definition: Iridium_9604_typedefs.h:221
A network operator - from getOperators().
Definition: Iridium_9604_typedefs.h:212