![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
multihop protocol
Dependencies: mbed
packet.h@8:fd217a8f8658, 2015-11-17 (annotated)
- Committer:
- mfrede
- Date:
- Tue Nov 17 19:25:53 2015 +0000
- Revision:
- 8:fd217a8f8658
- Parent:
- 4:024e613151a5
add rssi
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mfrede | 2:9365aaf34637 | 1 | #ifndef LAB5PACKET |
mfrede | 2:9365aaf34637 | 2 | #define LAB5PACKET |
mfrede | 2:9365aaf34637 | 3 | |
mfrede | 2:9365aaf34637 | 4 | |
mfrede | 2:9365aaf34637 | 5 | class packet |
mfrede | 2:9365aaf34637 | 6 | { |
mfrede | 2:9365aaf34637 | 7 | #define HELLO_TYPE 1 |
mfrede | 2:9365aaf34637 | 8 | #define ROUTE_REQ_TYPE 2 |
mfrede | 2:9365aaf34637 | 9 | #define ROUTE_ACK_TYPE 3 |
mfrede | 2:9365aaf34637 | 10 | #define DATA_TYPE 4 |
mfrede | 2:9365aaf34637 | 11 | public: |
mfrede | 2:9365aaf34637 | 12 | packet(unsigned short from, unsigned short to, unsigned short TYPE, float data1, float data2) { |
mfrede | 2:9365aaf34637 | 13 | TTL = 4; |
mfrede | 2:9365aaf34637 | 14 | from = from; |
mfrede | 2:9365aaf34637 | 15 | to = to; |
mfrede | 2:9365aaf34637 | 16 | TYPE = TYPE; |
mfrede | 2:9365aaf34637 | 17 | data1 = data1; |
mfrede | 2:9365aaf34637 | 18 | data2 = data2; |
mfrede | 2:9365aaf34637 | 19 | }; |
mfrede | 2:9365aaf34637 | 20 | |
mfrede | 4:024e613151a5 | 21 | uint8_t from; |
mfrede | 4:024e613151a5 | 22 | uint8_t to; |
mfrede | 4:024e613151a5 | 23 | uint8_t TTL; |
mfrede | 4:024e613151a5 | 24 | uint8_t TYPE; |
mfrede | 2:9365aaf34637 | 25 | float data1; |
mfrede | 2:9365aaf34637 | 26 | float data2; |
mfrede | 2:9365aaf34637 | 27 | |
mfrede | 2:9365aaf34637 | 28 | }; |
mfrede | 2:9365aaf34637 | 29 | |
mfrede | 2:9365aaf34637 | 30 | #endif |