cancel
Showing results for 
Search instead for 
Did you mean: 

Characteristics properties

jampino
Associate II
Posted on October 26, 2017 at 14:27

Hello all,

I have a bluenrg-1 working as a master and it is connected to a bluenrg-1 working as a slave. The connection is established and it is working fine.

When I send the command aci_gatt_disc_all_primary_services() I received a response from the event aci_att_read_by_group_type_resp_event(), so I can obtain the UUID characteristic from the slave. Now I would like to know the characteristics of that UUID from the slave ( like char_properties, char_value_length). Though I can do it sending the command aci_gatt_disc_char_by_uuid(), when I send the command the response is ok but I do not get anything from the event  aci_gatt_disc_read_char_by_uuid_resp_event() as it is not called.

Am I doing it wrong or there is a better way to do it, to get the information I need from the slave?

Thank you  

4 REPLIES 4
jampino
Associate II
Posted on October 26, 2017 at 15:13

Hello,

Just if someone can confirm that, I am sending the command aci_gatt_disc_char_by_uuid( Connection_Handle, start_handle, end_handle, UUID_TYPE_128, &uuid );

UUID_TYPE_128 = 0x02

UUID_TYPE_16 = 0x01

Then if you go into that function:

tBleStatus aci_gatt_disc_char_by_uuid(uint16_t Connection_Handle,

uint16_t Start_Handle,

uint16_t End_Handle,

uint8_t UUID_Type,

UUID_t *UUID)

{

struct hci_request rq;

uint8_t cmd_buffer[258];

aci_gatt_disc_char_by_uuid_cp0 *cp0 = (aci_gatt_disc_char_by_uuid_cp0*)(cmd_buffer);

tBleStatus status = 0;

uint8_t index_input = 0;

cp0->Connection_Handle = htob(Connection_Handle, 2);

index_input += 2;

cp0->Start_Handle = htob(Start_Handle, 2);

index_input += 2;

cp0->End_Handle = htob(End_Handle, 2);

index_input += 2;

cp0->UUID_Type = htob(UUID_Type, 1);

index_input += 1;

Osal_MemCpy((void *) &cp0->UUID, (const void *) UUID, UUID_Type);  <--At that point UUID_Type value will be 2

                                                                                  so the UUID will not be copied correctly, just 2 of the bytes.

Thank you.

Antonio Vilei
Senior III
Posted on October 27, 2017 at 18:11

Hi Jamp,

if you need more information about how to perform services and characteristics discovery, I suggest to use the

http://www.st.com/content/st_com/en/products/embedded-software/wireless-connectivity-software/stsw-bnrgui.html

 tool.

It has an interactive feature called 'Service Discovery...' that lets you discover services and characteristics of peer devices (you can find it in the 'ACI Utilities' tab).

After that, you can review the individual commands and events being generated.

Best regards,

Antonio

Andrea Palmieri
ST Employee
Posted on October 31, 2017 at 09:57

Hi Jamp,

you can refer to the attached version of the bluenrg1_gatt_aci.c file fixing the UUID_Type handling. The fix will be included in the next release of the BlueNRG-1 package.

Hope that helps.

Andrea

________________

Attachments :

bluenrg1_gatt_aci.c.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HyJK&d=%2Fa%2F0X0000000b6F%2FCYckuWXbUeyAn7cgdrwOfp7zymz7XM0ttAONagXII2A&asPdf=false
Posted on October 31, 2017 at 11:00

Hello,

Thank you Antonio now I have everything more clear about it.

Cheers Andrea, yes it will help.