Backup:fast start ap function.

This commit is contained in:
Fancy code 2024-04-17 13:20:58 +08:00
parent e5a2d7cfd9
commit 79a29db217
3 changed files with 9 additions and 4 deletions

View File

@ -14,11 +14,13 @@
*/
#include "WifiHal.h"
#include "LinuxApi.h"
#include "ILog.h"
StatusCode WifiHal::OpenApMode(void)
{
// fx_system("ifconfig wlan0 192.168.169.1 netmask 255.255.255.0");
// fx_system("hostapd -d /etc/hostapd.conf &");
// fx_system("touch /var/lib/misc/udhcpd.leases");
// fx_system("udhcpd -f /etc/udhcpd.conf &");
LogInfo(" ==================================== OpenApMode. \n");
fx_system("ifconfig wlan0 192.168.169.1 netmask 255.255.255.0");
fx_system("hostapd -d /etc/hostapd.conf &");
fx_system("touch /var/lib/misc/udhcpd.leases");
fx_system("udhcpd -f /etc/udhcpd.conf &");
return CreateStatusCode(STATUS_CODE_OK);
}

View File

@ -31,6 +31,7 @@ const StatusCode AppManager::Init(const AppParam &param)
LogError("Get wifi hal failed.\n");
return CreateStatusCode(STATUS_CODE_NOT_OK);
}
LogInfo("ssssssssssssssssssssssssssssssssssssssssssssssssss\n");
wifi->OpenApMode();
AppManagerMakePtr::GetInstance()->CreateProtocolHandle(mProtocolHandle);
HttpServerStart(param);

View File

@ -186,7 +186,9 @@ StatusCode WebServerInit(const WebServerParam webParam)
char authPath[BUF_LENGTH] = {0};
char listen[BUF_LENGTH] = {0};
snprintf(routePath, BUF_LENGTH, "%s/route.txt", GOAHEAD_CONFIG_FILE_PATH);
LogInfo("ssssssssssssssssssssssssssssssssss routePath %s\n", routePath);
snprintf(authPath, BUF_LENGTH, "%s/auth.txt", GOAHEAD_CONFIG_FILE_PATH);
LogInfo("ssssssssssssssssssssssssssssssssss authPath %s\n", authPath);
snprintf(listen, BUF_LENGTH, "%s:%d", webParam.mIp, webParam.mPort);
// initPlatform();
if (websOpen(documents, routePath) < 0) {