BLE major and minor not updating

Viewed 20

I'm using AmebaD RTL8722DM mini similar to arduino to make it a ibeacon using its libraries on examples. I want to update major and minor values but i get 0 on both. Can't understand what is wrong with it, like in the picture below. nrf connect

Below the example code im running:

#include "BLEDevice.h"
#include "BLEBeacon.h"

iBeacon beacon;
//altBeacon beacon;

// See the following for generating UUIDs:
// https://www.uuidgenerator.net/
#define UUID "00112233-4455-6677-8899-AABBCCDDEEFF"
 int a = 123;
 int b = 456;


void setup() {
    // For all possible BLE manufacturer IDs, refer to:
    // www.bluetooth.com/specifications/assigned-numbers/company-identifiers/
    beacon.setManufacturerId(0x004C); // MfgId (0x004C: Apple Inc)
    beacon.setRSSI(0xBF);             // rssi: (0xBF: -65 dBm)
    beacon.setMajor(a);          // 123
    beacon.setMinor(b);          // 456
    beacon.setUUID(UUID);

    BLE.init();
    BLE.configAdvert()->setAdvType(GAP_ADTYPE_ADV_NONCONN_IND);
    BLE.configAdvert()->setAdvData(beacon.getAdvData(), beacon.advDataSize);
    BLE.configAdvert()->setScanRspData(beacon.getScanRsp(), beacon.scanRspSize);
    BLE.beginPeripheral();


}

void loop() {

  a = a + 1;
  b = b + 1;


    delay(1000);
    
}  
0 Answers
Related