blue_st_sdk.advertising_data package

Submodules

blue_st_sdk.advertising_data.ble_advertising_data module

ble_advertising_data

The ble_advertising_data module keeps the information contained within the advertising data coming from Bluetooth devices.

class blue_st_sdk.advertising_data.ble_advertising_data.BLEAdvertisingData[source]

Bases: object

Interface that defines the advertising data.

get_address()[source]

Get the device MAC address.

Returns:
str: The device MAC address.
Raises:
NotImplementedError if the method has not been implemented.
get_device_id()[source]

Get the device identifier.

Returns:
int: The device identifier.
Raises:
NotImplementedError if the method has not been implemented.
get_device_type()[source]

Get the device’s type.

Returns:
The device’s type.
Raises:
NotImplementedError if the method has not been implemented.
get_feature_mask()[source]

Get the bitmask that keeps track of the available features.

Returns:
The bitmask that keeps track of the available features.
Raises:
NotImplementedError if the method has not been implemented.
get_name()[source]

Get the device name.

Returns:
str: The device name.
Raises:
NotImplementedError if the method has not been implemented.
get_protocol_version()[source]

Get the device protocol version.

Returns:
int: The device protocol version.
Raises:
NotImplementedError if the method has not been implemented.
get_tx_power()[source]

Get the device transmission power in mdb.

Returns:
int: The device transmission power in mdb.
Raises:
NotImplementedError if the method has not been implemented.
is_device_sleeping()[source]

Check whether the device is sleeping.

Returns:
True if the device is sleeping, False otherwise.
Raises:
NotImplementedError if the method has not been implemented.

blue_st_sdk.advertising_data.ble_advertising_data_parser module

ble_advertising_data_parser

The ble_advertising_data_parser module contains tools to parse the advertising data coming from Bluetooth devices.

class blue_st_sdk.advertising_data.ble_advertising_data_parser.BLEAdvertisingDataParser[source]

Bases: object

Interface to parse the advertising data sent by a Bluetooth device.

classmethod parse(advertising_data)[source]

Parse the BLE advertising_data.

Args:
advertising_data (list): BLE advertising_data.
Returns:
blue_st_sdk.advertising_data.blue_st_advertising_data.BLEAdvertisingData: The advertising data information sent by the device.
Raises:
NotImplementedError if the method has not been implemented.

blue_st_sdk.advertising_data.blue_st_advertising_data module

blue_st_advertising_data

The blue_st_advertising_data module keeps the information contained within the advertising data coming from Bluetooth devices implementing the Blue ST protocol.

class blue_st_sdk.advertising_data.blue_st_advertising_data.BlueSTAdvertisingData(name, tx_power, address, device_id, device_type, protocol_version, feature_mask, sleeping)[source]

Bases: blue_st_sdk.advertising_data.ble_advertising_data.BLEAdvertisingData

Advertising data sent by a device that follows the BlueST protocol.

__init__(name, tx_power, address, device_id, device_type, protocol_version, feature_mask, sleeping)[source]

Constructor.

Args:
name (str): The device name. tx_power (int): The device transmission power. address (str): The device MAC address. device_id (int): The device identifier. device_type (blue_st_sdk.node.NodeType): The type of the node. protocol_version (int): The device Protocol Version. feature_mask (int): The bitmask that keeps track of the available features. sleeping (bool): The device sleeping status.
get_address()[source]

Get the device MAC address.

Returns:
str: The device MAC address.
get_device_id()[source]

Get the device identifier.

Returns:
int: The device identifier.
get_device_type()[source]

Get the device’s type.

Returns:
The device’s type.
get_feature_mask()[source]

Get the bitmask that keeps track of the available features.

Returns:
The bitmask that keeps track of the available features.
get_name()[source]

Get the device name.

Returns:
str: The device name.
get_protocol_version()[source]

Get the device protocol version.

Returns:
int: The device protocol version.
get_tx_power()[source]

Get the device transmission power in mdb.

Returns:
int: The device transmission power in mdb.
is_sleeping()[source]

Check whether the device is sleeping.

Returns:
True if the device is sleeping, False otherwise.

blue_st_sdk.advertising_data.blue_st_advertising_data_parser module

blue_st_advertising_data_parser

The blue_st_advertising_data_parser module contains tools to parse the advertising data coming from Bluetooth devices implementing the Blue ST protocol.

class blue_st_sdk.advertising_data.blue_st_advertising_data_parser.BlueSTAdvertisingDataParser[source]

Bases: blue_st_sdk.advertising_data.ble_advertising_data_parser.BLEAdvertisingDataParser

Advertising data sent by a device that follows the BlueST protocol.

ADVERTISING_DATA_MANUFACTURER_LENGTH_1 = 7

Allowed length for the advertising data manufacturer in bytes.

ADVERTISING_DATA_MANUFACTURER_LENGTH_2 = 13

Allowed length for the advertising data manufacturer in bytes.

VERSION_PROTOCOL_SUPPORTED_MAX = 1

Maximum version protocol supported.

VERSION_PROTOCOL_SUPPORTED_MIN = 1

Minimum version protocol supported.

classmethod parse(advertising_data)[source]

Parse the BLE advertising_data.

Args:
advertising_data (list): BLE advertising_data.
Returns:
blue_st_sdk.advertising_data.ble_advertising_data.BLEAdvertisingData: The advertising data information sent by the device.
Raises:
blue_st_sdk.utils.blue_st_exceptions.BlueSTInvalidAdvertisingDataException is raised if the advertising data is not well formed.

Module contents