aboutsummaryrefslogtreecommitdiff
path: root/src/WifiAP.h
diff options
context:
space:
mode:
authorArisotura <thetotalworm@gmail.com>2023-11-04 17:00:12 +0100
committerArisotura <thetotalworm@gmail.com>2023-11-04 17:00:12 +0100
commit2bd09eafebbc98e2e2b9fbb023b31551ccd8cf12 (patch)
tree3b35fb2c0ab0cbc4757eb24d0c3966a3e784dcbb /src/WifiAP.h
parent76976fef3038918ad01a9dbda4c0e5d9bebef9af (diff)
convert Wifi and WifiAP
Diffstat (limited to 'src/WifiAP.h')
-rw-r--r--src/WifiAP.h44
1 files changed, 32 insertions, 12 deletions
diff --git a/src/WifiAP.h b/src/WifiAP.h
index 04dbfa8..717e1c6 100644
--- a/src/WifiAP.h
+++ b/src/WifiAP.h
@@ -21,24 +21,44 @@
#include "types.h"
-namespace WifiAP
+class Wifi;
+
+class WifiAP
{
+public:
+ WifiAP(Wifi* wifi);
+ ~WifiAP();
+ void Reset();
+
+ static const char* APName;
+ static const u8 APMac[6];
+
+ void MSTimer();
+
+ // packet format: 12-byte TX header + original 802.11 frame
+ int SendPacket(u8* data, int len);
+ int RecvPacket(u8* data);
+
+private:
+ class Wifi* Wifi;
+
+ u64 USCounter;
-#define AP_MAC 0x00, 0xF0, 0x77, 0x77, 0x77, 0x77
-#define AP_NAME "melonAP"
+ u16 SeqNo;
-extern const u8 APMac[6];
+ bool BeaconDue;
-bool Init();
-void DeInit();
-void Reset();
+ u8 PacketBuffer[2048];
+ int PacketLen;
+ int RXNum;
-void MSTimer();
+ u8 LANBuffer[2048];
-// packet format: 12-byte TX header + original 802.11 frame
-int SendPacket(u8* data, int len);
-int RecvPacket(u8* data);
+ // this is a lazy AP, we only keep track of one client
+ // 0=disconnected 1=authenticated 2=associated
+ int ClientStatus;
-}
+ int HandleManagementFrame(u8* data, int len);
+};
#endif