WIFI_API_20150524e

Committer:
Marcomissyou
Date:
Tue Jun 09 06:04:13 2015 +0000
Revision:
0:a2de37bf5f3d
update to WIFI_API_20150524e

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Marcomissyou 0:a2de37bf5f3d 1 #ifndef WIFIDEVICE_H_
Marcomissyou 0:a2de37bf5f3d 2 #define WIFIDEVICE_H_
Marcomissyou 0:a2de37bf5f3d 3
Marcomissyou 0:a2de37bf5f3d 4 #include "nmi_wlan_if.h"
Marcomissyou 0:a2de37bf5f3d 5 #include "nmi_wlan.h"
Marcomissyou 0:a2de37bf5f3d 6
Marcomissyou 0:a2de37bf5f3d 7 /** Interface using WI-FI to connect to Ethernet
Marcomissyou 0:a2de37bf5f3d 8 *
Marcomissyou 0:a2de37bf5f3d 9 */
Marcomissyou 0:a2de37bf5f3d 10 class WIFIDevice {
Marcomissyou 0:a2de37bf5f3d 11 public:
Marcomissyou 0:a2de37bf5f3d 12
Marcomissyou 0:a2de37bf5f3d 13 /** Set WIFI in sleep mode.
Marcomissyou 0:a2de37bf5f3d 14 * Disable WIFI and set into sleep mode to conserve energy (no WIFI function is available at this point).
Marcomissyou 0:a2de37bf5f3d 15 * \return 0 on success, a negative number on failure
Marcomissyou 0:a2de37bf5f3d 16 */
Marcomissyou 0:a2de37bf5f3d 17 int sleep(void);
Marcomissyou 0:a2de37bf5f3d 18
Marcomissyou 0:a2de37bf5f3d 19 /** Set the position of embedded RF switch.
Marcomissyou 0:a2de37bf5f3d 20 * Set the position of RF switch between WIFI and BLE.
Marcomissyou 0:a2de37bf5f3d 21 * \param position set 1 on WIFI to use, set 0 on BLE to use.
Marcomissyou 0:a2de37bf5f3d 22 * \return 0 on success, a negative number on failure
Marcomissyou 0:a2de37bf5f3d 23 */
Marcomissyou 0:a2de37bf5f3d 24 int setSwitch(int position);
Marcomissyou 0:a2de37bf5f3d 25
Marcomissyou 0:a2de37bf5f3d 26 /** Get the position of embedded RF switch.
Marcomissyou 0:a2de37bf5f3d 27 * Get the current position of RF switch
Marcomissyou 0:a2de37bf5f3d 28 * \return get 1 on WIFI to use, get 0 on BLE to use
Marcomissyou 0:a2de37bf5f3d 29 */
Marcomissyou 0:a2de37bf5f3d 30 int getSwitch(void);
Marcomissyou 0:a2de37bf5f3d 31
Marcomissyou 0:a2de37bf5f3d 32 // /** Perform one time WIFI scan.
Marcomissyou 0:a2de37bf5f3d 33 // * Scan for available access point on all channels.
Marcomissyou 0:a2de37bf5f3d 34 // * \return number of scanned WIFI access point
Marcomissyou 0:a2de37bf5f3d 35 // */
Marcomissyou 0:a2de37bf5f3d 36 // int oneTimeScan(void);
Marcomissyou 0:a2de37bf5f3d 37 //
Marcomissyou 0:a2de37bf5f3d 38 // /** Get the scanned access point information.
Marcomissyou 0:a2de37bf5f3d 39 // * Get the scanned associated access point information table on least oneTimeScan.
Marcomissyou 0:a2de37bf5f3d 40 // * \param index query the information of result table in index number [0~19]
Marcomissyou 0:a2de37bf5f3d 41 // * \param SSID access point SSID name on query index
Marcomissyou 0:a2de37bf5f3d 42 // * \param RSSI access point RSSI (Received Signal Strength Indicator) on query index
Marcomissyou 0:a2de37bf5f3d 43 // * \param security access point security type on query index, get 0 on no security, 1 on WEP, 2 on WPA, 3 on WPA2
Marcomissyou 0:a2de37bf5f3d 44 // * \return 0 on success, a negative number on failure when empty
Marcomissyou 0:a2de37bf5f3d 45 // */
Marcomissyou 0:a2de37bf5f3d 46 // int getScanResult(uint8_t index, uint8_t* SSID, int* RSSI, uint8_t security);
Marcomissyou 0:a2de37bf5f3d 47
Marcomissyou 0:a2de37bf5f3d 48 /** Set network connection in priority.
Marcomissyou 0:a2de37bf5f3d 49 * Set SSID, password and priority to connect.
Marcomissyou 0:a2de37bf5f3d 50 * \param SSID name of access point to connect
Marcomissyou 0:a2de37bf5f3d 51 * \param PW password of the given SSID
Marcomissyou 0:a2de37bf5f3d 52 * \param priority range from 0 to 2, set 0 for the highest priority
Marcomissyou 0:a2de37bf5f3d 53 */
Marcomissyou 0:a2de37bf5f3d 54 void setNetwork(char* SSID, char* PW, uint8_t priority);
Marcomissyou 0:a2de37bf5f3d 55
Marcomissyou 0:a2de37bf5f3d 56 // /** Get the status of embedded WIFI chipset.
Marcomissyou 0:a2de37bf5f3d 57 // * Get the current status of embedded WIFI chipset
Marcomissyou 0:a2de37bf5f3d 58 // * \return get 1 on WIFI to use, get 0 on BLE to use
Marcomissyou 0:a2de37bf5f3d 59 // */
Marcomissyou 0:a2de37bf5f3d 60 // int getStatus(void);
Marcomissyou 0:a2de37bf5f3d 61
Marcomissyou 0:a2de37bf5f3d 62 // /** Set WIFI output power.
Marcomissyou 0:a2de37bf5f3d 63 // * Set WIFI output power level
Marcomissyou 0:a2de37bf5f3d 64 // * \param output power level
Marcomissyou 0:a2de37bf5f3d 65 // * \return 0 on success, a negative number on failure
Marcomissyou 0:a2de37bf5f3d 66 // */
Marcomissyou 0:a2de37bf5f3d 67 // int setTxPower(uint8_t powerIndex);
Marcomissyou 0:a2de37bf5f3d 68
Marcomissyou 0:a2de37bf5f3d 69 };
Marcomissyou 0:a2de37bf5f3d 70
Marcomissyou 0:a2de37bf5f3d 71 //#include "EthernetInterface.h"
Marcomissyou 0:a2de37bf5f3d 72
Marcomissyou 0:a2de37bf5f3d 73 #endif /* WIFIDEVICE_H_ */