This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to setting the "Characteristic Presentation Format" in BLE stack V1.3?

Hi all,

i try to setting the  "Characteristic Presentation Format" of Thermometer example code in BLE stack V1.3.

But i don't understand the following code from Thermometerservice.c line:193.

// 4. Presentation Format

{

{ ATT_BT_UUID_SIZE, charFormatUUID },

GATT_PERMIT_READ,

0,

(uint8 *)&thermometerTempFormat (PS. static uint8 thermometerTempFormat = 12;)

},

I found from BLUETOOTH SPECIFICATION Version 4.0 [Vol 3] as the following table.

I don't understand why the Presentation Format is declared as in Thermometerservice.c?

What is the relationship between the code and the specification?

Do any document to explain it?

3.3.3.5 Characteristic Presentation Format :

Attribute Handle 

Attribute Type

Attribute Value

Attribute Permissions

0xNNNN

0x2904 – UUID for «Character- istic Format» 

Format

Exponent

Unit

Name Space 

Description

Read only
No Authentication, NO authorization 


Thanks!!

Peter.

  • Hi Peter,

    Looking at the Health Thermometer Service spec i can't see any reference to presentation format. Indeed this seems to be defined anyway by the spec for the measurement characteristic. It may be that the app is designed after an older version of the profile spec.

    I'd say remove the presentation format entirely. I'll report this as a bug.

    Best regards,
    Aslak 

  • The "Characteristic Presentation Format" still seems to be missing from the Simplink stack.  I have lots of custom GATT characteristics and I'd love to use the BLE "format" field to indicate the value types so my master software can be more adaptable.  Am I missing something in the TI documentation?

  • Kevin,

    Considering at least the CC2640R2 SDK, the characteristic presentation format UUID is defined in gatt_uuid.h.

    In any case the UUID is 0x2904.

    If you want to add a presentation format, just add an attribute to a characteristic, give the attribute that UUID, and format the content after the spec: 

    Looks like you should implement it as an array of 7 bytes, perhaps uinion'ed with a packed struct if you want the compiler to do the setting and getting.

    If by "missing" you mean there are no defines and so on already made, I think you're right.

    Best regards,
    Aslak

  • Thanks for the info!  I got it setup and it seems to be working.  Now if I can only get it on the Android end...