google / eddystone

Specification for Eddystone, an open beacon format from Google
Apache License 2.0
3.07k stars 761 forks source link

How to change TX power level on eddystone-UID protocol #252

Open SimonCrA opened 5 years ago

SimonCrA commented 5 years ago

HI, Greetings.

I am emulating a beacon with ESP32, and i want to change TX power level to reach differents distances. how can i change TX power level?

I've already tried with estimote beacons and with them I can change TX power level from -18dbm to 4dbm. But i haven't be able to do it with ESP32 chip.

I am doing this with Eddystone protocol, more specific Eddystone-UID.

EddystoneUid::EddystoneUid(const std::string& nid, const std::string& bid) { frame.len16bitServiceUuidPart = 0x03; // <- 1 (data type value) + 2 (16-bit Eddystone UUID) frame.type16bitServiceUuid = 0x03; // 16-bit Service UUID frame.eddystoneUuid = EDDYSTONE_SERVICE_UUID; frame.lenServiceDataPart = 0x17; // Eddystone-UID full length (23bytes) frame.typeServiceData = 0x16; // Service Data frame._eddystoneUuid = EDDYSTONE_SERVICE_UUID; frame.frameType = EDDYSTONE_FRAME_TYPE_UID; frame.ranging = 0x00; // TODO: ranging data memset(frame.nid, 0, sizeof(frame.nid)); memset(frame.bid, 0, sizeof(frame.bid)); memset(frame.rfu, 0, sizeof(frame.rfu)); setBeaconId(nid, bid); }

That example code shows eddystone-uid frame, but I don't know how to change the TX power level.

in the line.

frame.ranging = 0x00; // TODO: ranging data

This is to change de level of RSSI at 1 meter, It isn't what i want.