15 #define BayTCP_BUFFER 136 18 #define BayTCP_CONFIG_SERVER 0 19 #define BayTCP_CONFIG_PORT 1 20 #define BayTCP_CONFIG_PATH 2 21 #define BayTCP_CONFIG_USER 3 22 #define BayTCP_CONFIG_PASSWORD 4 23 #define BayTCP_CONFIG_SENDER 5 24 #define BayTCP_CONFIG_APN 6 25 #define BayTCP_CONFIG_PROVPW 7 26 #define BayTCP_CONFIG_PROVUSER 8 27 #define BayTCP_CONFIG_PIN 9 28 #define BayTCP_CONFIG_MAC 6 29 #define BayTCP_CONFIG_IP 7 30 #define BayTCP_CONFIG_MASK 8 31 #define BayTCP_CONFIG_DEFAULT_GW 9 33 #define BayTCP_CONFIG_SIZE 140 34 #define BayTCP_EEPROM_OFFSET 400 36 #define BayTCP_DEBUG_OUTPUT 0 37 #define BayTCP_DEBUG_INPUT 0 39 #define printP(x) printPGM(PSTR(x)) 40 #define printlnP(x) printlnPGM(PSTR(x)) 41 #define wait_for(x,y) wait_forPGM(PSTR(x),y) 42 #define SerialprintP(x) serialprintPGM(PSTR(x)) 43 #define SerialprintlnP(x) serialprintlnPGM(PSTR(x)) 51 #include "../BayEOSBuffer/BayEOSBuffer.h" 52 #include "../SdFat/SdFat.h" 58 virtual int i_available() = 0;
78 virtual uint8_t
connect(
void)=0;
100 void setConfig(
const char *str,uint8_t index);
129 const uint8_t* parseMAC(
const char* str);
130 const uint8_t* parseIP(
const char* str);
131 uint8_t hex2int(
const char c);
144 virtual void flushMTU(
void)=0;
145 virtual void finishTransmissionMode(
void)=0;
146 void printPostHeader(uint16_t size);
147 void setConfigPointers(
void);
148 uint8_t addToConfigBuffer(uint8_t offset,
const char* str);
150 void skipChars(
void);
151 uint8_t wait_forOK(uint16_t timeout);
152 uint8_t wait_forPGM(
const char* str, uint16_t timeout,uint8_t bytes=0,
char* buffer=NULL);
153 uint8_t wait_for_available(uint16_t* timeout,
int bytes=1);
154 void printPGM(
const char *str);
155 void printlnPGM(
const char *str);
156 void serialprintPGM(
const char *str);
157 void serialprintlnPGM(
const char *str);
160 char _config_buffer[BayTCP_CONFIG_SIZE];
161 char _pgm_buffer[20];
172 char _base64buffer[BayTCP_BUFFER];
173 uint8_t _tx_error_count;
175 int strlenURLencoded(
const char *str);
176 void printURLencoded(
const char *str);
177 static const char*
const _urlencodedChars;
void readConfigFromStringPGM(const char *string)
virtual uint8_t connect(void)=0
void setConfig(const char *str, uint8_t index)
virtual void disconnect(void)=0
void readConfigFromEEPROM(int eeoffset=BayTCP_EEPROM_OFFSET)
void readConfigFromFile(const char *file)
uint8_t sendMultiFromBuffer(uint16_t maxsize=5000)
char ** getConfigPointer(uint8_t index)
uint8_t sendPayload(void)
const char * getConfig(void)
void writeConfigToEEPROM(int eeoffset=BayTCP_EEPROM_OFFSET)