Skip to content

Commit c9ed50c

Browse files
solving FIXME
1 parent 4cb8171 commit c9ed50c

File tree

4 files changed

+102
-184
lines changed

4 files changed

+102
-184
lines changed

libraries/WiFi/src/WiFi.cpp

Lines changed: 27 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -153,15 +153,13 @@ void CWifi::end(void) {
153153
}
154154

155155
/* -------------------------------------------------------------------------- */
156-
uint8_t* CWifi::macAddress(uint8_t* mac) { // FIXME
156+
uint8_t* CWifi::macAddress(uint8_t* mac) {
157157
/* -------------------------------------------------------------------------- */
158-
// if(ni != nullptr) {
159-
// if(ni->getMacAddress(mac) == WL_MAC_ADDR_LENGTH) {
160-
// return mac;
161-
// }
162-
// }
163-
// memset(mac,0x00,6);
164-
// return mac;
158+
if(WiFiStation.getMacAddress(mac) == WL_MAC_ADDR_LENGTH) {
159+
return mac;
160+
}
161+
memset(mac,0x00,6);
162+
return mac;
165163
}
166164

167165
/* -------------------------------------------------------------------------- */
@@ -171,105 +169,57 @@ int8_t CWifi::scanNetworks() {
171169
}
172170

173171
/* -------------------------------------------------------------------------- */
174-
IPAddress CWifi::localIP() { //FIXME
172+
IPAddress CWifi::localIP() {
175173
/* -------------------------------------------------------------------------- */
176-
// if(ni != nullptr) {
177-
// return IPAddress(ni->getIpAdd());
178-
// }
179-
// return IPAddress((uint32_t)0);
180174
return WiFiStation.localIP();
181175
}
182176

183177
/* -------------------------------------------------------------------------- */
184-
IPAddress CWifi::subnetMask() { // FIXME
178+
IPAddress CWifi::subnetMask() {
185179
/* -------------------------------------------------------------------------- */
186-
// if(ni != nullptr) {
187-
// return IPAddress(ni->getNmAdd());
188-
// }
189-
// return IPAddress((uint32_t)0);
190180
return WiFiStation.subnetMask();
191181
}
192182

193183
/* -------------------------------------------------------------------------- */
194-
IPAddress CWifi::gatewayIP() { // FIXME
184+
IPAddress CWifi::gatewayIP() {
195185
/* -------------------------------------------------------------------------- */
196-
// if(ni != nullptr) {
197-
// return IPAddress(ni->getGwAdd());
198-
// }
199-
// return IPAddress((uint32_t)0);
200186
return WiFiStation.gatewayIP();
201187
}
202188

203189
/* -------------------------------------------------------------------------- */
204-
IPAddress CWifi::dnsIP(int n) { // FIXME
205-
// return CLwipIf::getInstance().getDns(n);
190+
IPAddress CWifi::dnsIP(int n) {
191+
return CLwipIf::getInstance().getDns(n);
206192
}
207193

208194
/* -------------------------------------------------------------------------- */
209-
const char* CWifi::SSID(uint8_t networkItem) { // FIXME
210-
// return CLwipIf::getInstance().getSSID(networkItem);
211-
}
212-
/* -------------------------------------------------------------------------- */
213-
214-
/* -------------------------------------------------------------------------- */
215-
int32_t CWifi::RSSI(uint8_t networkItem) { // FIXME
216-
// return CLwipIf::getInstance().getRSSI(networkItem);
217-
}
218-
/* -------------------------------------------------------------------------- */
219-
220-
/* -------------------------------------------------------------------------- */
221-
uint8_t CWifi::encryptionType(uint8_t networkItem) { // FIXME
222-
// return CLwipIf::getInstance().getEncrType(networkItem);
195+
const char* CWifi::SSID() {
196+
return WiFiStation.getSSID();
223197
}
224198
/* -------------------------------------------------------------------------- */
225199

226200
/* -------------------------------------------------------------------------- */
227-
uint8_t* CWifi::BSSID(uint8_t networkItem, uint8_t* bssid) { // FIXME
228-
// return CLwipIf::getInstance().getBSSID(networkItem,bssid);
201+
int32_t CWifi::RSSI() {
202+
return WiFiStation.getRSSI();
229203
}
230204
/* -------------------------------------------------------------------------- */
231205

232206
/* -------------------------------------------------------------------------- */
233-
uint8_t CWifi::channel(uint8_t networkItem) { // FIXME
234-
// return CLwipIf::getInstance().getChannel(networkItem);
207+
uint8_t CWifi::encryptionType() {
208+
return WiFiStation.getEncryptionType();
235209
}
236210
/* -------------------------------------------------------------------------- */
237211

238212
/* -------------------------------------------------------------------------- */
239-
const char* CWifi::SSID() { // FIXME
240-
/* -------------------------------------------------------------------------- */
241-
// if(ni != nullptr) {
242-
// return ni->getSSID();
243-
// }
244-
// return "";
213+
uint8_t* CWifi::BSSID(uint8_t* bssid) {
214+
return WiFiStation.getBSSID(bssid);
245215
}
246-
247216
/* -------------------------------------------------------------------------- */
248-
uint8_t* CWifi::BSSID(uint8_t* bssid) { // FIXME
249-
/* -------------------------------------------------------------------------- */
250-
// if(ni != nullptr) {
251-
// return ni->getBSSID(bssid);
252-
// }
253-
// return nullptr;
254-
}
255217

256218
/* -------------------------------------------------------------------------- */
257-
int32_t CWifi::RSSI() { // FIXME
258-
/* -------------------------------------------------------------------------- */
259-
// if(ni != nullptr) {
260-
// return ni->getRSSI();
261-
// }
262-
// return 0;
219+
uint8_t CWifi::channel() {
220+
return WiFiStation.getChannel();
263221
}
264-
265222
/* -------------------------------------------------------------------------- */
266-
uint8_t CWifi::encryptionType() { // FIXME
267-
/* -------------------------------------------------------------------------- */
268-
// if(ni != nullptr) {
269-
// return ni->getEncryptionType();
270-
// }
271-
// return 0;
272-
}
273223

274224
/* -------------------------------------------------------------------------- */
275225
uint8_t CWifi::status() { // FIXME
@@ -278,21 +228,21 @@ uint8_t CWifi::status() { // FIXME
278228
}
279229

280230
/* -------------------------------------------------------------------------- */
281-
int CWifi::hostByName(const char* aHostname, IPAddress& aResult) { // FIXME
231+
int CWifi::hostByName(const char* aHostname, IPAddress& aResult) {
282232
/* -------------------------------------------------------------------------- */
283-
// return CLwipIf::getInstance().getHostByName(aHostname,aResult);
233+
return CLwipIf::getInstance().getHostByName(aHostname, aResult);
284234
}
285235

286236
/* -------------------------------------------------------------------------- */
287-
void CWifi::lowPowerMode() { // FIXME
237+
void CWifi::lowPowerMode() {
288238
/* -------------------------------------------------------------------------- */
289-
// CLwipIf::getInstance().setLowPowerMode();
239+
WiFiStation.setLowPowerMode();
290240
}
291241

292242
/* -------------------------------------------------------------------------- */
293-
void CWifi::noLowPowerMode() { // FIXME
243+
void CWifi::noLowPowerMode() {
294244
/* -------------------------------------------------------------------------- */
295-
// CLwipIf::getInstance().resetLowPowerMode();
245+
WiFiStation.resetLowPowerMode();
296246
}
297247

298248
uint8_t CWifi::reasonCode() {

libraries/WiFi/src/WiFiC3.h

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -184,47 +184,7 @@ class CWifi {
184184
*/
185185
int8_t scanNetworks();
186186

187-
/*
188-
* Return the SSID discovered during the network scan.
189-
*
190-
* param networkItem: specify from which network item want to get the information
191-
*
192-
* return: SSID string of the specified item on the networks scanned list
193-
*/
194-
const char* SSID(uint8_t networkItem);
195-
196-
/*
197-
* Return the encryption type of the networks discovered during the scanNetworks
198-
*
199-
* param networkItem: specify from which network item want to get the information
200-
*
201-
* return: encryption type (enum wl_enc_type) of the specified item on the networks scanned list
202-
203-
* enum wl_enc_type :
204-
* ENC_TYPE_WEP,
205-
* ENC_TYPE_WPA,
206-
* ENC_TYPE_WPA2,
207-
* ENC_TYPE_WPA2_ENTERPRISE,
208-
* ENC_TYPE_WPA3,
209-
* ENC_TYPE_NONE,
210-
* ENC_TYPE_AUTO,
211-
*
212-
* ENC_TYPE_UNKNOWN = 255
213-
*
214-
*/
215-
uint8_t encryptionType(uint8_t networkItem);
216-
217-
uint8_t* BSSID(uint8_t networkItem, uint8_t* bssid);
218-
uint8_t channel(uint8_t networkItem);
219-
220-
/*
221-
* Return the RSSI of the networks discovered during the scanNetworks
222-
*
223-
* param networkItem: specify from which network item want to get the information
224-
*
225-
* return: signed value of RSSI of the specified item on the networks scanned list
226-
*/
227-
int32_t RSSI(uint8_t networkItem);
187+
uint8_t channel();
228188

229189
/*
230190
* Return Connection status.

0 commit comments

Comments
 (0)