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.

Config/SoftAPConfig.h

Committer:
yangcq88517
Date:
2015-02-03
Revision:
0:8e83b9448758
Child:
9:0ce800923eda

File content as of revision 0:8e83b9448758:

#ifndef SmartLab_MuRata_Config_SoftAPConfig
#define SmartLab_MuRata_Config_SoftAPConfig

#include "WIFINetwork.h"

namespace SmartLabMuRata
{
class SoftAPConfig : public WIFINetwork
{
public :
    enum State {
        /// <summary>
        /// indicates AP is to be turned off. The rest of the parameters are ignored.
        /// </summary>
        OFF = 0x00,

        /// <summary>
        /// indicates turning on soft AP using existing NVM parameters,
        /// </summary>
        ON_NVM = 0x01,

        /// <summary>
        /// indicates turning on AP with the parameters provided. If the soft AP is already on, it is first turned off.
        /// </summary>
        ON_PARAMETERS = 0x02,
    };

    SoftAPConfig(State state, const char * SSID = "", const SecurityMode securityMode = WIFI_SECURITY_OPEN, const char * securityKey = NULL);

    char GetOnOffStatus();

    char GetPersistency();

    SoftAPConfig * SetOnOffState(const State onOff);

    SoftAPConfig * SetPersistency(const bool persistency);

    virtual SoftAPConfig * SetSecurityKey(const char * SecurityKey);

    virtual SoftAPConfig * SetBSSID(const char * BSSID);

    virtual SoftAPConfig * SetSSID(const char * SSID);

    /// <summary>
    /// WIFI_SECURITY_OPEN
    /// WIFI_SECURITY_WPA_TKIP_PSK
    /// WIFI_SECURITY_WPA2_AES_PSK
    /// WIFI_SECURITY_WPA2_MIXED_PSK
    /// supported
    /// </summary>
    /// <param name="securityMode"></param>
    /// <returns></returns>
    virtual SoftAPConfig * SetSecurityMode(const SecurityMode securityMode);

    virtual SoftAPConfig * SetChannel(const char channel);
    /*
     * Parameters are as follows:
     * UINT8 Request Sequence
     * UINT8 Onoff
     * UINT8 Persistency
     * UINT8 SSID [up to 33]
     * UINT8 Channel
     * UINT8 Security mode
     * UINT8 Security key length (0-64)
     * … Security key [ ]
     * OnOff = 0 indicates AP is to be turned off. The rest of the parameters are ignored.
     * OnOff = 1 indicates turning on soft AP using existing NVM parameters,
     * OnOff = 2 indicates turning on AP with the parameters provided. If the soft AP is already on, it is first turned off.
     * Persistency=1 indicates the soft AP’s on/off state and parameters (if OnOff = 2) will be saved in NVM. For example, if OnOff =0 and Persistency=1, the soft AP will not be turned on after a reset.
     */

private :
    State onOff;
    bool persistency;

    /// <summary>
    /// OnOff = 0 indicates AP is to be turned off. The rest of the parameters are ignored.
    /// BSSID is not required
    /// !!! cannot be WEP and WIFI_SECURITY_WPA_AES_PSK !!!
    /// </summary>
    /// <param name="SSID">only required when OnOff = 2, which is ON_PARAMETERS</param>
    /// <param name="securityMode"></param>
    /// <param name="securityKey"></param>
};
}

#endif