Reverse discovered beacon UUID

Author:    lknop <lknop@users.noreply.github.com>
This commit is contained in:
lknop 2020-07-19 18:25:10 -06:00 committed by h2zero
parent 2b4c1cd4f1
commit 11b6f816ca

View file

@ -15,6 +15,7 @@
#if defined(CONFIG_BT_ENABLED)
#include <string.h>
#include <algorithm>
#include "NimBLEBeacon.h"
#include "NimBLELog.h"
@ -78,7 +79,7 @@ uint16_t NimBLEBeacon::getMinor() {
* @return The UUID advertised.
*/
NimBLEUUID NimBLEBeacon::getProximityUUID() {
return NimBLEUUID(m_beaconData.proximityUUID, 16, false);
return NimBLEUUID(m_beaconData.proximityUUID, 16, true);
}
@ -139,7 +140,9 @@ void NimBLEBeacon::setMinor(uint16_t minor) {
void NimBLEBeacon::setProximityUUID(const NimBLEUUID &uuid) {
NimBLEUUID temp_uuid = uuid;
temp_uuid.to128();
memcpy(m_beaconData.proximityUUID, temp_uuid.getNative()->u128.value, 16);
std::reverse_copy(temp_uuid.getNative()->u128.value,
temp_uuid.getNative()->u128.value + 16,
m_beaconData.proximityUUID);
} // setProximityUUID