uses pushing box to publish to google spreadsheets with a state machine instead of a while loop

Dependents:   DCS_FINAL_CODE

Fork of GSM_PUSHING_BOX_STATE_MACHINE by DCS_TEAM

gsmqueue.h

Committer:
es_marble
Date:
2015-03-05
Revision:
3:dac922a18af6
Parent:
1:c1458b739eb6
Child:
4:3264bc92993c

File content as of revision 3:dac922a18af6:

#ifndef GSMQUEUE_H
#define GSMQUEUE_H

/* gsmqueue.cpp
 * Contains functions to read from the DMA buffer in a queue fashion
 */

//Memory block of char size alocated for DMA
#define BUFFER_LENGTH 255 //cannot exeede an int max value

#define QUEUETAIL (char*)DMA_TCD0_DADDR


//Initialize variables 
void queueInit();

//Find an occurrence of the given string in the buffer.
//Only advance queueHead until a matching string is found.
bool findInQueue(char* str, int strLen);

//Increment queue index by 1, auxiliar function
char* incrementIndex(char* pointerToIncrement);

//will eliminate all elements form queue.
void flushQueue();

//Print queue elements
void printQueue();   //for debugging

//Parse through characters until first integer is found
int parseInt();

//Returns true if the character is numeric
bool isNumeric(char* qPos);

//Reset the GSM DMA idle bit to 0
void resetGSMIdleBit();

//Get the GSM DMA idle bit (if 1, indicates we already received a response)
bool getGSMIdleBit();

#endif