NNN50 WIFI_API library
Dependents: NNN50_CE_Test_UDP NNN50_linux_firmware NNN50_SoftAP_HelloWorld NNN50_BLEWIFISensor ... more
This is mbed compatible EthernetInterface lib exclude for Delta DFCM-NNN50 platform.
Additional information and examples can be found in mbed Handbook
Diff: WIFIDevice.h
- Revision:
- 0:06fccc63b33d
- Child:
- 1:be6abb24f013
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/WIFIDevice.h Wed Nov 23 17:36:49 2016 +0000
@@ -0,0 +1,89 @@
+#ifndef WIFIDEVICE_H_
+#define WIFIDEVICE_H_
+
+ /** Interface using WI-FI to connect to Ethernet
+ *
+ */
+
+#include "mbed.h"
+#include "EthernetInterface.h"
+
+class WIFIDevice {
+public:
+
+ /** Set WIFI in sleep mode.
+ * Disable WIFI and set into sleep mode to conserve energy (no WIFI function is available at this point).
+ * \return 0 on success, a negative number on failure
+ */
+ int sleep(void);
+
+ /** Check if the device is connected to Access Point
+ * \return 1 if connected, 0 otherwise.
+ */
+ int is_AP_connected(void);
+
+ /** Perform WIFI scan.
+ * Scan for available access point on all channels.
+ * \return number of scanned WIFI access point
+ */
+ int apScan(void (*eventCallback)(tstrM2mWifiscanResult result));
+
+ /** Set network connection in priority.
+ * Set SSID, password and priority to connect.
+ * \param secType type of securith support in STA mode, support
+ M2M_WIFI_SEC_OPEN < Open security >
+ M2M_WIFI_SEC_WPA_PSK < Wi-Fi network is secured with WPA/WPA2 personal(PSK) >
+ M2M_WIFI_SEC_WEP < Security type WEP (40 or 104) OPEN OR SHARED >
+ M2M_WIFI_SEC_802_1X < Wi-Fi network is secured with WPA/WPA2 Enterprise.IEEE802.1x user-name/password authentication >
+ * \param SSID name of access point to connect
+ * \param PW password of the given SSID
+ */
+ void setNetwork(uint8_t secType, char* SSID, char* PW);
+
+ /** Set Access Point in given configuration.
+ * Set SSID, password, security type and channel in AP mode.
+ * \param SSID name of access point in AP mode
+ * \param PW password of the given SSID
+ * \param security tyoe of security in AP mode (default: (SECURITY_WPA2_AES_PSK)), support
+ SECURITY_OPEN < Open security >
+ SECURITY_WEP_PSK < WEP Security with open authentication with 5/13 ascii characters or 10/26 hex codes passwords
+ SECURITY_WEP_SHARED < WEP Security with shared authentication with 5/13 ascii characters or 10/26 hex codes passwords
+ SECURITY_WPA_TKIP_PSK < WPA Security with TKIP with 8 or more ascii characters passwords
+ SECURITY_WPA_AES_PSK < WPA Security with AES with 8 or more ascii characters passwords
+ SECURITY_WPA2_AES_PSK < WPA2 Security with AES with 8 or more ascii characters passwords
+ SECURITY_WPA2_TKIP_PSK < WPA2 Security with TKIP with 8 or more ascii characters passwords
+ SECURITY_WPA2_MIXED_PSK< WPA2 Security with AES & TKIP with 8 or more ascii characters passwords
+ * \param channel range from 1 to 14 (default: (1))
+ */
+ //void WIFIDevice::setAccessPoint(char* SSID, char* PW, uint8_t secType, uint8_t channel=1);
+
+ /** Erase a 4KB sector of embeeded flash.
+ * Flash memory will be erased in groups of 4KB sector.
+ * \param address range from 0x00 to 0x3F000 (must be a multiple of 0x1000).
+ * \return 0 on success, a negative number on failure
+ */
+ //int storage_erase4KB(uint32_t address);
+
+ /** Write data into embeeded flash.
+ * Write one (multiple) byte(s) of data into flash, must perform erase before the flash memory area can be overwrite.
+ * \param address flash memory address to be written, range from 0x00 to 0x3FFFF.
+ * \param data pointer to the buffer containing data to be written.
+ * \param len length of the data to be written to flash.
+ * \return 0 on success, a negative number on failure
+ */
+ //int storage_write(uint32_t address, uint8_t *data, uint16_t len);
+
+ /** Read data from embeeded flash.
+ * Read one (multiple) byte(s) of data from flash.
+ * \param address flash memory address to be read, range from 0x00 to 0x3FFFF.
+ * \param data pointer to the buffer containing data to be read.
+ * \param len length of the data to be read from flash.
+ * \return 0 on success, a negative number on failure
+ */
+ //int storage_read(uint32_t address, uint8_t *data, uint16_t len);
+
+};
+
+int enableCoexistance();
+
+#endif /* WIFIDEVICE_H_ */