sevencore fota solution development project
ext_fota/SerialManager.h@6:8dd20294b2aa, 2015-07-17 (annotated)
- Committer:
- dudnwjs
- Date:
- Fri Jul 17 14:04:12 2015 +0000
- Revision:
- 6:8dd20294b2aa
- Parent:
- 5:e11b23f9aacc
- Child:
- 9:fcf91f563147
EXT DEMO FILE OPEN COMPLETE
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 | 5:e11b23f9aacc | 16 | void ReceiveToSerialTest(void); |
dudnwjs | 6:8dd20294b2aa | 17 | void DataReceive(uint8_t *databuf, unsigned short size); |
dudnwjs | 2:dba344c91bce | 18 | |
dudnwjs | 2:dba344c91bce | 19 | private: |
dudnwjs | 2:dba344c91bce | 20 | void PrintSerialManager(void); |
dudnwjs | 2:dba344c91bce | 21 | |
dudnwjs | 2:dba344c91bce | 22 | bool print_flag; |
dudnwjs | 2:dba344c91bce | 23 | Serial *device; |
dudnwjs | 2:dba344c91bce | 24 | Serial *hostpc; |
dudnwjs | 2:dba344c91bce | 25 | uint8_t FE_MSG_PACKET_TYPE; |
dudnwjs | 2:dba344c91bce | 26 | int MAX_PACKET_LENGTH; |
dudnwjs | 2:dba344c91bce | 27 | unsigned char bReceiveState; |
dudnwjs | 2:dba344c91bce | 28 | unsigned short wDataLength; |
dudnwjs | 2:dba344c91bce | 29 | unsigned short wReceivePos; |
dudnwjs | 2:dba344c91bce | 30 | unsigned char bHdrBytesRead; |
dudnwjs | 2:dba344c91bce | 31 | unsigned char bReceiveElementArr[512]; |
dudnwjs | 2:dba344c91bce | 32 | |
dudnwjs | 2:dba344c91bce | 33 | }; |
dudnwjs | 2:dba344c91bce | 34 | |
dudnwjs | 2:dba344c91bce | 35 | }//namespace |
dudnwjs | 2:dba344c91bce | 36 | |
dudnwjs | 2:dba344c91bce | 37 | #endif//SERIALMANAGER_H |