2019-02-14 13:58:07 +00:00
|
|
|
/*
|
2019-02-15 13:37:40 +00:00
|
|
|
* Copyright (c) 2018-2019, Arm Limited and affiliates.
|
2019-02-14 13:58:07 +00:00
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
2017-09-19 17:16:36 +00:00
|
|
|
#ifndef WIFI_TESTS_H
|
|
|
|
#define WIFI_TESTS_H
|
|
|
|
|
|
|
|
#include "WiFiInterface.h"
|
|
|
|
|
2017-10-04 09:32:46 +00:00
|
|
|
/** Get WiFiInterface based on provided
|
|
|
|
* app_json. */
|
2017-09-19 17:16:36 +00:00
|
|
|
WiFiInterface *get_interface(void);
|
|
|
|
|
2017-12-22 10:54:22 +00:00
|
|
|
/**
|
|
|
|
* Get security protocol to be used
|
|
|
|
*/
|
|
|
|
nsapi_security get_security(void);
|
|
|
|
|
2017-10-04 09:32:46 +00:00
|
|
|
/*
|
|
|
|
* Test cases
|
|
|
|
*/
|
|
|
|
|
|
|
|
/** Test that constructor of the driver works. */
|
2017-09-19 17:16:36 +00:00
|
|
|
void wifi_constructor(void);
|
2017-10-04 09:32:46 +00:00
|
|
|
|
|
|
|
/** This test case is to test whether the driver accepts valid credentials and reject ones that are not valid. */
|
2017-09-19 17:16:36 +00:00
|
|
|
void wifi_set_credential(void);
|
2017-10-04 09:32:46 +00:00
|
|
|
|
|
|
|
/** Test validity of WiFiInterface::set_channel(). */
|
2017-09-19 17:16:36 +00:00
|
|
|
void wifi_set_channel(void);
|
2017-10-04 09:32:46 +00:00
|
|
|
|
|
|
|
/** Test WiFiInterface::get_rssi() API.
|
|
|
|
* When connected, it should return valid RSSI value. When unconnected it should return 0. */
|
2017-09-19 17:16:36 +00:00
|
|
|
void wifi_get_rssi(void);
|
2017-10-04 09:32:46 +00:00
|
|
|
|
|
|
|
/** Test WiFiInterface::connect(ssid, pass, security, channel) with NULL parameters */
|
2017-09-19 17:16:36 +00:00
|
|
|
void wifi_connect_params_null(void);
|
2017-10-04 09:32:46 +00:00
|
|
|
|
|
|
|
/** Test WiFiInterface::connect(ssid, pass, security) with valid parameters for unsecure network */
|
2017-09-19 17:16:36 +00:00
|
|
|
void wifi_connect_params_valid_unsecure(void);
|
2017-10-04 09:32:46 +00:00
|
|
|
|
|
|
|
/** Test WiFiInterface::connect(ssid, pass, security) with valid parameters for secure network */
|
2017-09-19 17:16:36 +00:00
|
|
|
void wifi_connect_params_valid_secure(void);
|
2017-10-04 09:32:46 +00:00
|
|
|
|
|
|
|
/** Test WiFiInterface::connect(ssid, pass, security, channel) with valid parameters for secure network using channel specified. */
|
2017-09-19 17:16:36 +00:00
|
|
|
void wifi_connect_params_channel(void);
|
2017-10-04 09:32:46 +00:00
|
|
|
|
|
|
|
/** Test WiFiInterface::connect(ssid, pass, security, channel) with valid parameters for secure network using wrong channel number. */
|
2017-09-19 17:16:36 +00:00
|
|
|
void wifi_connect_params_channel_fail(void);
|
2017-10-04 09:32:46 +00:00
|
|
|
|
|
|
|
/** Test WiFiInterface::connect() without parameters. Use set_credentials() for setting parameters. */
|
2017-09-19 17:16:36 +00:00
|
|
|
void wifi_connect(void);
|
2017-10-04 09:32:46 +00:00
|
|
|
|
|
|
|
/** Test WiFiInterface::connect() without parameters. Don't set parameters with set_credentials() */
|
2017-09-19 17:16:36 +00:00
|
|
|
void wifi_connect_nocredentials(void);
|
2017-10-04 09:32:46 +00:00
|
|
|
|
|
|
|
/** Test WiFiInterface::connect() without parameters. Use secure settings for set_credentials. */
|
2017-09-19 17:16:36 +00:00
|
|
|
void wifi_connect_secure(void);
|
2017-10-04 09:32:46 +00:00
|
|
|
|
|
|
|
/** Test WiFiInterface::connect() failing with wrong password. */
|
2017-09-19 17:16:36 +00:00
|
|
|
void wifi_connect_secure_fail(void);
|
2017-10-04 09:32:46 +00:00
|
|
|
|
|
|
|
/** Test WiFiInterface::connect() - disconnect() repeatition works. */
|
2017-09-19 17:16:36 +00:00
|
|
|
void wifi_connect_disconnect_repeat(void);
|
2017-10-04 09:32:46 +00:00
|
|
|
|
|
|
|
/** Call WiFiInterface::scan() with null parameters to get number of networks available. */
|
2017-09-19 17:16:36 +00:00
|
|
|
void wifi_scan_null(void);
|
2017-10-04 09:32:46 +00:00
|
|
|
|
|
|
|
/** Call WiFiInterface::scan() with valid accesspoint list allocated */
|
2017-09-19 17:16:36 +00:00
|
|
|
void wifi_scan(void);
|
|
|
|
|
|
|
|
#endif //WIFI_TESTS_H
|