21 #define ESP8266_BUFFER_LENGTH ( 70 ) 25 #define ESP8266_SERVER_IP_ADDRESS_SHORT ( 10 ) 28 #define ESP8266_HOMEAUTMESSAGE_RECEIVEMESSAGE_QUEUE_LENGTH ( 5 ) 29 #define ESP8266_HOMEAUTMESSAGE_SENDMESSAGE_QUEUE_LENGTH ( 5 ) 32 #define ESP8266_HOMEAUT_MESSAGECONTENT_LENGTH ( 40 ) 34 #define ESP8266_HOMEAUTMESSAGE_ITEM_SIZE ( ESP8266_HOMEAUT_MESSAGECONTENT_LENGTH + 1 ) 36 #define ESP8266_HOMEAUT_MESSAGEHEADER_LENGTH ( 12 ) 40 #define ESP8266_HOMEAUT_MESSAGEBOTTOM_LENGTH ( 6 ) 43 #define ESP8266_HOMEAUT_RECEIVING_MESSAGE_LENGTH ( ESP8266_HOMEAUT_MESSAGECONTENT_LENGTH + \ 44 ESP8266_HOMEAUT_MESSAGEHEADER_LENGTH + ESP8266_HOMEAUT_MESSAGEBOTTOM_LENGTH ) 47 #define ESP8266_HOMEAUTMESSAGE_RECEIVEDMESSAGE_NULLCHAR ( 52 ) 48 #define ESP8266_HOMEAUTMESSAGE_RECEIVEDMESSAGE_START ( 12 ) 55 ESP8266_ConnectionStatus_Unknown = 0,
56 ESP8266_ConnectionStatus_OnConnecting,
57 ESP8266_ConnectionStatus_SuccessfulConnected,
58 ESP8266_ConnectionStatus_SuccessfulServerStarted,
59 ESP8266_ConnectionStatus_ClosedConnection,
60 ESP8266_ConnectionStatus_Error
62 } ESP8266_ConnectionStatusType;
66 ESP8266_TcpConnectionStatus_Unknown = 0,
67 ESP8266_TcpConnectionStatus_Connected,
68 ESP8266_TcpConnectionStatus_Error
70 } ESP8266_TcpConnectionStatusType;
77 extern UART_HandleTypeDef Esp8266UartHandle;
78 extern volatile uint8_t ESP8266_Uart_ReceivedCharFlag;
80 #ifdef CONFIG_USE_FREERTOS 81 extern xSemaphoreHandle ESP8266_USART_Rx_Semaphore;
82 extern xQueueHandle ESP8266_SendMessage_Queue;
83 extern xQueueHandle ESP8266_ReceivedMessage_Queue;
87 extern ESP8266_ConnectionStatusType ESP8266_ConnectionStatus;
88 extern ESP8266_TcpConnectionStatusType ESP8266_TcpConnectionStatus;
90 extern char ESP8266_MyIpAddressString[4];
91 extern uint8_t ESP8266_MyIpAddressDecimal;
92 extern uint8_t ESP8266_DebugEnableFlag;
94 extern uint8_t ESP8266_Receive_Mode_FixLength;
95 extern uint8_t ESP8266_ReceiveBuffer_Cnt;
96 extern char ESP8266_ReceiveBuffer[ESP8266_BUFFER_LENGTH];
112 void ESP8266_Test (
void );
113 void ESP8266_SendString (
char *aTxBuffer);
114 void ESP8266_ReceiveString (
char *aRxBuffer, uint8_t length);
115 void ESP8266_BufferReset (
char *Buffer, uint8_t length);
116 void ESP8266_Task (
void );
119 ReturnType ESP8266_Init (
void );
121 ReturnType ESP8266_Config (
void );
122 ReturnType ESP8266_ConnectToWifiNetwork (
void );
124 ReturnType ESP8266_StartServer (
void );
125 ReturnType ESP8266_FindServer (
void );
126 ReturnType ESP8266_ConnectToServer (
void );
128 ReturnType ESP8266_SendTcpMessage (
char *message );
129 ReturnType ESP8266_SendMessageToQueue ( uint8_t *message );
131 ReturnType ESP8266_ReceiveFixTcpMessage (
void );
133 ReturnType ESP8266_WaitClientConnect(
void);
135 ReturnType ESP8266_CheckReceiveMessage (
void );
138 void ESP8266_WaitAnswer(
void);