15
15
* limitations under the License.
16
16
*/
17
17
18
- #include " NxpWifiDriver .h"
18
+ #include " ZephyrWifiDriver .h"
19
19
20
20
#include < platform/KeyValueStoreManager.h>
21
21
@@ -32,13 +32,13 @@ namespace chip {
32
32
namespace DeviceLayer {
33
33
namespace NetworkCommissioning {
34
34
35
- size_t NxpWifiDriver ::WiFiNetworkIterator::Count ()
35
+ size_t ZephyrWifiDriver ::WiFiNetworkIterator::Count ()
36
36
{
37
37
VerifyOrReturnValue (mDriver != nullptr , 0 );
38
38
return mDriver ->mStagingNetwork .IsConfigured () ? 1 : 0 ;
39
39
}
40
40
41
- bool NxpWifiDriver ::WiFiNetworkIterator::Next (Network & item)
41
+ bool ZephyrWifiDriver ::WiFiNetworkIterator::Next (Network & item)
42
42
{
43
43
// we assume only one network is actually supported
44
44
// TODO: verify if this can be extended
@@ -67,7 +67,7 @@ bool NxpWifiDriver::WiFiNetworkIterator::Next(Network & item)
67
67
return true ;
68
68
}
69
69
70
- bool NxpWifiScanResponseIterator ::Next (WiFiScanResponse & item)
70
+ bool ZephyrWifiScanResponseIterator ::Next (WiFiScanResponse & item)
71
71
{
72
72
if (mResultId < mResultCount )
73
73
{
@@ -77,14 +77,14 @@ bool NxpWifiScanResponseIterator::Next(WiFiScanResponse & item)
77
77
return false ;
78
78
}
79
79
80
- void NxpWifiScanResponseIterator ::Release ()
80
+ void ZephyrWifiScanResponseIterator ::Release ()
81
81
{
82
82
mResultId = mResultCount = 0 ;
83
83
Platform::MemoryFree (mResults );
84
84
mResults = nullptr ;
85
85
}
86
86
87
- void NxpWifiScanResponseIterator ::Add (const WiFiScanResponse & result)
87
+ void ZephyrWifiScanResponseIterator ::Add (const WiFiScanResponse & result)
88
88
{
89
89
void * newResults = Platform::MemoryRealloc (mResults , (mResultCount + 1 ) * sizeof (WiFiScanResponse));
90
90
@@ -95,7 +95,7 @@ void NxpWifiScanResponseIterator::Add(const WiFiScanResponse & result)
95
95
}
96
96
}
97
97
98
- CHIP_ERROR NxpWifiDriver ::Init (NetworkStatusChangeCallback * networkStatusChangeCallback)
98
+ CHIP_ERROR ZephyrWifiDriver ::Init (NetworkStatusChangeCallback * networkStatusChangeCallback)
99
99
{
100
100
mpNetworkStatusChangeCallback = networkStatusChangeCallback;
101
101
@@ -113,7 +113,7 @@ CHIP_ERROR NxpWifiDriver::Init(NetworkStatusChangeCallback * networkStatusChange
113
113
return CHIP_NO_ERROR;
114
114
}
115
115
116
- void NxpWifiDriver ::OnNetworkStatusChanged (Status status)
116
+ void ZephyrWifiDriver ::OnNetworkStatusChanged (Status status)
117
117
{
118
118
if (status == Status::kSuccess )
119
119
{
@@ -132,20 +132,20 @@ void NxpWifiDriver::OnNetworkStatusChanged(Status status)
132
132
}
133
133
}
134
134
135
- void NxpWifiDriver ::Shutdown ()
135
+ void ZephyrWifiDriver ::Shutdown ()
136
136
{
137
137
mpNetworkStatusChangeCallback = nullptr ;
138
138
}
139
139
140
- CHIP_ERROR NxpWifiDriver ::CommitConfiguration ()
140
+ CHIP_ERROR ZephyrWifiDriver ::CommitConfiguration ()
141
141
{
142
142
ReturnErrorOnFailure (KeyValueStoreMgr ().Put (kPassKey , mStagingNetwork .pass , mStagingNetwork .passLen ));
143
143
ReturnErrorOnFailure (KeyValueStoreMgr ().Put (kSsidKey , mStagingNetwork .ssid , mStagingNetwork .ssidLen ));
144
144
145
145
return CHIP_NO_ERROR;
146
146
}
147
147
148
- CHIP_ERROR NxpWifiDriver ::RevertConfiguration ()
148
+ CHIP_ERROR ZephyrWifiDriver ::RevertConfiguration ()
149
149
{
150
150
LoadFromStorage ();
151
151
@@ -172,8 +172,8 @@ CHIP_ERROR NxpWifiDriver::RevertConfiguration()
172
172
return CHIP_NO_ERROR;
173
173
}
174
174
175
- Status NxpWifiDriver ::AddOrUpdateNetwork (ByteSpan ssid, ByteSpan credentials, MutableCharSpan & outDebugText,
176
- uint8_t & outNetworkIndex)
175
+ Status ZephyrWifiDriver ::AddOrUpdateNetwork (ByteSpan ssid, ByteSpan credentials, MutableCharSpan & outDebugText,
176
+ uint8_t & outNetworkIndex)
177
177
{
178
178
outDebugText = {};
179
179
outNetworkIndex = 0 ;
@@ -191,7 +191,7 @@ Status NxpWifiDriver::AddOrUpdateNetwork(ByteSpan ssid, ByteSpan credentials, Mu
191
191
return Status::kSuccess ;
192
192
}
193
193
194
- Status NxpWifiDriver ::RemoveNetwork (ByteSpan networkId, MutableCharSpan & outDebugText, uint8_t & outNetworkIndex)
194
+ Status ZephyrWifiDriver ::RemoveNetwork (ByteSpan networkId, MutableCharSpan & outDebugText, uint8_t & outNetworkIndex)
195
195
{
196
196
outDebugText = {};
197
197
outNetworkIndex = 0 ;
@@ -202,7 +202,7 @@ Status NxpWifiDriver::RemoveNetwork(ByteSpan networkId, MutableCharSpan & outDeb
202
202
return Status::kSuccess ;
203
203
}
204
204
205
- Status NxpWifiDriver ::ReorderNetwork (ByteSpan networkId, uint8_t index, MutableCharSpan & outDebugText)
205
+ Status ZephyrWifiDriver ::ReorderNetwork (ByteSpan networkId, uint8_t index, MutableCharSpan & outDebugText)
206
206
{
207
207
outDebugText = {};
208
208
@@ -213,7 +213,7 @@ Status NxpWifiDriver::ReorderNetwork(ByteSpan networkId, uint8_t index, MutableC
213
213
return Status::kSuccess ;
214
214
}
215
215
216
- void NxpWifiDriver ::ConnectNetwork (ByteSpan networkId, ConnectCallback * callback)
216
+ void ZephyrWifiDriver ::ConnectNetwork (ByteSpan networkId, ConnectCallback * callback)
217
217
{
218
218
Status status = Status::kSuccess ;
219
219
WiFiManager::StationStatus stationStatus;
@@ -252,7 +252,7 @@ void NxpWifiDriver::ConnectNetwork(ByteSpan networkId, ConnectCallback * callbac
252
252
}
253
253
}
254
254
255
- void NxpWifiDriver ::LoadFromStorage ()
255
+ void ZephyrWifiDriver ::LoadFromStorage ()
256
256
{
257
257
WiFiManager::WiFiNetwork network;
258
258
@@ -262,20 +262,20 @@ void NxpWifiDriver::LoadFromStorage()
262
262
mStagingNetwork = network;
263
263
}
264
264
265
- void NxpWifiDriver ::OnScanWiFiNetworkDone (WiFiManager::WiFiRequestStatus status)
265
+ void ZephyrWifiDriver ::OnScanWiFiNetworkDone (WiFiManager::WiFiRequestStatus status)
266
266
{
267
267
VerifyOrReturn (mScanCallback != nullptr );
268
268
mScanCallback ->OnFinished (status == WiFiManager::WiFiRequestStatus::SUCCESS ? Status::kSuccess : Status::kUnknownError ,
269
269
CharSpan (), &mScanResponseIterator );
270
270
mScanCallback = nullptr ;
271
271
}
272
272
273
- void NxpWifiDriver ::OnScanWiFiNetworkResult (const WiFiScanResponse & response)
273
+ void ZephyrWifiDriver ::OnScanWiFiNetworkResult (const WiFiScanResponse & response)
274
274
{
275
275
mScanResponseIterator .Add (response);
276
276
}
277
277
278
- void NxpWifiDriver ::ScanNetworks (ByteSpan ssid, WiFiDriver::ScanCallback * callback)
278
+ void ZephyrWifiDriver ::ScanNetworks (ByteSpan ssid, WiFiDriver::ScanCallback * callback)
279
279
{
280
280
mScanCallback = callback;
281
281
CHIP_ERROR error = WiFiManager::Instance ().Scan (
0 commit comments