How to advertise with specific 128bit uuid by pc-ble-driver-py?

Hi,

I have met a problem that I try to advertise nRF52840 dongle in pc-ble-driver-py. However, connection is not built from this command:

Fullscreen
1
2
3
BASE_UUID = [0x6E, 0x40, 0x00, 0x01, 0xB5, 0xA3, 0xF3, 0x93,
0xE0, 0xA9, 0xE5, 0x0E, 0x24, 0xDC, 0xCA, 0x9E]
adv_data = BLEAdvData(service_128bit_uuid_complete=BASE_UUID)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

The uuid is uart over ble which is used in nRFConnect desktop. And we can connect through this application.

I wonder to know how to advertise with specific 128bit uuid by pc-ble-driver-py. Thank you!

Parents
  • I find that this code can not change the complete list of 128-bit service uuids. Is there any function which can change the uuid of the advertising device?

  • Hi,

    This post might be helpful to solve this:

     Adding custome characterstics using pc-ble-driver-py 

  • Hi Sigurd,

    This function self.adapter.driver.ble_vs_uuid_add still doesn't work. Maybe the difference is that I use nRF52840 as slave by adveristing it. 

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    class HRCollector(BLEDriverObserver, BLEAdapterObserver):
    def __init__(self, adapter):
    super(HRCollector, self).__init__()
    self.adapter = adapter
    self.conn_q = Queue()
    self.adapter.observer_register(self)
    self.adapter.driver.observer_register(self)
    self.adapter.default_mtu = 250
    from pc_ble_driver_py.ble_driver import BLEUUIDBase
    self.nus_base = BLEUUIDBase([
    0x6e, 0x40, 0x00, 0x00, 0xb5, 0xa3, 0xf3, 0x93, 0xe0, 0xa9, 0xe5, 0x0e, 0x24, 0xdc, 0xca, 0x9e
    ])
    def open(self):
    self.adapter.driver.open()
    if config.__conn_ic_id__.upper() == "NRF51":
    self.adapter.driver.ble_enable(
    BLEEnableParams(
    vs_uuid_count=1,
    service_changed=0,
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Reply
  • Hi Sigurd,

    This function self.adapter.driver.ble_vs_uuid_add still doesn't work. Maybe the difference is that I use nRF52840 as slave by adveristing it. 

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    class HRCollector(BLEDriverObserver, BLEAdapterObserver):
    def __init__(self, adapter):
    super(HRCollector, self).__init__()
    self.adapter = adapter
    self.conn_q = Queue()
    self.adapter.observer_register(self)
    self.adapter.driver.observer_register(self)
    self.adapter.default_mtu = 250
    from pc_ble_driver_py.ble_driver import BLEUUIDBase
    self.nus_base = BLEUUIDBase([
    0x6e, 0x40, 0x00, 0x00, 0xb5, 0xa3, 0xf3, 0x93, 0xe0, 0xa9, 0xe5, 0x0e, 0x24, 0xdc, 0xca, 0x9e
    ])
    def open(self):
    self.adapter.driver.open()
    if config.__conn_ic_id__.upper() == "NRF51":
    self.adapter.driver.ble_enable(
    BLEEnableParams(
    vs_uuid_count=1,
    service_changed=0,
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Children