uses pushing box to publish to google spreadsheets with a state machine instead of a while loop
Fork of GSM_PUSHING_BOX_STATE_MACHINE by
gsmqueue.h@2:8352ad91f2ee, 2015-03-05 (annotated)
- Committer:
- danilob
- Date:
- Thu Mar 05 21:24:31 2015 +0000
- Revision:
- 2:8352ad91f2ee
- Parent:
- 1:c1458b739eb6
- Child:
- 4:3264bc92993c
state machine v1
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
danilob | 0:41904adca656 | 1 | #ifndef GSMQUEUE_H |
danilob | 0:41904adca656 | 2 | #define GSMQUEUE_H |
danilob | 0:41904adca656 | 3 | |
danilob | 0:41904adca656 | 4 | /* gsmqueue.cpp |
danilob | 0:41904adca656 | 5 | * Contains functions to read from the DMA buffer in a queue fashion |
danilob | 0:41904adca656 | 6 | */ |
danilob | 0:41904adca656 | 7 | |
danilob | 0:41904adca656 | 8 | //Memory block of char size alocated for DMA |
danilob | 0:41904adca656 | 9 | #define BUFFER_LENGTH 255 //cannot exeede an int max value |
danilob | 0:41904adca656 | 10 | |
danilob | 0:41904adca656 | 11 | |
danilob | 0:41904adca656 | 12 | #define QUEUETAIL (char*)DMA_TCD0_DADDR |
danilob | 0:41904adca656 | 13 | |
danilob | 0:41904adca656 | 14 | |
danilob | 0:41904adca656 | 15 | //Initialize variables |
danilob | 0:41904adca656 | 16 | void queueInit(); |
danilob | 0:41904adca656 | 17 | |
danilob | 0:41904adca656 | 18 | //Find an occurrence of the given string in the buffer. |
danilob | 0:41904adca656 | 19 | //Only advance queueHead until a matching string is found. |
danilob | 0:41904adca656 | 20 | bool findInQueue(char* str, int strLen); |
danilob | 0:41904adca656 | 21 | |
danilob | 0:41904adca656 | 22 | //Increment queue index by 1, auxiliar function |
danilob | 0:41904adca656 | 23 | char* incrementIndex(char* pointerToIncrement); |
danilob | 0:41904adca656 | 24 | |
danilob | 0:41904adca656 | 25 | //will eliminate all elements form queue. |
danilob | 0:41904adca656 | 26 | void flushQueue(); |
danilob | 0:41904adca656 | 27 | |
danilob | 0:41904adca656 | 28 | //Print queue elements |
danilob | 0:41904adca656 | 29 | void printQueue(); //for debugging |
danilob | 0:41904adca656 | 30 | |
danilob | 0:41904adca656 | 31 | //Parse through characters until first integer is found |
danilob | 0:41904adca656 | 32 | int parseInt(); |
danilob | 0:41904adca656 | 33 | |
es_marble | 1:c1458b739eb6 | 34 | //Reset the GSM DMA idle bit to 0 |
es_marble | 1:c1458b739eb6 | 35 | void resetGSMIdleBit(); |
es_marble | 1:c1458b739eb6 | 36 | |
es_marble | 1:c1458b739eb6 | 37 | //Get the GSM DMA idle bit (if 1, indicates we already received a response) |
es_marble | 1:c1458b739eb6 | 38 | bool getGSMIdleBit(); |
es_marble | 1:c1458b739eb6 | 39 | |
danilob | 2:8352ad91f2ee | 40 | |
danilob | 0:41904adca656 | 41 | #endif |