|
Arduino KVComm
master
Key-Value pair communication library for Arduino
|
Class for sending SLIP packets. More...
#include <SLIPStream/SLIPSender.hpp>
Public Member Functions | |
| SLIPSender ()=default | |
| Default constructor. More... | |
| SLIPSender (Sender &&sender) | |
| Constructor with sender initialization. More... | |
| size_t | beginPacket () |
| Start a packet. More... | |
| size_t | endPacket () |
| Finish the packet. More... | |
| size_t | write (const uint8_t *data, size_t len) |
| Write some data as the body of a packet. More... | |
Private Attributes | |
| Sender | sender |
Class for sending SLIP packets.
| Sender | The functor that actually sends a byte over the transmission channel. Takes a single byte as an argument and returns the number of bytes written (similar to Serial.write(uint8_t)): size_t sender(uint8_t byte) |
Definition at line 26 of file SLIPSender.hpp.
|
default |
Default constructor.
|
inline |
Constructor with sender initialization.
| sender | Initialization for the sender. Perfect forwarding is used. |
Definition at line 38 of file SLIPSender.hpp.
|
inline |
Start a packet.
Sends a SLIP END character to flush the buffer of the receiver.
Definition at line 48 of file SLIPSender.hpp.
|
inline |
Finish the packet.
Sends a SLIP END character.
Definition at line 56 of file SLIPSender.hpp.
| size_t write | ( | const uint8_t * | data, |
| size_t | len | ||
| ) |
Write some data as the body of a packet.
The data is encoded by SLIP before sending, so arbitrary binary data can be sent.
| data | A pointer to the data to send. |
| len | The number of bytes to send. |
Definition at line 4 of file SLIPSender.ipp.
|
private |
Definition at line 73 of file SLIPSender.hpp.
1.8.16