66
77#include < sys_dev_wifi_native.h>
88#include < nf_rt_events_native.h>
9- // #include <esp_wifi_types.h>
109
1110// /////////////////////////////////////////////////////////////////////////////////////
1211// !!! KEEP IN SYNC WITH System.Device.WiFi (in managed code) !!! //
@@ -20,7 +19,6 @@ struct ScanRecord
2019 uint8_t cypherType;
2120};
2221
23-
2422// //
2523// // Stores Ap records to target string.
2624// // if pTarget == 0 then just calculates length of target
@@ -59,6 +57,16 @@ struct ScanRecord
5957// return (recordCount * sizeof(ScanRecord) + sizeof(uint16_t));
6058// }
6159
60+ HRESULT Library_sys_dev_wifi_native_System_Device_Wifi_WifiAdapter::NativeSetDeviceName___VOID__STRING (
61+ CLR_RT_StackFrame &stack)
62+ {
63+ NANOCLR_HEADER ();
64+ {
65+ NANOCLR_SET_AND_LEAVE (CLR_E_NOTIMPL);
66+ }
67+ NANOCLR_NOCLEANUP ();
68+ }
69+
6270HRESULT Library_sys_dev_wifi_native_System_Device_Wifi_WifiAdapter::DisposeNative___VOID (CLR_RT_StackFrame &stack)
6371{
6472 NANOCLR_HEADER ();
@@ -113,7 +121,7 @@ HRESULT Library_sys_dev_wifi_native_System_Device_Wifi_WifiAdapter::
113121 int reconnectionKind;
114122 int netIndex;
115123 CLR_RT_HeapBlock hbTimeout;
116- // CLR_INT64 *timeout;
124+ // CLR_INT64 *timeout;
117125 bool eventResult = true ;
118126 WifiConnectionStatus Status = WifiConnectionStatus_UnspecifiedFailure;
119127
@@ -147,49 +155,50 @@ HRESULT Library_sys_dev_wifi_native_System_Device_Wifi_WifiAdapter::
147155 // Wait for connect to finish
148156 while (eventResult)
149157 {
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- // }
158+ // int connectResult = Network_Interface_Connect_Result(netIndex);
159+ // if (connectResult >= 0)
160+ // {
161+ // // Map ESP32 wifi reason code to WifiConnectionStatus
162+ // switch (connectResult)
163+ // {
164+ // case 0:
165+ // Status = WifiConnectionStatus_Success;
166+ // break;
167+
168+ // case WIFI_REASON_NO_AP_FOUND:
169+ // Status = WifiConnectionStatus_NetworkNotAvailable;
170+ // break;
171+
172+ // case WIFI_REASON_AUTH_EXPIRE:
173+ // case WIFI_REASON_4WAY_HANDSHAKE_TIMEOUT:
174+ // case WIFI_REASON_BEACON_TIMEOUT:
175+ // case WIFI_REASON_AUTH_FAIL:
176+ // case WIFI_REASON_ASSOC_FAIL:
177+ // case WIFI_REASON_HANDSHAKE_TIMEOUT:
178+ // Status = WifiConnectionStatus_InvalidCredential;
179+ // break;
180+
181+ // default:
182+ // Status = WifiConnectionStatus_UnspecifiedFailure;
183+ // break;
184+ // }
185+ // break;
186+ // }
187+
188+ // // Get timeout
189+ // NANOCLR_CHECK_HRESULT(stack.SetupTimeoutFromTicks(hbTimeout, timeout));
190+
191+ // // non-blocking wait allowing other threads to run while we wait for the Spi transaction to complete
192+ // NANOCLR_CHECK_HRESULT(
193+ // g_CLR_RT_ExecutionEngine.WaitEvents(stack.m_owningThread, *timeout, Event_Wifi_Station,
194+ // eventResult));
195+
196+ // if (!eventResult)
197+ // {
198+ // // Timeout
199+ // Status = WifiConnectionStatus_Timeout;
200+ // break;
201+ // }
193202 }
194203
195204 // Return value to the managed application
@@ -241,7 +250,7 @@ HRESULT Library_sys_dev_wifi_native_System_Device_Wifi_WifiAdapter::GetNativeSca
241250 // // Temporary ap record storage
242251 // wifi_ap_record_t *ap_records = 0;
243252 // {
244- // CLR_RT_HeapBlock &top = stack.PushValueAndClear();
253+ // CLR_RT_HeapBlock &top = stack.PushValueAndClear();
245254 // CLR_RT_HeapBlock_Array *array;
246255 // CLR_UINT8 *buf;
247256 // uint16_t number = 0;
@@ -288,7 +297,7 @@ HRESULT Library_sys_dev_wifi_native_System_Device_Wifi_WifiAdapter::GetNativeSca
288297 // platform_free(ap_records);
289298 // }
290299
291- // NANOCLR_CLEANUP_END();
300+ // NANOCLR_CLEANUP_END();
292301
293302 NANOCLR_NOCLEANUP_NOLABEL ();
294303}
0 commit comments