Hi all,
I am using the python bindings in recent weeks to development a BLE scanning device and have found the python bindings very useful for getting the kit up and running. I now need to use the pc_ble_driver_py to create an BLE advertiser. I have had success in running the advertising.py example, I can see the advertising device in the nRF connect app with the service uuids 0x1800 (Generic Access) and 0x1801 (Generic Attribute). What I need to do is add additional services and data to this advertising.py example. Im struggling to find how to do this.
the advertising.py example uses:
adv_data = BLEAdvData(complete_local_name="My_Advertiser")
to create the advertising data, then uses the adv_data in a data_set method to create the basic advertising data.
driver.ble_gap_adv_data_set(adv_data)
The full main() function in the example is:
def main(serial_port):
print("Serial port used: {}".format(serial_port))
driver = BLEDriver(serial_port=serial_port, baud_rate=1000000)
observer = TimeoutObserver()
adv_data = BLEAdvData(complete_local_name="my_Advertiser")
driver.observer_register(observer)
driver.open()
if config.__conn_ic_id__.upper() == "NRF51":
driver.ble_enable(
BLEEnableParams(
vs_uuid_count=0,
service_changed=0,
periph_conn_count=1,
central_conn_count=0,
central_sec_count=0,
)
)
elif config.__conn_ic_id__.upper() == "NRF52":
driver.ble_enable()
driver.ble_gap_adv_data_set(adv_data)
driver.ble_gap_adv_start()
observer.wait_for_timeout()
print("Closing")
driver.close()
My question is how can I find documentation or any other examples on how I can create additional advertising data from the device. For example if I wanted to create an additional 16bit uuid for the advertising device I guessed I should change the adv_data variable to something like:
adv_data = BLEAdvData(complete_local_name="my_Advertiser",service_16bit_uuid_complete = [0x11AA, 0x22AA, 0x33AA])
I've tried a few variations of the above, I'm sure I'm missing some significant steps in the procedure for adding additional advertising services and data.
Any help or advice is appreciated, hopefully the above is explained clearly enough, let me know if anything obvious is missing.
I am new to Nordic dev kits and software in past few months, so this is my first post to the group. Thanks everyone for reading.
Haydn