aboutsummaryrefslogtreecommitdiff
path: root/stm32f091/server.c
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-10-11 19:16:26 +0200
committerlonkaars <loek@pipeframe.xyz>2022-10-11 19:16:26 +0200
commitb455848ee62b06ba73801cff477c6ff214c4053e (patch)
treed23dcf59e7d485b94a90ed79ae459bd6cdad4a83 /stm32f091/server.c
parentacb25f74631597b2b24dca2c16da9dbb9ed2ecb1 (diff)
stm32 esp code merged
Diffstat (limited to 'stm32f091/server.c')
-rw-r--r--stm32f091/server.c57
1 files changed, 57 insertions, 0 deletions
diff --git a/stm32f091/server.c b/stm32f091/server.c
new file mode 100644
index 0000000..e289245
--- /dev/null
+++ b/stm32f091/server.c
@@ -0,0 +1,57 @@
+#include <stm32f0xx_hal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "setup.h"
+#include "server.h"
+#include "esp8266.h"
+
+void ws_server_demo() {
+ uint8_t ok[]= "ok\r\n";
+ uint8_t hier[]= "hier\r\n";
+ //disconnect();//connect();//
+
+ ws_esp8266_StartEsp();
+ HAL_UART_Transmit(&huart2, hier,sizeof(hier),1000);
+ ws_esp8266_close();
+ HAL_UART_Transmit(&huart2, hier,sizeof(hier),1000);
+ ws_esp8266_serveruit();
+ HAL_UART_Transmit(&huart2, hier,sizeof(hier),1000);
+ ws_esp8266_mux();
+ HAL_UART_Transmit(&huart2, hier,sizeof(hier),1000);
+ ws_esp8266_mode();
+ HAL_UART_Transmit(&huart2, hier,sizeof(hier),1000);
+
+ ws_esp8266_serveraan();
+ HAL_UART_Transmit(&huart2, ok,sizeof(ok),1000);
+ uint8_t receive[24]={0};
+ uint8_t sendToQTData[]="gelukt";
+ uint8_t test[]="test";
+ int ret;
+ //ATsendCommand(sendToQTData);
+ while (1)
+ {
+
+ if(receive[0]=='\0')
+ {
+ HAL_UART_Receive_IT(&huart1, receive, 24);
+ }
+ else
+ {
+ HAL_UART_Transmit(&huart2, test,strlen((char*)test),1000);
+ HAL_Delay(5000);
+
+ // if(receivingMsg(receive, 24)==1)
+ // {
+ // ret=1;
+ ws_esp8266_ATsendCommand(sendToQTData);
+ ws_esp8266_close();
+ memset(receive,0,24);
+ //}
+ }
+
+
+
+ }
+}