-
-
Notifications
You must be signed in to change notification settings - Fork 47
/
WifiUser.c
45 lines (39 loc) · 1.19 KB
/
WifiUser.c
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
#include "Wifi.h"
//#######################################################################################
void Wifi_UserInit(void)
{
Wifi_SetMode(WifiMode_Station);
//Wifi_SetMode(WifiMode_SoftAp);
while (Wifi_Station_ConnectToAp("L70_9587","33559366",NULL) == false);
}
//#######################################################################################
void Wifi_UserProcess(void)
{
static uint8_t last=0;
if(strstr(Wifi.MyIP,"0.0.0.0")!=NULL)
{
if(last!=1)
{
}
last=1;
}
else
{
if(last!=2)
{
Wifi_TcpIp_StartTcpConnection(0,Wifi.MyGateWay,33333,10);
}
last=2;
}
}
//#######################################################################################
void Wifi_UserGetUdpData(uint8_t LinkId,uint16_t DataLen,uint8_t *Data)
{
Wifi_TcpIp_SendDataUdp(LinkId,2,(uint8_t*)"OK");
}
//#######################################################################################
void Wifi_UserGetTcpData(uint8_t LinkId,uint16_t DataLen,uint8_t *Data)
{
Wifi_TcpIp_SendDataTcp(LinkId,2,(uint8_t*)"OK");
}
//#######################################################################################