mirror of
https://github.com/h2zero/esp-nimble-cpp.git
synced 2024-11-21 20:50:55 +01:00
Reverse discovered beacon UUID
Author: lknop <lknop@users.noreply.github.com>
This commit is contained in:
parent
2b4c1cd4f1
commit
11b6f816ca
1 changed files with 5 additions and 2 deletions
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue