KDDI Fx0 hackathon / NySNICInterface

Fork of NySNICInterface by Ryo Iizuka

Committer:
kishino
Date:
Tue Mar 11 10:38:36 2014 +0000
Revision:
2:0ba43344c814
Parent:
0:61c402886fbb
Child:
3:9f90024d7fb2
Created the basic composition of SNIC UART command API.; Created the UART command for getting firmware's version.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
kishino 0:61c402886fbb 1 #ifndef _YD_WIFIINTERFACE_H_
kishino 0:61c402886fbb 2 #define _YD_WIFIINTERFACE_H_
kishino 0:61c402886fbb 3
kishino 0:61c402886fbb 4 #include "YDwifi.h"
kishino 0:61c402886fbb 5
kishino 2:0ba43344c814 6 namespace murata_wifi
kishino 2:0ba43344c814 7 {
kishino 2:0ba43344c814 8
kishino 0:61c402886fbb 9 class C_YDwifiInterface: public C_YDwifi {
kishino 0:61c402886fbb 10 public:
kishino 0:61c402886fbb 11
kishino 2:0ba43344c814 12 /** Constructor
kishino 2:0ba43344c814 13 @param tx mbed pin to use for tx line of Serial interface
kishino 2:0ba43344c814 14 @param rx mbed pin to use for rx line of Serial interface
kishino 2:0ba43344c814 15 @param cts mbed pin to use for cts line of Serial interface
kishino 2:0ba43344c814 16 @param rts mbed pin to use for rts line of Serial interface
kishino 2:0ba43344c814 17 @param reset reset pin of the wifi module
kishino 2:0ba43344c814 18 @param alarm alarm pin of the wifi module (default: NC)
kishino 2:0ba43344c814 19 @param baud baud rate of Serial interface (default: 9600)
kishino 0:61c402886fbb 20 */
kishino 2:0ba43344c814 21 C_YDwifiInterface(PinName tx, PinName rx, PinName cts, PinName rts, PinName reset, PinName alarm = NC, int baud = 9600);
kishino 2:0ba43344c814 22
kishino 2:0ba43344c814 23 /** Initialize the interface.
kishino 2:0ba43344c814 24 @return 0 on success, a negative number on failure
kishino 2:0ba43344c814 25 */
kishino 2:0ba43344c814 26 int init();
kishino 0:61c402886fbb 27
kishino 2:0ba43344c814 28 /** Get Firmware version string.
kishino 2:0ba43344c814 29 @param version_p Pointer of FW version string.(null terminated)[output]
kishino 2:0ba43344c814 30 @return 0:success/other:fail
kishino 2:0ba43344c814 31 @note This function is blocked until a returns.
kishino 2:0ba43344c814 32 When you use it by UI thread, be careful.
kishino 2:0ba43344c814 33 */
kishino 2:0ba43344c814 34 int getFWVersion( unsigned char *version_p );
kishino 0:61c402886fbb 35
kishino 0:61c402886fbb 36 #if 0
kishino 0:61c402886fbb 37 /** Connect
kishino 0:61c402886fbb 38 * Bring the interface up, start DHCP if needed.
kishino 0:61c402886fbb 39 * \param sec the Wi-Fi security type
kishino 0:61c402886fbb 40 * \param ssid the Wi-Fi SSID
kishino 0:61c402886fbb 41 * \param phrase the Wi-Fi passphrase or security key
kishino 0:61c402886fbb 42 * \param mode the Wi-Fi mode
kishino 0:61c402886fbb 43 * \return 0 on success, a negative number on failure
kishino 0:61c402886fbb 44 */
kishino 0:61c402886fbb 45 int connect(Security sec, const char* ssid, const char* phrase, WiFiMode mode = WM_INFRASTRUCTURE);
kishino 0:61c402886fbb 46
kishino 0:61c402886fbb 47 /** Disconnect
kishino 0:61c402886fbb 48 * Bring the interface down
kishino 0:61c402886fbb 49 * \return 0 on success, a negative number on failure
kishino 0:61c402886fbb 50 */
kishino 0:61c402886fbb 51 int disconnect();
kishino 0:61c402886fbb 52
kishino 0:61c402886fbb 53 /** Get the MAC address of your Ethernet interface
kishino 0:61c402886fbb 54 * \return a pointer to a string containing the MAC address
kishino 0:61c402886fbb 55 */
kishino 0:61c402886fbb 56 char* getMACAddress();
kishino 0:61c402886fbb 57
kishino 0:61c402886fbb 58 /** Get the IP address of your Ethernet interface
kishino 0:61c402886fbb 59 * \return a pointer to a string containing the IP address
kishino 0:61c402886fbb 60 */
kishino 0:61c402886fbb 61 char* getIPAddress();
kishino 0:61c402886fbb 62
kishino 0:61c402886fbb 63 /** Get the Gateway address of your Ethernet interface
kishino 0:61c402886fbb 64 * \return a pointer to a string containing the Gateway address
kishino 0:61c402886fbb 65 */
kishino 0:61c402886fbb 66 char* getGateway();
kishino 0:61c402886fbb 67
kishino 0:61c402886fbb 68 /** Get the Network mask of your Ethernet interface
kishino 0:61c402886fbb 69 * \return a pointer to a string containing the Network mask
kishino 0:61c402886fbb 70 */
kishino 0:61c402886fbb 71 char* getNetworkMask();
kishino 0:61c402886fbb 72 #endif
kishino 0:61c402886fbb 73 };
kishino 2:0ba43344c814 74 }
kishino 0:61c402886fbb 75
kishino 0:61c402886fbb 76 #endif /* _YD_WIFIINTERFACE_H_ */