The format field determines how a single value contained in the Characteristic Value is formatted.
If a format is not a whole number of octets, then the data shall be contained within the least significant bits of the value, and all other bits shall be set to zero on transmission and ignored upon receipt. If the Characteristic Value is less than an octet, it occupies an entire octet. The following format values are defined:
Format | Short Name | Description | Exponent Value |
---|---|---|---|
0x00 | rfu | Reserved for future use | No |
0x01 | boolean | unsigned 1-bit; 0=false, 1=true | No |
0x02 | 2bit | unsigned 2-bit integer | No |
0x03 | nibble | unsigned 4-bit integer | No |
0x04 | uint8 | unsigned 8-bit integer | Yes |
0x05 | uint12 | unsigned 12-bit integer | Yes |
0x06 | uint16 | unsigned 16-bit integer | Yes |
0x07 | uint24 | unsigned 24-bit integer | Yes |
0x08 | uint32 | unsigned 32-bit integer | Yes |
0x09 | uint48 | unsigned 48-bit integer | Yes |
0x0A | uint64 | unsigned 64-bit integer | Yes |
0x0B | uint128 | unsigned 128-bit integer | Yes |
0x0C | sint8 | signed 8-bit integer | Yes |
0x0D | sint12 | signed 12-bit integer | Yes |
0x0E | sint16 | signed 16-bit integer | Yes |
0x0F | sint24 | signed 24-bit integer | Yes |
0x10 | sint32 | signed 32-bit integer | Yes |
0x11 | sint48 | signed 48-bit integer | Yes |
0x12 | sint64 | signed 64-bit integer | Yes |
0x13 | sint128 | signed 128-bit integer | Yes |
0x14 | float32 | IEEE-754 32-bit floating point | No |
0x15 | float64 | IEEE-754 64-bit floating point | No |
0x16 | SFLOAT | IEEE-11073 16-bit SFLOAT | No |
0x17 | FLOAT | IEEE-11073 32-bit FLOAT | No |
0x18 | duint16 | IEEE-20601 format | No |
0x19 | utf8s | UTF-8 string | No |
0x1A | utf16s | UTF-16 string | No |
0x1B | struct | Opaque structure | No |
0x1C-0xFF | rfu | Reserved for Future Use | No |
Additional Formatting Notes
- When encoding an IPv4 address, the uint32 Format type shall be used.
- When encoding an IPv6 address, the uint128 Format type shall be used.
- When encoding a Bluetooth BD_ADDR, the uint48 Format type shall be used.
- A duint16 is two uint16 values concatenated together.