21 #ifndef SELKIELoggerLPMS_Connection
22 #define SELKIELoggerLPMS_Connection
36 #define LPMS_BUFF 1024
52 uint8_t buf[
LPMS_BUFF],
size_t *index,
size_t *hw);
bool lpms_readMessage_buf(int handle, lpms_message *out, uint8_t buf[LPMS_BUFF], size_t *index, size_t *hw)
Read data from handle, and parse message if able.
bool lpms_send_command(const int handle, lpms_message *m)
Write command defined by structure to handle.
bool lpms_find_messages(int handle, size_t numtypes, const uint8_t types[], int timeout, lpms_message *out, uint8_t buf[LPMS_BUFF], size_t *index, size_t *hw)
Read data from handle until first of specified message types is found.
#define LPMS_BUFF
Default serial buffer allocation size.
bool lpms_readMessage(int handle, lpms_message *out)
Static wrapper around lpms_readMessage_buf.
bool lpms_send_get_config(const int handle)
Shortcut: Send LPMS_MSG_GET_OUTPUTS.
void lpms_closeConnection(int handle)
Close LPMS serial connection.
int lpms_openConnection(const char *device, const int baud)
Open connection to an LPMS serial device.
bool lpms_send_stream_mode(const int handle)
Shortcut: Send LPMS_MSG_MODE_STREAM.
bool lpms_send_command_mode(const int handle)
Shortcut: Send LPMS_MSG_MODE_CMD.