CHENGQI YANG / SmartLab_MuRata
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers SSIDRecordIndication.cpp Source File

SSIDRecordIndication.cpp

00001 #include "SSIDRecordIndication.h"
00002 
00003 using namespace SmartLabMuRata;
00004 
00005 SSIDRecordIndication::SSIDRecordIndication(Payload * payload)
00006     : Payload(payload)
00007 {}
00008 
00009 int SSIDRecordIndication::GetNumberofRecords()
00010 {
00011     return GetData()[2];
00012 }
00013 
00014 void SSIDRecordIndication::GetRecords(WIFINetworkDetail * details)
00015 {
00016     int count = GetNumberofRecords();
00017 
00018     if (count <= 0)
00019         return;
00020         
00021     int index = 0;
00022     int _position = 3;
00023 
00024     const char * value = GetData();
00025 
00026     while (index < count) {
00027         
00028         (details + index)->SetChannel(value[_position++])
00029         ->SetRSSI(value[_position++])
00030         ->SetSecurityMode((SecurityMode)value[_position++])
00031         ->SetBSSID(value + _position)
00032         ->SetNetworkType((BSSType)value[_position += 6])
00033         ->SetMaxDataRate(value[_position++])
00034         ->SetSSID(value + (_position += 2));
00035 
00036         _position+= strlen((details + index)->GetSSID()) + 1;
00037         
00038         index++;
00039     }
00040 }