Skip to content

Commit 970a21f

Browse files
author
Mika Leppänen
committed
Updated greentea Wifi tests to use default interface
1 parent 3c03fef commit 970a21f

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

TESTS/network/wifi/get_interface.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,17 @@
1515
* limitations under the License.
1616
*/
1717

18-
#ifndef MBED_CONF_APP_OBJECT_CONSTRUCTION
19-
#error [NOT_SUPPORTED] No network interface found for this target.
18+
#define WIFI 2
19+
#if !defined(MBED_CONF_TARGET_NETWORK_DEFAULT_INTERFACE_TYPE) || \
20+
MBED_CONF_TARGET_NETWORK_DEFAULT_INTERFACE_TYPE != WIFI
21+
#error [NOT_SUPPORTED] No network configuration found for this target.
2022
#endif
21-
2223
#if !defined(MBED_CONF_APP_WIFI_SECURE_SSID) && !defined(MBED_CONF_APP_WIFI_UNSECURE_SSID)
2324
#error [NOT_SUPPORTED] Requires parameters from mbed_app.json
2425
#endif
2526

2627
#include "mbed.h"
27-
#include MBED_CONF_APP_HEADER_FILE
28+
#include "WiFiInterface.h"
2829

2930
WiFiInterface *get_interface()
3031
{
@@ -35,7 +36,7 @@ WiFiInterface *get_interface()
3536
return interface;
3637
}
3738

38-
interface = MBED_CONF_APP_OBJECT_CONSTRUCTION;
39+
interface = WiFiInterface::get_default_instance();
3940

4041
return interface;
4142
}

TESTS/network/wifi/main.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@
1515
* limitations under the License.
1616
*/
1717

18-
#ifndef MBED_CONF_APP_OBJECT_CONSTRUCTION
19-
#error [NOT_SUPPORTED] No network interface found for this target.
18+
#define WIFI 2
19+
#if !defined(MBED_CONF_TARGET_NETWORK_DEFAULT_INTERFACE_TYPE) || \
20+
MBED_CONF_TARGET_NETWORK_DEFAULT_INTERFACE_TYPE != WIFI
21+
#error [NOT_SUPPORTED] No network configuration found for this target.
2022
#endif
2123

2224
#include "mbed.h"

TESTS/network/wifi/template_mbed_app.txt

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,6 @@
2424
"help": "Channel number of unsecure SSID",
2525
"value": 2
2626
},
27-
"header-file": {
28-
"help" : "String for including your driver header file",
29-
"value" : "\"WIFI_INTERFACE.h\""
30-
},
31-
"object-construction" : {
32-
"value" : "new WIFI_INTERFACE()"
33-
},
3427
"ap-mac-secure": {
3528
"help": "BSSID of secure AP in form of AA:BB:CC:DD:EE:FF",
3629
"value": "\"AA:AA:AA:AA:AA:AA\""
@@ -43,5 +36,10 @@
4336
"help": "How many networks may appear in Wifi scan result",
4437
"value": 10
4538
}
39+
},
40+
"target_overrides": {
41+
"*": {
42+
"target.network-default-interface-type": "WIFI"
43+
}
4644
}
4745
}

0 commit comments

Comments
 (0)