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.
Fork of ut_bbr_2018 by
RFManager.h
00001 #ifndef RFMANAGER_H 00002 #define RFMANAGER_H 00003 00004 #include "mbed.h" 00005 #include "CircularBuffer2.h" 00006 00007 class RFManager { 00008 protected: 00009 FunctionPointer _callback; 00010 00011 public: 00012 RFManager(PinName txPinName, PinName rxPinName); 00013 00014 void baud(int baudrate); 00015 00016 char *read(); 00017 00018 void send(char *sendData); 00019 00020 void send(char *sendData, int length); 00021 00022 void update(); 00023 00024 void handleMessage(); 00025 00026 void setShortCommandMode(bool isEnabled); 00027 00028 bool readable(); 00029 00030 void attach(void (*function)(void)) { 00031 _callback.attach(function); 00032 } 00033 00034 template<typename T> 00035 void attach(T *object, void (T::*member)(void)) { 00036 _callback.attach( object, member ); 00037 } 00038 00039 private: 00040 Serial serial; 00041 00042 int serialId; 00043 00044 void rxHandler(void); 00045 00046 bool messageAvailable; 00047 00048 void serialWrite(char *sendData, int length); 00049 char serialReadChar(); 00050 00051 CircularBuffer2<char> buf; 00052 00053 unsigned int receiveCounter; 00054 char receiveBuffer[16]; 00055 00056 char receivedMessage[16]; 00057 00058 bool shortCommandsEnabled; 00059 unsigned int commandLength; 00060 unsigned int shortCommandLength; 00061 unsigned int longCommandLength; 00062 }; 00063 00064 00065 #endif //RFManager_H
Generated on Thu Aug 18 2022 01:51:11 by
1.7.2
