51 lines
1.5 KiB
C++
51 lines
1.5 KiB
C++
/*
|
|
* WifiSyscall.hpp
|
|
* SYS_WIFI_SCAN, SYS_WIFI_INFO, SYS_WIFI_CONNECT, SYS_WIFI_DISCONNECT
|
|
* Copyright (c) 2026 Daniel Hammer
|
|
*/
|
|
|
|
#pragma once
|
|
#include <cstdint>
|
|
#include <Drivers/Net/Wifi/Wifi.hpp>
|
|
|
|
#include "Syscall.hpp"
|
|
|
|
namespace montauk::abi {
|
|
|
|
static int64_t Sys_WifiScan(WifiNetwork* buf, int maxCount, uint32_t timeoutMs) {
|
|
if (!buf || maxCount <= 0) return -1;
|
|
if (maxCount > 64) maxCount = 64;
|
|
return (int64_t)Drivers::Net::Wifi::Scan(buf, maxCount, timeoutMs);
|
|
}
|
|
|
|
static int64_t Sys_WifiInfo(WifiInfo* buf) {
|
|
if (!buf) return -1;
|
|
return (int64_t)Drivers::Net::Wifi::GetInfo(buf);
|
|
}
|
|
|
|
static int64_t Sys_WifiScanStart(uint32_t timeoutMs) {
|
|
return (int64_t)Drivers::Net::Wifi::StartScan(timeoutMs);
|
|
}
|
|
|
|
static int64_t Sys_WifiResults(WifiNetwork* buf, int maxCount) {
|
|
if (!buf || maxCount <= 0) return -1;
|
|
if (maxCount > 64) maxCount = 64;
|
|
return (int64_t)Drivers::Net::Wifi::GetResults(buf, maxCount);
|
|
}
|
|
|
|
static int64_t Sys_WifiConnect(const char* ssid, const char* password) {
|
|
if (!ssid) return -1;
|
|
return (int64_t)Drivers::Net::Wifi::Connect(ssid, password);
|
|
}
|
|
|
|
static int64_t Sys_WifiConnectAsync(const char* ssid, const char* password) {
|
|
if (!ssid) return -1;
|
|
return (int64_t)Drivers::Net::Wifi::ConnectAsync(ssid, password);
|
|
}
|
|
|
|
static int64_t Sys_WifiDisconnect() {
|
|
return (int64_t)Drivers::Net::Wifi::Disconnect();
|
|
}
|
|
|
|
}
|