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
WIFIDevice.h
- Committer:
- tsungta
- Date:
- 2016-12-19
- Revision:
- 5:2429f27521aa
- Parent:
- 1:be6abb24f013
- Child:
- 9:32d6cd2f8456
File content as of revision 5:2429f27521aa:
#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); /** Enable 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 AP_ip the IP address of AP * \param security tyoe of security in AP mode (default: (M2M_WIFI_SEC_WEP)), support M2M_WIFI_SEC_OPEN < Open security > M2M_WIFI_SEC_WEP < Security type WEP with 10 hexadecimal digits > * \param channel range from 1 to 14 (default: (1)) * \return 0 on success, a negative number on failure */ int WIFIDevice::enableAccessPoint(char* SSID, char* PW, char* AP_ip = "192.168.1.1", uint8_t secType=M2M_WIFI_SEC_WEP, 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_ */