Skip to main content

<alp/ble.h> — Bluetooth Low Energy 5.4

BLE peripheral and central support.

#include <alp/ble.h>

Peripheral (advertising + GATT server)

alp_ble_t *ble = alp_ble_open(&(alp_ble_config_t){
.role = ALP_BLE_ROLE_PERIPHERAL,
.device_name = "ALP-Sensor-01",
});

alp_ble_advertise(ble, &(alp_ble_adv_config_t){
.interval_ms = 100,
.connectable = true,
});

// GATT service registration via alp_ble_gatt_register_service(...)

Central (scan + connect)

alp_ble_t *ble = alp_ble_open(&(alp_ble_config_t){
.role = ALP_BLE_ROLE_CENTRAL,
});

void on_device(const alp_ble_scan_result_t *r, void *user) { /* ... */ }
alp_ble_scan_start(ble, on_device, NULL);

Backend

  • AEN family — BLE rides the same TI CC3501E coprocessor as Wi-Fi. See the CC3501E section.
  • V2N family — BLE rides the Murata LBEE5HY2FY-922 combo module (UART HCI).

The application API is identical.

board.yaml

iot:
ble: true

See also

Questions about this page? Discuss in Community Forum