Create custom bluetooth packets on Arduino Nano BLE

I am working on a project where I need to create a remote drone ID on an Arduino Nano BLE. To do this, I need to use the packet standard at file:///Users/jacobhagberg/Downloads/F3411.40165%20UAS%20Remote%20ID.pdf. Is there a way that I can have manually craft Bluetooth frames in order to meet the standard? As far as I can tell the ArduinoBLE library is not able to do this.

Bluetooth Low Energy is built upon the Generic Attribute (aka GATT) and the Generic Access (aka GAP) profiles. They define how BLE devices communicate with each other and establish connections.

What do you mean with this ?


The Arduino BLE Library is built with these profiles in mind.

### Advertising and GAP

BLE devices let other devices know that they exist by advertising using the General Advertising Profile (GAP). Advertising packets can contain a device name, some other information, and also a list of the services it provides.

Advertising packets have a limited size. You will only be able to fit a single 128-bit service UUID in the packet. Make sure the device name is not too long, or you won’t even be able to fit that.

You can provide additional services that are not advertised. Central devices will learn about these through the connection/bonding process. Non-advertised services cannot be used to discover devices, though. Sometimes this is not an issue. For example, you may have a custom peripheral device with a custom service, but in your central device app you may know that it also provides the Battery Service and other services.

### GATT

The Bluetooth LE protocol operates on multiple layers. General Attribute Profile (GATT) is the layer that defines services and characteristics and enables read/write/notify/indicate operations on them. When reading more about GATT, you may encounter GATT concepts of a “server” and “client”. These don’t always correspond to central and peripherals. In most cases, though, the peripheral is the GATT server (since it provides the services and characteristics), while the central is the GATT client.

The library offers the option to define your own content for the characteristic - see discussion here for example

I worded this poorly, but what I mean is, the FAA standard for drone ID uses both wifi and Bluetooth to broadcast drone data. As far as I can tell, to be able to make these frames for the Bluetooth version of drone ID, I would need to craft raw Bluetooth frames that get played over the advertising channels via Bluetooth. Do you think I need to craft raw frames, or is there a way to do this some other way?

I'm not familiar with the details of the FAA standard for drone ID but this looks really like a standard BLE advertisement packet in BLE 5.

The arduino library is not suited to build such a frame as it's designed with BLE 4 in mind and won't support an advertisement packet larger than 31 bytes.

If you were using an ESP32, you could look at ESP-IDF, it does provide more control over BLE capabilities and supports BLE 5 features.

https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/bluetooth/bt_le.html

I've never played with a Arduino Nano BLE, so you'd need to explore what's the underlying BLE 5 API

example code