Commit 4eb33108 authored by Oscar Saldias Calcerrada's avatar Oscar Saldias Calcerrada
Browse files

Mejoras en DW1000Device.cpp: Se cambia la variable de clase _range de tipo...

Mejoras en DW1000Device.cpp: Se cambia la variable de clase _range de tipo int16_t a float y se quita conversion en getter y setter. Ademas, se modifica nombre de la variable de clase _deplyDelayTimeUS  por _replyDelayTime y se cambia el tipo uint16_t por uint32_t para evitar overflow
parent 2a838692
......@@ -58,7 +58,7 @@ DW1000Device::~DW1000Device() {
}
//setters:
void DW1000Device::setReplyTime(uint16_t replyDelayTimeUs) { _replyDelayTimeUS = replyDelayTimeUs; }
void DW1000Device::setIndex(uint8_t index) { _index = index; }
void DW1000Device::setAddress(char charAddress[]) { DW1000.convertToByte(charAddress, _ownAddress); }
......@@ -70,15 +70,18 @@ void DW1000Device::setShortAddress(byte address[]) {
memcpy(_shortAddress, address, 2);
}
//void DW1000Device::setRange(float range) { _range = round(range*100); }
void DW1000Device::setRange(float range) { _range = range; }
void DW1000Device::setRange(float range) { _range = round(range*100); }
void DW1000Device::setRXPower(float rxPower) { _rxPower = round(rxPower*100); }
void DW1000Device::setRXPower(float RXPower) { _RXPower = round(RXPower*100); }
void DW1000Device::setFPPower(float FPPower) { _FPPower = round(FPPower*100); }
void DW1000Device::setFPPower(float fpPower) { _fpPower = round(fpPower*100); }
void DW1000Device::setQuality(float quality) { _quality = round(quality*100); }
void DW1000Device::setReplyDelayTime(uint32_t replyDelayTime) { _replyDelayTime = replyDelayTime; }
uint8_t DW1000Device::getIndex() const { return _index; }
const byte* DW1000Device::getByteAddress() const {
return _ownAddress;
......@@ -126,14 +129,16 @@ boolean DW1000Device::isShortAddressEquals(const byte shortAddress[]) {
return areShortAddressesEqual(this->getByteShortAddress(), shortAddress);
}
float DW1000Device::getRange() const { return float(_range)/100.0f; }
//float DW1000Device::getRange() const { return float(_range)/100.0f; }
float DW1000Device::getRange() const { return _range; }
float DW1000Device::getRXPower() const { return float(_RXPower)/100.0f; }
float DW1000Device::getRXPower() const { return float(_rxPower)/100.0f; }
float DW1000Device::getFPPower() const { return float(_FPPower)/100.0f; }
float DW1000Device::getFPPower() const { return float(_fpPower)/100.0f; }
float DW1000Device::getQuality() const { return float(_quality)/100.0f; }
uint32_t DW1000Device::getReplyDelayTime() const { return _replyDelayTime; }
void DW1000Device::randomShortAddress() {
_shortAddress[0] = random(0, 256);
......
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