Fail to get 128-bit UUID from peripheral when 20736 works in Central mode

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
LeCa_2156671
Level 4
Level 4
First like received First like given

Hi BCMs,

     We have one trouble as below.

Condition:

1. 20736 work in central mode.

2. Try to connect to one peripheral whose UUID is 128-bits.

Issue: Fail to get 128-bit UUID from peripheral when 20736 works in Central mode

Debug:

     we find out that, when 20736 call the function of blecli_ClientRsp(int len, int attr_len, UINT8 *data) in blecli.c (..\WICED-Smart-SDK-2.2.1\WICED-Smart-SDK\Wiced-Smart\bleapp\app)

     The process in this blecli_ClientRsp()

     ...

     ......

                for(i=0; i<len; i+=attr_len)

                {

                    uuid = data[i+4] + (data[i+5]<<8);

                    //ble_trace1("uuid=%04x", uuid);

                    if(uuid == cliAppState->blecli_svc_uuid)

                    {

                        found = i; //start position of uuid

           break;

                    }

                }

     Here, we see that, the UUID would be analyzed in 16-bit directly but not 128-bits.

     We try to modify this function to solve this issue, but WICED would not compile & link the file of blecli.c.

     Question: blecli.c is already burned into the internal ROM ? or could be modified by some way to solve this issue ?

     tks

0 Likes
1 Solution

Hi Lemancai,

You can't use the code in bIecli.c if you used the 128bit UUID, only handle the 16bit UUID in blecli.c, you should add code in the hello_client_process_rsp function, please refer to ancs_client_process_rsp in ancs_client.c for how to handle the 128bit UUID.

BTW, the blecli.c had been programed in ROM code, you can't modified it.

View solution in original post

0 Likes
10 Replies
BoonT_56
Employee
Employee
500 likes received 250 likes received 100 likes received

Did you have the below patch in your makefile?

APP_PATCHES_AND_LIBS += central_role_patches.a

0 Likes

Hi Boont,

     Thanks for your help.

     We checked that, in the makefile:

########################################################################

################ DO NOT MODIFY FILE BELOW THIS LINE ####################

########################################################################

# Devices that support central/scatternet role should include

# special central role patch library

APP_PATCHES_AND_LIBS += central_role_patches.a

APP_PATCHES_AND_LIBS += additional_advertisement_control.a

APP_PATCHES_AND_LIBS += thread_and_mem_mgmt.a

0 Likes

Hi Boont,

     APP_PATCHES_AND_LIBS += central_role_patches.a is include in the makefile.

     Could you help me to solve this problem ?

     Sincerely...

0 Likes

Let your peripheral broadcast. Use an iphone app (e.g. Lightblue) to detect your peripheral. Can the app detect and connect to the peripheral? Can you see the uuid being displayed?

0 Likes

Hi Boont,

     We have done the test as below:

2 peripherals, the first one is 16-bit UUID, the another one is 128-bit UUID.

and we have one bluetooth sniffer

20736 work in central mode,

1. detect and connect to the first peripheral, it could well receive the 16-bit UUID and report to App layer in 20736 application.

2. detect and connect to the second peripheral, with the sniffer, we could see the 128-bit UUID data package is sent out to 20736 from the second peripheral, but there is no report to App layer in 20736 application.

   So that, we doubt that, there is some problem when 20736 analyze 128-bit UUID. and we checked the function in blecli.c, finally we find out  the problem I list above.

0 Likes

how did you set up your central? Is your central connected to a PC to receive notifications?

0 Likes

Can you try your setup with one side being the hello-client and the other side with the hello-sensor? Let me know if the issue still occur.

0 Likes

Hi Boont,

     20736 we run hello-client.

     The 16-bit UUID peripheral is one Moto360 android phone which run one client APK we programmed.

     The 128-bit UUID peripheral is one Mi-3 android phone which run the same client APK.

     Moto360 could be connected and query the service well. and could send data to 20736 hello-client application.

     But Mi-3 is failed to be connected.

     The difference is the UUID length when we trace with the sniffer. Adv & scan are all right

     tks

0 Likes

Hi Lemancai,

You can't use the code in bIecli.c if you used the 128bit UUID, only handle the 16bit UUID in blecli.c, you should add code in the hello_client_process_rsp function, please refer to ancs_client_process_rsp in ancs_client.c for how to handle the 128bit UUID.

BTW, the blecli.c had been programed in ROM code, you can't modified it.

0 Likes

Hi Ocean,

     Thanks for your reply. We would develop the function by ourselves.

     tks

0 Likes