Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

GATT Characteristic Presentation Format: UNITS

Good day,

I again have an interesting question).
There is a useful descriptor to better understand the purpose of the characteristic. This is a 0x2904 handle (GATT Characteristic Presentation Format).
This question is related to the "unit" field. As part of SDK, I did not find a description of the units themselves, in connection with which I wrote a specific listing (I did not look well in SDK?).

However, there is one moment. How to specify the units for the data from the accelerometer? Accelerometer gives data in free fall units (aka g = 9.81 m/s^2) that are not standard and are missing from the list (GATT units).

Now I indicated units as acceleration. but it is confusing. So, if I give 1000 mg, then the receiving side can perceive them as 1.000 m/s^2. although it should like 9.800 m/s^2 ...

What to do in this case correctly?

Thank.

Parents
  • The below will not be perceived as weight, it will be perceived as acceleration. Seems like a good fit for your accelaration data.

    For weight (mg) you have different unit value that goes into this one.

    to get to milligram from this, you need to use the exponent of -3 in this table.

  • ,

    I khow about exponent, we use this.

    Here the question is a little different. I give the device to the user, He reads the descriptors of the characteristics and sees:
    - data type: signed, 16 bits (SINT16)
    - unit of measurement: acceleration, m/s^2
    - exponent: -3

    Now, the user receives the data (notification) and sees the number 1000.

    He should perceive it as 1000mg = 1g, But this does not correspond to the description in the descriptor. And the user thinks it is 1000 mm/s^2. I had to give an explanation in the letter.

    Your application on android (NrfConnect) behaves the same way.

Reply
  • ,

    I khow about exponent, we use this.

    Here the question is a little different. I give the device to the user, He reads the descriptors of the characteristics and sees:
    - data type: signed, 16 bits (SINT16)
    - unit of measurement: acceleration, m/s^2
    - exponent: -3

    Now, the user receives the data (notification) and sees the number 1000.

    He should perceive it as 1000mg = 1g, But this does not correspond to the description in the descriptor. And the user thinks it is 1000 mm/s^2. I had to give an explanation in the letter.

    Your application on android (NrfConnect) behaves the same way.

Children
Related