APP 4
Dependencies: mbed CRC16 mbed-rtos
MEF.h@27:011ad1667040, 2016-02-23 (annotated)
- Committer:
- manl2003
- Date:
- Tue Feb 23 21:15:05 2016 +0000
- Revision:
- 27:011ad1667040
- Parent:
- 26:f2b37f9dfca9
Tout beau, mef inclue.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
vinbel93 | 26:f2b37f9dfca9 | 1 | // Vincent Bélanger et Laurent Mandrile |
vinbel93 | 26:f2b37f9dfca9 | 2 | // belv1802 - manl2003 |
vinbel93 | 26:f2b37f9dfca9 | 3 | |
manl2003 | 10:51ee22e230c7 | 4 | #include "APP.h" |
manl2003 | 10:51ee22e230c7 | 5 | |
manl2003 | 10:51ee22e230c7 | 6 | #pragma once |
manl2003 | 10:51ee22e230c7 | 7 | |
manl2003 | 10:51ee22e230c7 | 8 | class MEF |
manl2003 | 10:51ee22e230c7 | 9 | { |
vinbel93 | 14:9505b98c6623 | 10 | public: |
vinbel93 | 14:9505b98c6623 | 11 | |
manl2003 | 10:51ee22e230c7 | 12 | void ReceiveBit(bool bit); |
vinbel93 | 26:f2b37f9dfca9 | 13 | |
manl2003 | 10:51ee22e230c7 | 14 | private: |
manl2003 | 10:51ee22e230c7 | 15 | |
manl2003 | 27:011ad1667040 | 16 | //Verification du start byte |
manl2003 | 10:51ee22e230c7 | 17 | bool startChecker(); |
manl2003 | 27:011ad1667040 | 18 | //Verification du preamble byte |
manl2003 | 10:51ee22e230c7 | 19 | bool preambleChecker(); |
manl2003 | 27:011ad1667040 | 20 | //Calcul de la longueur |
manl2003 | 10:51ee22e230c7 | 21 | int calculateSize(); |
manl2003 | 12:715af3660c73 | 22 | bool compareCRC(); |
vinbel93 | 20:f0932bfe09ed | 23 | void init(); |
vinbel93 | 26:f2b37f9dfca9 | 24 | |
manl2003 | 27:011ad1667040 | 25 | //État actuel de la mef |
manl2003 | 10:51ee22e230c7 | 26 | STATES state; |
manl2003 | 27:011ad1667040 | 27 | //Buffer d'entrée |
manl2003 | 12:715af3660c73 | 28 | bitset<16> m_InputBuffer; |
manl2003 | 27:011ad1667040 | 29 | //Payload en bits |
manl2003 | 12:715af3660c73 | 30 | bitset<MAX_DATA> m_BSPayload; |
manl2003 | 27:011ad1667040 | 31 | //Payload en char |
manl2003 | 12:715af3660c73 | 32 | char m_CPayload[80]; |
manl2003 | 10:51ee22e230c7 | 33 | int m_Counter; |
manl2003 | 10:51ee22e230c7 | 34 | int m_DataSize; |
manl2003 | 12:715af3660c73 | 35 | unsigned short m_CRC; |
manl2003 | 10:51ee22e230c7 | 36 | }; |