|
| bool | getNTPTime (SARA_R5 &r5) |
| |
| size_t | readFromStreamUntil (Stream &stream, const char delim, char *const buffer, const size_t max) |
| | Read characters from stream into buffer until the delim char is encountered. More...
|
| |
| void | streamPassthrough (Stream *s1, Stream *s2) |
| |
| int | waitForChar (Stream &stream, uint32_t timeout) |
| | Wait up to timeout ms for any character to appear in stream. More...
|
| |
| JsonObjectConst | getSensorDefn (const char *const vendor, const char *const model) |
| |
| JsonObjectConst | getSensorDefn (const size_t sensor_idx, const sensor_list &sensors) |
| |
| void | enable12V (void) |
| | Enable the SDI-12 power line if it is not already enabled. More...
|
| |
| void | disable12V (void) |
| | Disable the SDI-12 power line. More...
|
| |
| const char * | iso8601 (void) |
| |
| void | log_to_sdcard (const char *msg) |
| |
| void | log_to_sdcardf (const char *fmt,...) |
| |
| int | read_spiffs_file (const char *const filename, char *buffer, const size_t max_length, size_t &bytes_read) |
| |
| int | read_r5_file (const String &filename, char *const buffer, const size_t length, size_t &bytes_read, SARA_R5_error_t &r5_err) |
| |
| bool | wait_for_at (void) |
| | Waits until an AT command to the R5 modem returns OK, or a timeout is reached. More...
|
| |
| bool | connect_to_internet (void) |
| | Get the R5 modem connected to the internet. More...
|
| |
Global utility functions.
| bool connect_to_internet |
( |
void |
| ) |
|
Get the R5 modem connected to the internet.
This function sets the ESP32 and modem RTCs from the network time using NTP.
If this function returns true, the modem has registered to the network, brought up a packet switched profile, and obtained an IP address. MQTT, FTP, etc can be used.
- Returns
- true if the connection succeeds, otherwise false.
| size_t readFromStreamUntil |
( |
Stream & |
stream, |
|
|
const char |
delim, |
|
|
char *const |
buffer, |
|
|
const size_t |
max |
|
) |
| |
Read characters from stream into buffer until the delim char is encountered.
This function will respect the backspace character (0x08) by moving the 'virtual cursor' back one character in buffer, if buffer is not empty.
Up to max - 1 characters will be read to ensure the resulting string is null terminated.
- Parameters
-
| stream | the Stream to read from. |
| delim | the character that causes reading to stop and the function to return. |
| buffer | the buffer to write characters into. |
| max | the maximum number of characters to be read. |
- Returns
- the length of the string read from stream.