-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHandlerHTTP.h
More file actions
41 lines (30 loc) · 824 Bytes
/
Copy pathHandlerHTTP.h
File metadata and controls
41 lines (30 loc) · 824 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef HandlerHTTP_h
#define HandlerHTTP_h
#define DELAY_FOR_HTTP 30
#include <Arduino.h>
#include "Modem.h"
#include "Constants.h"
class HandlerHTTP {
public:
HandlerHTTP(Modem *m);
bool isHaveParam();
// void setSensorData(uint8_t themperature, uint8_t motionCounter);
uint8_t sendDataToServer(int themperature, uint8_t motionCounter,uint8_t voltage);
void init();
private:
Modem *modem;
// function
bool setRequestParam(char *wKey /* , char *fields */);
bool getRequestParam();
uint8_t checkIsSuccess();
// fields
char urlHead[44] = "http://api.thingspeak.com/update?api_key=";
char getKeyCommand[10] = "AT+CPBR=6";
int themperature = 0;
uint8_t motionCounter = 0;
uint8_t voltage = 0;
char requestHeader[64];
//char *fieldsList;
bool isHaveParams = false;
};
#endif