Commit ed27fe18 authored by Oscar Saldias Calcerrada's avatar Oscar Saldias Calcerrada
Browse files

Mejoras en DW1000Ranging.cpp: Se agrega control de límite de cantidad de...

Mejoras en DW1000Ranging.cpp: Se agrega control de límite de cantidad de dispositivos en las operaciones addNetworkDevice
parent 4eb33108
......@@ -237,6 +237,11 @@ void DW1000RangingClass::startAsTag(char address[], const byte mode[], const boo
boolean DW1000RangingClass::addNetworkDevice(DW1000Device* device, boolean shortAddress) {
if(_networkDevicesNumber == MAX_DEVICES) {
// Max devices reached
return false;
}
//we test our network devices array to check
//we don't already have it
for(uint8_t i = 0; i < _networkDevicesNumber; i++) {
......@@ -263,6 +268,11 @@ boolean DW1000RangingClass::addNetworkDevice(DW1000Device* device, boolean short
boolean DW1000RangingClass::addNetworkDevice(DW1000Device* device) {
if(_networkDevicesNumber == MAX_DEVICES) {
// Max devices reached
return false;
}
//we test our network devices array to check
//we don't already have it
for(uint8_t i = 0; i < _networkDevicesNumber; i++) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment