JM9 UART packet packer. More...
#include <Jason.h>
Public Member Functions | |
| JM9_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. | |
Public Attributes | |
| HardwareSerial & | uart |
| The underlying UART object. | |
JM9 UART packet packer.
This packer can pack data into packets and send the packets through a UART bus.
| JM9_packer::JM9_packer | ( | HardwareSerial & | init_uart, |
| const uint8_t | init_start_byte ) |
Creates a packer.
| init_uart | the UART object to write this packet to |
| init_start_byte | the start byte of each packet |
| bool JM9_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