Hi all,

I'm trying to write a protobuf to detect the RSSI values of some
wireless stations in the area. I'm having some trouble 'updating' the
RSSI value of a station if it has already been seen before. At the
minute I'm doing a strcmp of the Station MAC from the message and the
MAC retrieved from libpcap, and then if they match attempting to
"add_rssi(rssi_val)" to that station.

My questions are -
1) is there a better method of searching through the stations already
entered in the message.
2) what's the best method for updating the rssi of an indexed station?
i'm using the following method at the minute, but it is not working as
can't "add_rssi" to a const:

// if station has been seen before
for(int k = 0; k < stationlog.station_size(); k++) {

        const DIDS::Station& station_iter = stationlog.station(k);

        if (strcmp(station_iter.mac().c_str(), libpcapSta->mac-
>unparse().c_str()) == 0) {
                station_iter.add_rssi(libpcapSta->rssi);
        }
}

the .proto file i'm using is:
------------------------------------------
package DIDS;

message Station {
        optional string mac = 2;
        optional int32 beacons = 3;
        repeated int32 rssi = 4;
}

message Instance {
        repeated Station station = 1;
}
------------------------------------------

Thanks, and apologies if I've missed something obvious!

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.

Reply via email to