66
77#include < sys_dev_wifi_native.h>
88#include < nf_rt_events_native.h>
9- // #include <esp_wifi_types.h>
9+ // #include <esp_wifi_types.h>
1010
1111// /////////////////////////////////////////////////////////////////////////////////////
1212// !!! KEEP IN SYNC WITH System.Device.WiFi (in managed code) !!! //
@@ -20,7 +20,6 @@ struct ScanRecord
2020 uint8_t cypherType;
2121};
2222
23-
2423// //
2524// // Stores Ap records to target string.
2625// // if pTarget == 0 then just calculates length of target
@@ -59,6 +58,16 @@ struct ScanRecord
5958// return (recordCount * sizeof(ScanRecord) + sizeof(uint16_t));
6059// }
6160
61+ HRESULT Library_sys_dev_wifi_native_System_Device_Wifi_WifiAdapter::NativeSetDeviceName___VOID__STRING (
62+ CLR_RT_StackFrame &stack)
63+ {
64+ NANOCLR_HEADER ();
65+ {
66+ NANOCLR_SET_AND_LEAVE (CLR_E_NOTIMPL);
67+ }
68+ NANOCLR_NOCLEANUP ();
69+ }
70+
6271HRESULT Library_sys_dev_wifi_native_System_Device_Wifi_WifiAdapter::DisposeNative___VOID (CLR_RT_StackFrame &stack)
6372{
6473 NANOCLR_HEADER ();
@@ -113,7 +122,7 @@ HRESULT Library_sys_dev_wifi_native_System_Device_Wifi_WifiAdapter::
113122 int reconnectionKind;
114123 int netIndex;
115124 CLR_RT_HeapBlock hbTimeout;
116- // CLR_INT64 *timeout;
125+ // CLR_INT64 *timeout;
117126 bool eventResult = true ;
118127 WifiConnectionStatus Status = WifiConnectionStatus_UnspecifiedFailure;
119128
@@ -147,49 +156,50 @@ HRESULT Library_sys_dev_wifi_native_System_Device_Wifi_WifiAdapter::
147156 // Wait for connect to finish
148157 while (eventResult)
149158 {
150- // int connectResult = Network_Interface_Connect_Result(netIndex);
151- // if (connectResult >= 0)
152- // {
153- // // Map ESP32 wifi reason code to WifiConnectionStatus
154- // switch (connectResult)
155- // {
156- // case 0:
157- // Status = WifiConnectionStatus_Success;
158- // break;
159-
160- // case WIFI_REASON_NO_AP_FOUND:
161- // Status = WifiConnectionStatus_NetworkNotAvailable;
162- // break;
163-
164- // case WIFI_REASON_AUTH_EXPIRE:
165- // case WIFI_REASON_4WAY_HANDSHAKE_TIMEOUT:
166- // case WIFI_REASON_BEACON_TIMEOUT:
167- // case WIFI_REASON_AUTH_FAIL:
168- // case WIFI_REASON_ASSOC_FAIL:
169- // case WIFI_REASON_HANDSHAKE_TIMEOUT:
170- // Status = WifiConnectionStatus_InvalidCredential;
171- // break;
172-
173- // default:
174- // Status = WifiConnectionStatus_UnspecifiedFailure;
175- // break;
176- // }
177- // break;
178- // }
179-
180- // // Get timeout
181- // NANOCLR_CHECK_HRESULT(stack.SetupTimeoutFromTicks(hbTimeout, timeout));
182-
183- // // non-blocking wait allowing other threads to run while we wait for the Spi transaction to complete
184- // NANOCLR_CHECK_HRESULT(
185- // g_CLR_RT_ExecutionEngine.WaitEvents(stack.m_owningThread, *timeout, Event_Wifi_Station, eventResult));
186-
187- // if (!eventResult)
188- // {
189- // // Timeout
190- // Status = WifiConnectionStatus_Timeout;
191- // break;
192- // }
159+ // int connectResult = Network_Interface_Connect_Result(netIndex);
160+ // if (connectResult >= 0)
161+ // {
162+ // // Map ESP32 wifi reason code to WifiConnectionStatus
163+ // switch (connectResult)
164+ // {
165+ // case 0:
166+ // Status = WifiConnectionStatus_Success;
167+ // break;
168+
169+ // case WIFI_REASON_NO_AP_FOUND:
170+ // Status = WifiConnectionStatus_NetworkNotAvailable;
171+ // break;
172+
173+ // case WIFI_REASON_AUTH_EXPIRE:
174+ // case WIFI_REASON_4WAY_HANDSHAKE_TIMEOUT:
175+ // case WIFI_REASON_BEACON_TIMEOUT:
176+ // case WIFI_REASON_AUTH_FAIL:
177+ // case WIFI_REASON_ASSOC_FAIL:
178+ // case WIFI_REASON_HANDSHAKE_TIMEOUT:
179+ // Status = WifiConnectionStatus_InvalidCredential;
180+ // break;
181+
182+ // default:
183+ // Status = WifiConnectionStatus_UnspecifiedFailure;
184+ // break;
185+ // }
186+ // break;
187+ // }
188+
189+ // // Get timeout
190+ // NANOCLR_CHECK_HRESULT(stack.SetupTimeoutFromTicks(hbTimeout, timeout));
191+
192+ // // non-blocking wait allowing other threads to run while we wait for the Spi transaction to complete
193+ // NANOCLR_CHECK_HRESULT(
194+ // g_CLR_RT_ExecutionEngine.WaitEvents(stack.m_owningThread, *timeout, Event_Wifi_Station,
195+ // eventResult));
196+
197+ // if (!eventResult)
198+ // {
199+ // // Timeout
200+ // Status = WifiConnectionStatus_Timeout;
201+ // break;
202+ // }
193203 }
194204
195205 // Return value to the managed application
@@ -241,7 +251,7 @@ HRESULT Library_sys_dev_wifi_native_System_Device_Wifi_WifiAdapter::GetNativeSca
241251 // // Temporary ap record storage
242252 // wifi_ap_record_t *ap_records = 0;
243253 // {
244- // CLR_RT_HeapBlock &top = stack.PushValueAndClear();
254+ // CLR_RT_HeapBlock &top = stack.PushValueAndClear();
245255 // CLR_RT_HeapBlock_Array *array;
246256 // CLR_UINT8 *buf;
247257 // uint16_t number = 0;
@@ -288,7 +298,7 @@ HRESULT Library_sys_dev_wifi_native_System_Device_Wifi_WifiAdapter::GetNativeSca
288298 // platform_free(ap_records);
289299 // }
290300
291- // NANOCLR_CLEANUP_END();
301+ // NANOCLR_CLEANUP_END();
292302
293303 NANOCLR_NOCLEANUP_NOLABEL ();
294304}
0 commit comments