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.
Dependencies: nRF24L01P_Hello_World nRF24L01P
Diff: protocol.h
- Revision:
- 4:5caf9e1dc16c
- Child:
- 5:668dd9395ca5
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/protocol.h Fri Jan 08 08:51:10 2021 +0000 @@ -0,0 +1,24 @@ +#ifndef PROTOCOL_H +#define PROTOCOL_H + +//Etats de receptions +#define WAITING 0 +#define FUNCTION_MSB 1 +#define FUNCTION_LSB 2 +#define LENGTH_MSB 3 +#define LENGTH_LSB 4 +#define PAYLOAD 5 +#define CHECKSUM 6 + +//Numéro des fonctions +#define COMMAND_ID_TEXT 0x0020 + +//Taille des trames pour certaines fonctions +//#define + +//Prototypes des fonctions +int encodeMessage(int msgFunction, int msgPayloadLength, char* msgPayload, char* msg); +char calculateChecksum(int msgFunction, int msgPayloadLength, char* msgPayload); +void decodeMessage(char receivedByte); + +#endif \ No newline at end of file