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.

Type/WIFINetwork.cpp

Committer:
yangcq88517
Date:
2015-02-03
Revision:
0:8e83b9448758
Child:
1:fd19bd683e90

File content as of revision 0:8e83b9448758:

#include "WIFINetwork.h"

using namespace SmartLabMuRata;

string & WIFINetwork::GetSecurityKey()
{
    return key;
}

const char * WIFINetwork::GetBSSID()
{
    return BSSID;
}

WIFINetwork::WIFINetwork() { BSSID = NULL; }

WIFINetwork::WIFINetwork(const char * SSID, const SecurityMode securityMode, const char * securityKey)
    : WIFIInfo(SSID, securityMode)
{
    BSSID = NULL;
    SetSecurityKey(securityKey);
}

WIFINetwork::~WIFINetwork()
{
    delete[] BSSID;
}

WIFINetwork * WIFINetwork::SetSecurityKey(const char * SecurityKey)
{
    key = string(SecurityKey);
    return this;
}

WIFINetwork * WIFINetwork::SetBSSID(const char * BSSID)
{
    if (this->BSSID == NULL)
        this->BSSID = new char[6];

    memcpy(this->BSSID, BSSID, 6);
    return this;
}

WIFINetwork * WIFINetwork::SetSSID(const char * SSID)
{
    WIFIInfo::SetSSID(SSID);
    return this;
}

WIFINetwork * WIFINetwork::SetSecurityMode(const SecurityMode securityMode)
{
    WIFIInfo::SetSecurityMode(securityMode);
    return this;
}

WIFINetwork * WIFINetwork::SetChannel(const char channel)
{
    WIFIInfo::SetChannel(channel);
    return this;
}