#include <ares_lora_serial.hpp>
Serial driver class for communicating with Ares LoRa devices.
◆ AresSerial()
Constructor.
- Parameters
-
| configs | The configurations for the driver. |
◆ ~AresSerial()
| AresSerial::~AresSerial |
( |
| ) |
|
Destructor. Automatically stops the driver and closes any serial connections.
◆ get_response_timeout()
| std::chrono::milliseconds AresSerial::get_response_timeout |
( |
| ) |
const |
|
nodiscard |
Retrieve the firmware response timeout.
- Returns
- The firmware response timeout.
◆ led()
| py::tuple AresSerial::led |
( |
uint8_t | id, |
|
|
uint8_t | state ) |
Set or retrieve the LED state from firmware.
- Parameters
-
| id | The LED number/ID to set/fetch the state for. |
| state | The new LED state for the firmware or a fetch state request. |
- Returns
- py::tuple<Fetch LED state | Default LED state, ACK'ed error code>
◆ lora_config()
Configure the LoRa modem.
- Parameters
-
| config | The new LoRa modem configurations. |
- Returns
- The ACK'ed error code from the firmware.
◆ send_heartbeat()
| int AresSerial::send_heartbeat |
( |
bool | ready, |
|
|
uint8_t | tx_cnt ) |
Send a heartbeat message over the LoRa network.
- Parameters
-
| ready | Flag indicating the system is ready to collect data. |
| tx_cnt | The amount of times to transmit the heartbeat. |
- Returns
- The ACK'ed error code from the firmware.
◆ send_log()
| py::tuple AresSerial::send_log |
( |
const std::string & | log_msg, |
|
|
bool | broadcast, |
|
|
uint8_t | tx_cnt, |
|
|
uint16_t | id ) |
Send a logging message over the LoRa network.
- Parameters
-
| log_msg | The log message to send. |
| broadcast | Flag indicating if the log message should be broadcasted. |
| tx_cnt | The number of times to send the message or the max attempts. |
| id | The ID to direct the message to. |
- Returns
- py::tuple<ACK'ed error code, ...>.
- Note
- If broadcast is true, id is ignored.
-
If broadcast is false, and id is 0, then id will be overridden to be the claimed master node. If there is no claimed master node, then the broadcast flag will be overridden to be true.
-
tx_cnt is the number of times the message is sent when broadcasting. If not broadcasting, it is the maximum number of attempts to exchange a logging message chunk with the destination node.
◆ send_start()
| int AresSerial::send_start |
( |
int64_t | sec, |
|
|
uint64_t | nsec, |
|
|
uint16_t | id, |
|
|
bool | broadcast ) |
Send a start message over the LoRa network.
- Parameters
-
| sec | The seconds part of the start time. |
| nsec | The nanoseconds part of the start time. |
| id | The ID to send the start message to. Ignored if broadcast is set. |
| broadcast | Broadcast the start time to all the listening nodes. |
- Returns
- The ACK'ed error code from firmware.
◆ set_logging_level()
| void AresSerial::set_logging_level |
( |
uint32_t | level | ) |
|
Set the logging level for the core module.
- Parameters
-
| level | The new logging level. |
◆ set_response_timeout()
| void AresSerial::set_response_timeout |
( |
const std::chrono::milliseconds & | timeout | ) |
|
Set the firmware response timeout.
- Parameters
-
| timeout | The new response timeout. |
◆ setting_get()
| py::tuple AresSerial::setting_get |
( |
uint16_t | id | ) |
|
Retrieve a setting configuration from firmware.
- Parameters
-
- Returns
- py::tuple<setting value, ACK'ed error code>
◆ setting_set()
| int AresSerial::setting_set |
( |
uint16_t | id, |
|
|
uint32_t | value ) |
Configure a setting on firmware.
- Parameters
-
| id | The setting ID. |
| value | The new value of the setting. |
- Returns
- The ACK'ed error code from the firmware.
◆ start()
| void AresSerial::start |
( |
| ) |
|
◆ stop()
| void AresSerial::stop |
( |
| ) |
|
◆ version()
| py::tuple AresSerial::version |
( |
| ) |
|
Retrieve version information from the firmware.
- Returns
- py::tuple<app version tuple, ncs version tuple, kernel version tuple>
The documentation for this class was generated from the following file: