Using pc_ble_driver_py (version 0.15.0) to create a peripheral with a specific Device Name in characteristic 0x2A00 (Generic access service), the resulting device name is garbage. The class "BLEConfigGapDeviceName" is used to try setting the device name in the following way:
Fullscreen
1
2
3
configName = BLEConfigGapDeviceName(device_name="0000000000",device_name_read_only=False)
ble_driver.ble_cfg_set(BLEConfig(driver.BLE_GAP_CFG_DEVICE_NAME), configName)
ble_driver.ble_enable()
This is the result in nRF Connect:
In the log window the following is seen:
Attribute value read, handle: 0x03, value (0x): D4-03-00-20-00-00-00-00-D0-1C
This is the complete file:
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import logging
import sys
import time
from threading import Condition, Lock
from pc_ble_driver_py.observers import BLEDriverObserver
BASE_UUID_DICT = {'BV_BASE_UUID': [0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x10, 0x00,
0x80, 0x00,
0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB]}
SERVICE1 = (("MyService1" , 0x3000),
(("Char1" , 0x3001, 1, [0x00], "Desc"),
("Char2" , 0x3002, 2, [0x00], "Desc"),))
DEVICE_INFORMATION_SERVICE = (("Device Information" , 0x180A),
(("Manufacturer name" , 0x2A29, 20, b"Name", None),
("Model name" , 0x2A24, 20, b"Model1", None),
("Firmware version" , 0x2A26, 20, b"v_0.0.1", None),))
SERVICES_CONFIG = ( DEVICE_INFORMATION_SERVICE,
SERVICE1,
What am I doing wrong?