Legrandgroup / libezsp

C++ library to send/receive wireless Zigbee messages to/from a Silicon Labs-based transceiver using the EZSP protocol.
BSD 3-Clause "New" or "Revised" License
16 stars 7 forks source link

Improve active scan result by running multiple passes #75

Open lionelains opened 4 years ago

lionelains commented 4 years ago

Only running 1 active scan misses a few networks. We should be able to provide a loop count in the API call to startActiveScan() so that an active scan gets better results (consolidated on multiple passes)

lionelains commented 3 years ago

To be merged, we still need to consolidate results from multiple passes, that is to say, remove duplicates based on extended PAN ID. We should first check if there is not already the same PANID+extended PAN ID known on this same channel. If this is the case, then we will update the result rather than pushing a new value. Otherwise, without that improvement, this is what we are getting when performing triple scan:

Scan succesfully started
EZSP_NETWORK_FOUND_HANDLER: New network found: EmberZigbeeNetwork: { [channel: 11][panId: 0xd4ef][extendedPanId: 0x89c1542a249278bc][allowingJoin: false][stackProfile: 0x02][nwkUpdateId: 0x00] }
Closing GP channel request window
Scan finished
Re-running active scan (2 loop(s) remaining)
Channel mask 800
Scan succesfully started
EZSP_NETWORK_FOUND_HANDLER: New network found: EmberZigbeeNetwork: { [channel: 11][panId: 0xd4ef][extendedPanId: 0x89c1542a249278bc][allowingJoin: false][stackProfile: 0x02][nwkUpdateId: 0x00] }
Scan finished
Re-running active scan (1 loop(s) remaining)
Channel mask 800
Scan succesfully started
EZSP_NETWORK_FOUND_HANDLER: New network found: EmberZigbeeNetwork: { [channel: 11][panId: 0xd4ef][extendedPanId: 0x89c1542a249278bc][allowingJoin: false][stackProfile: 0x02][nwkUpdateId: 0x00] }
Scan finished
3 zigbee network(s) found on channel 11:
Network:ZigbeeNetworkScanResult: { [channel: 11][lastHop: LQI=232, rssi=-42][panId: 0xd4ef][extendedPanId: 0x89c1542a249278bc][allowingJoin: false][stackProfile: 0x02][nwkUpdateId: 0x00] }
Network:ZigbeeNetworkScanResult: { [channel: 11][lastHop: LQI=228, rssi=-43][panId: 0xd4ef][extendedPanId: 0x89c1542a249278bc][allowingJoin: false][stackProfile: 0x02][nwkUpdateId: 0x00] }
Network:ZigbeeNetworkScanResult: { [channel: 11][lastHop: LQI=232, rssi=-42][panId: 0xd4ef][extendedPanId: 0x89c1542a249278bc][allowingJoin: false][stackProfile: 0x02][nwkUpdateId: 0x00] }