adi_spo2_watch.application package¶
Subpackages¶
Submodules¶
adi_spo2_watch.application.ad7156_application module¶
- class adi_spo2_watch.application.ad7156_application.AD7156Application(packet_manager)¶
Bases:
CommonStream
AD7156 Application class.
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_ad7156_application()
- delete_device_configuration_block() Dict ¶
Deletes AD7156 Device configuration block.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_ad7156_application() application.delete_device_configuration_block()
- disable_csv_logging() None ¶
Stops logging stream data into CSV.
- Returns:
None
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_ad7156_application() x = application.disable_csv_logging()
- enable_csv_logging(filename: str, header: List = None) None ¶
Start logging stream data into CSV.
- Parameters:
filename – Name of the CSV file.
header – Header list of the CSV file.
- Returns:
None
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_ad7156_application() x = application.enable_csv_logging("ad7156.csv")
- static get_supported_streams() List[Stream] ¶
List all supported streams.
- Returns:
Array of stream ID enums.
- Return type:
List[Stream]
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_adpd_application() x = application.get_supported_streams() print(x) # [<Stream.ADPD1: ['0xC2', '0x11']>, ... , <Stream.ADPD12: ['0xC2', '0x1D']>]
- load_configuration() Dict ¶
Loads configuration.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_ad7156_application() x = application.load_configuration() print(x["payload"]["status"]) # CommonStatus.OK
- read_device_configuration_block() Dict ¶
Returns entire device configuration block.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_ad7156_application() x = application.read_device_configuration_block() print(x["payload"]["data"]) # []
- read_register(addresses: List[int]) Dict ¶
Reads the register values of specified addresses. This function takes a list of addresses to read, and returns a response packet as dictionary containing addresses and values.
- Parameters:
addresses (List[int]) – List of register addresses to read.
- Returns:
A response packet as dictionary
- Return type:
Dict
Address Lower Limit
Address Upper Limit
0x00
0x17
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_ad7156_application() x = application.read_register([0x10, 0x12]) print(x["payload"]["data"]) # [['0x10', '0x0'], ['0x12', '0x0']]
- write_device_configuration_block(addresses_values: List[List[int]]) Dict ¶
Writes the device configuration block values of specified addresses. This function takes a list of addresses and values to write, and returns a response packet as dictionary containing addresses and values.
- Parameters:
addresses_values (List[List[int]]) – List of addresses and values to write.
- Returns:
A response packet as dictionary.
- Return type:
Dict
Address Lower Limit
Address Upper Limit
0x09
0x12
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_ad7156_application() x = application.write_device_configuration_block([[0x10, 2], [0x12, 0x1]]) print(x["payload"]["size"]) # 2
- write_device_configuration_block_from_file(filename: str) Dict ¶
Writes the device configuration block values of specified addresses from file.
- Parameters:
filename – dcb filename
- Returns:
A response packet as dictionary.
- Return type:
Dict
Address Lower Limit
Address Upper Limit
0x09
0x12
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_ad7156_application() application.write_device_configuration_block_from_file("adxl_dcb.dcfg")
- write_register(addresses_values: List[List[int]]) Dict ¶
Writes the register values of specified addresses. This function takes a list of addresses and values to write, and returns a response packet as dictionary containing addresses and values.
- Parameters:
addresses_values (List[List[int]]) – List of register addresses and values to write.
- Returns:
A response packet as dictionary.
- Return type:
Dict
Address Lower Limit
Address Upper Limit
0x09
0x12
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_ad7156_application() x = application.write_register([[0x10, 0x1], [0x12, 0x2]]) print(x["payload"]["data"]) # [['0x10', '0x1'], ['0x12', '0x2']]
adi_spo2_watch.application.adp5360_application module¶
- class adi_spo2_watch.application.adp5360_application.ADP5360Application(packet_manager)¶
Bases:
CommonApplication
Battery Application class.
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_adp5360_application()
- STREAM_BATTERY = [198, 145]¶
- delete_device_configuration_block() Dict ¶
Deletes PM Device configuration block.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_adp5360_application() application.delete_device_configuration_block()
- disable_csv_logging() None ¶
Stops logging stream data into CSV.
- Returns:
None
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_adp5360_application() x = application.disable_csv_logging()
- enable_csv_logging(filename: str, header: List = None) None ¶
Start logging stream data into CSV.
- Parameters:
filename – Name of the CSV file.
header – Header list of the CSV file.
- Returns:
None
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_adp5360_application() x = application.enable_csv_logging("adp.csv")
- get_battery_info() Dict ¶
Returns device current battery information.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_adp5360_application() x = application.get_battery_info() print(x["payload"]["battery_status"], x["payload"]["battery_level"]) # BatteryStatus.COMPLETE 100
- get_battery_threshold() Dict ¶
get low and critical level threshold for device battery.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_test_application() x = application.get_battery_threshold() print(x["payload"]["status"]) # PMStatus.OK
- static get_supported_streams() List[Stream] ¶
List all supported streams.
- Returns:
Array of stream ID enums.
- Return type:
List[Stream]
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_adpd_application() x = application.get_supported_streams() print(x) # [<Stream.ADPD1: ['0xC2', '0x11']>, ... , <Stream.ADPD12: ['0xC2', '0x1D']>]
- read_device_configuration_block() Dict ¶
Returns entire device configuration block.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_adp5360_application() x = application.read_device_configuration_block() print(x["payload"]["dcb_data"]) # []
- read_register(addresses: List[int]) Dict ¶
Reads the register values of specified addresses. This function takes a list of addresses to read, and returns a response packet as dictionary containing addresses and values.
- Parameters:
addresses (List[int]) – List of register addresses to read.
- Returns:
A response packet as dictionary
- Return type:
Dict
Address Lower Limit
Address Upper Limit
0x00
0x36
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_adp5360_application() x = application.read_register([0x15, 0x20, 0x2E]) print(x["payload"]["data"]) # [['0x15', '0x0'], ['0x20', '0x0'], ['0x2E', '0x0']]
- set_battery_threshold(low_level: int, critical_level: int, download_level: int) Dict ¶
Set low and critical level threshold for device battery.
- Parameters:
low_level (int) – low level threshold for device battery.
critical_level (int) – critical level threshold for device battery.
download_level (int) – download level.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_test_application() x = application.set_battery_threshold(15, 10, 20) print(x["payload"]["status"]) # PMStatus.OK
- set_callback(callback_function: ~typing.Callable, args: ~typing.Tuple = (), stream: ~adi_spo2_watch.core.enums.common_enums.Stream = <Stream.BATTERY: ['0xC6', '0x91']>) None ¶
Sets the callback for the stream data.
- Parameters:
callback_function – callback function for specified adpd stream.
args – optional arguments that will be passed with the callback.
stream (Stream) – Callback for specified stream, use get_supported_streams() to list all supported streams.
- Returns:
None
from adi_spo2_watch import SDK # make sure optional arguments have default value to prevent them causing Exceptions. def callback(data, optional1=None, optional2=None): print(data) sdk = SDK("COM4") application = sdk.get_adp5360_application() # these optional arguments can be used to pass file, matplotlib or other objects to manipulate data. optional_arg1 = "1" optional_arg2 = "2" application.set_callback(callback, args=(optional_arg1, optional_arg2))
- subscribe_stream(stream: ~adi_spo2_watch.core.enums.common_enums.Stream = <Stream.BATTERY: ['0xC6', '0x91']>)¶
Subscribe to the stream.
- Parameters:
stream – stream name, use get_supported_streams() to list all supported streams.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_adp5360_application() subs_stream = application.subscribe_stream(STREAM_BATTERY) print(subs_stream["payload"]["status"]) # CommonStatus.SUBSCRIBER_ADDED
- unsubscribe_stream(stream: Stream = None)¶
Unsubscribe the stream.
- Parameters:
stream – stream name, use get_supported_streams() to list all supported streams.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_adp5360_application() unsubscribe_stream = application.unsubscribe_stream() print(unsubscribe_stream["payload"]["status"]) # CommonStatus.SUBSCRIBER_REMOVED
- write_device_configuration_block(addresses_values: List[List[int]]) Dict ¶
Writes the device configuration block values of specified addresses. This function takes a list of addresses and values to write, and returns a response packet as dictionary containing addresses and values.
- Parameters:
addresses_values (List[List[int]]) – List of addresses and values to write.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_adp5360_application() x = application.write_device_configuration_block([[0x2, 2], [0x1, 0x1]]) print(x["payload"]["size"]) # 2
- write_device_configuration_block_from_file(filename: str) Dict ¶
Writes the device configuration block values of specified addresses from file.
- Parameters:
filename – dcb filename
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_adp5360_application() application.write_device_configuration_block_from_file("pm_dcb.dcfg")
- write_register(addresses_values: List[List[int]]) Dict ¶
Writes the register values of specified addresses. This function takes a list of addresses and values to write, and returns a response packet as dictionary containing addresses and values.
- Parameters:
addresses_values (List[List[int]]) – List of register addresses and values to write.
- Returns:
A response packet as dictionary.
- Return type:
Dict
Address ranges
[0x2-0x7], [0xA-0xE], [0x11-0x22], [0x27-0x2E], [0x30-0x33], [0x36]
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_adp5360_application() x = application.write_register([[0x20, 0x1], [0x21, 0x2], [0x2E, 0x3]]) print(x["payload"]["data"]) # [['0x20', '0x1'], ['0x21', '0x2'], ['0x2E', '0x3']]
adi_spo2_watch.application.bia_application module¶
- class adi_spo2_watch.application.bia_application.BIAApplication(packet_manager)¶
Bases:
CommonStream
BIA Application class.
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_bia_application()
- BIA_DCFG_BLOCK = [17]¶
- BIA_LCFG_BLOCK = [16]¶
- DFT_WINDOW_1024 = [0, 8]¶
- DFT_WINDOW_128 = [0, 5]¶
- DFT_WINDOW_16 = [0, 2]¶
- DFT_WINDOW_16384 = [0, 18]¶
- DFT_WINDOW_2048 = [0, 9]¶
- DFT_WINDOW_256 = [0, 6]¶
- DFT_WINDOW_32 = [0, 3]¶
- DFT_WINDOW_4 = [0, 0]¶
- DFT_WINDOW_4096 = [0, 16]¶
- DFT_WINDOW_512 = [0, 7]¶
- DFT_WINDOW_64 = [0, 4]¶
- DFT_WINDOW_8 = [0, 1]¶
- DFT_WINDOW_8192 = [0, 17]¶
- RESISTOR_1K = [0, 1]¶
- RESISTOR_200 = [0, 0]¶
- RESISTOR_5K = [0, 2]¶
- STREAM_BCM = [200, 20]¶
- STREAM_BIA = [196, 7]¶
- calibrate_hs_resistor_tia(hs_resistor_tia_id: HSResistorTIA) Dict ¶
Calibrate High Speed Resistor Trans Impedance Amplifier.
- Parameters:
hs_resistor_tia_id (HSResistorTIA) – High Speed Resistor Trans Impedance Amplifier to calibrate, | use get_supported_hs_resistor_tia_ids() to list all supported resistor.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_bia_application() x = application.get_supported_hs_resistor_tia_ids() print(x) # [<HSResistorTIA.RESISTOR_200: ['0x0', '0x0']>, ... , <HSResistorTIA.RESISTOR_5K: ['0x0', '0x2']>] x = application.calibrate_hs_resistor_tia(application.RESISTOR_1K) print(x["payload"]["hs_resistor_tia"]) # HSResistorTIA.RESISTOR_1K
- delete_device_configuration_block(dcb_block_index: DCBConfigBlockIndex) Dict ¶
Deletes BIA Device configuration block. use dcb_flag to see if packet is for lcfg or dcfg.
- Parameters:
dcb_block_index – dcb block index (lcfg/dcfg), use get_supported_dcb_block() to get all supported DCB index.
- Returns:
A response packet as dictionary.
- Return type:
dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_bia_application() application.delete_device_configuration_block()
- disable_csv_logging(stream: ~adi_spo2_watch.core.enums.common_enums.Stream = <Stream.BIA: ['0xC4', '0x07']>) None ¶
Stops logging stream data into CSV.
- Parameters:
stream – stream name, use get_supported_streams() to list all supported streams.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_bia_application() x = application.disable_csv_logging()
- enable_csv_logging(filename: str, header: ~typing.List = None, stream: ~adi_spo2_watch.core.enums.common_enums.Stream = <Stream.BIA: ['0xC4', '0x07']>) None ¶
Start logging stream data into CSV.
- Parameters:
filename – Name of the CSV file.
header – Header list of the CSV file.
stream – stream name, use get_supported_streams() to list all supported streams.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_bia_application() x = application.enable_csv_logging("bcm.csv")
- get_device_configuration(addresses: List[int]) Dict ¶
Get device configuration.
- Parameters:
addresses (List[int]) – List of field values to read.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_bia_application() x = application.get_device_configuration([0x00, 0x1])
- get_sensor_status(stream: ~adi_spo2_watch.core.enums.common_enums.Stream = <Stream.BIA: ['0xC4', '0x07']>) Dict ¶
Returns packet with number of subscribers and number of sensor start request registered.
- Parameters:
stream – stream name, use get_supported_streams() to list all supported streams.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_bia_application() x = application.get_sensor_status(application.STREAM_BIA) print(x["payload"]["num_subscribers"], x["payload"]["num_start_registered"]) # 0 0
- static get_supported_dcb_block() List[DCBConfigBlockIndex] ¶
List all supported DCBConfigBlockIndex for BIA.
- Returns:
Array of DCBConfigBlockIndex enums.
- Return type:
List[DCBConfigBlockIndex]
- static get_supported_dft_windows() List[BIADFTWindow] ¶
List all supported DFT window for BIA.
- Returns:
Array of DFT window enums.
- Return type:
List
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_bia_application() x = application.get_supported_dft_windows() print(x) # [<BIADFTWindow.DFT_WINDOW_4: ['0x0', '0x0']>, ... , <BIADFTWindow.DFT_WINDOW_16384: ['0x0', '0x12']>]
- static get_supported_hs_resistor_tia_ids() List[HSResistorTIA] ¶
List all supported High Speed Resistor Trans Impedance Amplifier for BIA.
- Returns:
Array of High Speed Resistor Trans Impedance Amplifier enums.
- Return type:
List
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_bia_application() x = application.get_supported_hs_resistor_tia_ids() print(x) # [<HSResistorTIA.RESISTOR_200: ['0x0', '0x0']>, ... , <HSResistorTIA.RESISTOR_5K: ['0x0', '0x2']>]
- static get_supported_streams() List[Stream] ¶
List all supported streams for BIA.
- Returns:
Array of stream ID enums.
- Return type:
List[Stream]
- load_device_configuration() Dict ¶
Load device configuration.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_bia_application() x = application.load_device_configuration()
- read_device_configuration_block(dcb_block_index: DCBConfigBlockIndex) Dict ¶
Returns entire device configuration block.
- Parameters:
dcb_block_index – dcb block index (lcfg/dcfg), use get_supported_dcb_block() to get list of all supported DCB index.
- Returns:
A response packet as dictionary.
- Return type:
dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_bia_application() x = application.read_device_configuration_block()
- read_library_configuration(fields: List[int]) Dict ¶
Reads library configuration from specified field values.
- Parameters:
fields (List[int]) – List of field values to read.
- Returns:
A response packet as dictionary
- Return type:
Dict
Fields Lower Limit
Fields Upper Limit
0x00
0x12
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_bia_application() x = application.read_library_configuration([0x00]) print(x["payload"]["data"]) # [['0x0', '0x0']]
- set_callback(callback_function: ~typing.Callable, args: ~typing.Tuple = (), stream: ~adi_spo2_watch.core.enums.common_enums.Stream = <Stream.BIA: ['0xC4', '0x07']>) None ¶
Sets the callback for the stream data.
- Parameters:
callback_function – callback function for specified BIA stream.
args – optional arguments that will be passed with the callback.
stream (Stream) – stream name, use get_supported_streams() to list all supported streams.
- Returns:
None
from adi_spo2_watch import SDK # make sure optional arguments have default value to prevent them causing Exceptions. def callback(data, optional1=None, optional2=None): print(data) sdk = SDK("COM4") application = sdk.get_bia_application() # these optional arguments can be used to pass file, matplotlib or other objects to manipulate data. optional_arg1 = "1" optional_arg2 = "2" application.set_callback(callback, args=(optional_arg1, optional_arg2), stream=application.STREAM_BIA)
- set_device_configuration(addresses_values: List[List[int]]) Dict ¶
Set device configuration.
- Parameters:
addresses_values (List[List[int]]) – List of addresses and values to set.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_bia_application() x = application.set_device_configuration([[0x0, 2], [0x1, 0x1]])
- set_discrete_fourier_transformation(dft_window: BIADFTWindow) Dict ¶
Set Discrete Fourier Transformation for BIA.
- Parameters:
dft_window (BIADFTWindow) – DFT window for Discrete Fourier Transformation, use get_supported_dft_windows() | to list all supported DFT window.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_bia_application() x = application.get_supported_dft_windows() print(x) # [<BCMDFTWindow.DFT_WINDOW_4: ['0x0', '0x0']>, ... ,<BCMDFTWindow.DFT_WINDOW_16384: ['0x0', '0x12']>] x = application.set_discrete_fourier_transformation(application.DFT_WINDOW_16384) print(x["payload"]["dft_window"]) # BCMDFTWindow.DFT_WINDOW_16384
- start_and_subscribe_stream(stream: ~adi_spo2_watch.core.enums.common_enums.Stream = <Stream.BIA: ['0xC4', '0x07']>) Tuple[Dict, Dict] ¶
Starts BIA sensor and also subscribe to the specified BIA stream.
- Parameters:
stream (Stream) – stream name, use get_supported_streams() to list all supported streams.
- Returns:
A response packet as dictionary.
- Return type:
Tuple[Dict, Dict]
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_bia_application() x = application.get_supported_streams() start_sensor, subs_stream = application.start_and_subscribe_stream() print(start_sensor["payload"]["status"], subs_stream["payload"]["status"]) # CommonStatus.STREAM_STARTED CommonStatus.SUBSCRIBER_ADDED
- stop_and_unsubscribe_stream(stream: ~adi_spo2_watch.core.enums.common_enums.Stream = <Stream.BIA: ['0xC4', '0x07']>) Tuple[Dict, Dict] ¶
Stops BIA sensor and also Unsubscribe the specified BIA stream.
- Parameters:
stream (Stream) – stream name, use get_supported_streams() to list all supported streams.
- Returns:
A response packet as dictionary.
- Return type:
Tuple[Dict, Dict]
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_bia_application() x = application.get_supported_streams() stop_sensor, unsubscribe_stream = application.stop_and_unsubscribe_stream() print(stop_sensor["payload"]["status"], unsubscribe_stream["payload"]["status"]) # CommonStatus.STREAM_STOPPED CommonStatus.SUBSCRIBER_REMOVED
- subscribe_stream(stream: ~adi_spo2_watch.core.enums.common_enums.Stream = <Stream.BIA: ['0xC4', '0x07']>) Dict ¶
Subscribe to the specified BIA stream.
- Parameters:
stream (Stream) – stream name, use get_supported_streams() to list all supported streams.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_bia_application() x = application.get_supported_streams() subs_stream = application.subscribe_stream() print(subs_stream["payload"]["status"]) # CommonStatus.SUBSCRIBER_ADDED
- unsubscribe_stream(stream: ~adi_spo2_watch.core.enums.common_enums.Stream = <Stream.BIA: ['0xC4', '0x07']>) Dict ¶
Unsubscribe the specified BIA stream.
- Parameters:
stream (Stream) – stream name, use get_supported_streams() to list all supported streams.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_bia_application() x = application.get_supported_streams() unsubscribe_stream = application.unsubscribe_stream() print(unsubscribe_stream["payload"]["status"]) # CommonStatus.SUBSCRIBER_REMOVED
- write_dcb_to_lcfg() Dict ¶
Writes Device configuration block data to library configuration.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_bia_application() x = application.write_dcb_to_lcfg() print(x["payload"]["status"]) # CommonStatus.OK
- write_device_configuration_block(addresses_values: List[List[int]], dcb_block_index: DCBConfigBlockIndex) Dict ¶
Writes the device configuration block values of specified addresses. This function takes a list of addresses and values to write, and returns a response packet as dictionary containing addresses and values. use dcb_flag to see if packet is for lcfg or dcfg.
- Parameters:
addresses_values (List[List[int]]) – List of addresses and values to write.
dcb_block_index – dcb block index (lcfg/dcfg), use get_supported_dcb_block() to get list of all supported DCB index.
- Returns:
A response packet as dictionary.
- Return type:
Dict
Address Lower Limit
Address Upper Limit
0x00
0x1B
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_bia_application() x = application.write_device_configuration_block([[0x0, 2], [0x1, 0x1]]) print(x["payload"]["size"]) # 2
- write_device_configuration_block_from_file(filename: str, dcb_block_index: DCBConfigBlockIndex) Dict ¶
Writes the device configuration block values of specified addresses from file.
- Parameters:
filename – dcb filename
dcb_block_index – dcb block index (lcfg/dcfg), use get_supported_dcb_block() to get list of all supported DCB index.
- Returns:
A response packet as dictionary.
- Return type:
dict
Address Lower Limit
Address Upper Limit
0x00
0x12
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_bia_application() application.write_device_configuration_block_from_file("bia_dcb.dcfg")
- write_library_configuration(fields_values: List[List[int]]) Dict ¶
Writes library configuration from List of fields and values.
- Parameters:
fields_values (List[List[int]]) – List of fields and values to write.
- Returns:
A response packet as dictionary.
- Return type:
Dict
Fields Lower Limit
Fields Upper Limit
0x00
0x1B
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_bia_application() x = application.write_library_configuration([[0x00, 0x1]]) print(x["payload"]["data"]) # [['0x0', '0x1']]
adi_spo2_watch.application.common_application module¶
- class adi_spo2_watch.application.common_application.CommonApplication(destination, packet_manager)¶
Bases:
object
A Common Application class.
- static device_configuration_file_to_list(dcfg_file: str, address: bool = True)¶
This API parse DCB file to python List.
- Parameters:
dcfg_file – DCB file.
address – If address is true, it will return a 2D list else 1D list.
- Returns:
List
- set_timeout(timeout_value: float)¶
Sets the time out for queue to wait for command packet response.
- Parameters:
timeout_value (int) – queue timeout value.
adi_spo2_watch.application.common_stream module¶
- class adi_spo2_watch.application.common_stream.CommonStream(destination, stream, packet_manager)¶
Bases:
CommonApplication
A Common Stream class for streaming data from sensors.
- get_packet_lost_count(stream: Stream = None)¶
This API returns the number of missing packets during a stream session.
- Parameters:
stream – stream name, use get_supported_streams() to list all supported streams.
- Returns:
Int
- get_sensor_status()¶
Returns packet with number of subscribers and number of sensor start request registered.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_study_watch import SDK sdk = SDK("COM4") application = sdk.get_adxl_application() x = application.get_sensor_status() print(x["payload"]["num_subscribers"], x["payload"]["num_start_registered"]) # 0 0
- set_callback(callback_function: Callable, args: Tuple = ())¶
Sets the callback for the stream data.
- Parameters:
args – optional arguments that will be passed with the callback.
callback_function – callback function for stream adxl data.
- Returns:
None
from adi_study_watch import SDK # make sure optional arguments have default value to prevent them causing Exceptions. def callback(data, optional1=None, optional2=None): print(data) sdk = SDK("COM4") application = sdk.get_adxl_application() # these optional arguments can be used to pass file, matplotlib or other objects to manipulate data. optional_arg1 = "1" optional_arg2 = "2" application.set_callback(callback, args=(optional_arg1, optional_arg2))
- start_and_subscribe_stream(stream: Stream = None)¶
Starts sensor and also subscribe to the stream.
- Parameters:
stream – stream name, use get_supported_streams() to list all supported streams.
- Returns:
A response packet as dictionary.
- Return type:
Tuple[Dict, Dict]
from adi_study_watch import SDK sdk = SDK("COM4") application = sdk.get_adxl_application() start_sensor, subs_stream = application.start_and_subscribe_stream() print(start_sensor["payload"]["status"], subs_stream["payload"]["status"]) # CommonStatus.STREAM_STARTED CommonStatus.SUBSCRIBER_ADDED
- start_sensor()¶
Starts sensor.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_study_watch import SDK sdk = SDK("COM4") application = sdk.get_adxl_application() start_sensor = application.start_sensor() print(start_sensor["payload"]["status"]) # CommonStatus.STREAM_STARTED
- stop_and_unsubscribe_stream(stream: Stream = None)¶
Stops sensor and also Unsubscribe the stream.
- Parameters:
stream – stream name, use get_supported_streams() to list all supported streams.
- Returns:
A response packet as dictionary.
- Return type:
Tuple[Dict, Dict]
from adi_study_watch import SDK sdk = SDK("COM4") application = sdk.get_adxl_application() stop_sensor, unsubscribe_stream = application.stop_and_unsubscribe_stream() print(stop_sensor["payload"]["status"], unsubscribe_stream["payload"]["status"]) # CommonStatus.STREAM_STOPPED CommonStatus.SUBSCRIBER_REMOVED
- stop_sensor()¶
Stops sensor.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_study_watch import SDK sdk = SDK("COM4") application = sdk.get_adxl_application() stop_sensor = application.stop_sensor() print(stop_sensor["payload"]["status"]) # CommonStatus.STREAM_STOPPED
- subscribe_stream(stream: Stream = None)¶
Subscribe to the stream.
- Parameters:
stream – stream name, use get_supported_streams() to list all supported streams.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_study_watch import SDK sdk = SDK("COM4") application = sdk.get_adxl_application() subs_stream = application.subscribe_stream() print(subs_stream["payload"]["status"]) # CommonStatus.SUBSCRIBER_ADDED
- unsubscribe_stream(stream: Stream = None)¶
Unsubscribe the stream.
- Parameters:
stream – stream name, use get_supported_streams() to list all supported streams.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_study_watch import SDK sdk = SDK("COM4") application = sdk.get_adxl_application() unsubscribe_stream = application.unsubscribe_stream() print(unsubscribe_stream["payload"]["status"]) # CommonStatus.SUBSCRIBER_REMOVED
adi_spo2_watch.application.csv_logging module¶
adi_spo2_watch.application.ecg_application module¶
- class adi_spo2_watch.application.ecg_application.ECGApplication(packet_manager)¶
Bases:
CommonStream
ECG Application class.
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_ecg_application()
- delete_device_configuration_block() Dict ¶
Deletes ECG Device configuration block.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_ecg_application() application.delete_device_configuration_block()
- disable_csv_logging() None ¶
Stops logging stream data into CSV.
- Returns:
None
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_ecg_application() x = application.disable_csv_logging()
- enable_csv_logging(filename: str, header: List = None) None ¶
Start logging stream data into CSV.
- Parameters:
filename – Name of the CSV file.
header – Header list of the CSV file.
- Returns:
None
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_ecg_application() x = application.enable_csv_logging("ecg.csv")
- get_algo_version() Dict ¶
Returns ECG version info.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_ecg_application() x = application.get_algo_version() print(x["payload"]["major_version"]) # 3 print(x["payload"]["minor_version"]) # 4 print(x["payload"]["patch_version"]) # 3 print(x["payload"]["version_string"]) # ECG_App print(x["payload"]["build_version"]) # TEST ECG_VERSION STRING
- get_decimation_factor() Dict ¶
Returns stream decimation factor.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_ecg_application() x = application.get_decimation_factor() print(x["payload"]["decimation_factor"]) # 1
- get_sensor_status()¶
Returns packet with number of subscribers and number of sensor start request registered.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_ecg_application() x = application.get_sensor_status() print(x["payload"]["num_subscribers"], x["payload"]["num_start_registered"]) # 0 0
- static get_supported_streams() List[Stream] ¶
List all supported streams.
- Returns:
Array of stream ID enums.
- Return type:
List[Stream]
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_ecg_application() x = application.get_supported_streams() print(x) # [<Stream.ECG: ['0xC4', '0x01']>]
- get_version() Dict ¶
Returns ECG version info.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_ecg_application() x = application.get_version() print(x["payload"]["major_version"]) # 3 print(x["payload"]["minor_version"]) # 4 print(x["payload"]["patch_version"]) # 3 print(x["payload"]["version_string"]) # ECG_App print(x["payload"]["build_version"]) # TEST ECG_VERSION STRING
- read_device_configuration_block() Dict ¶
Returns entire device configuration block.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_ecg_application() x = application.get_ecg_application() print(x["payload"]["data"]) # []
- read_library_configuration(fields: List[int]) Dict ¶
Reads library configuration from specified field values.
- Parameters:
fields (List[int]) – List of field values to read.
- Returns:
A response packet as dictionary
- Return type:
Dict
Fields Lower Limit
Fields Upper Limit
0x00
0x03
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_ecg_application() x = application.read_library_configuration([0x00]) print(x["payload"]["data"]) # [['0x0', '0x0']]
- set_decimation_factor(decimation_factor: int) Dict ¶
Sets decimation factor for ECG stream.
- Parameters:
decimation_factor (int) – decimation factor for stream
- Returns:
A response packet as dictionary
- Return type:
Dict
Decimation Lower Limit
Decimation Upper Limit
0x01
0x05
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_ecg_application() x = application.set_decimation_factor(2) print(x["payload"]["decimation_factor"]) # 2
- start_and_subscribe_stream(stream: ~adi_spo2_watch.core.enums.common_enums.Stream = <Stream.ECG: ['0xC4', '0x01']>)¶
Starts sensor and also subscribe to the stream.
- Parameters:
stream – stream name, use get_supported_streams() to list all supported streams.
- Returns:
A response packet as dictionary.
- Return type:
Tuple[Dict, Dict]
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_ecg_application() start_sensor, subs_stream = application.start_and_subscribe_stream() print(start_sensor["payload"]["status"], subs_stream["payload"]["status"]) # CommonStatus.STREAM_STARTED CommonStatus.SUBSCRIBER_ADDED
- start_sensor()¶
Starts sensor.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_ecg_application() start_sensor = application.start_sensor() print(start_sensor["payload"]["status"]) # CommonStatus.STREAM_STARTED
- stop_and_unsubscribe_stream(stream: ~adi_spo2_watch.core.enums.common_enums.Stream = <Stream.ECG: ['0xC4', '0x01']>)¶
Stops sensor and also Unsubscribe the stream.
- Parameters:
stream – stream name, use get_supported_streams() to list all supported streams.
- Returns:
A response packet as dictionary.
- Return type:
Tuple[Dict, Dict]
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_ecg_application() stop_sensor, unsubscribe_stream = application.stop_and_unsubscribe_stream() print(stop_sensor["payload"]["status"], unsubscribe_stream["payload"]["status"]) # CommonStatus.STREAM_STOPPED CommonStatus.SUBSCRIBER_REMOVED
- stop_sensor()¶
Stops sensor.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_ecg_application() stop_sensor = application.stop_sensor() print(stop_sensor["payload"]["status"]) # CommonStatus.STREAM_STOPPED
- subscribe_stream(stream: ~adi_spo2_watch.core.enums.common_enums.Stream = <Stream.ECG: ['0xC4', '0x01']>)¶
Subscribe to the stream.
- Parameters:
stream – stream name, use get_supported_streams() to list all supported streams.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_ecg_application() subs_stream = application.subscribe_stream() print(subs_stream["payload"]["status"]) # CommonStatus.SUBSCRIBER_ADDED
- unsubscribe_stream(stream: ~adi_spo2_watch.core.enums.common_enums.Stream = <Stream.ECG: ['0xC4', '0x01']>)¶
Unsubscribe the stream.
- Parameters:
stream – stream name, use get_supported_streams() to list all supported streams.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_ecg_application() unsubscribe_stream = application.unsubscribe_stream() print(unsubscribe_stream["payload"]["status"]) # CommonStatus.SUBSCRIBER_REMOVED
- write_dcb_to_lcfg() Dict ¶
Writes Device configuration block data to library configuration.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_ecg_application() x = application.write_dcb_to_lcfg() print(x["payload"]["status"]) # CommonStatus.OK
- write_device_configuration_block(addresses_values: List[List[int]]) Dict ¶
Writes the device configuration block values of specified addresses. This function takes a list of addresses and values to write, and returns a response packet as dictionary containing addresses and values.
- Parameters:
addresses_values (List[List[int]]) – List of addresses and values to write.
- Returns:
A response packet as dictionary.
- Return type:
Dict
Address Lower Limit
Address Upper Limit
0x00
0x03
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_ecg_application() x = application.write_device_configuration_block([[0x0, 2], [0x1, 0x1]]) print(x["payload"]["size"]) # 2
- write_device_configuration_block_from_file(filename: str) Dict ¶
Writes the device configuration block values of specified addresses from file.
- Parameters:
filename – dcb filename
- Returns:
A response packet as dictionary.
- Return type:
Dict
Address Lower Limit
Address Upper Limit
0x00
0x03
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_ecg_application() application.write_device_configuration_block_from_file("ecg_dcb.lcfg")
- write_library_configuration(fields_values: List[List[int]]) Dict ¶
Writes library configuration from List of fields and values.
- Parameters:
fields_values (List[List[int]]) – List of fields and values to write.
- Returns:
A response packet as dictionary.
- Return type:
Dict
Fields Lower Limit
Fields Upper Limit
0x00
0x03
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_ecg_application() x = application.write_library_configuration([[0x01, 0x2]]) print(x["payload"]["data"]) # [['0x0', '0x1']]
adi_spo2_watch.application.eda_application module¶
- class adi_spo2_watch.application.eda_application.EDAApplication(packet_manager)¶
Bases:
CommonStream
EDA Application class.
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_eda_application()
- DFT_WINDOW_16 = [2]¶
- DFT_WINDOW_32 = [3]¶
- DFT_WINDOW_4 = [0]¶
- DFT_WINDOW_8 = [1]¶
- EDA_DCFG_BLOCK = [18]¶
- EDA_LCFG_BLOCK = [6]¶
- POWER_INVALID = [0]¶
- POWER_SLEEP = [1]¶
- POWER_WAKEUP = [2]¶
- SCALE_RESISTOR_100K = [20, 0]¶
- SCALE_RESISTOR_10K = [8, 0]¶
- SCALE_RESISTOR_110 = [1, 0]¶
- SCALE_RESISTOR_120K = [21, 0]¶
- SCALE_RESISTOR_128K = [22, 0]¶
- SCALE_RESISTOR_12K = [9, 0]¶
- SCALE_RESISTOR_160K = [23, 0]¶
- SCALE_RESISTOR_16K = [10, 0]¶
- SCALE_RESISTOR_196K = [24, 0]¶
- SCALE_RESISTOR_1K = [2, 0]¶
- SCALE_RESISTOR_20K = [11, 0]¶
- SCALE_RESISTOR_24K = [12, 0]¶
- SCALE_RESISTOR_256K = [25, 0]¶
- SCALE_RESISTOR_2K = [3, 0]¶
- SCALE_RESISTOR_30K = [13, 0]¶
- SCALE_RESISTOR_32K = [14, 0]¶
- SCALE_RESISTOR_3K = [4, 0]¶
- SCALE_RESISTOR_40K = [15, 0]¶
- SCALE_RESISTOR_48K = [16, 0]¶
- SCALE_RESISTOR_4K = [5, 0]¶
- SCALE_RESISTOR_512K = [26, 0]¶
- SCALE_RESISTOR_64K = [17, 0]¶
- SCALE_RESISTOR_6K = [6, 0]¶
- SCALE_RESISTOR_85K = [18, 0]¶
- SCALE_RESISTOR_8K = [7, 0]¶
- SCALE_RESISTOR_96K = [19, 0]¶
- calibrate_resistor_tia(min_scale: ScaleResistor, max_scale: ScaleResistor, lp_resistor_tia: ScaleResistor) Dict ¶
Calibrate Resistor Trans Impedance Amplifier.
- param min_scale:
min scale for Resistor Trans Impedance Amplifier, use get_supported_scales() | to list all supported scales.
- param max_scale:
max scale for Resistor Trans Impedance Amplifier, use get_supported_scales() | to list all supported scales.
- param lp_resistor_tia:
lp_resistor_tia, use get_supported_scales() to list all supported scales.
- type min_scale:
ScaleResistor
- type max_scale:
ScaleResistor
- type lp_resistor_tia:
ScaleResistor
- return:
A response packet as dictionary.
- rtype:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_eda_application() x = application.get_supported_scales() print(x) # [<ScaleResistor.SCALE_RESISTOR_100K: ['0x0', '0x14']>, ... ] x = application.calibrate_resistor_tia(application.SCALE_RESISTOR_128K, application.SCALE_RESISTOR_256K, application.SCALE_RESISTOR_256K) print(x["payload"]["status"]) # CommonStatus.OK
- delete_device_configuration_block(dcb_block_index: DCBConfigBlockIndex) Dict ¶
Deletes EDA Device configuration block. use dcb_flag to see if packet is for lcfg or dcfg.
- Parameters:
dcb_block_index – dcb block index (lcfg/dcfg), use get_supported_dcb_block() to get list of all supported DCB index.
- Returns:
A response packet as dictionary.
- Return type:
dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_eda_application() application.delete_device_configuration_block()
- delete_rtia_calibration_table() Dict ¶
Delete RTIA calibration table.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_eda_application() x = application.delete_rtia_calibration_table()
- disable_csv_logging() None ¶
Stops logging stream data into CSV.
- Returns:
None
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_eda_application() x = application.disable_csv_logging()
- disable_dynamic_scaling() Dict ¶
Disables Dynamic scaling.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_eda_application() application.disable_dynamic_scaling()
- enable_csv_logging(filename: str, header: List = None) None ¶
Start logging stream data into CSV.
- Parameters:
filename – Name of the CSV file.
header – Header list of the CSV file.
- Returns:
None
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_eda_application() x = application.enable_csv_logging("eda.csv")
- enable_dynamic_scaling(min_scale: ScaleResistor, max_scale: ScaleResistor, lp_resistor_tia: ScaleResistor) Dict ¶
Enables Dynamic scaling.
- param min_scale:
min scale for Resistor Trans Impedance Amplifier, use get_supported_scales() | to list all supported scales.
- param max_scale:
max scale for Resistor Trans Impedance Amplifier, use get_supported_scales() | to list all supported scales.
- param lp_resistor_tia:
lp_resistor_tia, use get_supported_scales() to list all supported scales.
- type min_scale:
ScaleResistor
- type max_scale:
ScaleResistor
- type lp_resistor_tia:
ScaleResistor
- return:
A response packet as dictionary.
- rtype:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_eda_application() x = application.get_supported_scales() print(x) # [<ScaleResistor.SCALE_RESISTOR_100K: ['0x0', '0x14']>, ... ] x = application.enable_dynamic_scaling(application.SCALE_RESISTOR_128K, application.SCALE_RESISTOR_256K, application.SCALE_RESISTOR_256K) print(x["payload"]["status"]) # CommonStatus.OK
- get_baseline_impedance() Dict ¶
Get Baseline Impedance for EDA.
- Returns:
A response packet as dictionary
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_eda_application() packet = application.get_baseline_impedance() print(packet)
- get_decimation_factor() Dict ¶
Returns stream decimation factor.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_eda_application() x = application.get_decimation_factor() print(x["payload"]["decimation_factor"]) # 1
- get_device_configuration(addresses: List[int]) Dict ¶
Get device configuration.
- Parameters:
addresses (List[int]) – List of field values to read.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_eda_application() x = application.get_device_configuration([0x00, 0x1])
- get_fds_rtia_calibration_table() Dict ¶
Get FDS RTIA calibration table.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_eda_application() x = application.get_fds_rtia_calibration_table()
- get_ram_rtia_calibration_table() Dict ¶
Get RAM RTIA calibration table.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_eda_application() x = application.get_ram_rtia_calibration_table()
- get_sensor_status()¶
Returns packet with number of subscribers and number of sensor start request registered.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_eda_application() x = application.get_sensor_status() print(x["payload"]["num_subscribers"], x["payload"]["num_start_registered"]) # 0 0
- static get_supported_dcb_block() List[DCBConfigBlockIndex] ¶
List all supported DCBConfigBlockIndex.
- Returns:
Array of DCBConfigBlockIndex enums.
- Return type:
List[DCBConfigBlockIndex]
- static get_supported_dft_windows() List[EDADFTWindow] ¶
List all supported dft window for EDA.
- Returns:
Array of dft window enums.
- Return type:
List
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_eda_application() x = application.get_supported_dft_windows() print(x) # [<EDADFTWindow.DFT_WINDOW_4: ['0x0']>, ... , <EDADFTWindow.DFT_WINDOW_32: ['0x3']>]
- static get_supported_power_modes() List[EDAPowerMode] ¶
List all supported power mode for EDA.
- Returns:
Array of power modes enums.
- Return type:
List
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_eda_application() x = application.get_supported_power_modes() print(x)
- static get_supported_scales() List[ScaleResistor] ¶
List all supported scales for EDA.
- Returns:
Array of scales enums.
- Return type:
List
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_eda_application() x = application.get_supported_scales() print(x) # [<ScaleResistor.SCALE_RESISTOR_100K: ['0x0', '0x14']>, ...]
- static get_supported_streams() List[Stream] ¶
List all supported streams.
- Returns:
Array of stream ID enums.
- Return type:
List[Stream]
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_eda_application() x = application.get_supported_streams() print(x) # [<Stream.EDA: ['0xC4', '0x02']>]
- get_version() Dict ¶
Returns EDA version info.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_ecg_application() x = application.get_version() print(x["payload"]["major_version"]) # 3 print(x["payload"]["minor_version"]) # 4 print(x["payload"]["patch_version"]) # 3 print(x["payload"]["version_string"]) # EDA_App print(x["payload"]["build_version"]) # TEST EDA_VERSION STRING
- load_device_configuration() Dict ¶
Load device configuration.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_eda_application() x = application.load_device_configuration()
- read_device_configuration_block(dcb_block_index: DCBConfigBlockIndex) Dict ¶
Returns entire device configuration block.
Note: read_device_configuration_block API has a size limit of 3.
- Parameters:
dcb_block_index – dcb block index (lcfg/dcfg), use get_supported_dcb_block() to get list of all supported DCB index.
- Returns:
A response packet as dictionary.
- Return type:
dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_eda_application() x = application.read_device_configuration_block()
- read_library_configuration(fields: List[int]) Dict ¶
Reads library configuration from specified field values.
- Parameters:
fields (List[int]) – List of field values to read.
- Returns:
A response packet as dictionary
- Return type:
Dict
Fields Lower Limit
Fields Upper Limit
0x00
0x02
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_eda_application() x = application.read_library_configuration([0x00]) print(x["payload"]["data"]) # [['0x0', '0x0']]
- read_register(addresses: List[int]) Dict ¶
Reads the register values of specified addresses. This function takes a list of addresses to read, and returns a response packet as dictionary containing addresses and values.
- Parameters:
addresses (List[int]) – List of register addresses to read.
- Returns:
A response packet as dictionary
- Return type:
Dict
Address Lower Limit
Address Upper Limit
0x00
0x2E
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_eda_application() x = application.read_register([0x15, 0x20, 0x2E]) print(x["payload"]["data"]) # [['0x15', '0x0'], ['0x20', '0x0'], ['0x2E', '0x0']]
- reset_baseline_impedance() Dict ¶
Reset baseline impedance.
- Returns:
A response packet as dictionary
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_eda_application() x = application.reset_baseline_impedance() print(x)
- set_baseline_impedance(real_dft16: float, imaginary_dft16: float, real_dft8: float, imaginary_dft8: float, resistor_baseline: int) Dict ¶
Set Baseline Impedance for EDA.
- Parameters:
real_dft16 (float) – Real DFT16
imaginary_dft16 (float) – Imaginary DFT16
real_dft8 (float) – Real DFT8
imaginary_dft8 (float) – Imaginary DFT8
resistor_baseline (int) – Resistor Baseline
- Returns:
A response packet as dictionary
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_eda_application() packet = application.set_baseline_impedance(25000.5, 25000.5, 25000.5, 25000.5, 19900) print(packet)
- set_decimation_factor(decimation_factor: int) Dict ¶
Sets decimation factor for EDA stream.
- Parameters:
decimation_factor (int) – decimation factor for stream
- Returns:
A response packet as dictionary
- Return type:
Dict
Decimation Lower Limit
Decimation Upper Limit
0x01
0x05
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_eda_application() x = application.set_decimation_factor(2) print(x["payload"]["decimation_factor"]) # 2
- set_device_configuration(addresses_values: List[List[int]]) Dict ¶
Set device configuration.
- Parameters:
addresses_values (List[List[int]]) – List of addresses and values to set.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_eda_application() x = application.set_device_configuration([[0x0, 2], [0x1, 0x1]])
- set_discrete_fourier_transformation(dft_window: EDADFTWindow) Dict ¶
Set Discrete Fourier Transformation for EDA.
- Parameters:
dft_window (EDADFTWindow) – DFT window for Discrete Fourier Transformation, use get_supported_dft_windows() | to list all supported DFT window.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_eda_application() x = application.get_supported_dft_windows() print(x) # [<EDADFTWindow.DFT_WINDOW_4: ['0x0']>, ... ,<EDADFTWindow.DFT_WINDOW_32: ['0x3']>] x = application.set_discrete_fourier_transformation(application.DFT_WINDOW_32) print(x["payload"]["dft_window"]) # EDADFTWindow.DFT_WINDOW_32
- set_power_mode(power_mode: EDAPowerMode) Dict ¶
Control the AD5940 ICs power state: to make it enter Hibernate or wakeup state. EPHY_LDO turn On needs to be done prior to this.
- Parameters:
power_mode – power mode, use get_supported_power_modes() to get all supported power modes.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_eda_application() x = application.set_power_mode(application.POWER_SLEEP)
- start_and_subscribe_stream(stream: ~adi_spo2_watch.core.enums.common_enums.Stream = <Stream.EDA: ['0xC4', '0x02']>)¶
Starts sensor and also subscribe to the stream.
- Parameters:
stream – stream name, use get_supported_streams() to list all supported streams.
- Returns:
A response packet as dictionary.
- Return type:
Tuple[Dict, Dict]
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_eda_application() start_sensor, subs_stream = application.start_and_subscribe_stream() print(start_sensor["payload"]["status"], subs_stream["payload"]["status"]) # CommonStatus.STREAM_STARTED CommonStatus.SUBSCRIBER_ADDED
- start_sensor()¶
Starts sensor.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_eda_application() start_sensor = application.start_sensor() print(start_sensor["payload"]["status"]) # CommonStatus.STREAM_STARTED
- stop_and_unsubscribe_stream(stream: ~adi_spo2_watch.core.enums.common_enums.Stream = <Stream.EDA: ['0xC4', '0x02']>)¶
Stops sensor and also Unsubscribe the stream.
- Parameters:
stream – stream name, use get_supported_streams() to list all supported streams.
- Returns:
A response packet as dictionary.
- Return type:
Tuple[Dict, Dict]
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_eda_application() stop_sensor, unsubscribe_stream = application.stop_and_unsubscribe_stream() print(stop_sensor["payload"]["status"], unsubscribe_stream["payload"]["status"]) # CommonStatus.STREAM_STOPPED CommonStatus.SUBSCRIBER_REMOVED
- stop_sensor()¶
Stops sensor.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_eda_application() stop_sensor = application.stop_sensor() print(stop_sensor["payload"]["status"]) # CommonStatus.STREAM_STOPPED
- subscribe_stream(stream: ~adi_spo2_watch.core.enums.common_enums.Stream = <Stream.EDA: ['0xC4', '0x02']>)¶
Subscribe to the stream.
- Parameters:
stream – stream name, use get_supported_streams() to list all supported streams.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_eda_application() subs_stream = application.subscribe_stream() print(subs_stream["payload"]["status"]) # CommonStatus.SUBSCRIBER_ADDED
- unsubscribe_stream(stream: ~adi_spo2_watch.core.enums.common_enums.Stream = <Stream.EDA: ['0xC4', '0x02']>)¶
Unsubscribe the stream.
- Parameters:
stream – stream name, use get_supported_streams() to list all supported streams.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_eda_application() unsubscribe_stream = application.unsubscribe_stream() print(unsubscribe_stream["payload"]["status"]) # CommonStatus.SUBSCRIBER_REMOVED
- write_dcb_to_lcfg() Dict ¶
Writes Device configuration block data to library configuration.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_eda_application() x = application.write_dcb_to_lcfg() print(x["payload"]["status"]) # CommonStatus.OK
- write_device_configuration_block(addresses_values: List[List[int]], dcb_block_index: DCBConfigBlockIndex) Dict ¶
Writes the device configuration block values of specified addresses. This function takes a list of addresses and values to write, and returns a response packet as dictionary containing addresses and values.
- Parameters:
addresses_values (List[List[int]]) – List of addresses and values to write.
dcb_block_index – dcb block index (lcfg/dcfg), use get_supported_dcb_block() to get list of all supported DCB index.
- Returns:
A response packet as dictionary.
- Return type:
Dict
Address Lower Limit
Address Upper Limit
0x00
0x02
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_eda_application() x = application.write_device_configuration_block([[0x0, 2], [0x1, 0x1]]) print(x["payload"]["size"]) # 2
- write_device_configuration_block_from_file(filename: str, dcb_block_index: DCBConfigBlockIndex) Dict ¶
Writes the device configuration block values of specified addresses from file. use dcb_flag to see if packet is for lcfg or dcfg.
- Parameters:
filename – dcb filename
dcb_block_index – dcb block index (lcfg/dcfg), use get_supported_dcb_block() to get list of all supported DCB index.
- Returns:
A response packet as dictionary.
- Return type:
dict
Address Lower Limit
Address Upper Limit
0x00
0x02
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_eda_application() application.write_device_configuration_block_from_file("eda_dcb.dcfg")
- write_library_configuration(fields_values: List[List[int]]) Dict ¶
Writes library configuration from List of fields and values.
- Parameters:
fields_values (List[List[int]]) – List of fields and values to write.
- Returns:
A response packet as dictionary.
- Return type:
Dict
Fields Lower Limit
Fields Upper Limit
0x00
0x02
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_eda_application() x = application.write_library_configuration([[0x00, 0x1]]) print(x["payload"]["data"]) # [['0x0', '0x1']]
- write_register(addresses_values: List[List[int]]) Dict ¶
Writes the register values of specified addresses. This function takes a list of addresses and values to write, and returns a response packet as dictionary containing addresses and values.
- Parameters:
addresses_values (List[List[int]]) – List of register addresses and values to write.
- Returns:
A response packet as dictionary.
- Return type:
Dict
Address Lower Limit
Address Upper Limit
0x20
0x2E
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_eda_application() x = application.write_register([[0x20, 0x1], [0x21, 0x2], [0x2E, 0x3]]) print(x["payload"]["data"]) # [['0x20', '0x1'], ['0x21', '0x2'], ['0x2E', '0x3']]
adi_spo2_watch.application.fs_application module¶
- class adi_spo2_watch.application.fs_application.FSApplication(packet_manager)¶
Bases:
CommonApplication
FS Application class.
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_fs_application()
- CRC_CHECK_EVENT = 1¶
- DOWNLOAD_EVENT = 0¶
- JOIN_FILE_EVENT = 3¶
- MAX30208_TEMPERATURE_STREAM = [200, 65]¶
- SEQUENCE_CHECK_EVENT = 2¶
- SH_ADXL_STREAM = [200, 50]¶
- SH_AMA_STREAM = [200, 55]¶
- SH_HRM_STREAM = [200, 49]¶
- SH_MAX86178_BIOZ_STREAM = [200, 54]¶
- SH_MAX86178_ECG_STREAM = [200, 53]¶
- SH_MAX86178_STREAM1 = [200, 42]¶
- SH_MAX86178_STREAM2 = [200, 43]¶
- SH_MAX86178_STREAM3 = [200, 44]¶
- SH_MAX86178_STREAM4 = [200, 45]¶
- SH_MAX86178_STREAM5 = [200, 46]¶
- SH_MAX86178_STREAM6 = [200, 47]¶
- SH_REG_CONF_STREAM = [200, 51]¶
- SH_RR_STREAM = [200, 52]¶
- SH_SPO2_STREAM = [200, 48]¶
- STREAM_AD7156 = [200, 21]¶
- STREAM_ADPD1 = [194, 17]¶
- STREAM_ADPD10 = [194, 26]¶
- STREAM_ADPD11 = [194, 27]¶
- STREAM_ADPD12 = [194, 28]¶
- STREAM_ADPD2 = [194, 18]¶
- STREAM_ADPD3 = [194, 19]¶
- STREAM_ADPD4 = [194, 20]¶
- STREAM_ADPD5 = [194, 21]¶
- STREAM_ADPD6 = [194, 22]¶
- STREAM_ADPD7 = [194, 23]¶
- STREAM_ADPD8 = [194, 24]¶
- STREAM_ADPD9 = [194, 25]¶
- STREAM_ADXL = [194, 2]¶
- STREAM_BATTERY = [198, 145]¶
- STREAM_BCM = [200, 20]¶
- STREAM_BIA = [196, 7]¶
- STREAM_DYNAMIC_AGC = [198, 176]¶
- STREAM_ECG = [196, 1]¶
- STREAM_EDA = [196, 2]¶
- STREAM_HRV = [198, 192]¶
- STREAM_PEDOMETER = [196, 4]¶
- STREAM_PPG = [196, 0]¶
- STREAM_SQI = [200, 13]¶
- STREAM_STATIC_AGC = [198, 177]¶
- STREAM_TEMPERATURE1 = [200, 22]¶
- STREAM_TEMPERATURE10 = [200, 31]¶
- STREAM_TEMPERATURE11 = [200, 32]¶
- STREAM_TEMPERATURE12 = [200, 33]¶
- STREAM_TEMPERATURE2 = [200, 23]¶
- STREAM_TEMPERATURE3 = [200, 24]¶
- STREAM_TEMPERATURE4 = [196, 6]¶
- STREAM_TEMPERATURE5 = [200, 26]¶
- STREAM_TEMPERATURE6 = [200, 27]¶
- STREAM_TEMPERATURE7 = [200, 28]¶
- STREAM_TEMPERATURE8 = [200, 29]¶
- STREAM_TEMPERATURE9 = [200, 30]¶
- abort_logging() Dict ¶
Aborts all logging process.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_fs_application() application.abort_logging()
- append_file() Dict ¶
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_fs_application() application.append_file()
- delete_config_file() Dict ¶
Deletes config file.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_fs_application() application.delete_config_file()
- disable_config_log() Dict ¶
Disables config log.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_fs_application() application.disable_config_log()
- download_file(filename: str, download_to_file: bool = True, display_progress: bool = True, progress_callback: Callable = None, continue_download: str = None, test_mode: bool = None) List[Dict] ¶
Download specified file from the device.
- Parameters:
filename (str) – filename to download, use ls() to obtain list of all files.
download_to_file (bool) – save the payload.data_stream to the file
display_progress (bool) – display progress of download.
progress_callback – download status callback for user.
continue_download (str) – filepath of the raw log [.LOG_RAW] file, which was previously interrupted using the same communication interface.
test_mode – Used for firmware testing.
- Returns:
list of response packet as dictionary.
- Return type:
List
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_fs_application() x = application.download_file("1216471B.LOG") print(x) # [{'header': {'source': <Stream.FS: ['0xC6', '0x1']>, .. , 'crc16': 18166}}]
- download_file_chunk(filename: str, retransmit_type: int, page_roll_over: int, page_chunk_number: int, page_number: int) Dict ¶
Download specified chunk of file from the device.
- Parameters:
page_number
page_chunk_number
page_roll_over
retransmit_type
filename (str) – filename to download, use ls() to obtain list of all files.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_fs_application() x = application.download_file_chunk(0, 50, "1216471B.LOG") print(x) # {'header': {'source': <Stream.FS: ['0xC6', '0x1']>, .. , 'crc16': 18166}}
- download_file_v2(filename: str, download_to_file: bool = False, display_progress: bool = False, progress_callback: Callable = None) List[Dict] ¶
Download specified file from the device.
Comparison with V1 algo: size - V1 - V2 - V2/V1 158841 - 1.85 - 2.64 - 1.5 317477 - 3.71 - 5.22 - 1.5 949889 - 11.08 - 16.22 - 1.55 7908885 - 92.57 - 147.94 - 1.59
Comparison with updated V1 algo: size - V1 - V2 - wt - V2/V1 158841 - 2.33 - 2.64 - 2.28 - 1.13 317477 - 4.68 - 5.22 - 4.06 - 1.11 949889 - 14.02 - 16.22 - 11.35 - 1.15 7908885 - 122.11 - 147.94 - 91.44 - 1.20
- Parameters:
filename (str) – filename to download, use ls() to obtain list of all files.
download_to_file (bool) – save the payload.data_stream to the file
display_progress (bool) – display progress of download.
progress_callback – download status callback for user.
- Returns:
list of response packet as dictionary.
- Return type:
List
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_fs_application() x = application.download_file("1216471B.LOG") print(x) # [{'header': {'source': <Stream.FS: ['0xC6', '0x1']>, .. , 'crc16': 18166}}]
- enable_config_log() Dict ¶
Enables config log.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_fs_application() application.enable_config_log()
- format() Dict ¶
Format the entire file system.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_fs_application() application.format()
- get_file_count() Dict ¶
Returns a packet containing number of file present on the device.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_fs_application() x = application.get_file_count() print(x["payload"]["file_count"]) # 3
- get_status() Dict ¶
Returns current logging status.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_fs_application() x = application.get_status() print(x["payload"]["status"]) # FSStatus.LOGGING_IN_PROGRESS
- get_stream_status(stream: Stream) Dict ¶
Returns specified stream status information.
- Parameters:
stream (Stream) – stream to obtain status information, use get_supported_streams() to list all supported streams.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_fs_application() x = application.get_supported_streams() print(x) # [<Stream.ADPD1: ['0xC2', '0x11']>, ... , <Stream.SQI: ['0xC8', '0x0D']>] x = application.get_stream_status(application.STREAM_ADXL) print(x["payload"]["stream_address"], x["payload"]["num_subscribers"], x["payload"]["num_start_registered"]) # Stream.ADXL 0 0
- static get_supported_streams() List[Stream] ¶
List all supported streams for FS.
- Returns:
Array of stream ID enums.
- Return type:
List
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_fs_application() x = application.get_supported_streams() print(x) # [<Stream.ADPD1: ['0xC2', '0x11']>, ... , <Stream.SQI: ['0xC8', '0xD']>]
- inject_key_value_pair(value_id: str) Dict ¶
Inject Key Value Pair into the log.
- Parameters:
value_id (str) – Key Value pair to inject in log.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_fs_application() x = application.inject_key_value_pair("1234") print(x["payload"]["status"]) # FSStatus.OK
- ls() List[Dict] ¶
List all the files present on the device.
- Returns:
list of response packet as dictionary.
- Return type:
List
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_fs_application() files = application.ls() for file in files: print(file["payload"]["filename"], file["payload"]["filetype"], file["payload"]["file_size"]) # 1216471B.LOG FileType.DATA_FILE 5242880 # 121647E1.LOG FileType.DATA_FILE 477636 # 121647ED.LOG FileType.DATA_FILE 140206
- mount() Dict ¶
Mounts the File system.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_fs_application() application.mount()
- start_logging() Dict ¶
Starts current logging process.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_fs_application() application.start_logging()
- stop_logging() Dict ¶
Stops current logging process.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_fs_application() application.stop_logging()
- stream_file(filename: str, file_stream_callback: Callable) None ¶
Stream specified file from the device.
- Parameters:
filename (str) – filename to download, use ls() to obtain list of all files.
file_stream_callback (Callable) – callback for streaming file
from adi_spo2_watch import SDK def file_callback(data, total_size, stream_progress): print(data) # [{'header': {'source': <Stream.FS: ['0xC6', '0x1']>, .. , 'crc16': 18166}}] sdk = SDK("COM4") application = sdk.get_fs_application() # alternately yo can use download_file if you don't want to stream file content application.stream_file("1216471B.LOG", file_callback) # wait for stream to finish while True: pass
- subscribe_stream(stream: Stream) Dict ¶
Subscribe to the specified stream.
- Parameters:
stream (Stream) – stream name, use get_supported_streams() to list all supported streams.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_fs_application() x = application.get_supported_streams() print(x) # [<Stream.ADPD1: ['0xC2', '0x11']>, ... , <Stream.SQI: ['0xC8', '0xD']>] x = application.subscribe_stream(application.STREAM_ADXL) print(x["payload"]["status"], x["payload"]["stream_address"]) # CommonStatus.SUBSCRIBER_ADDED Stream.ADXL
- unsubscribe_stream(stream: Stream) Dict ¶
UnSubscribe to the specified stream.
- Parameters:
stream (Stream) – stream name, use get_supported_streams() to list all supported streams.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_fs_application() x = application.get_supported_streams() print(x) # [<Stream.ADPD1: ['0xC2', '0x11']>, ... , <Stream.SQI: ['0xC8', '0xD']>] x = application.unsubscribe_stream(application.STREAM_ADXL) print(x["payload"]["status"], x["payload"]["stream_address"]) # CommonStatus.SUBSCRIBER_COUNT_DECREMENT Stream.ADXL
- volume_info() Dict ¶
Returns file system volume information.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_fs_application() x = application.volume_info() print(f'{x["payload"]["total_memory"]}, {x["payload"]["used_memory"]}, {x["payload"]["available_memory"]}%') # 536870656, 6197248, 98%
- write_config_file(filename: str) [Dict] ¶
Writes user config file into FS.
- Parameters:
filename – command.log file to write.
- Returns:
A response packet as dictionary.
- Return type:
[Dict]
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_fs_application() x = application.write_config_file("command.log")
adi_spo2_watch.application.low_touch_application module¶
- class adi_spo2_watch.application.low_touch_application.LowTouchApplication(packet_manager)¶
Bases:
CommonApplication
FS Application class.
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_low_touch_application()
- GENERAL_BLOCK = [0]¶
- LT_APP_LCFG_BLOCK = [10]¶
- START_COMMAND = [1]¶
- STOP_COMMAND = [2]¶
- delete_device_configuration_block(dcb_block_index: DCBConfigBlockIndex) Dict ¶
Deletes ADPD Device configuration block.
- Parameters:
dcb_block_index – dcb block index, use get_supported_dcb_block() to get all supported DCB index.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_low_touch_application() application.delete_device_configuration_block()
- disable_command_logging(command_type: CommandType, filename: str = 'commands.LOG', word_align: bool = False) None ¶
Stops recording SDK commands to a file.
- Parameters:
command_type – Start or Stop command recording, use get_supported_command_type() to get all supported command type.
filename – Name of the file to store commands.
word_align – Word align has to be true for generating LT app DCB, for User config file (FS) word align needs to be false.
- Returns:
None
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_low_touch_application() application.disable_command_logging(application.START)
- disable_touch_sensor() Dict ¶
Disables low touch application, after bottom touch sensor is disabled.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_lt_application() x = application.disable_lt_app() print(x["payload"]["status"]) # LTStatus.OK
- enable_command_logging(command_type: CommandType) None ¶
Starts recording SDK commands to a file.
- Parameters:
command_type – Start or Stop command recording, use get_supported_command_type() to get all supported command type.
- Returns:
None
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_low_touch_application() application.enable_command_logging(application.START)
- enable_touch_sensor() Dict ¶
Enables low touch application, after bottom touch sensor is enabled.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_lt_application() x = application.enable_lt_app() print(x["payload"]["status"]) # LTStatus.OK
- get_low_touch_status() Dict ¶
Returns low touch application status.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_lt_application() x = application.get_low_touch_status() print(x["payload"]["status"]) # LTStatus.LT_APP_STARTED
- static get_supported_command_type() List[CommandType] ¶
List all supported CommandType.
- Returns:
Array of CommandType enums.
- Return type:
List[CommandType]
- static get_supported_dcb_block() List[DCBConfigBlockIndex] ¶
List all supported DCBConfigBlockIndex.
- Returns:
Array of DCBConfigBlockIndex enums.
- Return type:
List[DCBConfigBlockIndex]
- read_ch2_cap() Dict ¶
Read the AD7156 CH2 Capacitance in uF.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_low_touch_application() x = application.read_ch2_cap() print(x["payload"]["cap_value"]) # 0
- read_device_configuration_block(dcb_block_index: DCBConfigBlockIndex, readable_format: bool = True) [Dict] ¶
Returns entire device configuration block.
- Parameters:
dcb_block_index – dcb block index, use get_supported_dcb_block() to get all supported DCB index.
readable_format – Converts binary result into readable commands.
- Returns:
A response packet as dictionary.
- Return type:
[Dict]
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_low_touch_application() x = application.read_device_configuration_block() print(x["payload"]["data"])
- read_library_configuration(fields: List[int]) Dict ¶
Reads library configuration from specified field values.
- Parameters:
fields (List[int]) – List of field values to read.
- Returns:
A response packet as dictionary
- Return type:
Dict
Fields Lower Limit
Fields Upper Limit
0x00
0x04
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_low_touch_application() x = application.read_library_configuration([0x00]) print(x["payload"]["data"]) # [['0x0', '0x0']]
- wrist_detect() Dict ¶
Get the wrist detect status of the user wearing the watch (On Wrist/Off Wrist) and the Sensor application used to detect it. It takes about 7 secs to return the Status. By default, ‘SENSOR_EDA’ is used, when LT application is not running. If LT app is running, it could return the status immediately or take up to 7 secs, if the wrist-detect decision is being made. It uses ‘SENSOR_ECG’ or ‘SENSOR_BIA’ when ECG or BIA app is part of the LT application logging use-case. It shows ‘SENSOR_INVALID’ is the wrist-detect decision is being made. When LT application is started with either ECG/BIA, wrist On is also based on electrodes touched properly.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_low_touch_application() x = application.wrist_detect() print(x["payload"]["wrist_detect_status"]) print(x["payload"]["wrist_detect_sensor_used"]) # 0
- write_device_configuration_block_from_file(filename: str, dcb_block_index: DCBConfigBlockIndex) [Dict] ¶
Writes the device configuration block values from specified binary file.
- Parameters:
dcb_block_index – dcb block index, use get_supported_dcb_block() to get all supported DCB index.
filename – binary filename
- Returns:
A response packet as dictionary.
- Return type:
[Dict]
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_low_touch_application() application.write_device_configuration_block_from_file("lt_dcb.dcb")
- write_library_configuration(fields_values: List[List[int]]) Dict ¶
Writes library configuration from List of fields and values.
- Parameters:
fields_values (List[List[int]]) – List of fields and values to write.
- Returns:
A response packet as dictionary.
- Return type:
Dict
Fields Lower Limit
Fields Upper Limit
0x00
0x04
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_low_touch_application() x = application.write_library_configuration([[0x00, 0x1]]) print(x["payload"]["data"]) # [['0x0', '0x1']]
adi_spo2_watch.application.lt_mode4_application module¶
- class adi_spo2_watch.application.lt_mode4_application.LTMode4Application(packet_manager)¶
Bases:
CommonApplication
lt_mode4 Application class.
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_lt_mode4_application()
- CONFIGURED = [1]¶
- FS_MAX_FILE_COUNT = [5]¶
- FS_MEMORY_FULL = [4]¶
- LOG_DOWNLOAD = [8]¶
- LOG_OFF = [3]¶
- LOG_OFF_TOOL_CONNECTED = [7]¶
- LOG_ON = [2]¶
- SHIPMENT_MODE = [6]¶
- STANDBY = [0]¶
- clear_prev_state_event()¶
Clears the LTMode4 config app’s previous state, event received and the corresponding timestamp structure maintained registered in the Watch Fw.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_lt_mode4_application() application.clear_prev_state_event()
- get_prev_state_event()¶
This is a command, to get the lt_mode4 config app’s previous state, event received and the corresponding timestamp registered in the Watch Fw.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_lt_mode4_application() application.get_prev_state_event()
- get_state()¶
Get lt_mode4 state.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_lt_mode4_application() application.get_state()
- static get_supported_states()¶
List all supported states for LTMode4State.
- Returns:
Array of lt_mode4 state ID enums.
- Return type:
List[LTMode4State]
- set_state(state: LTMode4State)¶
Set lt_mode4 state.
- Parameters:
state (LTMode4State) – lt_mode4 state, use get_supported_states() to list all lt_mode4 states.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_lt_mode4_application() application.set_state(application.STATE_SLEEP)
adi_spo2_watch.application.max30208_application module¶
- class adi_spo2_watch.application.max30208_application.MAX30208Application(packet_manager)¶
Bases:
CommonStream
MAX30208 Application class.
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_max30208_application()
- MAX30208_TEMPERATURE_STREAM = [200, 65]¶
- disable_csv_logging() None ¶
Stops logging stream data into CSV.
- Returns:
None
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_max30208_application() x = application.disable_csv_logging()
- enable_csv_logging(filename: str, header: List = None) None ¶
Start logging stream data into CSV.
- Parameters:
filename – Name of the CSV file.
header – Header list of the CSV file.
- Returns:
None
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_max30208_application() x = application.enable_csv_logging("max30208_temp.csv")
adi_spo2_watch.application.pm_application module¶
- class adi_spo2_watch.application.pm_application.PMApplication(packet_manager)¶
Bases:
CommonApplication
PM Application class.
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_pm_application()
- CHIP_AD5940 = [4]¶
- CHIP_AD7156 = [6]¶
- CHIP_ADP5360 = [3]¶
- CHIP_ADPD4K = [2]¶
- CHIP_ADXL362 = [1]¶
- CHIP_MAX30208 = [7]¶
- CHIP_NAND_FLASH = [5]¶
- CHIP_SH_ADXL367 = [9]¶
- CHIP_SH_MAX86178 = [8]¶
- delete_display_device_configuration_block() Dict ¶
Deletes Display Device configuration block.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_pm_application() application.delete_display_device_configuration_block()
- device_configuration_block_status() Dict ¶
Display dcb status of all applications.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_pm_application() x = application.device_configuration_block_status() print(x["payload"]["adxl_block"], x["payload"]["adpd4000_block"], x["payload"]["ppg_block"]) # 0 0 0
- disable_battery_charging() Dict ¶
Disable battery charging.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_pm_application() application.disable_battery_charging()
- disable_hibernate_mode() Dict ¶
Disable the hibernate mode status in the Watch Fw. It is based on this value that Hibernate Mode happens. It also shows the time in seconds, based on which the Hibernate mode entry happens.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_pm_application() application.disable_hibernate_mode()
- disable_sync_timer() Dict ¶
Disable Sync Timer
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_pm_application() application.disable_sync_timer()
- disable_top_touch() Dict ¶
This API is used to disable top touch application(backlight control) in Fw.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_pm_application() application.disable_top_touch()
- enable_battery_charging() Dict ¶
Enable battery charging.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_pm_application() application.enable_battery_charging()
- enable_hibernate_mode(seconds_to_trigger: int) Dict ¶
Enable the hibernate mode status in the Watch Fw. It is based on this value that Hibernate Mode happens.
- Parameters:
seconds_to_trigger – Time in seconds, based on which the Hibernate mode entry happens.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_pm_application() application.enable_hibernate_mode()
- enable_sync_timer() Dict ¶
Enables Sync Timer
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_pm_application() application.enable_sync_timer()
- enable_top_touch() Dict ¶
This API is used to enable top touch application(backlight control) in Fw.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_pm_application() application.enable_top_touch()
- enter_boot_loader_mode() Dict ¶
Sets the device to boot loader mode.
- Returns:
A empty dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_pm_application() application.enter_boot_loader_mode()
- fds_erase() Dict ¶
Erases the NOR flash pages reserved for FDS; This command will result in BLE disconnection and watch reset.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_pm_application() application.fds_erase()
- get_bootloader_version() Dict ¶
Get the bootloader’s version information, if Bootloader is present in the Watch. This returns 0, if Bootloader is not present or if Bootloader DFU has not yet been done.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_pm_application() application.get_bootloader_version()
- get_chip_id(chip_name: ChipID) Dict ¶
Returns chip id for specified chip name.
- Parameters:
chip_name (ChipID) – get chip id of the chip_name, use get_supported_chips() to list all support chip names.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_pm_application() x = application.get_supported_chips() print(x) # [<ChipID.CHIP_ADXL362: ['0x1']>, ... , <ChipID.CHIP_AD7156: ['0x6']>] x = application.get_chip_id(application.CHIP_ADPD4K) print(x["payload"]["chip_name"], x["payload"]["chip_id"]) # ChipID.ADPD4K 192
- get_datetime() Dict ¶
Returns device current datetime.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_pm_application() x = application.get_datetime() print(f"{x['payload']['year']}-{x['payload']['month']}-{x['payload']['day']}") # 2020-12-16 print(f"{x['payload']['hour']}:{x['payload']['minute']}:{x['payload']['second']}") # 15:17:57
- get_existing_connection()¶
Connect to serial device over USB or BLE, after checking if there is previous tool staying connected to the watch. Provide a serial device identifier appropriate for your platform (COMX for Windows, /dev/ttyX for Linux and OSX).
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_pm_application() application.connect_usb_check_previous_tool_connection()
- get_hibernate_mode() Dict ¶
Get the hibernate mode status- enabled/disabled in the Watch Fw. It is based on this value that Hibernate Mode happens. It also shows the time in seconds, based on which the Hibernate mode entry happens.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_pm_application() application.get_hibernate_mode()
- get_mcu_version() Dict ¶
Returns Device MCU version.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_pm_application() x = application.get_mcu_version() print(x["payload"]["mcu"]) # MCUType.MCU_M4
- static get_supported_chips() List[ChipID] ¶
List all supported chips for PM.
- Returns:
Array of chips enums.
- Return type:
List
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_pm_application() x = application.get_supported_chips() print(x) # [<ChipID.CHIP_ADXL362: ['0x1']>, ... , <ChipID.CHIP_AD7156: ['0x6']>]
- get_system_info() Dict ¶
Returns Device system info.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_pm_application() x = application.get_system_info() print(x["payload"]["version"]) # 0 print(x["payload"]["mac_address"]) # C5-05-CA-F1-67-D5 print(x["payload"]["device_id"]) # 0
- get_top_touch_status() Dict ¶
- This API is used to get the status of top touch application(backlight control) in Fw,
whether it is enabled or disabled
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_pm_application() application.get_top_touch_status()
- get_version() Dict ¶
Returns Device version info.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_pm_application() x = application.get_version() print(x["payload"]["major_version"]) # 1 print(x["payload"]["minor_version"]) # 0 print(x["payload"]["patch_version"]) # 1 print(x["payload"]["version_string"]) # -Perseus print(x["payload"]["build_version"]) # |298b4ce1_Rl|2020-12-14 12:34:31 -0500
- load_configuration() Dict ¶
This command must be used every time after PM DCB write/erase to update the device configuration. Otherwise not needed as ADP5360 config is already loaded during boot up.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_pm_application() application.load_configuration()
- read_display_device_configuration_block() Dict ¶
Returns entire device configuration block.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_pm_application() x = application.read_display_device_configuration_block() print(x["payload"]["data"]) # []
- read_uicr_customer_registers() Dict ¶
Read UICR customer Register.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_pm_application() packet = application.read_uicr_customer_registers()
- set_datetime(date_time: datetime) Dict ¶
Set specified datetime to device.
- Parameters:
date_time (datetime) – datetime for device.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK import datetime sdk = SDK("COM4") application = sdk.get_pm_application() now = datetime.datetime.now() x = application.set_datetime(now) print(x["payload"]["status"]) # CommonStatus.OK
- start_sync_timer() Dict ¶
Starts Sync Timer
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_pm_application() application.start_sync_timer()
- stop_sync_timer() Dict ¶
Stops Sync Timer
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_pm_application() application.enable_sync_timer()
- system_hardware_reset() Dict ¶
Reset device hardware.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_pm_application() x = application.system_hardware_reset() print(x["payload"]["status"]) # PMStatus.OK
- system_reset() Dict ¶
Reset device system.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_pm_application() x = application.system_reset() print(x["payload"]["status"]) # PMStatus.OK
- write_display_device_configuration_block(addresses_values: List[List[int]]) Dict ¶
Writes the device configuration block values of specified addresses. This function takes a list of addresses and values to write, and returns a response packet as dictionary containing addresses and values.
- Parameters:
addresses_values (List[List[int]]) – List of addresses and values to write.
- Returns:
A response packet as dictionary.
- Return type:
Dict
Address Lower Limit
Address Upper Limit
0x20
0x2E
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_pm_application() x = application.write_display_device_configuration_block([[0x20, 2], [0x21, 0x1]]) print(x["payload"]["size"]) # 2
- write_display_device_configuration_block_from_file(filename: str) Dict ¶
Writes the device configuration block values of specified addresses from file.
- Parameters:
filename – dcb filename
- Returns:
A response packet as dictionary.
- Return type:
Dict
Address Lower Limit
Address Upper Limit
0x20
0x2E
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_pm_application() application.write_display_device_configuration_block_from_file("display_dcb.dcfg")
- write_uicr_customer_registers(hw_revision: str = None, manufacture_date: str = None) Dict ¶
Writes to UICR customer Register. This API can only be used after NOR flash is erased, the following command can be used to do so: $nrfjprog –eraseall
- The following information is written to UICR. Hardcoded information:
manufacturer_name “ADI”, model_number “EVAL-HCRWATCH4Z hw_revision “4.3.00” serial_number 12 bytes BLE MAC address manufacture_date is current system date manufacture_date This is optional.
- Parameters:
manufacture_date – manufacture date size limit 12. default = current system date(YYYY-MM-DD).
hw_revision – hw revision size limit 8. default = 4.3.00.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_pm_application() packet = application.write_uicr_customer_registers("2022-02-15")
adi_spo2_watch.application.sensorhub_application module¶
- class adi_spo2_watch.application.sensorhub_application.SensorHubApplication(packet_manager)¶
Bases:
CommonStream
Sensor Hub Application class.
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application()
- ADXL367_DEVICE = [2]¶
- DEVICE_367 = [111, 1]¶
- DEVICE_AMA = [71]¶
- DEVICE_BIOZ = [50]¶
- DEVICE_ECG = [49]¶
- DEVICE_G_R_IR = [48]¶
- DEVICE_WAS = [70]¶
- MAX86178_DEVICE = [1]¶
- MAX86178_ECG_DEVICE = [4]¶
- SENSORHUB_DEVICE = [3]¶
- SH_ADXL367_MEAS_RANGE_2G = [0]¶
- SH_ADXL367_MEAS_RANGE_4G = [1]¶
- SH_ADXL367_MEAS_RANGE_8G = [2]¶
- SH_ADXL_STREAM = [200, 50]¶
- SH_AMA_STREAM = [200, 55]¶
- SH_APPLICATION_MODE = [0]¶
- SH_BOOTLOADER_MODE = [1]¶
- SH_CONFIG_ADXL_MODE = [3]¶
- SH_CONFIG_ALGO_MODE = [1]¶
- SH_CONFIG_AMA_MODE = [6]¶
- SH_CONFIG_BIOZ_MODE = [5]¶
- SH_CONFIG_ECG_MODE = [4]¶
- SH_CONFIG_PPG_MODE = [2]¶
- SH_CONFIG_RAW_MODE = [0]¶
- SH_HRM_STREAM = [200, 49]¶
- SH_MAX86178_BIOZ_STREAM = [200, 54]¶
- SH_MAX86178_ECG_STREAM = [200, 53]¶
- SH_MAX86178_STREAM1 = [200, 42]¶
- SH_MAX86178_STREAM2 = [200, 43]¶
- SH_MAX86178_STREAM3 = [200, 44]¶
- SH_MAX86178_STREAM4 = [200, 45]¶
- SH_MAX86178_STREAM5 = [200, 46]¶
- SH_MAX86178_STREAM6 = [200, 47]¶
- SH_REG_CONF_STREAM = [200, 51]¶
- SH_RR_STREAM = [200, 52]¶
- SH_SPO2_STREAM = [200, 48]¶
- adxl367_read_register(addresses: List[int]) Dict ¶
Read the register value of specified address.
- Parameters:
addresses (List[int]) – List of register addresses to read.
- Returns:
A response packet as dictionary.
- Return type:
Dict
Address Lower Limit
Address Upper Limit
0x00
0x45
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() x = application.adxl367_read_register([0x20, 0x21]) print(x["payload"]["data"]) # [['0x20', '0x07'] [0x21, 0x00]]
- adxl367_self_test(meas_range: ADXL367MeasRange) Dict ¶
Command to run ADXL367 self test through the sensorhub
- Parameters:
meas_range (ADXL367MeasRange) – Measure range to be used, use get_supported_adxl367_meas_range() to get supported measurement range
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() x = application.adxl367_self_test(application.SH_ADXL367_MEAS_RANGE_8G) print(x["payload"]["result"])
- adxl367_write_register(addresses_values: List[List[int]]) Dict ¶
Writes the register value of specified address.
- Parameters:
addresses_values (List[List[int]]) – List of register addresses and values to write.
- Returns:
A response packet as dictionary.
- Return type:
Dict
Address Lower Limit
Address Upper Limit
0x00
0x45
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() x = application.adxl367_write_register([[0x20, 0x1], [0x21, 0x2]]) print(x["payload"]["data"]) # [['0x20', '0x1'], ['0x21', '0x2']]
- bootloader_test_data() Dict ¶
Fetch the page size (if any) that’s set in the Sensorhub. If page size read out is ‘0’ this means that no page size has been configured at sensorhub.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() x = application.bootloader_test_data() print(x)
- delete_adxl367_device_configuration_block() Dict ¶
Deletes ADXL367 Device configuration block.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() application.delete_adxl367_device_configuration_block()
- delete_max86178_device_configuration_block() Dict ¶
Deletes MAX86178 Device configuration block.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() application.delete_max86178_device_configuration_block()
- disable_csv_logging(stream: ~adi_spo2_watch.core.enums.common_enums.Stream = <Stream.SENSORHUB_MAX86178_STREAM1: ['0xC8', '0x2A']>) None ¶
Stops logging stream data into CSV.
- Parameters:
stream – stream name, use get_supported_streams() to list all supported streams.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() x = application.disable_csv_logging(stream = application.SH_MAX86178_STREAM1)
- enable_csv_logging(filename: str, header: ~typing.List = None, stream: ~adi_spo2_watch.core.enums.common_enums.Stream = <Stream.SENSORHUB_MAX86178_STREAM1: ['0xC8', '0x2A']>) None ¶
Start logging stream data into CSV.
- Parameters:
filename – Name of the CSV file.
header – Header list of the CSV file.
stream – stream name, use get_supported_streams() to list all supported streams.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() x = application.enable_csv_logging("ppg.csv", stream = application.SH_MAX86178_STREAM1)
- enter_sh_boot_loader_mode(mode: bool) Dict ¶
Sets the Sensor Hub device to boot loader mode.
- Parameters:
mode (bool) – True for bootloader mode, False for application mode
- Returns:
A empty dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() x = application.enter_boot_loader_mode(True) print(x)
- get_adxl367_calibration_config() Dict ¶
Fetch ADXL367 calibration config
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() application.get_adxl367_calibration_config()
- get_adxl367_calibration_en() Dict ¶
Fetch ADXL367 calibration
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() application.get_adxl367_calibration_en()
- get_algo_decimation() Dict ¶
Get the decimation status for algorithm data stream :return: A response packet as dictionary. :rtype: Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() application.get_algo_decimation()
- get_operation_mode() Dict ¶
Fetch sensorhub’s current operation mode
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() x = application.get_operation_mode() print(x)
- get_sensor_status(stream: ~adi_spo2_watch.core.enums.common_enums.Stream = <Stream.SENSORHUB_MAX86178_STREAM1: ['0xC8', '0x2A']>) Dict ¶
Returns packet with number of subscribers and number of sensor start request registered.
- Parameters:
stream – stream name, use get_supported_streams() to list all supported streams.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() x = application.get_sensor_status(application.SH_MAX86178_STREAM1) print(x["payload"]["num_subscribers"], x["payload"]["num_start_registered"]) # 0 0
- get_sh_algo_version() Dict ¶
Command fetch the sensorhub algorithm version
- Returns:
A empty dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() x = application.get_sh_algo_version() print(f'{x["payload"]["major"]}.{x["payload"]["minor"]}.{x["payload"]["patch"]}')
- get_sh_firmware_version() Dict ¶
Command to fetch the sensorhub firmware version
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() x = application.get_sh_firmware_version() print(f'{x["payload"]["major"]}.{x["payload"]["minor"]}.{x["payload"]["patch"]}')
- get_sh_frequency(device: ~adi_spo2_watch.core.enums.sensorhub_enums.SHDevice = <SHDevice.SENSORHUB_DEVICE: ['0x03']>) Dict ¶
Command to get the sampling frequency (in Hz) for the sensors at sensorhub
- Parameters:
odr – Sampling frequency in hz
device – Device for which ODR is to be set, use get_supported_devices() to fetch supported devices
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() x = application.get_sh_frequency(application.SENSORHUB_DEVICE) print(x["payload"]["odr"])
- get_sh_page_size() Dict ¶
Fetch the page size (if any) that’s set in the sensorhub. If page size read out is ‘0’ this means that no page size has been configured at sensorhub.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() x = application.get_sh_page_size() print(x)
- get_sh_rr_version() Dict ¶
Command fetch the sensorhub Respiration rate version
- Returns:
A empty dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() x = application.get_sh_rr_version() print(f'{x["payload"]["major"]}.{x["payload"]["minor"]}.{x["payload"]["patch"]}')
- static get_supported_adxl367_devices() List[ADXL367Device] ¶
List all supported device ID for adxl367.
- Returns:
Array of device ID enums.
- Return type:
List[ADXL367Device]
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() x = application.get_supported_adxl367_devices() print(x) # [<SensorHubApplication.DEVICE_367: ['0x6F', '0x1']>]
- static get_supported_adxl367_meas_range() List[ADXL367MeasRange] ¶
List all supported measurement range for ADXL367
- Returns:
Array of measurement range enums.
- Return type:
List[ADXL367MeasRange]
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() x = application.get_supported_adxl367_meas_range() print(x) # [<SensorHubApplication.SH_ADXL367_MEAS_RANGE_2G: ['0x00']>,...]
- static get_supported_config_ids() List[SHConfigID] ¶
List all supported Sensorhub configurations
- Returns:
Array of config ID enums.
- Return type:
List[SHConfigID]
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() x = application.get_supported_config_ids() print(x) # [<SHConfigID.SENSORHUB_RAW_MODE: ['0x00']>, ... , <SHConfigID.SENSORHUB_ADXL_MODE: ['0x05']>]
- static get_supported_devices() List[SHDevice] ¶
List all supported devices.
- Returns:
Array of device ID enums.
- Return type:
List[SHDevice]
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() x = application.get_supported_devices() print(x) # [<SensorHubApplication.MAX81678_DEVICE: ['0x1']>, ...]
- static get_supported_max86178_devices() List[MAX86178Device] ¶
List all supported device ID for max86178.
- Returns:
Array of device ID enums.
- Return type:
List[MAX86178Device]
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() x = application.get_supported_max86178_devices() print(x) # [<SensorHubApplication.DEVICE_G_R_IR: ['0x30']>]
- static get_supported_streams() List[Stream] ¶
List all supported streams for Sensorhub.
- Returns:
Array of stream ID enums.
- Return type:
List[Stream]
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() x = application.get_supported_streams() print(x) # [<Stream.SENSORHUB_MAX86178_STREAM1: ['0xC8', '0x27']>, ... , <Stream.SENSORHUB_HRM_STREAM: ['0xC8', 0x2B']>]
- static get_supported_was_devices() List[ALGODevice] ¶
List all supported device ID.
- Returns:
Array of device ID enums.
- Return type:
List[ALGODevice]
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() x = application.get_supported_was_devices() print(x) # [<SensorHubApplication.DEVICE_WAS: ['0x46']>]
- load_adxl367_configuration(device_id: ADXL367Device) Dict ¶
Loads specified device id configuration.
- Parameters:
device_id (ADXL367Device) – Device ID to load, use get_supported_adxl367_devices() to list all supported adxl367 devices.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() x = application.get_supported_adxl367_devices() print(x) # [<ADXL367Device.DEVICE_367: ['0x6F', '0x1']>] x = application.load_adxl367_configuration(application.DEVICE_367) print(x["payload"]["device_id"]) # <ADXL367Device.DEVICE_367: ['0x6F', '0x1']>
- load_max86178_configuration(device_id: MAX86178Device) Dict ¶
Loads specified device id configuration.
- Parameters:
device_id (MAX86178Device) – Device ID to load, use get_supported_max86178_devices() to list all supported devices.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() x = application.get_supported_max86178_devices() print(x) # [<MAX86178Device.DEVICE_G_R_IR: ['0x30']>] x = application.load_max86178_configuration(application.DEVICE_G_R_IR) print(x["payload"]["device_id"]) # <MAX86178Device.DEVICE_G_R_IR: ['0x30']>
- load_was_configuration(device_id: ALGODevice) Dict ¶
Loads specified device id configuration.
- Parameters:
device_id (ALGODevice) – Device ID to load, use get_supported_was_devices() to list all supported devices.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() x = application.get_supported_was_devices() print(x) # [<MAX86178Device.DEVICE_WAS: ['0x46']>] x = application.load_was_configuration(application.DEVICE_WAS) print(x["payload"]["device_id"]) # <MAX86178Device.DEVICE_WAS: ['0x46']>
- lp_self_test() Dict ¶
Perform self test for Sensorhub’s low power mode
x = application.lp_self_test() print(x[“payload”][“result”])
- max86178_enable_ecg_packetization(enable: bool) Dict ¶
Enable/Disable continuous stream from MAX86178 ECG based on lead status :param enable : True -> Continuous stream, False -> Stream only when Leads on is detected :return: A response packet as dictionary. :rtype: Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() x = application.max86178_enable_ecg_packetization(True) print(x["payload"]["status"]) # CommonStatus.OK
- max86178_read_register(addresses: List[int]) Dict ¶
Read the register value of specified address.
- Parameters:
addresses (List[int]) – List of register addresses to read.
- Returns:
A response packet as dictionary.
- Return type:
Dict
Address Lower Limit
Address Upper Limit
0x00
0xC9
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() x = application.max86178_read_register([0x20, 0x21]) print(x["payload"]["data"] # [['0x20', '0x07'] [0x21, 0x00]]
- max86178_write_register(addresses_values: List[List[int]]) Dict ¶
Writes the register value of specified address.
- Parameters:
addresses_values (List[List[int]]) – List of register addresses and values to write.
- Returns:
A response packet as dictionary.
- Return type:
Dict
Address Lower Limit
Address Upper Limit
0x00
0xC9
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() x = application.max86178_write_register([[0x20, 0x1], [0x21, 0x2]]) print(x["payload"]["data"]) # [['0x20', '0x1'], ['0x21', '0x2']]
- read_adxl367_device_configuration_block() Dict ¶
Returns the entire adxl367 device configuration block.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() x = application.read_adxl367_device_configuration_block() print(x["payload"]["data"]) # []
- read_library_configuration(fields: List[int]) Dict ¶
Reads library configuration from specified field values.
- Parameters:
fields (List[int]) – List of field values to read.
- Returns:
A response packet as dictionary
- Return type:
Dict
Fields Lower Limit
Fields Upper Limit
0x00
0x34
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() x = application.read_library_configuration([0x0000]) print(x["payload"]["data"]) # [['0x0', '0x0']]
- read_max86178_device_configuration_block() List[Dict] ¶
Returns entire device configuration block.
- Returns:
A response packet as dictionary.
- Return type:
[Dict]
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() x = application.read_max86178_device_configuration_block() print(x["payload"]["data"])
- read_register_dump(device_id: SHDevice) List[Dict] ¶
Returns device configuration data. :param read : device enum :type fields: SHDevice, use get_supported_devices() to fetch supported devices :return: A response packet as dictionary. :rtype: List[Dict]
from adi_spo2_watch import SDK sdk = SDK("COM4") sdk = SDK("COM4") application = sdk.get_sensorhub_application() x = application.sh_read_reg_dump() print(x["payload"]["data"]) # [['0x0', '0x12']]
- read_was_library_configuration_block() List[Dict] ¶
Returns entire was device configuration block.
- Returns:
A response packet as dictionary.
- Return type:
[Dict]
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() x = application.read_was_library_configuration_block() print(x["payload"]["data"])
- set_adxl367_calibration_config(x_gain: int, y_gain: int, z_gain: int, x_offset: int, y_offset: int, z_offset: int) Dict ¶
Fetch ADXL367 calibration config
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() application.set_adxl367_calibration_config(10000, 10000, 10000, 0, 0, 0)
- set_adxl367_calibration_en(cal_en: bool) Dict ¶
Enable/disable ADXL367 calibration
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() application.set_adxl367_calibration_en(True)
- set_algo_decimation(en_reg_decimation: bool, en_spo2_decimation: bool, en_hr_decimation: bool, en_rr_decimation: bool) Dict ¶
Set the decimation for algorithm data stream :return: A response packet as dictionary. :rtype: Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() application.set_algo_decimation(True, True, True, True)
- set_callback(callback_function: ~typing.Callable, args: ~typing.Tuple = (), stream: ~adi_spo2_watch.core.enums.common_enums.Stream = <Stream.SENSORHUB_MAX86178_STREAM1: ['0xC8', '0x2A']>) None ¶
Sets the callback for the stream data.
- Parameters:
callback_function – callback function for specified sensorhub stream.
args – optional arguments that will be passed with the callback.
stream (Stream) – stream name, use get_supported_streams() to list all supported streams.
- Returns:
None
from adi_spo2_watch import SDK # make sure optional arguments have default value to prevent them causing Exceptions. def callback(data, optional1=None, optional2=None): print(data) sdk = SDK("COM4") application = sdk.get_sensorhub_application() # these optional arguments can be used to pass file, matplotlib or other objects to manipulate data. optional_arg1 = "1" optional_arg2 = "2" application.set_callback(callback, args=(optional_arg1, optional_arg2), stream=application.PPG)
- set_operation_mode(sh_mode: SHConfigID) Dict ¶
Set sensorhub operation mode.
- Parameters:
sh_mode (SHConfigID) – Operation mode, use get_supported_config_ids() to get supported operation modes
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() x = application.set_operation_mode(application.SH_CONFIG_RAW_MODE) print(x["payload"]["status"])
- set_sh_authorization(auth: List[int]) Dict ¶
Fetch the page size (if any) that’s set in the sensorhub. If page size read out is ‘0’ this means that no page size has been configured at sensorhub.
- Parameters:
nonce (List[int]) – auth
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() x = application.set_sh_authorization([97, 67]) print(x)
- set_sh_frequency(odr: int, device: ~adi_spo2_watch.core.enums.sensorhub_enums.SHDevice = <SHDevice.SENSORHUB_DEVICE: ['0x03']>) Dict ¶
Command to set the sampling frequency (in Hz) for the sensors at sensorhub Supported frequencies: 25Hz, 50Hz, 100Hz
- Parameters:
odr (int) – Sampling frequency in hz
device – Device for which ODR is to be set, use get_supported_devices() to fetch supported devices
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() x = application.set_sh_frequency(25, application.SENSORHUB_DEVICE) print(x["payload"]["odr"])
- set_sh_iv(nonce: List[int]) Dict ¶
Fetch the page size (if any) that’s set in the sensorhub. If page size read out is ‘0’ this means that no page size has been configured at sensorhub.
- Parameters:
nonce (List[int]) – IV
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() x = application.set_sh_iv([415, 67]) print(x["payload"]["status"])
- set_sh_page_num(page_num: int) Dict ¶
Set the page size in the sensorhub.
- Parameters:
page_num (int) – Page size in bytes
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() x = application.set_sh_page_num(8196) print(x)
- sh_erase_flash() Dict ¶
Fetch the page size (if any) that’s set in the Sensorhub. If page size read out is ‘0’ this means that no page size has been configured at sensorhub.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() x = application.sh_erase_flash() print(x)
- sh_exit_bootloader() Dict ¶
Fetch the page size (if any) that’s set in the Sensorhub. If page size read out is ‘0’ this means that no page size has been configured at sensorhub.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() x = application.sh_exit_bootloader() print(x)
- sh_hard_reset() Dict ¶
Command to perform the hard reset to enter in application mode at sensorhub.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() x = application.sh_hard_reset() print(x["payload"]["wakeupmode"])
- sh_init_download_page() Dict ¶
Fetch the page size (if any) that’s set in the Sensorhub. If page size read out is ‘0’ this means that no page size has been configured at sensorhub.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() x = application.sh_init_download_page() print(x)
- sh_start_download_page(packet_num: int, page_num: int, page_part_sz: int, page: List[int]) Dict ¶
Fetch the page size (if any) that’s set in the Sensorhub. If page size read out is ‘0’ this means that no page size has been configured at sensorhub.
- Parameters:
packet_num (int) – Packet number
page_num (int) – Page number
page_part_sz (int) – Page part size
page (List[int]) – Page
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() x = application.sh_start_download_page(0, 0, 1024, [0xFF, 0xFF...]) print(x)
- start_and_subscribe_stream(stream: ~adi_spo2_watch.core.enums.common_enums.Stream = <Stream.SENSORHUB_MAX86178_STREAM1: ['0xC8', '0x2A']>) Tuple[Dict, Dict] ¶
Starts sensorhub and also subscribes to the specified stream.
- Parameters:
stream (Stream) – stream name, use get_supported_streams() to list all supported streams.
- Returns:
A response packet as dictionary.
- Return type:
Tuple[Dict, Dict]
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() x = application.get_supported_streams() # [<Stream.SENSORHUB_MAX86178_STREAM1: [0xC8, 0x27]>, ... , <Stream.SENSORHUB_ADXL367_STREAM: [0xC8, 0x2C]>] start_sensor, subs_stream = application.start_and_subscribe_stream() print(start_sensor["payload"]["status"], subs_stream["payload"]["status"]) # CommonStatus.STREAM_STARTED CommonStatus.SUBSCRIBER_ADDED
- stop_and_unsubscribe_stream(stream: ~adi_spo2_watch.core.enums.common_enums.Stream = <Stream.SENSORHUB_MAX86178_STREAM1: ['0xC8', '0x2A']>) Tuple[Dict, Dict] ¶
Stops sensorhub and also unsubscribes from specified stream.
- Parameters:
stream (Stream) – stream name, use get_supported_streams() to list all supported streams.
- Returns:
A response packet as dictionary.
- Return type:
Tuple[Dict, Dict]
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() x = application.get_supported_streams() # [<Stream.SENSORHUB_MAX86178_STREAM1: [0xC8, 0x27]>, ... , <Stream.SENSORHUB_ADXL367_STREAM: [0xC8, 0x2C]>] stop_sensor, unsubscribe_stream = application.stop_and_unsubscribe_stream() print(stop_sensor["payload"]["status"], unsubscribe_stream["payload"]["status"]) # CommonStatus.STREAM_STOPPED CommonStatus.SUBSCRIBER_REMOVED
- subscribe_stream(stream: ~adi_spo2_watch.core.enums.common_enums.Stream = <Stream.SENSORHUB_MAX86178_STREAM1: ['0xC8', '0x2A']>) Dict ¶
Subscribe to the specified stream.
- Parameters:
stream (Stream) – stream name, use get_supported_streams() to list all supported streams.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() x = application.get_supported_streams() # [<Stream.SENSORHUB_MAX86178_STREAM1: [0xC8, 0x27]>, ... , <Stream.SENSORHUB_ADXL367_STREAM: [0xC8, 0x2C]>] subs_stream = application.subscribe_stream() print(subs_stream["payload"]["status"]) # CommonStatus.SUBSCRIBER_ADDED
- unsubscribe_stream(stream: ~adi_spo2_watch.core.enums.common_enums.Stream = <Stream.SENSORHUB_MAX86178_STREAM1: ['0xC8', '0x2A']>) Dict ¶
Unsubscribe the specified stream.
- Parameters:
stream (Stream) – stream name, use get_supported_streams() to list all supported streams.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() x = application.get_supported_streams() # [<Stream.SENSORHUB_MAX86178_STREAM1: [0xC8, 0x27]>, ... , <Stream.SENSORHUB_ADXL367_STREAM: [0xC8, 0x2C]>] unsubscribe_stream = application.unsubscribe_stream() print(unsubscribe_stream["payload"]["status"]) # CommonStatus.SUBSCRIBER_REMOVED
- write_adxl367_device_configuration_block(addresses_values: List[List[int]]) Dict ¶
Writes the device configuration block values of specified addresses. This function takes a list of addresses and values to write, and returns a response packet as dictionary containing addresses and values.
- Parameters:
addresses_values (List[List[int]]) – List of addresses and values to write.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() x = application.write_adxl367_device_configuration_block([[0x20, 2], [0x21, 0x1]]) print(x["payload"]["size"]) # 2
- write_adxl367_device_configuration_block_from_file(filename: str) Dict ¶
Writes the device configuration block values of specified addresses from file.
- Parameters:
filename – dcb filename
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() application.write_adxl367_device_configuration_block_from_file("adxl367_dcb.dcfg")
- write_library_configuration(fields_values: List[List[int]]) List[Dict] ¶
Writes the was configuration block values of specified fields. This function takes a list of fields and values to write, and returns a response packet as dictionary containing fields and values.
- Parameters:
fields_values (List[List[int]]) – List of addresses and values to write.
- Returns:
A response packet as dictionary.
- Return type:
List[Dict]
Address Lower Limit
Address Upper Limit
0x0000
0x0277
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() x = application.write_library_configuration([[0x20, 2], [0x21, 0x1]]) print(x["payload"]["size"]) # 2
- write_max86178_device_configuration_block(addresses_values: List[List[int]]) List[Dict] ¶
Writes the device configuration block values of specified addresses. This function takes a list of addresses and values to write, and returns a response packet as dictionary containing addresses and values.
- Parameters:
addresses_values (List[List[int]]) – List of addresses and values to write.
- Returns:
A response packet as dictionary.
- Return type:
[Dict]
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() x = application.write_max86178_device_configuration_block([[0x20, 2], [0x21, 0x1]]) print(x["payload"]["size"]) # 2
- write_max86178_device_configuration_block_from_file(filename: str) List[Dict] ¶
Writes the device configuration block values of specified addresses from file.
- Parameters:
filename – dcb filename
- Returns:
A response packet as dictionary.
- Return type:
[Dict]
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() application.write_max86178_device_configuration_block_from_file("max86178_dcb.dcfg")
- write_was_library_configuration_block_from_file(filename: str) Dict ¶
Writes the was configuration block values of specified addresses from file.
- Parameters:
filename – was filename
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_sensorhub_application() application.write_was_library_configuration_block_from_file("sh_was.lcfg")
adi_spo2_watch.application.session_manager_application module¶
- class adi_spo2_watch.application.session_manager_application.SessionManagerApplication(packet_manager)¶
Bases:
CommonApplication
Session Manager Application class.
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_session_manager_application()
- delete_device_configuration_block() Dict ¶
Deletes PM Device configuration block.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_session_manager_application() application.delete_device_configuration_block()
- static get_session_states()¶
List all supported streams.
- Returns:
Array of stream ID enums.
- Return type:
List[Stream]
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_session_manager_application() x = application.get_session_states() print(x)
- read_device_configuration_block() Dict ¶
Returns entire device configuration block.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_session_manager_application() x = application.read_device_configuration_block() print(x["payload"]["data"]) # []
- read_library_configuration(fields: List[int]) Dict ¶
Reads library configuration from specified index values.
- Parameters:
fields (List[int]) – List of field values to read.
- Returns:
A response packet as dictionary
- Return type:
Dict
Fields Lower Limit
Fields Upper Limit
0x00
0x19
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_session_manager_application() x = application.read_library_configuration([0x02, 0x06, 0x07]) print(x["payload"]["data"]) # [['0x0', '0x0']]
- start_sensor()¶
Starts sensor.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_session_manager_application() start_sensor = application.start_sensor() print(start_sensor["payload"]["status"]) # CommonStatus.STREAM_STARTED
- stop_sensor()¶
Stops sensor.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_session_manager_application() stop_sensor = application.stop_sensor() print(stop_sensor["payload"]["status"]) # CommonStatus.STREAM_STOPPED
- write_device_configuration_block(addresses_values: List[List[int]]) Dict ¶
Writes the device configuration block values of specified addresses. This function takes a list of addresses and values to write, and returns a response packet as dictionary containing addresses and values.
- Parameters:
addresses_values (List[List[int]]) – List of addresses and values to write.
- Returns:
A response packet as dictionary.
- Return type:
Dict
Address Lower Limit
Address Upper Limit
0x00
0x13
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_user0_application() x = application.write_device_configuration_block([[0x10, 0x10], [0x02, 0x02]) print(x["payload"]["size"]) # 2
- write_device_configuration_block_from_file(filename: str) Dict ¶
Writes the device configuration block values of specified addresses from file.
- Parameters:
filename – dcb filename
- Returns:
A response packet as dictionary.
- Return type:
Dict
Address Lower Limit
Address Upper Limit
0x00
0x19
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_session_manager_application() application.write_device_configuration_block_from_file("session_config_dcb.lcfg")
- write_library_configuration(fields_values: List[List[int]]) Dict ¶
Writes library configuration from List of fields and values.
- Parameters:
fields_values (List[List[int]]) – List of fields and values to write.
- Returns:
A response packet as dictionary.
- Return type:
Dict
Fields Lower Limit
Fields Upper Limit
0x00
0x13
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_session_manager_application() x = application.write_library_configuration([[0x02, 0x2]]) print(x["payload"]["data"]) # [['0x0', '0x1']]
adi_spo2_watch.application.test_application module¶
- class adi_spo2_watch.application.test_application.TestApplication(key_press_callback_function, cap_sense_callback_function, packet_manager)¶
Bases:
CommonApplication
- BLACK = [1]¶
- BLUE = [4]¶
- GREEN = [3]¶
- LDO_EPHYZ = [3]¶
- LDO_FS = [1]¶
- LDO_OPTICAL = [2]¶
- LED_BLUE = [4]¶
- LED_GREEN = [1]¶
- LED_IR = [3]¶
- LED_MWL = [0]¶
- LED_RED = [2]¶
- POWER_MODE_ACTIVE = [0]¶
- POWER_MODE_HIBERNATE = [2]¶
- POWER_MODE_SHUTDOWN = [3]¶
- RED = [2]¶
- STREAM_ADPD1 = [194, 17]¶
- STREAM_ADPD10 = [194, 26]¶
- STREAM_ADPD11 = [194, 27]¶
- STREAM_ADPD12 = [194, 28]¶
- STREAM_ADPD2 = [194, 18]¶
- STREAM_ADPD3 = [194, 19]¶
- STREAM_ADPD4 = [194, 20]¶
- STREAM_ADPD5 = [194, 21]¶
- STREAM_ADPD6 = [194, 22]¶
- STREAM_ADPD7 = [194, 23]¶
- STREAM_ADPD8 = [194, 24]¶
- STREAM_ADPD9 = [194, 25]¶
- STREAM_ADXL = [194, 2]¶
- STREAM_BCM = [196, 7]¶
- STREAM_ECG = [196, 1]¶
- STREAM_EDA = [196, 2]¶
- STREAM_PEDOMETER = [196, 4]¶
- STREAM_PPG = [196, 0]¶
- STREAM_SQI = [200, 13]¶
- STREAM_SYNC_PPG = [196, 5]¶
- STREAM_TEMPERATURE1 = [200, 22]¶
- STREAM_TEMPERATURE10 = [200, 31]¶
- STREAM_TEMPERATURE11 = [200, 32]¶
- STREAM_TEMPERATURE12 = [200, 33]¶
- STREAM_TEMPERATURE2 = [200, 23]¶
- STREAM_TEMPERATURE3 = [200, 24]¶
- STREAM_TEMPERATURE4 = [196, 6]¶
- STREAM_TEMPERATURE5 = [200, 26]¶
- STREAM_TEMPERATURE6 = [200, 27]¶
- STREAM_TEMPERATURE7 = [200, 28]¶
- STREAM_TEMPERATURE8 = [200, 29]¶
- STREAM_TEMPERATURE9 = [200, 30]¶
- SWITCH_AD5940 = [1]¶
- SWITCH_AD8233 = [0]¶
- SWITCH_ADPD4000 = [2]¶
- WHITE = [0]¶
- adxl_self_test() Dict ¶
ADXL self test.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_test_application() x = application.adxl_self_test()
- disable_back_light() Dict ¶
Disables the back light of the watch.
- Returns:
A response packet as dictionary
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_test_application() x = application.disable_back_light() print(x["payload"]["status"]) # CommonStatus.OK
- disable_cap_sense_test() Dict ¶
Disable cap sense test.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_test_application() x = application.disable_cap_sense_test() print(x["payload"]["status"]) # CommonStatus.OK
- disable_electrode_switch(switch_name: ElectrodeSwitch) Dict ¶
Disables specified electrode switch.
- Parameters:
switch_name (ElectrodeSwitch) – electrode switch to disable, use get_supported_switches() to list all supported switches.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_test_application() x = application.get_supported_switches() print(x) # [<ElectrodeSwitch.AD8233_SWITCH: ['0x0']>, ... , <ElectrodeSwitch.ADPD4000_SWITCH: ['0x2']>] x = application.disable_electrode_switch(application.SWITCH_AD5940) print(x["payload"]["switch_name"], x["payload"]["enabled"]) # ElectrodeSwitch.AD5940 False
- disable_key_press_test() Dict ¶
” Disables and unsubscribe to key press test data.
- Returns:
A response packet as dictionary
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_test_application() x = application.enable_key_press_test() print(x["payload"]["status"]) # CommonStatus.OK
- disable_ldo(ldo_id: LDO) Dict ¶
Disables specified ldo ID.
- Parameters:
ldo_id (LDO) – ldo ID to disable, use get_supported_ldo() to list all supported ldo IDs.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_test_application() x = application.get_supported_ldo() print(x) # [<LDO.LDO_FS: ['0x1']>, <LDO.OPTICAL_LDO: ['0x2']>, <LDO.LDO_EPHYZ: ['0x3']>] x = application.disable_ldo(application.LDO_OPTICAL) print(x["payload"]["ldo_name"], x["payload"]["enabled"]) # LDO.OPTICAL False
- enable_back_light() Dict ¶
” Enables the back light of the watch.
- Returns:
A response packet as dictionary
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_test_application() x = application.enable_back_light() print(x["payload"]["status"]) # CommonStatus.OK
- enable_cap_sense_test() Dict ¶
Enables cap sense test.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_test_application() x = application.enable_cap_sense_test() print(x["payload"]["status"]) # CommonStatus.OK
- enable_electrode_switch(switch_name: ElectrodeSwitch) Dict ¶
Enables specified electrode switch.
- Parameters:
switch_name (ElectrodeSwitch) – electrode switch to enable, use get_supported_switches() to list all supported switches.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_test_application() x = application.get_supported_switches() print(x) # [<ElectrodeSwitch.AD8233_SWITCH: ['0x0']>, ... , <ElectrodeSwitch.ADPD4000_SWITCH: ['0x2']>] x = application.enable_electrode_switch(application.SWITCH_AD5940) print(x["payload"]["switch_name"], x["payload"]["enabled"]) # ElectrodeSwitch.AD5940 True
- enable_key_press_test() Dict ¶
” Enables and subscribe to key press test data.
- Returns:
A response packet as dictionary
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_test_application() x = application.enable_key_press_test() print(x["payload"]["status"]) # CommonStatus.OK
- enable_ldo(ldo_id: LDO) Dict ¶
Enables specified ldo ID.
- Parameters:
ldo_id (LDO) – ldo ID to enable, use get_supported_ldo() to list all supported ldo IDs.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_test_application() x = application.get_supported_ldo() print(x) # [<LDO.LDO_FS: ['0x1']>, <LDO.OPTICAL_LDO: ['0x2']>, <LDO.LDO_EPHYZ: ['0x3']>] x = application.enable_ldo(application.LDO_OPTICAL) print(x["payload"]["ldo_name"], x["payload"]["enabled"]) # LDO.OPTICAL True
- file_read_test(filename: str) dict | None ¶
File read test.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_test_application() x = application.file_read_test("03124671.LOG")
- flash_reset() Dict ¶
Resets device flash.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_test_application() x = application.flash_reset() print(x["payload"]["status"]) # PMStatus.OK
- fs_log_test() Dict ¶
Log test.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_test_application() application.fs_log_test()
- fs_mark_block_as_bad(block: int) Dict ¶
Command to mark block as bad.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_test_application() x = application.fs_mark_block_as_bad(10)
- fs_mark_block_as_good(block: int) Dict ¶
Command to mark block as good.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_test_application() x = application.fs_mark_block_as_good(10)
- fs_test(test_list: List[int]) Dict ¶
This is the command to run the FS developer tests WARNING: Do not exit the test in between as it may lead to few blocks being marked as BAD block List of tests - Test Case-1: Read/Write/Erase of reserved block Test Case-2: Open a file that doesn’t exist Test Case-3: Create, write and read of <4byte data file Test Case-4: Create, write and read of <page_size data file Test Case-5: Create, write and read of <block_size data file Test Case-6: Create, write and read of full flash size data file : [[[[Long Duration Test]]] Test Case-7: Create and write >flash_size of data in a file : [[[[Long Duration Test]]] Test Case-8: Create, write, read and erase of file in CFG block Test Case-9: Skipping bad blocks during read/write Test Case-10: Creation of max possible 62 data files, additional file creation should fail Test Case-11: Skipping of bad blocks during erase Test Case-12: Erase of data block Test Case-13: Erase of data block for head pointer > tail pointer case : [[[Long Duration Test]]] Test Case-14: Erase of data block for head pointer < tail pointer case : [[[Long Duration Test]]] Test Case-15: Erase of full flash filled with data : [[[Long Duration Test]]] Test Case-16: Append feature with no file present before Test Case-17: Append feature with 1 file present before Test Case-18: Append feature with max 62 files present before Test Case-19: Not closing a file after writing > block_size(256KB) and < 2block_size (512KB) of data Test Case-20: TOC corruption
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_test_application() x = application.fs_test()
- get_agc_info(led_index: ADPDLed) Dict ¶
Returns AGC info of specified led index.
- Parameters:
led_index (ADPDLed) – led_index to obtain info, use get_supported_led_ids() to list all supported led ID.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_test_application() x = application.get_supported_led_ids() print(x) # [<ADPDLed.LED_GREEN: ['0x0']>, <ADPDLed.LED_RED: ['0x1']>, ... , <ADPDLed.LED_BLUE: ['0x3']>] x = application.get_agc_info(application.LED_GREEN) print(x["payload"]["led_index"]) # ADPDLed.LED_GREEN print(x["payload"]["ch1"]) # [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] print(x["payload"]["ch2"]) # [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] print(x["payload"]["dc0_led_current"]) # 0 print(x["payload"]["tia_ch1"]) # 0 print(x["payload"]["tia_ch2"]) # 0
- get_apps_health_status() Dict ¶
Returns ISR count of ad5940, adpd, adxl.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_test_application() x = application.get_apps_health_status() print(x["payload"]["ad5940_isr_count"], x["payload"]["adpd_isr_count"], x["payload"]["adxl_isr_count"]) # 0 0 0
- get_bad_blocks() Dict ¶
Returns a packet containing number of bad blocks in the file system.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_test_application() x = application.get_bad_blocks() print(x["payload"]["bad_blocks"]) # 0
- get_debug_info() Dict ¶
Returns debug info of FS.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_test_application() x = application.get_debug_info() print(x["payload"]["status"]) # CommonStatus.OK
- get_fds_status() Dict ¶
FDS status.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_test_application() application.get_fds_status()
- get_file_info(file_index: int) Dict ¶
File info.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_test_application() x = application.get_file_info(4)
- get_ppg_states() Dict ¶
Get PPG states.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_test_application() x = application.get_states() print(x["payload"]["states"]) # [0,0,0, ... ,0,0]
- get_stream_debug_info(stream: Stream) Dict ¶
Returns specified stream debug info of FS.
- Parameters:
stream (Stream) – stream to obtain debug info, use get_supported_streams() to list all supported streams.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_test_application() x = application.get_supported_streams() print(x) # [<Stream.ADPD1: ['0xC2', '0x11']>, ... , <Stream.SQI: ['0xC8', '0x0D']>] x = application.get_stream_debug_info(application.STREAM_ADXL) print(x["payload"]["stream_address"], x["payload"]["packets_received"], x["payload"]["packets_missed"]) # Stream.ADXL 0 0
- static get_supported_display_colors() List[DisplayColor] ¶
List all supported Display colors for Display Application.
- Returns:
Array of Display color enums.
- Return type:
List
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_test_application() x = application.get_supported_display_colors() print(x) # [<DisplayColor.WHITE: ['0x0']>, <DisplayColor.BLACK: ['0x1']>, ... , <DisplayColor.BLUE: ['0x4']>]
- static get_supported_ldo() List[LDO] ¶
List all supported ldo for PM.
- Returns:
Array of ldo enums.
- Return type:
List
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_test_application() x = application.get_supported_ldo() print(x) # [<LDO.LDO_FS: ['0x1']>, <LDO.OPTICAL_LDO: ['0x2']>, <LDO.LDO_EPHYZ: ['0x3']>]
- static get_supported_led_ids() List[ADPDLed] ¶
List all supported led IDs for ADPD.
- Returns:
Array of Led ID enums.
- Return type:
List
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_test_application() x = application.get_supported_led_ids() print(x) # [<ADPDLed.LED_MWL: ['0x0']>, <ADPDLed.LED_GREEN: ['0x1']>, ... , <ADPDLed.LED_BLUE: ['0x4']>]
- static get_supported_power_states() List[PowerMode] ¶
List all supported power states for PM.
- Returns:
Array of power states enums.
- Return type:
List
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_test_application() x = application.get_supported_power_states() print(x) # [<PowerState.ACTIVE_MODE: ['0x0']>, ... , <PowerState.SHUTDOWN_MODE: ['0x3']>]
- static get_supported_streams() List[Stream] ¶
List all supported streams for FS.
- Returns:
Array of stream ID enums.
- Return type:
List
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_fs_application() x = application.get_supported_streams() print(x) # [<Stream.ADPD1: ['0xC2', '0x11']>, ... , <Stream.SQI: ['0xC8', '0xD']>]
- static get_supported_switches() List[ElectrodeSwitch] ¶
List all supported switches for PM.
- Returns:
Array of switches enums.
- Return type:
List
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_test_application() x = application.get_supported_switches() print(x) # [<ElectrodeSwitch.SWITCH_AD8233: ['0x0']>, ... , <ElectrodeSwitch.SWITCH_ADPD4000: ['0x2']>]
- page_read_test(page_num: int, num_bytes: int) Dict ¶
Page read test.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_test_application() x = application.page_read_test(300, 20)
- pattern_config_write(file_size: int, scale_type: int, scale_factor: int, base: int, display_progress=False) List[Dict] ¶
Pattern Write. 16384 0 2 1 (linear scale) 16384 1 2 2 (log scale) 16384 2 2 2 (exp scale)
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_test_application() application.pattern_config_write(16384, 0, 2, 1)
- pattern_write(file_size: int, scale_type: int, scale_factor: int, base: int, num_files_to_write: int, display_progress: bool = False) List[Dict] ¶
Pattern Write. 16384 0 2 1 2 (linear scale) 16384 1 2 2 2 (log scale) 16384 2 2 2 2 (exp scale)
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_test_application() application.pattern_write(16384, 0, 2, 1, 2)
- ping(num_pings: int, packet_size: int) List[Dict] ¶
Pings the device to send response of specified packet size and specified times (num_pings).
- Parameters:
num_pings (int) – number of times packets to be sent from device.
packet_size (int) – size of the ping packet from device, must be between 15 and 244.
- Returns:
list of response packet as dictionary.
- Return type:
List
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_test_application() x = application.ping(3, 16) for packet in x: print(packet["payload"]["sequence_num"]) # 1 # 2 # 3
- read_device_configuration_block_info() Dict ¶
Read Device config block info.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_test_application() application.read_device_configuration_block_info()
- set_cap_sense_callback(callback_function: Callable) None ¶
Sets the callback for the stream data.
- Parameters:
callback_function – callback function for stream key test data.
- Returns:
None
from adi_spo2_watch import SDK def callback(data): print(data) sdk = SDK("COM4") application = sdk.get_test_application() application.set_cap_sense_callback(callback)
- set_display_color(color: DisplayColor) Dict ¶
Set the specified color to watch screen, to check for pixel damage.
- Parameters:
color (DisplayColor) – color to set on watch screen, use get_supported_display_colors() to list all supported colors.
- Returns:
A response packet as dictionary
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_test_application() x = application.get_supported_display_colors() print(x) # [<DisplayColor.WHITE: ['0x0']>, <DisplayColor.BLACK: ['0x1']>, ... , <DisplayColor.BLUE: ['0x4']>] x = application.set_display_color(application.BLUE) print(x["payload"]["color"]) # DisplayColor.BLUE
- set_key_press_callback(callback_function: Callable) None ¶
Sets the callback for the stream data.
- Parameters:
callback_function – callback function for stream key test data.
- Returns:
None
from adi_spo2_watch import SDK def callback(data): print(data) sdk = SDK("COM4") application = sdk.get_test_application() application.set_callback(callback)
- set_power_mode(power_state: PowerMode) Dict ¶
Set specified power state to PM.
- Parameters:
power_state (PowerMode) – power state to set, use get_supported_power_states() to list all supported power states.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_test_application() x = application.get_supported_power_states() print(x) # [<PowerState.ACTIVE_MODE: ['0x0']>, ... , <PowerState.SHUTDOWN_MODE: ['0x3']>] x = application.set_power_mode(application.ACTIVE_MODE) print(x["payload"]["power_state"]) # PowerState.ACTIVE_MODE
- test_command1(data: int) Dict ¶
ADPD test command.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_test_application() x = application.test_command1()
- test_command2(data: int) Dict ¶
ADPD test command.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_test_application() x = application.test_command2()
- test_command3(data: int) Dict ¶
ADPD test command.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_test_application() x = application.test_command3()
adi_spo2_watch.application.user0_application module¶
- class adi_spo2_watch.application.user0_application.User0Application(packet_manager)¶
Bases:
CommonApplication
User0 Application class.
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_user0_application()
- STATE_ADMIT_STANDBY = [0]¶
- STATE_CHARGING_BATTERY = [7]¶
- STATE_END_MONITORING = [6]¶
- STATE_INTERMITTENT_MONITORING = [3]¶
- STATE_INTERMITTENT_MONITORING_START_LOG = [4]¶
- STATE_INTERMITTENT_MONITORING_STOP_LOG = [5]¶
- STATE_OUT_OF_BATTERY_STATE_BEFORE_START_MONITORING = [8]¶
- STATE_OUT_OF_BATTERY_STATE_DURING_INTERMITTENT_MONITORING = [9]¶
- STATE_SLEEP = [2]¶
- STATE_START_MONITORING = [1]¶
- clear_prev_state_event()¶
Clears the user0 config app’s previous state, event received and the corresponding timestamp structure maintained registered in the Watch Fw.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_user0_application() application.clear_prev_state_event()
- delete_device_configuration_block() Dict ¶
Delete device configuration block.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_user0_application() application.delete_device_configuration_block()
- delete_experiment_id()¶
Remove experiment ID.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_user0_application() application.delete_experiment_id()
- delete_hardware_id()¶
Delete Hardware ID.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_user0_application() application.delete_hardware_id()
- disable_user0_bypass_timings() Dict ¶
Disable user0 bypass timings.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_user0_application() application.disable_user0_bypass_timings()
- enable_user0_bypass_timings() Dict ¶
Enable user0 bypass timings.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_user0_application() application.enable_user0_bypass_timings()
- get_experiment_id()¶
Get experiment ID.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_user0_application() application.get_experiment_id()
- get_hardware_id()¶
Get Hardware ID.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_user0_application() application.get_hardware_id()
- get_prev_state_event()¶
This is a command, to get the user0 config app’s previous state, event received and the corresponding timestamp registered in the Watch Fw.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_user0_application() application.get_prev_state_event()
- get_state()¶
Get User0 state.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_user0_application() application.get_state()
- static get_supported_states()¶
List all supported states for User0.
- Returns:
Array of user0 state ID enums.
- Return type:
List[User0State]
- read_device_configuration_block() Dict ¶
Returns entire device configuration block.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_user0_application() x = application.read_device_configuration_block() print(x["payload"]["data"]) # []
- read_library_configuration(fields: List[int]) Dict ¶
Reads library configuration from specified field values.
- Parameters:
fields (List[int]) – List of field values to read.
- Returns:
A response packet as dictionary
- Return type:
Dict
Fields Lower Limit
Fields Upper Limit
0x00
0x13
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_user0_application() x = application.read_library_configuration([0x00]) print(x["payload"]["data"]) # [['0x0', '0x0']]
- set_experiment_id(value: int)¶
Set experiment ID.
- Parameters:
value (int) – experiment ID.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_user0_application() application.set_experiment_id(5)
- set_hardware_id(value: int)¶
Set Hardware ID.
- Parameters:
value (int) – Hardware ID.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_user0_application() application.set_hardware_id(5)
- set_state(state: User0State)¶
Set User0 state.
- Parameters:
state (User0State) – User0 state, use get_supported_states() to list all User0 states.
- Returns:
A response packet as dictionary.
- Return type:
Dict
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_user0_application() application.set_state(application.STATE_SLEEP)
- write_device_configuration_block(values: List[int]) Dict ¶
Writes the device configuration block values of specified addresses. This function takes a list of addresses and values to write, and returns a response packet as dictionary containing addresses and values.
- Parameters:
values (List[int]) – List of addresses and values to write.
- Returns:
A response packet as dictionary.
- Return type:
Dict
Address Lower Limit
Address Upper Limit
0x00
0x13
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_user0_application() x = application.write_device_configuration_block([0x10, 0x01]) print(x["payload"]["size"]) # 2
- write_device_configuration_block_from_file(filename: str) Dict ¶
Writes the device configuration block values of specified addresses from file.
- Parameters:
filename – dcb filename
- Returns:
A response packet as dictionary.
- Return type:
Dict
Address Lower Limit
Address Upper Limit
0x00
0x13
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_user0_application() application.write_device_configuration_block_from_file("user0_dcb.lcfg")
- write_library_configuration(fields_values: List[List[int]]) Dict ¶
Writes library configuration from List of fields and values.
- Parameters:
fields_values (List[List[int]]) – List of fields and values to write.
- Returns:
A response packet as dictionary.
- Return type:
Dict
Fields Lower Limit
Fields Upper Limit
0x00
0x13
from adi_spo2_watch import SDK sdk = SDK("COM4") application = sdk.get_user0_application() x = application.write_library_configuration([[0x01, 0x2]]) print(x["payload"]["data"]) # [['0x0', '0x1']]