blue_st_sdk.features.standard_characteristics package¶
Submodules¶
blue_st_sdk.features.standard_characteristics.feature_heart_rate module¶
-
class
blue_st_sdk.features.standard_characteristics.feature_heart_rate.FeatureHeartRate(node)[source]¶ Bases:
blue_st_sdk.features.device_timestamp_feature.DeviceTimestampFeatureFeature that manages the Heart Rate’sample data as defined by the Bluetooth specification.
Refer to Heart Rate Measurement Specs for more information.
-
DATA_LENGTH_BYTES= 2¶
-
ENERGY_EXPENDED_FIELD= <blue_st_sdk.features.field.Field object>¶
-
ENERGY_EXPENDED_INDEX= 1¶
-
FEATURE_NAME= 'Heart Rate'¶
-
HEART_RATE_FIELD= <blue_st_sdk.features.field.Field object>¶
-
HEART_RATE_INDEX= 0¶
-
RR_INTERVAL_FIELD= <blue_st_sdk.features.field.Field object>¶
-
RR_INTERVAL_INDEX= 2¶
-
__init__(node)[source]¶ Build a new disabled feature, that doesn’t need to be initialized at node’sample side.
- Args:
- node (
blue_st_sdk.node.Node): Node that will update this - feature.
- node (
-
extract_data(timestamp, data, offset)[source]¶ Extract the data from the feature’s raw data. In this case it reads a 16-bit signed integer value.
- Args:
- timestamp (int): Data’s timestamp. data (str): The data read from the feature. offset (int): Offset where to start reading data.
- Returns:
blue_st_sdk.feature.ExtractedData: Container of the number of bytes read and the extracted data.- Raises:
blue_st_sdk.utils.blue_st_exceptions.BlueSTInvalidDataException- if the data array has not enough data to read.
-
classmethod
getEnergyExpended(sample)[source]¶ Extract the energy expended field from the sample.
- Args:
- sample (
blue_st_sdk.feature.Sample): The sample. - Returns:
- int: The energy expended if available, a negative number otherwise.
-
classmethod
getHeartRate(sample)[source]¶ Extract the Heart Rate from the sample.
- Args:
- sample (
blue_st_sdk.feature.Sample): The sample. - Returns:
- int: The Heart Rate if available, a negative number otherwise.
-
classmethod
getRRInterval(sample)[source]¶ Extract the RR interval field from the sample.
- Args:
- sample (
blue_st_sdk.feature.Sample): The sample. - Returns:
- float: The RR interval if available, <nan> otherwise.
-
classmethod
has8BitHeartRate(flags)[source]¶ Check if there is Heart Rate.
- Args:
- flags (int): Flags.
- Returns:
- bool: True if there is Heart Rate, False otherwise.
-
blue_st_sdk.features.standard_characteristics.standard_characteristic_to_feature_map module¶
-
class
blue_st_sdk.features.standard_characteristics.standard_characteristic_to_feature_map.StandardCharacteristicToFeatureMap[source]¶ Bases:
blue_st_sdk.utils.uuid_to_feature_map.UUIDToFeatureMapUtility class that stores in a map all the standard characteristics managed by the SDK.
-
STANDARD_FEATURE_UUID= '00002a37-0000-1000-8000-00805f9b34fb'¶ Standard feature UUID.
-