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.

Indication/SSIDRecordIndication.cpp

Committer:
yangcq88517
Date:
2015-02-04
Revision:
1:fd19bd683e90
Parent:
0:8e83b9448758
Child:
9:0ce800923eda

File content as of revision 1:fd19bd683e90:

#include "SSIDRecordIndication.h"

using namespace SmartLabMuRata;

SSIDRecordIndication::SSIDRecordIndication(Payload * payload)
    : Payload(payload)
{}

int SSIDRecordIndication::GetNumberofRecords()
{
    return GetData()[2];
}

void SSIDRecordIndication::GetRecords(WIFINetworkDetail * list)
{
    int count = GetNumberofRecords();

    if (count <= 0)
        return;

    int index = 0;
    int _position = 3;

    const char * value = GetData();

    while (index < count) {

        list[index].SetChannel(value[_position++])
        ->SetRSSI(value[_position++])
        ->SetSecurityMode((SecurityMode)value[_position++])
        ->SetBSSID(value + _position)
        ->SetNetworkType((BSSType)value[_position += 6])
        ->SetMaxDataRate(value[_position++])
        ->SetSSID(value + (_position += 2));

        _position+= strlen(list[index].GetSSID()) + 1;

        index++;
    }
}