Mistake on this page?
Report an issue in GitHub or email us
wifi_tests.h
1 /*
2  * Copyright (c) 2018-2019, Arm Limited and affiliates.
3  * SPDX-License-Identifier: Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 #ifndef WIFI_TESTS_H
18 #define WIFI_TESTS_H
19 
20 #ifdef MBED_CONF_NSAPI_PRESENT
21 #include "WiFiInterface.h"
22 
23 #if !defined(MBED_CONF_APP_WIFI_SECURE_SSID)
24 #define MBED_CONF_APP_WIFI_SECURE_SSID MBED_CONF_NSAPI_DEFAULT_WIFI_SSID
25 #endif
26 
27 #if !defined(MBED_CONF_APP_WIFI_PASSWORD)
28 #define MBED_CONF_APP_WIFI_PASSWORD MBED_CONF_NSAPI_DEFAULT_WIFI_PASSWORD
29 #endif
30 
31 #if !defined(MBED_CONF_APP_WIFI_SECURE_PROTOCOL)
32 #define MBED_CONF_APP_WIFI_SECURE_PROTOCOL MBED_CONF_NSAPI_DEFAULT_WIFI_SECURITY
33 #endif
34 
35 #if !defined(MBED_CONF_APP_WIFI_CH_SECURE)
36 #define MBED_CONF_APP_WIFI_CH_SECURE 1
37 #endif
38 
39 #if !defined(MBED_CONF_APP_MAX_SCAN_SIZE)
40 #define MBED_CONF_APP_MAX_SCAN_SIZE 10
41 #endif
42 
43 /** Get WiFiInterface based on provided
44  * app_json. */
45 WiFiInterface *get_interface(void);
46 
47 /**
48  * Get security protocol to be used
49  */
50 nsapi_security get_security(void);
51 
52 /*
53  * Test cases
54  */
55 
56 /** Test that constructor of the driver works. */
57 void wifi_constructor(void);
58 
59 /** This test case is to test whether the driver accepts valid credentials and reject ones that are not valid. */
60 void wifi_set_credential(void);
61 
62 /** Test validity of WiFiInterface::set_channel(). */
63 void wifi_set_channel(void);
64 
65 /** Test WiFiInterface::get_rssi() API.
66  * When connected, it should return valid RSSI value. When unconnected it should return 0. */
67 void wifi_get_rssi(void);
68 
69 /** Test WiFiInterface::connect(ssid, pass, security, channel) with NULL parameters */
70 void wifi_connect_params_null(void);
71 
72 /** Test WiFiInterface::connect(ssid, pass, security) with valid parameters for secure network */
73 void wifi_connect_params_valid_secure(void);
74 
75 /** Test WiFiInterface::connect(ssid, pass, security, channel) with valid parameters for secure network using channel specified. */
76 void wifi_connect_params_channel(void);
77 
78 /** Test WiFiInterface::connect(ssid, pass, security, channel) with valid parameters for secure network using wrong channel number. */
79 void wifi_connect_params_channel_fail(void);
80 
81 /** Test WiFiInterface::connect() without parameters. Use set_credentials() for setting parameters. */
82 void wifi_connect(void);
83 
84 /** Test WiFiInterface::connect() and disconnect() in nonblocking mode. Use set_credentials() for setting parameters. */
85 void wifi_connect_disconnect_nonblock(void);
86 
87 /** Test WiFiInterface::connect() without parameters. Don't set parameters with set_credentials() */
88 void wifi_connect_nocredentials(void);
89 
90 /** Test WiFiInterface::connect() without parameters. Use secure settings for set_credentials. */
91 void wifi_connect_secure(void);
92 
93 /** Test WiFiInterface::connect() failing with wrong password. */
94 void wifi_connect_secure_fail(void);
95 
96 /** Test WiFiInterface::connect() - disconnect() repetition works. */
97 void wifi_connect_disconnect_repeat(void);
98 
99 /** Call WiFiInterface::scan() with null parameters to get number of networks available. */
100 void wifi_scan_null(void);
101 
102 /** Call WiFiInterface::scan() with valid accesspoint list allocated */
103 void wifi_scan(void);
104 
105 #endif //WIFI_TESTS_H
106 #endif // MBED_CONF_NSAPI_PRESENT
Common interface between Wi-Fi devices.
Definition: WiFiInterface.h:32
nsapi_security
Enum of encryption types.
Definition: nsapi_types.h:167
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.