Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
sender.h
00001 #ifndef SENDER_H 00002 #define SENDER_H 00003 00004 #include "mbed.h" 00005 #include "rtos.h" 00006 #include <vector> 00007 #include <string> 00008 00009 vector<unsigned char> createFrame(const vector<unsigned char> &message); 00010 00011 00012 class Sender{ 00013 00014 enum State {prepare, sendData}; 00015 00016 Serial pc; 00017 00018 DigitalOut MO; 00019 public: 00020 void send(); 00021 Sender(); 00022 void sendMessage(const vector<unsigned char> & data); 00023 Ticker _ticker; 00024 DigitalOut myled; 00025 00026 private: 00027 void prepareBit(); 00028 State send_state; 00029 int _byteSentCount; 00030 int _bitSentCount; 00031 vector<unsigned char> data; 00032 bool _next_bit; 00033 bool _sending; 00034 }; 00035 00036 00037 #endif
Generated on Tue Jul 12 2022 18:11:54 by
