Direct-BT v3.3.0-1-gc2d430c
Direct-BT - Direct Bluetooth Programming.
Public Types | Static Public Member Functions | List of all members
ieee11073::FloatTypes Class Reference

IEEE11073 Float Data Types. More...

#include <DataTypes.hpp>

Collaboration diagram for ieee11073::FloatTypes:

Public Types

enum  ReservedFloatValues : int32_t {
  MDER_POSITIVE_INFINITY = 0x007FFFFE , MDER_NaN = 0x007FFFFF , MDER_NRes = 0x00800000 , MDER_RESERVED_VALUE = 0x00800001 ,
  MDER_NEGATIVE_INFINITY = 0x00800002
}
 
enum  ReservedSFloatValues : int16_t {
  MDER_S_POSITIVE_INFINITY = 0x07FE , MDER_S_NaN = 0x07FF , MDER_S_NRes = 0x0800 , MDER_S_RESERVED_VALUE = 0x0801 ,
  MDER_S_NEGATIVE_INFINITY = 0x0802
}
 

Static Public Member Functions

static float float16_IEEE11073_to_IEEE754 (const uint16_t raw_bt_float16_le)
 Converts a 'IEEE-11073 16-bit SFLOAT' to std IEEE754 float. More...
 
static float float32_IEEE11073_to_IEEE754 (const uint32_t raw_bt_float32_le)
 Converts a 'IEEE-11073 32-bit FLOAT' to std IEEE754 float. More...
 

Detailed Description

IEEE11073 Float Data Types.

Definition at line 99 of file DataTypes.hpp.

Member Enumeration Documentation

◆ ReservedFloatValues

Enumerator
MDER_POSITIVE_INFINITY 
MDER_NaN 
MDER_NRes 
MDER_RESERVED_VALUE 
MDER_NEGATIVE_INFINITY 

Definition at line 101 of file DataTypes.hpp.

◆ ReservedSFloatValues

Enumerator
MDER_S_POSITIVE_INFINITY 
MDER_S_NaN 
MDER_S_NRes 
MDER_S_RESERVED_VALUE 
MDER_S_NEGATIVE_INFINITY 

Definition at line 109 of file DataTypes.hpp.

Member Function Documentation

◆ float16_IEEE11073_to_IEEE754()

float FloatTypes::float16_IEEE11073_to_IEEE754 ( const uint16_t  raw_bt_float16_le)
static

Converts a 'IEEE-11073 16-bit SFLOAT' to std IEEE754 float.

raw_bt_float16_le is in little-endian, 2 bytes. Exponent at highest byte.

Definition at line 81 of file DataTypes.cpp.

◆ float32_IEEE11073_to_IEEE754()

float FloatTypes::float32_IEEE11073_to_IEEE754 ( const uint32_t  raw_bt_float32_le)
static

Converts a 'IEEE-11073 32-bit FLOAT' to std IEEE754 float.

Example: Temperature measurement, GattCharacteristicType::TEMPERATURE_MEASUREMENT.

raw_bt_float32_le is in little-endian, 4 bytes. Exponent at highest byte.

Definition at line 99 of file DataTypes.cpp.

Here is the caller graph for this function:

The documentation for this class was generated from the following files: