This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

how to built a 128 UUID bit

Hallo comunnity

I have a sensor which is working is sending data via BLE and it has a 128 UUID bit service [0x 000000-000000-1000-8000-0080-5F9B34FB] image description

In order to do the discovery i should add it using sd_ble_uuid_vs_add () But I´ve problem there, in my code, the ble_uuid_t is not accepting me the .uuid, it gives me the follwing error: aggregate value used where an integer was expected.

static ble_uuid128_t  quatServ128uuidd= {{0xFB, 0x34, 0x9B, 0x5F, 0x80, 0x00,
                0x00, 0x80, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}};

static ble_uuid_t const QUAT_UUID_SERVICE =
{
	.uuid = (uint16_t) quatServ128uuidd,
	.type = BLE_UUID_TYPE_VENDOR_BEGIN
};
err_code = sd_ble_gattc_primary_services_discover(m_conn_handle, start_handle, &QUAT_UUID_SERVICE);

But In the ble_uuid_t I've problems to set it up.

Other questions it is about the ble_gattc_write_params_t, I have problem in the handle and p_value. When I compile ,it says: initializer element is not constant.

static uint16_t  handle	 	= 0x0022;		/**<Quaternios handle>*/
static uint8_t* const p_value			= {0x01, 0x01};	/**<Activiation for the 
notifications>*/
 /**<Parameters for notifications>*/
static  ble_gattc_write_params_t const write_params =
{
	.write_op 	= BLE_GATT_OP_WRITE_CMD,
	.flags		= BLE_GATT_EXEC_WRITE_FLAG_PREPARED_WRITE,
	.handle		= handle,
	.offset		= 0,
	.len		= sizeof(p_value),
	.p_value	= p_value
}

Regards,

David Caraveo

Parents
  • As Turbo J explained, Nordic Soft Device runs (in the spirit of BT SIG) on 16-bit short UUIDs and 128-bit base UIDs during any GATT operation. So you will get structure of short 2-byte UUID value and reference to internal "table" of 16-byte UUID bases. By default Soft Device knows only BT SIG one and all the rest is treated as "unknown". If you know at start up which proprietary UUIDs you will use then you can provision them to the Soft Device (but you will need to remember which index is which). If not then you can either do it later during run-time or simply do this outside of Soft Device by reading full 128-bit UUID value by proper GATT commands (this is applicable for GATT Client only of course).

Reply
  • As Turbo J explained, Nordic Soft Device runs (in the spirit of BT SIG) on 16-bit short UUIDs and 128-bit base UIDs during any GATT operation. So you will get structure of short 2-byte UUID value and reference to internal "table" of 16-byte UUID bases. By default Soft Device knows only BT SIG one and all the rest is treated as "unknown". If you know at start up which proprietary UUIDs you will use then you can provision them to the Soft Device (but you will need to remember which index is which). If not then you can either do it later during run-time or simply do this outside of Soft Device by reading full 128-bit UUID value by proper GATT commands (this is applicable for GATT Client only of course).

Children
No Data
Related