sevencore fota solution development project
ext_fota/SerialManager.h@2:dba344c91bce, 2015-06-22 (annotated)
- Committer:
- dudnwjs
- Date:
- Mon Jun 22 09:43:13 2015 +0000
- Revision:
- 2:dba344c91bce
- Child:
- 5:e11b23f9aacc
Add Serial Manager;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dudnwjs | 2:dba344c91bce | 1 | #ifndef SERIALMANAGER_H |
dudnwjs | 2:dba344c91bce | 2 | #define SERIALMANAGER_H |
dudnwjs | 2:dba344c91bce | 3 | |
dudnwjs | 2:dba344c91bce | 4 | #include "mbed.h" |
dudnwjs | 2:dba344c91bce | 5 | |
dudnwjs | 2:dba344c91bce | 6 | namespace sevencore_fota{ |
dudnwjs | 2:dba344c91bce | 7 | |
dudnwjs | 2:dba344c91bce | 8 | class SerialManager |
dudnwjs | 2:dba344c91bce | 9 | { |
dudnwjs | 2:dba344c91bce | 10 | public: |
dudnwjs | 2:dba344c91bce | 11 | SerialManager(Serial *_device); |
dudnwjs | 2:dba344c91bce | 12 | SerialManager(Serial *_device,Serial *_hostpc); |
dudnwjs | 2:dba344c91bce | 13 | ~SerialManager(void); |
dudnwjs | 2:dba344c91bce | 14 | int SendToSerial(uint8_t *data,unsigned short size); |
dudnwjs | 2:dba344c91bce | 15 | int ReceiveToSerial(unsigned char *receive_msg); |
dudnwjs | 2:dba344c91bce | 16 | |
dudnwjs | 2:dba344c91bce | 17 | private: |
dudnwjs | 2:dba344c91bce | 18 | void PrintSerialManager(void); |
dudnwjs | 2:dba344c91bce | 19 | |
dudnwjs | 2:dba344c91bce | 20 | bool print_flag; |
dudnwjs | 2:dba344c91bce | 21 | Serial *device; |
dudnwjs | 2:dba344c91bce | 22 | Serial *hostpc; |
dudnwjs | 2:dba344c91bce | 23 | uint8_t FE_MSG_PACKET_TYPE; |
dudnwjs | 2:dba344c91bce | 24 | int MAX_PACKET_LENGTH; |
dudnwjs | 2:dba344c91bce | 25 | unsigned char bReceiveState; |
dudnwjs | 2:dba344c91bce | 26 | unsigned short wDataLength; |
dudnwjs | 2:dba344c91bce | 27 | unsigned short wReceivePos; |
dudnwjs | 2:dba344c91bce | 28 | unsigned char bHdrBytesRead; |
dudnwjs | 2:dba344c91bce | 29 | unsigned char bReceiveElementArr[512]; |
dudnwjs | 2:dba344c91bce | 30 | |
dudnwjs | 2:dba344c91bce | 31 | }; |
dudnwjs | 2:dba344c91bce | 32 | |
dudnwjs | 2:dba344c91bce | 33 | }//namespace |
dudnwjs | 2:dba344c91bce | 34 | |
dudnwjs | 2:dba344c91bce | 35 | #endif//SERIALMANAGER_H |