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/WIFINetworkDetail.cpp

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

File content as of revision 0:8e83b9448758:

#include "WIFINetworkDetail.h"

using namespace SmartLabMuRata;

WIFINetworkDetail::WIFINetworkDetail() { }

WIFINetworkDetail::WIFINetworkDetail(const char * SSID, const SecurityMode securityMode, const BSSType networkType, const int rssi, const int maxDataRate)
    : WIFINetwork(SSID, securityMode)
{
    netType = networkType;
    this->rssi = rssi;
    this->maxDataRate = maxDataRate;
}

int WIFINetworkDetail::GetRSSI()
{
    return rssi;
}

/// <summary>
/// Max Data Rate (Mbps)
/// </summary>
/// <returns></returns>
int WIFINetworkDetail::GetMaxDataRate()
{
    return maxDataRate;
}

BSSType WIFINetworkDetail::GetNetworkType()
{
    return netType;
}

WIFINetworkDetail * WIFINetworkDetail::SetRSSI(const int rssi)
{

    if (rssi >> 7 == 0x01)
        this->rssi = (~(rssi - 1) & 0x7F) * -1;
    else
        this->rssi = rssi;
    return this;
}

WIFINetworkDetail * WIFINetworkDetail::SetNetworkType(const BSSType networkType)
{
    netType = networkType;
    return this;
}

WIFINetworkDetail * WIFINetworkDetail::SetMaxDataRate(const int maxDataRate)
{
    this->maxDataRate = maxDataRate;
    return this;
}

WIFINetworkDetail * WIFINetworkDetail::SetSecurityKey(const char * SecurityKey)
{
    WIFINetwork::SetSecurityKey(SecurityKey);
    return this;
}

WIFINetworkDetail * WIFINetworkDetail::SetBSSID(const char * BSSID)
{
    WIFINetwork::SetBSSID(BSSID);
    return this;
}

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

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

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