-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathESP8266.h
50 lines (33 loc) · 1.2 KB
/
ESP8266.h
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
42
43
44
45
46
47
48
49
50
#ifndef ESP8266_H_
#define ESP8266_H_
#include "stdbool.h"
#define ESP_RX_buff_size 2048
#define ESP_TX_buff_size 64
#define ESP_DEBUG
bool ESP8266_ConnectToAnyAccessPointFromDefaultList();
void ESP8266_ClearRecvBuff();
bool ESP8266_Send(char *command);
bool ESP8266_Recv(char *correctAnswer);
char *ESP8266_GetAcceessPoints();
//Команда проходит, есть ответ, но модуль зависает
bool ESP8266_Restart();
void ESP8266_SetConfig(UART_HandleTypeDef *huart, GPIO_TypeDef *pinPort, uint32_t pinNum);
void ESP8266_ON();
void ESP8266_OFF();
bool ESP8266_Test(void);
bool ESP8266_EnableEcho();
bool ESP8266_DisableEcho();
bool ESP8266_ConnectTo(char *wifiName, char *password);
bool ESP8266_DisconnectFromWifi();
char *ESP8266_SendRequest(char *type, char *ip, uint8_t port, char *request);
bool ESP8266_AT_CIPSTART(char *type, char *ip, uint8_t port);
bool ESP8266_AT_CIPSEND(int requestLength);
bool ESP8266_AT_SendData(char *request);
struct AccessPoint
{
char accessPointName[64];
char accessPointPass[64];
};
struct AccessPoint DefaultAccessPointsList[] = {{"Snapy", "31055243167vlad"}, {"MERCUSYS_7EBA", "3105vlad3010vlada"}};
#include "ESP8266.c"
#endif /* ESP8266_H_ */