JM9 UART packet packer. More...
#include <Serial_packer.h>
Public Member Functions | |
| Serial_packer (HardwareSerial &init_uart, const uint8_t init_start_byte) | |
| Creates a packer. | |
| bool | send (const uint8_t *const tx_buf, const uint8_t tx_buf_len) |
| Creates and sends a packet. | |
| HardwareSerial & | get_uart () |
| Gets the UART object to send the packets to. | |
JM9 UART packet packer.
This packer can pack data into packets and send the packets through a UART bus.
| Serial_packer::Serial_packer | ( | HardwareSerial & | init_uart, |
| const uint8_t | init_start_byte ) |
Creates a packer.
| init_uart | the UART object to send the packets to |
| init_start_byte | the start byte of each packet |
| HardwareSerial & Serial_packer::get_uart | ( | ) |
Gets the UART object to send the packets to.
| bool Serial_packer::send | ( | const uint8_t *const | tx_buf, |
| const uint8_t | tx_buf_len ) |
Creates and sends a packet.
| tx_buf | the array of bytes to be sent |
| tx_buf_len | the number of bytes to be sent |
true if packet is successfully sent, false otherwise