Murata RF modules are designed to simplify wireless development and certification by minimizing the amount of RF expertise you need to wirelessly enable a wide range of applications.

Committer:
yangcq88517
Date:
Wed Mar 16 15:04:46 2016 +0000
Revision:
9:0ce800923eda
Parent:
1:fd19bd683e90
bug fix

Who changed what in which revision?

UserRevisionLine numberNew contents of line
yangcq88517 0:8e83b9448758 1 #ifndef SmartLab_MuRata_Config_DHCPConfig
yangcq88517 0:8e83b9448758 2 #define SmartLab_MuRata_Config_DHCPConfig
yangcq88517 0:8e83b9448758 3
yangcq88517 0:8e83b9448758 4 #include "WIFIInterface.h"
yangcq88517 0:8e83b9448758 5 #include "DHCPMode.h"
yangcq88517 0:8e83b9448758 6 #include "IPAddress.h"
yangcq88517 0:8e83b9448758 7
yangcq88517 0:8e83b9448758 8 namespace SmartLabMuRata
yangcq88517 0:8e83b9448758 9 {
yangcq88517 0:8e83b9448758 10 class DHCPConfig
yangcq88517 0:8e83b9448758 11 {
yangcq88517 0:8e83b9448758 12 /*
yangcq88517 0:8e83b9448758 13 * 0: interface is assigned the static IP, NetMask and Gateway IP. First IP and Last IP are not present. Any active DHCP client or server is stopped.
yangcq88517 0:8e83b9448758 14 * 1: STA interface uses DHCP to obtain the address. All subsequent fields are not present. STA DHCP client is started if necessary.
yangcq88517 0:8e83b9448758 15 * 2: only for AP interface. If the soft AP is not started or SNIC_INIT_REQ is not done, this command fails. Otherwise, this command stops the HTTP server, DNS server and DHCP server if configured, and restarts them with new parameters. It assigns IP for clients in range [First IP, Last IP] within the subnet mask. The AP itself is assigned the address within the same subnet specified by IP which must not be in the range of [First IP, Last IP]. The value of GTW IP and IP should be the same. If there are clients connected to the soft AP before this command, make sure the clients reconnect to the soft AP after this command.
yangcq88517 0:8e83b9448758 16 */
yangcq88517 0:8e83b9448758 17
yangcq88517 0:8e83b9448758 18 private :
yangcq88517 0:8e83b9448758 19 WIFIInterface _interface;
yangcq88517 0:8e83b9448758 20 DHCPMode mode;
yangcq88517 0:8e83b9448758 21
yangcq88517 0:8e83b9448758 22 IPAddress * ip;
yangcq88517 0:8e83b9448758 23 IPAddress * mask;
yangcq88517 0:8e83b9448758 24 IPAddress * gateway;
yangcq88517 0:8e83b9448758 25 IPAddress * first;
yangcq88517 0:8e83b9448758 26 IPAddress * last;
yangcq88517 0:8e83b9448758 27
yangcq88517 0:8e83b9448758 28 public :
yangcq88517 0:8e83b9448758 29
yangcq88517 0:8e83b9448758 30 DHCPConfig(const WIFIInterface wifiInterface, const DHCPMode mode);
yangcq88517 0:8e83b9448758 31
yangcq88517 1:fd19bd683e90 32 ~DHCPConfig();
yangcq88517 0:8e83b9448758 33
yangcq88517 0:8e83b9448758 34 WIFIInterface GetInterface();
yangcq88517 0:8e83b9448758 35
yangcq88517 0:8e83b9448758 36 DHCPMode GetDHCPMode();
yangcq88517 0:8e83b9448758 37
yangcq88517 0:8e83b9448758 38 IPAddress * GetLocalIP();
yangcq88517 0:8e83b9448758 39
yangcq88517 0:8e83b9448758 40 IPAddress * GetNetmask();
yangcq88517 0:8e83b9448758 41
yangcq88517 0:8e83b9448758 42 IPAddress * GetGatewayIP();
yangcq88517 0:8e83b9448758 43
yangcq88517 0:8e83b9448758 44 IPAddress * GetIPRangeFirst();
yangcq88517 0:8e83b9448758 45
yangcq88517 0:8e83b9448758 46 IPAddress * GetIPRangeLast();
yangcq88517 0:8e83b9448758 47
yangcq88517 0:8e83b9448758 48 DHCPConfig & SetInterface(const WIFIInterface wifiInterface);
yangcq88517 0:8e83b9448758 49
yangcq88517 0:8e83b9448758 50 DHCPConfig & SetDHCPMode(const DHCPMode mode);
yangcq88517 0:8e83b9448758 51
yangcq88517 9:0ce800923eda 52 DHCPConfig & SetLocalIP(char * ip);
yangcq88517 0:8e83b9448758 53
yangcq88517 9:0ce800923eda 54 DHCPConfig & SetNetmask(char * netmask);
yangcq88517 0:8e83b9448758 55
yangcq88517 9:0ce800923eda 56 DHCPConfig & SetGatewayIP(char * gateway);
yangcq88517 0:8e83b9448758 57
yangcq88517 9:0ce800923eda 58 DHCPConfig & SetIPRange(char * first, char * last);
yangcq88517 0:8e83b9448758 59 };
yangcq88517 0:8e83b9448758 60 }
yangcq88517 0:8e83b9448758 61
yangcq88517 0:8e83b9448758 62 #endif