Characteristic UUID does not match the _uuid argument to the BT_GATT_CHARACTERISTIC macro

Hello support team,

I'm building a FTMS application on a nRF52840 Dongle amd am struggling with the characteristic UUID's broadcast for my service.

Firstly, I am using the Nordic SDK macros to try and create the service.  It is a FTMS service (0x1826) with a Fitness Machine Feature (0x2ACC) characteristic and an Indoor Bike Data (0x2AD2) characteristic.  Creation of the service and the notification function (FM Feature is a read characteristic, Indoor Bike Data is a notification) are as follows:

static uint32_t feat_blsc;

static ssize_t read_feat(struct bt_conn *conn, const struct bt_gatt_attr *attr,
			 void *buf, uint16_t len, uint16_t offset)
{
	return bt_gatt_attr_read(conn, attr, buf, len, offset, &feat_blsc,
				 sizeof(feat_blsc));
}
#define BT_UUID_FTMS_VAL 0x1826
#define BT_UUID_FTMS BT_UUID_DECLARE_16(BT_UUID_FTMS_VAL)
BT_GATT_SERVICE_DEFINE(ftms_svc,
	BT_GATT_PRIMARY_SERVICE(BT_UUID_FTMS),
	BT_GATT_CHARACTERISTIC(BLE_UUID_INDOOR_BIKE_DATA_CHAR, BT_GATT_CHRC_NOTIFY,
			       BT_GATT_PERM_NONE, NULL, NULL, NULL),
	BT_GATT_CCC(ftms_ccc_cfg_changed, FTMS_GATT_PERM_DEFAULT),
	BT_GATT_CHARACTERISTIC(BLE_UUID_FTMS_FEATURE_CHAR, BT_GATT_CHRC_READ,
			       BT_GATT_PERM_READ, read_feat, NULL, NULL),
	BT_GATT_CCC(ftms_ccc_cfg_changed, FTMS_GATT_PERM_DEFAULT),
);
// ....
int bt_ftms_notify()
{
	int rc;
    static ble_ftms_indoor_bike_data_t data;
    // Populatle data

	rc = bt_gatt_notify(NULL, &ftms_svc.attrs[1], &data, sizeof(data));
	return rc == -ENOTCONN ? 0 : rc;
}

But using a discovery app I find the UUID's for the characteristics are not as expected:

I expected 0000xxxx-0000-1000-8000-00805F9B34FB for both, but got two 128-bit UUID's that look completely different and do not contain the 2 above (0x2ACA and 0x2AD2).

Is there a reason why the macro isn't using my provided 16-bit UUID's to build the standard 128-bit UUID?

Parents Reply Children
No Data
Related