usapack public
Dependents: optWingforHAPS_Eigen hexaTest_Eigen
Diff: UsaPack.hpp
- Revision:
- 10:a2c85eed720b
- Parent:
- 9:7d39154143a1
- Child:
- 11:6e58df8fd7ce
diff -r 7d39154143a1 -r a2c85eed720b UsaPack.hpp --- a/UsaPack.hpp Mon May 31 18:51:56 2021 +0000 +++ b/UsaPack.hpp Tue Jun 22 02:19:00 2021 +0000 @@ -10,7 +10,7 @@ class UsaPack { private: - Serial serial; + char receive_buffer[receive_size]; volatile int receive_index; volatile int package_index; @@ -22,12 +22,14 @@ volatile int send_index; volatile int send_end_index; - void Receive(); + void SendByte(); void Decode(); public: UsaPack(PinName tx, PinName rx, int baud); + void Receive(); + Serial serial; static void CobsEncode(char data[], int length, char send_data[]); static void CobsDecode(char receive_data[], int length, char data[]);