User Description from Smart Designer shows up blank

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

cross mob
Anonymous
Not applicable

Hi,

I'm testing out creation of some custom service / characteristics using the Smart Designer.  I've seen other BLE devices provide a textual user description for vendor-specified services and attributes, so I was trying to implement similar in my application.

I've created a custom service with a custom attribute in the designer and added the User Description as shown here:

Smart_User_Desc.png

When I build and push the compiled code to the chip, the corresponding characteristic does show up with a User Description, but the description text shows up as blank.  Is there anything I can do to make the text show up correctly?

It looks like the GATT DB content generated by the designer (User Description only) in my _db.c looks like:

    //<UserDescription>

    //<Value>Test description</Value>

    CHAR_DESCRIPTOR_UUID16 (HDLD_TEST_SERVICE_TEST_ATTRIBUTE_USER_DESCRIPTION,

                    UUID_DESCRIPTOR_CHARACTERISTIC_USER_DESCRIPTION,

                    LEGATTDB_PERM_READABLE, 16),

    //UTF-8 <User Description> Test description

    'T','e','s','t',' ','d','e','s','c','r','i','p','t','i','o','n',

I'm testing using LightBlue on an iOS device.

7 Replies
MichaelF_56
Moderator
Moderator
Moderator
250 sign-ins 25 comments on blog 10 comments on blog

Have you been through the 30 minute video that j.t put together here: WICED Smart Video BLOG: SDK 2.1 Smart Designer Tool Walk-Thru

Pay particular attention to the "To-Do" items that he mentions because while Smart Designer does automate some of the building of the code for you in the area of GATT DB creation and GPIO setup, there are still several things ("To-Do") that you will need to code yourself.

0 Likes
Anonymous
Not applicable

I went through the video, but while it goes through creation of service descriptions, I didn't see any usage of user description (which is a separate tab).

I can understand if this feature is one I have to modify manually, but this one already does change behavior on the device when I modify it in the designer, and it's not clear how I should modify designer output to get the description I'm looking for.

re: j.t.: I'm using SDK version 2.1.1.  I just verified in the Help->About page.  I did install 2.1.0 previously, in case that makes a difference.

0 Likes
Anonymous
Not applicable

Hello crhalvorson,

Here is how I configured the User Description in the Smart Designer

pastedImage_0.png

Here is the wic file:

pastedImage_1.png

and here is the User Description in the .c file:

pastedImage_2.png

We recommend our Android WICED Explorer to act as a Central and you should see the Characteristic value of crhalvorson displayed.

What Characteristic values are displayed for you now?

Thanks

JT

Anonymous
Not applicable

Hi JT,

I set up the characteristic and user description exactly as you have (with a user description of crhalvorson and Include User Description checked).

Here is the Service and Characteristic information:

service-char.png

  I installed Android WICED Explorer as you described, and it shows me this information for the characteristic:

Screenshot_2014-10-14-16-40-23.png

I see my vendor specific characteristic's default value of 11 here, but I don't see any way to view the User Description for the characteristic that I had set in the designer.  Is there a way to view this information in the app?

Thanks!

0 Likes
Anonymous
Not applicable

Hello crhalvorson,

Have you checked the Read in the Properties Tab?

pastedImage_0.png

Thanks,

JT

0 Likes
Anonymous
Not applicable

Hello crhalvorson,

Are you using SDK 2.1.1?

Thanks

JT

0 Likes
Anonymous
Not applicable

Hi,

Not sure if you ended up solving your problem here but I thought I would post my solution since it took me a great deal of time to come to.

After testing for a very long time I came to find that iOS does not like the values that the "WICED Smart Designer" assigns to the handles of the descriptors. The best explanation I could come up with would be that the descriptor handles are too far from their characteristic and the iOS bluetooth system cannot work out which characteristic they belong to. I found that changing the values of the handles so that they are in consecutive order fixes this problem.

As an example, the handle values for my attributes that the designer created were:

0x0300 - My Main Service

0x0310 - First Characteristic

0x0311 - First Characteristic Value

0x0320 - First Characteristic User Description

0x0330 - First Characteristic Client Configuration

0x0340 - Second Characteristic

0x0341 - Second Characteristic Value

0x0350 - Second Characteristic User Description

0x0360 - Second Characteristic Client Configuration

and so on...

When I tried to connect to this it would not be able to retrieve the values of the User Description or Client Configuration for any of the characteristics. In the bluetooth logs the following error was displayed:

2016-01-19T19:49:37.752 GattGateway.cpp:393       discoverAllCharacteristicDescriptors Notice     ATT        Finding all descriptors for characteristic handle 0x0310 on device "01B92C24-714D-7361-C6D5-15692166CE63"

2016-01-19T19:49:37.752 GattCommands.cpp:838      runCommand           Notice     ATT        Attempting to discover descriptors in range [0x0312, 0x033F] on device "01B92C24-714D-7361-C6D5-15692166CE63"

2016-01-19T19:49:37.870 GattDatabase.cpp:605      addDescriptor        Info       ATT        Found service "0x0300 Primary Service      [ UUID: 56BB95E0-BA0A-71B1-9540-76C333A71040, endHandle: 0x03B0 ]" for descriptor "0x0320 User Description     [ "" ]"

2016-01-19T19:49:37.870 GattDatabase.cpp:647      addDescriptor        Error      ATT        Dropping descriptor "0x0320 User Description     [ "" ]" as we couldn't find a parent characteristic

It seems that the iOS system starts searching for descriptors correctly but then is unable to read them correctly or attribute them to the correct characteristic.

I then went into the configuration an manually changed all of the handle values to:

0x0300 - My Main Service

0x0310 - First Characteristic

0x0311 - First Characteristic Value

0x0312 - First Characteristic User Description

0x0313 - First Characteristic Client Configuration

0x0340 - Second Characteristic

0x0341 - Second Characteristic Value

0x0342 - Second Characteristic User Description

0x0343 - Second Characteristic Client Configuration

and so on...

Then the user descriptions and client configurations were visible. Please note that if you are going to do this yourself make sure to do the following steps:

1. Perform a clean by going to Project->Clean since the C compiler will ignore changes to #defines when doing an incremental build.

2. Build and load the image onto your chip.

3. Reset the chip

4. On your iOS device turn Bluetooth off and then on again to reset the cache that iOS uses to speed up characteristic discovery

5. You may also need to force quit your app, but this isn't necessary if you are using LightBlue

Hope this Helps!

0 Likes