EZR
Dependencies: CRC16 FreescaleIAP FreescaleWatchdog GGSProtocol LM75B PIMA Parameters PersistentCircularQueue SerialNumberV2COM mbed-dev-watchdog_2016_03_04
Fork of smartRamalKW by
cmd/gravarNumeroSerie.cpp@10:7a1d1abb5172, 2015-07-23 (annotated)
- Committer:
- tpadovani
- Date:
- Thu Jul 23 22:46:18 2015 +0000
- Revision:
- 10:7a1d1abb5172
- Parent:
- 5:1bc98277c257
- Child:
- 16:cae76dbd681f
Mem?ria de massa de tens?o e comando para ler o rel?gio atual.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
tpadovani | 5:1bc98277c257 | 1 | #include "appCommands.h" |
tpadovani | 5:1bc98277c257 | 2 | #include "serialNumber.h" |
tpadovani | 5:1bc98277c257 | 3 | |
tpadovani | 5:1bc98277c257 | 4 | #define BOUNDARY_ERROR -99 //Commands may not span several sectors |
tpadovani | 5:1bc98277c257 | 5 | #define ALIGN_ERROR -98 //Data must be aligned on longword (two LSBs zero) |
tpadovani | 5:1bc98277c257 | 6 | #define PROTECTION_ERROR -97 //Flash sector is protected |
tpadovani | 5:1bc98277c257 | 7 | #define ACCESS_ERROR -96 //Something went wrong |
tpadovani | 5:1bc98277c257 | 8 | #define COLLISION_ERROR -95 //During writing something tried to flash which was written to |
tpadovani | 5:1bc98277c257 | 9 | #define LENGTH_ERROR -94 //The length must be multiples of 4 |
tpadovani | 5:1bc98277c257 | 10 | #define RUNTIME_ERROR -93 |
tpadovani | 5:1bc98277c257 | 11 | #define ERASE_ERROR -92 //The flash was not erased before writing to it |
tpadovani | 5:1bc98277c257 | 12 | #define PAYLOAD_INVALIDO -1 //Payload nao possui 8 bytes |
tpadovani | 5:1bc98277c257 | 13 | #define SUCESSO 0 |
tpadovani | 5:1bc98277c257 | 14 | |
tpadovani | 10:7a1d1abb5172 | 15 | void cmdGravarNumeroSerie(char * dados, unsigned char tamanhoDados){ |
tpadovani | 5:1bc98277c257 | 16 | |
tpadovani | 5:1bc98277c257 | 17 | if(tamanhoDados != SERIAL_LENGTH){ |
tpadovani | 5:1bc98277c257 | 18 | exec.enviaResposta(RESP_GRAVAR_NUM_SERIE, (char)PAYLOAD_INVALIDO); |
tpadovani | 5:1bc98277c257 | 19 | return; |
tpadovani | 5:1bc98277c257 | 20 | } |
tpadovani | 5:1bc98277c257 | 21 | |
tpadovani | 5:1bc98277c257 | 22 | int resp = sn.set(dados); |
tpadovani | 5:1bc98277c257 | 23 | exec.enviaResposta(RESP_GRAVAR_NUM_SERIE, resp); |
tpadovani | 5:1bc98277c257 | 24 | } |