adi_study_watch.application package

ad7156_application module

class adi_study_watch.application.ad7156_application.AD7156Application(packet_manager)

AD7156 Application class.

from adi_study_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_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_ad7156_application()
application.delete_device_configuration_block()
static device_configuration_file_to_list(dcfg_file, address=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

disable_csv_logging()None

Stops logging stream data into CSV.

Returns

None

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_ad7156_application()
x = application.disable_csv_logging()
enable_csv_logging(filename, header=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_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_ad7156_application()
x = application.enable_csv_logging("ad7156.csv")
get_packet_lost_count(stream=None)

This API returns the number of missing packets during a stream session.

Parameters

stream – Stream.

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
load_configuration()Dict

Loads configuration.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_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_study_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_study_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']]
set_callback(callback_function, args=())

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))
set_timeout(timeout_value: float)

Sets the time out for queue to wait for command packet response.

Parameters

timeout_value (int) – queue timeout value.

start_and_subscribe_stream(stream=None)

Starts sensor and also subscribe to the stream.

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=None)

Stops sensor and also Unsubscribe the stream.

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=None)

Subscribe to the stream.

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=None)

Unsubscribe the stream.

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
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_study_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_study_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_study_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']]

adp5360_application module

class adi_study_watch.application.adp5360_application.ADP5360Application(packet_manager)

Battery Application class.

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adp5360_application()
delete_device_configuration_block()Dict

Deletes PM Device configuration block.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adp5360_application()
application.delete_device_configuration_block()
static device_configuration_file_to_list(dcfg_file, address=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

disable_csv_logging()None

Stops logging stream data into CSV.

Returns

None

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adp5360_application()
x = application.disable_csv_logging()
enable_csv_logging(filename, header=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_study_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_study_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_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_test_application()
x = application.get_battery_threshold()
print(x["payload"]["status"])
# PMStatus.OK
read_device_configuration_block()Dict

Returns entire device configuration block.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_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_study_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_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_test_application()
x = application.set_battery_threshold(20, 5, 0)
print(x["payload"]["status"])
# PMStatus.OK
set_callback(callback_function: Callable, args: Tuple = (), stream: adi_study_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.

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_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))
set_timeout(timeout_value: float)

Sets the time out for queue to wait for command packet response.

Parameters

timeout_value (int) – queue timeout value.

subscribe_stream(stream=<Stream.BATTERY: ['0xC6', '0x91']>)

Subscribe to the stream.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_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=None)

Unsubscribe the stream.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_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_study_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_study_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_study_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']]

adpd_application module

class adi_study_watch.application.adpd_application.ADPDApplication(packet_manager)

ADPD Application class.

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adpd_application()
calibrate_clock(clock_id: adi_study_watch.core.enums.adpd_enums.Clock)Dict

Calibrate clock to specified clock ID.

Parameters

clock_id (Clock) – Clock ID to calibrate, use get_supported_clocks() to list all supported clock ID.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adpd_application()
x = application.get_supported_clocks()
print(x)
# [<Clock.NO_CLOCK: ['0x0']>, ... , <Clock.CLOCK_32K_AND_1M: ['0x5']>, <Clock.CLOCK_1M_AND_32M: ['0x6']>]
x = application.calibrate_clock(application.CLOCK_1M_AND_32M)
print(x["payload"]["clock_id"])
# Clock.CLOCK_1M_AND_32M
create_device_configuration(slot_app_ids: List[List[Union[adi_study_watch.core.enums.adpd_enums.ADPDSlot, adi_study_watch.core.enums.adpd_enums.ADPDAppID]]])Dict

Create ADPD device configuration.

Parameters

slot_app_ids (List[List[ADPDSlot, ADPDAppID]]) – List of slot ID and APP ID to write, use get_supported_slots() to list all | supported slot ID, and get_supported_app_id() to list all supported app ID.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adpd_application()
x = application.get_supported_slots()
print(x)
# [<ADPDSlot.SLOT_A: ['0x1']>, <ADPDSlot.SLOT_B: ['0x2']>, ... , <ADPDSlot.SLOT_L: ['0xC']>]
x = application.get_supported_app_id()
print(x)
# [<ADPDAppID.APP_PPG: ['0x1']>, <ADPDAppID.APP_ECG: ['0x0']>, ... , <ADPDAppID.APP_ADPD_BLUE: ['0x7']>]
x = application.create_device_configuration([[application.SLOT_A, application.APP_ECG],
                                            [application.SLOT_B, application.APP_ADPD_GREEN]])
print(x["payload"]["data"])
# [[<ADPDSlot.SLOT_A: ['0x1']>, <ADPDAppID.APP_ECG: ['0x0']>], ... ]
delete_device_configuration_block()Dict

Deletes ADPD Device configuration block.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adpd_application()
application.delete_device_configuration_block()
static device_configuration_file_to_list(dcfg_file, address=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

disable_agc(led_list: List[adi_study_watch.core.enums.adpd_enums.ADPDLed])Dict

Disables AGC for LED in list.

Parameters

led_list (List[ADPDLed]) – list of led to disable agc, use get_supported_led_ids() to list all supported led ID.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adpd_application()
x = application.get_supported_led_ids()
print(x)
# [<ADPDLed.LED_GREEN: ['0x0']>, <ADPDLed.LED_RED: ['0x1']>, ... , <ADPDLed.LED_BLUE: ['0x3']>]
x = application.disable_agc([application.LED_GREEN, application.LED_RED])
print(x["payload"]["agc_data"])
# [[<ADPDLed.LED_MWL: ['0x0']>, False], [<ADPDLed.LED_GREEN: ['0x1']>, False]]
disable_csv_logging(stream: adi_study_watch.core.enums.common_enums.Stream = <Stream.ADPD6: ['0xC2', '0x16']>)None

Stops logging stream data into CSV.

Parameters

stream – ADPD Stream.

Returns

None

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adpd_application()
x = application.disable_csv_logging(stream=application.STREAM_ADPD6)
disable_saturation_check(slot_list: List[adi_study_watch.core.enums.adpd_enums.ADPDSlot])Dict

Disables Saturation for slots in list.

Parameters

slot_list (List[ADPDSlot]) – list of slots to enable saturation check, use get_supported_slots() to list all supported slots.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adpd_application()
application.disable_saturation_check([application.SLOT_A, application.SLOT_B])
disable_uc_hr(slot: adi_study_watch.core.enums.adpd_enums.ADPDSlot)

Disable UC HR.

Parameters

slot (ADPDSlot) – use get_supported_slots() to list all supported slot ID.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adpd_application()
application.disable_uc_hr(application.SLOT_F)
enable_agc(led_list: List[adi_study_watch.core.enums.adpd_enums.ADPDLed])Dict

Enables AGC for LEDs in list.

Parameters

led_list (List[ADPDLed]) – list of led to enable agc, use get_supported_led_ids() to list all supported led ID.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adpd_application()
x = application.get_supported_led_ids()
print(x)
# [<ADPDLed.LED_GREEN: ['0x0']>, <ADPDLed.LED_RED: ['0x1']>, ... , <ADPDLed.LED_BLUE: ['0x3']>]
x = application.enable_agc([application.LED_GREEN, application.LED_RED])
print(x["payload"]["agc_data"])
# [[<ADPDLed.LED_MWL: ['0x0']>, True], [<ADPDLed.LED_GREEN: ['0x1']>, True]]
enable_csv_logging(filename, header=None, stream: adi_study_watch.core.enums.common_enums.Stream = <Stream.ADPD6: ['0xC2', '0x16']>)None

Start logging stream data into CSV.

Parameters
  • filename – Name of the CSV file.

  • header – Header list of the CSV file.

  • stream – ADPD Stream.

Returns

None

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adpd_application()
x = application.enable_csv_logging("adpd6.csv", stream=application.STREAM_ADPD6)
enable_saturation_check(slot_list: List[adi_study_watch.core.enums.adpd_enums.ADPDSlot])Dict

Enables Saturation for slots in list.

Parameters

slot_list (List[ADPDSlot]) – list of slots to enable saturation check, use get_supported_slots() to list all supported slots.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adpd_application()
application.enable_saturation_check([application.SLOT_A, application.SLOT_B])
enable_uc_hr(slot: adi_study_watch.core.enums.adpd_enums.ADPDSlot)

Enable UC HR.

Parameters

slot (ADPDSlot) – use get_supported_slots() to list all supported slot ID.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adpd_application()
application.enable_uc_hr(application.SLOT_F)
get_communication_mode()Dict

Get ADPD communication mode.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adpd_application()
x = application.get_communication_mode()
print(x["payload"]["com_mode"])
# 2
get_decimation_factor(stream: adi_study_watch.core.enums.common_enums.Stream = <Stream.ADPD6: ['0xC2', '0x16']>)Dict

Returns stream decimation factor.

Parameters

stream (Stream) – Stream to get decimation factor.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adpd_application()
x = application.get_supported_streams()
# [<Stream.ADPD1: ['0xC2', '0x11']>, ... , <Stream.ADPD_OPTIONAL: ['0xC2', '0x1D']>]
x = application.get_decimation_factor(application.STREAM_ADPD6)
print(x["payload"]["decimation_factor"])
# 1
get_device_configuration()List[Dict]

Returns device configuration data.

Returns

A response packet as dictionary.

Return type

List[Dict]

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adpd_application()
x = application.get_device_configuration()
print(x[0]["payload"]["data"])
# [['0x9', '0x97'], ['0x7', '0x8FFF'], ['0xB', '0x2F6'], ... ]
get_packet_lost_count(stream=None)

This API returns the number of missing packets during a stream session.

Parameters

stream – Stream.

Returns

Int

get_sensor_status(stream=<Stream.ADPD6: ['0xC2', '0x16']>)Dict

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_adpd_application()
x = application.get_sensor_status(application.STREAM_ADPD6)
print(x["payload"]["num_subscribers"], x["payload"]["num_start_registered"])
# 0 0
get_slot(slot_num: adi_study_watch.core.enums.adpd_enums.ADPDSlot)Dict

Get Specified ADPD Slot Detail.

Parameters

slot_num (ADPDSlot) – slot_num to get slot detail, use get_supported_slots() to list all supported slot ID.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adpd_application()
x = application.get_supported_slots()
print(x)
# [<ADPDSlot.SLOT_A: ['0x1']>, <ADPDSlot.SLOT_B: ['0x2']>, ..., <ADPDSlot.SLOT_L: ['0xC']>]
x = application.get_slot(application.SLOT_A)
print(x["payload"]["slot_num"], x["payload"]["slot_enabled"])
# <ADPDSlot.SLOT_A: ['0x1']> True
print(x["payload"]["slot_format"], x["payload"]["channel_num"])
# 3 3
get_slot_status(slot_num)Dict

Returns whether slot is enabled or not.

Parameters

slot_num (ADPDSlot) – slot_num to get status, use get_supported_slots() to list all supported slot ID.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adpd_application()
x = application.get_supported_slots()
print(x)
# [<ADPDSlot.SLOT_A: ['0x1']>, <ADPDSlot.SLOT_B: ['0x2']>, ..., <ADPDSlot.SLOT_L: ['0xC']>]
x = application.get_slot_status(application.SLOT_A)
print(x["payload"]["slot_enabled"])
# True
static get_supported_app_id()List[adi_study_watch.core.enums.adpd_enums.ADPDAppID]

List all supported Apps for ADPD.

Returns

Array of APP ID enums.

Return type

List[ADPDAppID]

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adpd_application()
x = application.get_supported_app_id()
print(x)
# [<ADPDAppID.APP_PPG: ['0x1']>, <ADPDAppID.APP_ECG: ['0x0']>, ... , <ADPDAppID.APP_ADPD_BLUE: ['0x7']>]
static get_supported_clocks()List[adi_study_watch.core.enums.adpd_enums.Clock]

List all supported clocks for ADPD.

Returns

Array of clock ID enums.

Return type

List[Clock]

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adpd_application()
x = application.get_supported_clocks()
print(x)
# [<Clock.NO_CLOCK: ['0x0']>, <Clock.CLOCK_32K: ['0x1']>, ... , <Clock.CLOCK_1M_AND_32M: ['0x6']>]
static get_supported_devices()List[adi_study_watch.core.enums.adpd_enums.ADPDDevice]

List all supported devices for ADPD.

Returns

Array of device ID enums.

Return type

List[ADPDDevice]

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adpd_application()
x = application.get_supported_devices()
print(x)
# [<ADPDDevice.DEVICE_GREEN: ['0x28']>, ... , <ADPDDevice.DEVICE_G_R_IR_B: ['0x2C']>]
static get_supported_led_ids()List[adi_study_watch.core.enums.adpd_enums.ADPDLed]

List all supported led IDs for ADPD.

Returns

Array of Led ID enums.

Return type

List[ADPDLed]

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adpd_application()
x = application.get_supported_led_ids()
print(x)
# [<ADPDLed.LED_GREEN: ['0x1']>, ... , <ADPDLed.LED_BLUE: ['0x4']>, <ADPDLed.LED_MWL: ['0x0']>]
static get_supported_slots()List[adi_study_watch.core.enums.adpd_enums.ADPDSlot]

List all supported slots for ADPD.

Returns

Array of slot ID enums.

Return type

List[ADPDSlot]

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adpd_application()
x = application.get_supported_slots()
print(x)
# [<ADPDSlot.SLOT_A: ['0x1']>, <ADPDSlot.SLOT_B: ['0x2']>, ... , <ADPDSlot.SLOT_L: ['0xC']>]
static get_supported_streams()List[adi_study_watch.core.enums.common_enums.Stream]

List all supported streams for ADPD.

Returns

Array of stream ID enums.

Return type

List[Stream]

from adi_study_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']>]
get_version()Dict

Returns ADPD version info.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adpd_application()
x = application.get_version()
print(x["payload"]["major_version"])
# 0
print(x["payload"]["minor_version"])
# 3
print(x["payload"]["patch_version"])
# 1
print(x["payload"]["version_string"])
# ADPD_App
print(x["payload"]["build_version"])
# TEST ADPD4000_VERSION STRING
load_configuration(device_id: adi_study_watch.core.enums.adpd_enums.ADPDDevice = <ADPDDevice.DEVICE_GREEN: ['0x28']>)Dict

Loads specified device id configuration.

Parameters

device_id (ADPDDevice) – Device ID to load, use get_supported_devices() to list all supported devices.

Returns

A response packet as dictionary.

Return type

Dict

 from adi_study_watch import SDK

 sdk = SDK("COM4")
 application = sdk.get_adpd_application()
 x = application.get_supported_devices()
 print(x)
 # [<ADPDDevice.DEVICE_GREEN: ['0x28']>, ... , <ADPDDevice.DEVICE_G_R_IR_B: ['0x2C']>]
 x = application.load_configuration(application.DEVICE_GREEN)
 print(x["payload"]["device_id"])
 # ADPDDevice.DEVICE_GREEN
pause()Dict

Pause ADPDDevice.DEVICE_G_R_IR_B.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adpd_application()
x = application.pause()
print(x["payload"]["device_id"], x["payload"]["pause"])
# ADPDDevice.DEVICE_G_R_IR_B True
read_device_configuration_block()[typing.Dict]

Returns entire device configuration block.

Returns

A response packet as dictionary.

Return type

[Dict]

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adpd_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

0x00

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adpd_application()
x = application.read_library_configuration([0x00])
print(x["payload"]["data"])
# [['0x0', '0x12C']]
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

0x0000

0x0277

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adpd_application()
x = application.read_register([0x15, 0x20, 0x2E])
print(x["payload"]["data"])
# [['0x15', '0x0'], ['0x20', '0x0'], ['0x2E', '0x0']]
resume()Dict

Resumes ADPDDevice.DEVICE_G_R_IR_B.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adpd_application()
x = application.resume()
print(x["payload"]["device_id"], x["payload"]["pause"])
# ADPDDevice.DEVICE_G_R_IR_B False
set_callback(callback_function: Callable, args: Tuple = (), stream: adi_study_watch.core.enums.common_enums.Stream = <Stream.ADPD6: ['0xC2', '0x16']>)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.

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_adpd_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_ADPD6)
set_decimation_factor(decimation_factor: int, stream: adi_study_watch.core.enums.common_enums.Stream = <Stream.ADPD6: ['0xC2', '0x16']>)Dict

Sets decimation factor for specified ADPD stream.

Parameters
  • stream (Stream) – Stream to set decimation factor.

  • 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_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adpd_application()
x = application.get_supported_streams()
# [<Stream.ADPD1: ['0xC2', '0x11']>, ... , <Stream.ADPD_OPTIONAL: ['0xC2', '0x1D']>]
x = application.set_decimation_factor(2, application.STREAM_ADPD6)
print(x["payload"]["decimation_factor"])
# 2
set_external_stream_data(csv_filename: str, start_row: int, column_index: int, display_progress: bool = False)None

Set csv file data for external adpd stream.

Parameters
  • csv_filename – csv file to load stream data.

  • start_row – start row index of data.

  • column_index – column index of data

  • display_progress – display detail progress bar.

Returns

None

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adpd_application()
application.set_external_stream_data("12104AD0_ADPDAppStream_SlotFChannel2.csv", 6, 2,
                                        display_progress=True)
set_external_stream_sampling_frequency(odr: int)Dict

Set ADPD external stream sampling frequency, ODR value in Hz.

Parameters

odr – ODR frequency in Hz.

Returns

A response packet as dictionary

Return type

Dict

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adpd_application()
x = application.set_external_stream_sampling_frequency(50)
print(x["payload"]["odr"])
# 100
set_sampling_frequency(odr: int)Dict

Set ADPD sampling frequency, ODR value in Hz.

Parameters

odr – ODR frequency in Hz.

Returns

A response packet as dictionary

Return type

Dict

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adpd_application()
x = application.set_sampling_frequency(100)
print(x["payload"]["odr"])
# 100
set_slot(slot_num: adi_study_watch.core.enums.adpd_enums.ADPDSlot, slot_enable: bool, slot_format: int, channel_num: int)Dict

Set Slot with slot format.

Parameters
  • slot_num (ADPDSlot) – slot_num to set slot, use get_supported_slots() to list all supported slot ID.

  • slot_enable (bool) – enable or disable slot.

  • slot_format (int) – format of the slot, possible values are 0,1,2,3,4.

  • channel_num (int) – channel for the slot, possible values are 1,3.

Returns

None

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adpd_application()
x = application.get_supported_slots()
print(x)
# [<ADPDSlot.SLOT_A: ['0x1']>, <ADPDSlot.SLOT_B: ['0x2']>, ..., <ADPDSlot.SLOT_L: ['0xC']>]
x = application.set_slot(application.SLOT_A, True, 3, 3)
print(x["payload"]["slot_num"], x["payload"]["slot_enabled"])
# ADPDSlot.SLOT_A True
print(x["payload"]["slot_format"], x["payload"]["channel_num"])
# 3 3
set_timeout(timeout_value: float)

Sets the time out for queue to wait for command packet response.

Parameters

timeout_value (int) – queue timeout value.

start_and_subscribe_stream(stream: adi_study_watch.core.enums.common_enums.Stream = <Stream.ADPD6: ['0xC2', '0x16']>)Tuple[Dict, Dict]

Starts ADPD sensor and also subscribe to the specified ADPD stream.

Parameters

stream (Stream) – Stream to subscribe.

Returns

A response packet as dictionary.

Return type

Tuple[Dict, Dict]

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adpd_application()
x = application.get_supported_streams()
# [<Stream.ADPD1: ['0xC2', '0x11']>, ... , <Stream.ADPD_OPTIONAL: ['0xC2', '0x1D']>]
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: adi_study_watch.core.enums.common_enums.Stream = <Stream.ADPD6: ['0xC2', '0x16']>)Tuple[Dict, Dict]

Stops ADPD sensor and also Unsubscribe the specified ADPD stream.

Parameters

stream (Stream) – Stream to unsubscribe.

Returns

A response packet as dictionary.

Return type

Tuple[Dict, Dict]

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adpd_application()
x = application.get_supported_streams()
# [<Stream.ADPD1: ['0xC2', '0x11']>, ... , <Stream.ADPD_OPTIONAL: ['0xC2', '0x1D']>]
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: adi_study_watch.core.enums.common_enums.Stream = <Stream.ADPD6: ['0xC2', '0x16']>)Dict

Subscribe to the specified ADPD stream.

Parameters

stream (Stream) – Stream to subscribe.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adpd_application()
x = application.get_supported_streams()
# [<Stream.ADPD1: ['0xC2', '0x11']>, ... , <Stream.ADPD_OPTIONAL: ['0xC2', '0x1D']>]
subs_stream = application.subscribe_stream()
print(subs_stream["payload"]["status"])
# CommonStatus.SUBSCRIBER_ADDED
unsubscribe_stream(stream: adi_study_watch.core.enums.common_enums.Stream = <Stream.ADPD6: ['0xC2', '0x16']>)Dict

Unsubscribe the specified ADPD stream.

Parameters

stream (Stream) – Stream to unsubscribe.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adpd_application()
x = application.get_supported_streams()
# [<Stream.ADPD1: ['0xC2', '0x11']>, ... , <Stream.ADPD_OPTIONAL: ['0xC2', '0x1D']>]
unsubscribe_stream = application.unsubscribe_stream()
print(unsubscribe_stream["payload"]["status"])
# CommonStatus.SUBSCRIBER_REMOVED
write_device_configuration_block(addresses_values: List[List[int]])[typing.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

0x0000

0x0277

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adpd_application()
x = application.write_device_configuration_block([[0x20, 2], [0x21, 0x1]])
print(x["payload"]["size"])
# 2
write_device_configuration_block_from_file(filename: str)[typing.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

0x0000

0x0277

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adpd_application()
application.write_device_configuration_block_from_file("adpd4000_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

0x00

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adpd_application()
x = application.write_library_configuration([[0x00, 0x12c]])
print(x["payload"]["data"])
# [['0x0', '0x12C']]
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

0x0000

0x0277

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adpd_application()
x = application.write_register([[0x20, 0x1], [0x21, 0x2], [0x2E, 0x3]])
print(x["payload"]["data"])
# [['0x20', '0x1'], ['0x21', '0x2'], ['0x2E', '0x3']]

adxl_application module

class adi_study_watch.application.adxl_application.ADXLApplication(packet_manager)

ADXL Application class.

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adxl_application()
delete_device_configuration_block()Dict

Deletes Adxl Device configuration block.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adxl_application()
application.delete_device_configuration_block()
static device_configuration_file_to_list(dcfg_file, address=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

disable_csv_logging()None

Stops logging stream data into CSV.

Returns

None

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adxl_application()
x = application.disable_csv_logging()
enable_csv_logging(filename, header=None)None

Start logging stream data into CSV.

Parameters
  • filename – Name of the CSV file.

  • header – Header list of the CSV file.

  • stream – BIA Stream.

Returns

None

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adxl_application()
x = application.enable_csv_logging("adxl.csv")
get_decimation_factor()Dict

Returns stream decimation factor.

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_decimation_factor()
print(x["payload"]["decimation_factor"])
# 1
get_device_configuration()Dict

Returns device configuration data.

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_device_configuration()
print(x["payload"]["dcfg_data"])
# [['0x9', '0x97'], ['0x7', '0x8FFF'], ['0xB', '0x2F6'], ... ]
get_packet_lost_count(stream=None)

This API returns the number of missing packets during a stream session.

Parameters

stream – Stream.

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
static get_supported_devices()List[adi_study_watch.core.enums.adxl_enums.ADXLDevice]

List all supported device ID for adxl.

Returns

Array of device ID enums.

Return type

List

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adxl_application()
x = application.get_supported_devices()
print(x)
# [<ADXLDevice.DEVICE_362: ['0x6A', '0x1']>]
load_configuration(device_id: adi_study_watch.core.enums.adxl_enums.ADXLDevice)Dict

Loads specified device id configuration.

Parameters

device_id – Device ID to load, use get_supported_devices() to list all supported devices.

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_supported_devices()
print(x)
# [<ADXLDevice.DEVICE_362: ['0x6A', '0x1']>]
x = application.load_configuration(application.DEVICE_362)
print(x["payload"]["device_id"])
# <ADXLDevice.DEVICE_362: ['0x6A', '0x1']>
read_device_configuration_block()Dict

Returns entire device configuration block.

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.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

0x2E

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adxl_application()
x = application.read_register([0x15, 0x20, 0x2E])
print(x["payload"]["data"])
# [['0x15', '0x0'], ['0x20', '0x0'], ['0x2E', '0x0']]
set_callback(callback_function, args=())

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))
set_decimation_factor(decimation_factor: int)Dict

Sets decimation factor for adxl 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_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adxl_application()
x = application.set_decimation_factor(2)
print(x["payload"]["decimation_factor"])
# 2
set_timeout(timeout_value: float)

Sets the time out for queue to wait for command packet response.

Parameters

timeout_value (int) – queue timeout value.

start_and_subscribe_stream(stream=None)

Starts sensor and also subscribe to the stream.

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=None)

Stops sensor and also Unsubscribe the stream.

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=None)

Subscribe to the stream.

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=None)

Unsubscribe the stream.

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
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

0x20

0x2E

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adxl_application()
x = application.write_device_configuration_block([[0x20, 2], [0x21, 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

0x20

0x2E

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adxl_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

0x20

0x2E

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_adxl_application()
x = application.write_register([[0x20, 0x1], [0x21, 0x2], [0x2E, 0x3]])
print(x["payload"]["data"])
# [['0x20', '0x1'], ['0x21', '0x2'], ['0x2E', '0x3']]

bia_application module

class adi_study_watch.application.bia_application.BIAApplication(packet_manager)

BIA Application class.

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_bia_application()
calibrate_hs_resistor_tia(hs_resistor_tia_id: adi_study_watch.core.enums.bia_enums.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_study_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: adi_study_watch.core.enums.dcb_enums.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)

Returns

A response packet as dictionary.

Return type

dict

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_bia_application()
application.delete_device_configuration_block()
static device_configuration_file_to_list(dcfg_file, address=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

disable_csv_logging(stream: adi_study_watch.core.enums.common_enums.Stream = <Stream.BIA: ['0xC4', '0x07']>)None

Stops logging stream data into CSV.

Parameters

stream – BIA Stream.

Returns

None

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_bia_application()
x = application.disable_csv_logging()
enable_csv_logging(filename, header=None, stream: adi_study_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 – BIA Stream.

Returns

None

from adi_study_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_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_bia_application()
x = application.get_device_configuration([0x00, 0x1])
get_packet_lost_count(stream=None)

This API returns the number of missing packets during a stream session.

Parameters

stream – Stream.

Returns

Int

get_sensor_status(stream=<Stream.BIA: ['0xC4', '0x07']>)Dict

Returns packet with number of subscribers and number of sensor start request registered.

Returns

A response packet as dictionary.

Returns

None

from adi_study_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_dft_windows()List[adi_study_watch.core.enums.bia_enums.BIADFTWindow]

List all supported DFT window for BIA.

Returns

Array of DFT window enums.

Return type

List

from adi_study_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[adi_study_watch.core.enums.bia_enums.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_study_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[adi_study_watch.core.enums.common_enums.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_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_bia_application()
x = application.load_device_configuration()
read_device_configuration_block(dcb_block_index: adi_study_watch.core.enums.dcb_enums.DCBConfigBlockIndex)Dict

Returns entire device configuration block.

Parameters

dcb_block_index – dcb block index (lcfg/dcfg)

Returns

A response packet as dictionary.

Return type

dict

from adi_study_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_study_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: Callable, args: Tuple = (), stream: adi_study_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) – Callback for specified stream.

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_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_study_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: adi_study_watch.core.enums.bia_enums.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_study_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
set_timeout(timeout_value: float)

Sets the time out for queue to wait for command packet response.

Parameters

timeout_value (int) – queue timeout value.

start_and_subscribe_stream(stream: adi_study_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 to subscribe.

Returns

A response packet as dictionary.

Return type

Tuple[Dict, Dict]

from adi_study_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
start_sensor()

Starts sensor.

Parameters

stream (Stream) – Stream to subscribe.

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: adi_study_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 to unsubscribe.

Returns

A response packet as dictionary.

Return type

Tuple[Dict, Dict]

from adi_study_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
stop_sensor()

Stops sensor.

Parameters

stream (Stream) – Stream to unsubscribe.

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: adi_study_watch.core.enums.common_enums.Stream = <Stream.BIA: ['0xC4', '0x07']>)Dict

Subscribe to the specified BIA stream.

Parameters

stream (Stream) – Stream to subscribe.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_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_study_watch.core.enums.common_enums.Stream = <Stream.BIA: ['0xC4', '0x07']>)Dict

Unsubscribe the specified BIA stream.

Parameters

stream (Stream) – Stream to unsubscribe.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_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.

Parameters

stream (Stream) – Stream to subscribe.

Returns

A response packet as dictionary.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_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: adi_study_watch.core.enums.dcb_enums.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)

Returns

A response packet as dictionary.

Return type

Dict

Address Lower Limit

Address Upper Limit

0x00

0x1B

from adi_study_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: adi_study_watch.core.enums.dcb_enums.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)

Returns

A response packet as dictionary.

Return type

dict

Address Lower Limit

Address Upper Limit

0x00

0x12

from adi_study_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_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_bia_application()
x = application.write_library_configuration([[0x00, 0x1]])
print(x["payload"]["data"])
# [['0x0', '0x1']]

common_application module

class adi_study_watch.application.common_application.CommonApplication(destination, packet_manager)

A Common Application class.

static device_configuration_file_to_list(dcfg_file, address=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.

common_stream module

class adi_study_watch.application.common_stream.CommonStream(destination, stream, packet_manager)

A Common Stream class for streaming data from sensors.

static device_configuration_file_to_list(dcfg_file, address=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

get_packet_lost_count(stream=None)

This API returns the number of missing packets during a stream session.

Parameters

stream – Stream.

Returns

Int

get_sensor_status()

Returns packet with number of subscribers and number of sensor start request registered.

Parameters

stream (Stream) – Stream to unsubscribe.

Return type

Dict

from adi_study_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
set_callback(callback_function, args=())

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) – Callback for specified stream.

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_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_timeout(timeout_value: float)

Sets the time out for queue to wait for command packet response.

Parameters

timeout_value (int) – queue timeout value.

start_and_subscribe_stream(stream=None)

Starts sensor and also subscribe to the stream.

Returns

A response packet as dictionary.

Return type

Tuple[Dict, Dict]

from adi_study_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
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=None)

Stops sensor and also Unsubscribe the stream.

Returns

A response packet as dictionary.

Returns

A response packet as dictionary.

Return type

Tuple[Dict, Dict]

from adi_study_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
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=None)

Subscribe to the stream.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_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=None)

Unsubscribe the stream.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_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

ecg_application module

class adi_study_watch.application.ecg_application.ECGApplication(packet_manager)

ECG Application class.

from adi_study_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_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_ecg_application()
application.delete_device_configuration_block()
static device_configuration_file_to_list(dcfg_file, address=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

disable_csv_logging()None

Stops logging stream data into CSV.

Returns

None

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_ecg_application()
x = application.disable_csv_logging()
enable_csv_logging(filename, header=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_study_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_study_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_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_ecg_application()
x = application.get_decimation_factor()
print(x["payload"]["decimation_factor"])
# 1
get_packet_lost_count(stream=None)

This API returns the number of missing packets during a stream session.

Parameters

stream – Stream.

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
get_version()Dict

Returns ECG version info.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_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_study_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_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_ecg_application()
x = application.read_library_configuration([0x00])
print(x["payload"]["data"])
# [['0x0', '0x0']]
set_callback(callback_function, args=())

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))
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_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_ecg_application()
x = application.set_decimation_factor(2)
print(x["payload"]["decimation_factor"])
# 2
set_timeout(timeout_value: float)

Sets the time out for queue to wait for command packet response.

Parameters

timeout_value (int) – queue timeout value.

start_and_subscribe_stream(stream=None)

Starts sensor and also subscribe to the stream.

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=None)

Stops sensor and also Unsubscribe the stream.

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=None)

Subscribe to the stream.

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=None)

Unsubscribe the stream.

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
write_dcb_to_lcfg()Dict

Writes Device configuration block data to library configuration.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_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_study_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_study_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_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_ecg_application()
x = application.write_library_configuration([[0x01, 0x2]])
print(x["payload"]["data"])
# [['0x0', '0x1']]

eda_application module

class adi_study_watch.application.eda_application.EDAApplication(packet_manager)

EDA Application class.

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_eda_application()
calibrate_resistor_tia(min_scale: adi_study_watch.core.enums.eda_enums.ScaleResistor, max_scale: adi_study_watch.core.enums.eda_enums.ScaleResistor, lp_resistor_tia: adi_study_watch.core.enums.eda_enums.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_study_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: adi_study_watch.core.enums.dcb_enums.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)

Returns

A response packet as dictionary.

Return type

dict

from adi_study_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_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_eda_application()
x = application.delete_rtia_calibration_table()
static device_configuration_file_to_list(dcfg_file, address=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

disable_csv_logging()None

Stops logging stream data into CSV.

Returns

None

from adi_study_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_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_eda_application()
application.disable_dynamic_scaling()
enable_csv_logging(filename, header=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_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_eda_application()
x = application.enable_csv_logging("eda.csv")
enable_dynamic_scaling(min_scale: adi_study_watch.core.enums.eda_enums.ScaleResistor, max_scale: adi_study_watch.core.enums.eda_enums.ScaleResistor, lp_resistor_tia: adi_study_watch.core.enums.eda_enums.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_study_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_study_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_study_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_study_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_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_eda_application()
x = application.get_fds_rtia_calibration_table()
get_packet_lost_count(stream=None)

This API returns the number of missing packets during a stream session.

Parameters

stream – Stream.

Returns

Int

get_ram_rtia_calibration_table()Dict

Get RAM RTIA calibration table.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_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_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
static get_supported_dft_windows()List[adi_study_watch.core.enums.eda_enums.EDADFTWindow]

List all supported dft window for EDA.

Returns

Array of dft window enums.

Return type

List

from adi_study_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[adi_study_watch.core.enums.eda_enums.EDAPowerMode]

List all supported power mode for EDA.

Returns

Array of power modes enums.

Return type

List

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_eda_application()
x = application.get_supported_power_modes()
print(x)
static get_supported_power_modes()List[adi_study_watch.core.enums.eda_enums.EDAPowerMode]

List all supported power mode for EDA.

Returns

Array of power modes enums.

Return type

List

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_eda_application()
x = application.get_supported_power_modes()
print(x)
static get_supported_scales()List[adi_study_watch.core.enums.eda_enums.ScaleResistor]

List all supported scales for EDA.

Returns

Array of scales enums.

Return type

List

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_eda_application()
x = application.get_supported_scales()
print(x)
# [<ScaleResistor.SCALE_RESISTOR_100K: ['0x0', '0x14']>, ...]
get_version()Dict

Returns EDA version info.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_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_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_eda_application()
x = application.load_device_configuration()
read_device_configuration_block(dcb_block_index: adi_study_watch.core.enums.dcb_enums.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)

Returns

A response packet as dictionary.

Return type

dict

from adi_study_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_study_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_study_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_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_eda_application()
x = application.reset_baseline_impedance()
print(x)
set_baseline_impedance(real_dft16, imaginary_dft16, real_dft8, imaginary_dft8, resistor_baseline)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_study_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_callback(callback_function, args=())

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))
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_study_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_study_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: adi_study_watch.core.enums.eda_enums.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_study_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: adi_study_watch.core.enums.eda_enums.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.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_eda_application()
x = application.set_power_mode(application.POWER_SLEEP)
set_power_mode(power_mode: adi_study_watch.core.enums.eda_enums.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.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_eda_application()
x = application.set_power_mode(application.POWER_SLEEP)
set_timeout(timeout_value: float)

Sets the time out for queue to wait for command packet response.

Parameters

timeout_value (int) – queue timeout value.

start_and_subscribe_stream(stream=None)

Starts sensor and also subscribe to the stream.

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=None)

Stops sensor and also Unsubscribe the stream.

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=None)

Subscribe to the stream.

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=None)

Unsubscribe the stream.

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
write_dcb_to_lcfg()Dict

Writes Device configuration block data to library configuration.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_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: adi_study_watch.core.enums.dcb_enums.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)

Returns

A response packet as dictionary.

Return type

Dict

Address Lower Limit

Address Upper Limit

0x00

0x02

from adi_study_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: adi_study_watch.core.enums.dcb_enums.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)

Returns

A response packet as dictionary.

Return type

dict

Address Lower Limit

Address Upper Limit

0x00

0x02

from adi_study_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_study_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_study_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']]

fs_application module

class adi_study_watch.application.fs_application.FSApplication(packet_manager)

FS Application class.

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_fs_application()
abort_logging()Dict

Aborts all logging process.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_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_study_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_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_fs_application()
application.delete_config_file()
static device_configuration_file_to_list(dcfg_file, address=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

disable_config_log()Dict

Disables config log.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_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: Optional[Callable] = None, continue_download: Optional[str] = None, test_mode=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_study_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

None

from adi_study_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: Optional[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.

  • 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_study_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_study_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_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_fs_application()
application.format()
fs_test(test_list: List)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_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_fs_application()
x = application.fs_test()
fs_test(test_list: List)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_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_fs_application()
x = application.fs_test()
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_study_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_study_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: adi_study_watch.core.enums.common_enums.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_study_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[adi_study_watch.core.enums.common_enums.Stream]

List all supported streams for FS.

Returns

Array of stream ID enums.

Return type

List

from adi_study_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_study_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

needs to be false. :return: None

from adi_study_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_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_fs_application()
application.mount()
set_timeout(timeout_value: float)

Sets the time out for queue to wait for command packet response.

Parameters

timeout_value (int) – queue timeout value.

start_logging()Dict

Starts current logging process.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_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_study_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_study_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: adi_study_watch.core.enums.common_enums.Stream)Dict

Subscribe to the specified stream.

Parameters

stream (Stream) – Stream to subscribe.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_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: adi_study_watch.core.enums.common_enums.Stream)Dict

UnSubscribe to the specified stream.

Parameters

stream (Stream) – Stream to unsubscribe.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_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_study_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)[typing.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_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_fs_application()
x = application.write_config_file("command.log")

low_touch_application module

class adi_study_watch.application.low_touch_application.LowTouchApplication(packet_manager)

FS Application class.

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_low_touch_application()
delete_device_configuration_block(dcb_block_index: adi_study_watch.core.enums.dcb_enums.DCBConfigBlockIndex)Dict

Deletes ADPD Device configuration block.

Parameters

dcb_block_index – dcb block index.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_low_touch_application()
application.delete_device_configuration_block()
static device_configuration_file_to_list(dcfg_file, address=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

disable_command_logging(command_type: adi_study_watch.core.enums.low_touch_enum.CommandType, filename='commands.LOG', word_align=False)None

Stops recording SDK commands to a file.

Parameters
  • command_type – Start or Stop command recording.

  • 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. :return: None

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_low_touch_application()
application.disable_command_logging(application.START)
enable_command_logging(command_type: adi_study_watch.core.enums.low_touch_enum.CommandType)None

Starts recording SDK commands to a file.

Parameters

command_type – Start or Stop command recording.

Returns

None

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_low_touch_application()
application.enable_command_logging(application.START)
read_ch2_cap()Dict

Read the AD7156 CH2 Capacitance in uF.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_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: adi_study_watch.core.enums.dcb_enums.DCBConfigBlockIndex, readable_format=True)[typing.Dict]

Returns entire device configuration block.

Parameters
  • dcb_block_index – dcb block index.

  • readable_format – Converts binary result into readable commands.

Returns

A response packet as dictionary.

Return type

[Dict]

from adi_study_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_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_low_touch_application()
x = application.read_library_configuration([0x00])
print(x["payload"]["data"])
# [['0x0', '0x0']]
set_timeout(timeout_value: float)

Sets the time out for queue to wait for command packet response.

Parameters

timeout_value (int) – queue timeout value.

write_device_configuration_block_from_file(filename: str, dcb_block_index: adi_study_watch.core.enums.dcb_enums.DCBConfigBlockIndex)[typing.Dict]

Writes the device configuration block values from specified binary file.

Parameters
  • dcb_block_index – dcb block index.

  • filename – binary filename

Returns

A response packet as dictionary.

Return type

[Dict]

from adi_study_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_study_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']]

pedometer_application module

class adi_study_watch.application.pedometer_application.PedometerApplication(packet_manager)

Pedometer Application class.

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_pedometer_application()
static device_configuration_file_to_list(dcfg_file, address=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

disable_csv_logging()None

Stops logging stream data into CSV.

Returns

None

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_pedometer_application()
x = application.disable_csv_logging()
enable_csv_logging(filename, header=None)None

Start logging stream data into CSV.

Parameters
  • filename – Name of the CSV file.

  • header – Header list of the CSV file.

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_pedometer_application()
x = application.enable_csv_logging("ped.csv")
get_algo_version()Dict

Returns Pedometer version info.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_pedometer_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_packet_lost_count(stream=None)

This API returns the number of missing packets during a stream session.

Parameters

stream – Stream.

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
get_version()Dict

Returns Pedometer version info.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_pedometer_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
set_callback(callback_function, args=())

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))
set_timeout(timeout_value: float)

Sets the time out for queue to wait for command packet response.

Parameters

timeout_value (int) – queue timeout value.

start_and_subscribe_stream(stream=None)

Starts sensor and also subscribe to the stream.

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=None)

Stops sensor and also Unsubscribe the stream.

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=None)

Subscribe to the stream.

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=None)

Unsubscribe the stream.

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

pm_application module

class adi_study_watch.application.pm_application.PMApplication(packet_manager)

PM Application class.

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_pm_application()
device_configuration_block_status()Dict

Display dcb status of all applications.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_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
static device_configuration_file_to_list(dcfg_file, address=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

disable_battery_charging()Dict

Disable battery charging.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_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_study_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_study_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_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_pm_application()
application.disable_top_touch()
disable_touch_sensor()Dict

Disables touch sensor.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_pm_application()
x = application.disable_touch_sensor()
print(x["payload"]["status"])
# PMStatus.OK
enable_battery_charging()Dict

Enable battery charging.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_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_study_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_study_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_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_pm_application()
application.enable_top_touch()
enable_touch_sensor()Dict

Enables touch sensor.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_pm_application()
x = application.enable_touch_sensor()
print(x["payload"]["status"])
# PMStatus.OK
enter_boot_loader_mode()Dict

Sets the device to boot loader mode.

Returns

A empty dictionary.

Return type

Dict

from adi_study_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_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_pm_application()
application.fds_erase()
get_chip_id(chip_name: adi_study_watch.core.enums.pm_enums.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_study_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_study_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_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_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_pm_application()
application.get_hibernate_mode()
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_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_pm_application()
application.get_hibernate_mode()
get_low_touch_status()Dict

Returns low touch status.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_pm_application()
x = application.get_low_touch_status()
print(x["payload"]["status"])
# PMStatus.LOW_TOUCH_LOGGING_NOT_STARTED
get_mcu_version()Dict

Returns Device MCU version.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_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[adi_study_watch.core.enums.pm_enums.ChipID]

List all supported chips for PM.

Returns

Array of chips enums.

Return type

List

from adi_study_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_study_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_study_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_study_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_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_pm_application()
application.load_configuration()
read_uicr_customer_registers()Dict

Read UICR customer Register.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_pm_application()
packet = application.read_uicr_customer_registers()
set_datetime(date_time: datetime.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_study_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
set_timeout(timeout_value: float)

Sets the time out for queue to wait for command packet response.

Parameters

timeout_value (int) – queue timeout value.

start_sync_timer()Dict

Starts Sync Timer

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_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_study_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_study_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_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_pm_application()
x = application.system_reset()
print(x["payload"]["status"])
# PMStatus.OK
write_uicr_customer_registers(hw_revision=None, manufacture_date=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

None

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_pm_application()
packet = application.write_uicr_customer_registers("2022-02-15")

ppg_application module

class adi_study_watch.application.ppg_application.PPGApplication(packet_manager)

PPG Application class.

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_ppg_application()
delete_device_configuration_block()Dict

Deletes PPG Device configuration block.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_ppg_application()
application.delete_device_configuration_block()
static device_configuration_file_to_list(dcfg_file, address=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

disable_csv_logging(stream: adi_study_watch.core.enums.common_enums.Stream = <Stream.PPG: ['0xC4', '0x00']>)None

Stops logging stream data into CSV.

Parameters

stream – PPG or SYNC_PPG stream.

Returns

None

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_ppg_application()
x = application.disable_csv_logging(stream = application.PPG)
enable_csv_logging(filename, header=None, stream: adi_study_watch.core.enums.common_enums.Stream = <Stream.PPG: ['0xC4', '0x00']>)None

Start logging stream data into CSV.

Parameters
  • filename – Name of the CSV file.

  • header – Header list of the CSV file.

  • stream – PPG or SYNC_PPG stream.

Returns

None

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_ppg_application()
x = application.enable_csv_logging("ppg.csv", stream = application.PPG)
get_algo_version()Dict

Returns PPG version info.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_ppg_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_library_configuration()Dict

Returns entire library configuration PPG.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_ppg_application()
x = application.get_library_configuration()
print(x["payload"]["data"])
# [192, 0, 0, 0, 32, 0, 0, 0, 1, 0, ... , 0,0,0]
get_packet_lost_count(stream=None)

This API returns the number of missing packets during a stream session.

Parameters

stream – Stream.

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
static get_supported_lcfg_ids()List[adi_study_watch.core.enums.ppg_enums.PPGLcfgId]

List all supported lcfg ID for PPG.

Returns

Array of lcfg ID enums.

Return type

List

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_ppg_application()
x = application.get_supported_lcfg_ids()
print(x)
# [<PPGLcfgId.LCFG_ID_ADPD107: ['0x6B']>, ... , <PPGLcfgId.LCFG_ID_ADPD4000: ['0x28']>]
static get_supported_streams()List[adi_study_watch.core.enums.common_enums.Stream]

List all supported streams for PPG.

Returns

Array of stream ID enums.

Return type

List[Stream]

get_version()Dict

Returns PPG version info.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_ppg_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_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_ppg_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

0x34

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_ppg_application()
x = application.read_library_configuration([0x00])
print(x["payload"]["data"])
# [['0x0', '0x0']]
set_callback(callback_function: Callable, args: Tuple = (), stream: adi_study_watch.core.enums.common_enums.Stream = <Stream.PPG: ['0xC4', '0x00']>)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.

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_ppg_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_library_configuration(lcfg_id: adi_study_watch.core.enums.ppg_enums.PPGLcfgId)Dict

Set PPG to specified library configuration.

Parameters

lcfg_id (PPGLcfgId) – PPG lcfg_id to set, use get_supported_lcfg_ids() to list all supported lcfg IDs

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_ppg_application()
x = application.set_library_configuration(application.LCFG_ID_ADPD4000)
print(x["payload"]["status"])
# CommonStatus.OK
set_timeout(timeout_value: float)

Sets the time out for queue to wait for command packet response.

Parameters

timeout_value (int) – queue timeout value.

start_and_subscribe_stream(stream=None)

Starts sensor and also subscribe to the stream.

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=None)

Stops sensor and also Unsubscribe the stream.

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.PPG: ['0xC4', '0x00']>)Dict

Subscribe to the PPG and SYNC PPG stream.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_ppg_application()
subs_stream = application.subscribe_stream()
print(subs_stream["payload"]["status"])
# CommonStatus.SUBSCRIBER_ADDED
unsubscribe_stream(stream=<Stream.PPG: ['0xC4', '0x00']>)Dict

Unsubscribe the PPG and SYNC PPG stream.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_ppg_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

Address Lower Limit

Address Upper Limit

0x00

0x38

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_ppg_application()
x = application.write_device_configuration_block([[0x20, 2], [0x21, 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

0x34

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_ppg_application()
application.write_device_configuration_block_from_file("ppg_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

0x34

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_ppg_application()
x = application.write_library_configuration([[0x00, 0x1]])
print(x["payload"]["data"])
# [['0x0', '0x1']]

sqi_application module

class adi_study_watch.application.sqi_application.SQIApplication(packet_manager)

SQI Application class.

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_sqi_application()
static device_configuration_file_to_list(dcfg_file, address=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

disable_csv_logging()None

Stops logging stream data into CSV.

Returns

None

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_sqi_application()
x = application.disable_csv_logging()
enable_csv_logging(filename, header=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_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_sqi_application()
x = application.enable_csv_logging("sqi.csv")
get_algo_version()Dict

Returns SQI version info.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_sqi_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_packet_lost_count(stream=None)

This API returns the number of missing packets during a stream session.

Parameters

stream – Stream.

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
static get_supported_slots()List[adi_study_watch.core.enums.sqi_enum.SQISlot]

List all supported slots for SQI.

Returns

Array of slot ID enums.

Return type

List

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_sqi_application()
x = application.get_supported_slots()
print(x)
# [<SQISlot.SLOT_F: ['0x6', '0x0']>, ... , <SQISlot.SLOT_I: ['0x9', '0x0']>]
get_version()Dict

Returns SQI version info.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_sqi_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
set_callback(callback_function, args=())

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))
set_slot(slot_id: adi_study_watch.core.enums.sqi_enum.SQISlot)Dict

Set specified Slot ID for SQI.

Parameters

slot_id (SQISlot) – slot_num to set, use get_supported_slots() to list all supported slot ID.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_sqi_application()
x = application.get_supported_slots()
print(x)
# [<SQISlot.SLOT_F: ['0x6', '0x0']>, ... , <SQISlot.SLOT_I: ['0x9', '0x0']>]
x = application.set_slot(application.SLOT_F)
print(x["payload"]["sqi_slot"])
# SQISlot.SLOT_F
set_timeout(timeout_value: float)

Sets the time out for queue to wait for command packet response.

Parameters

timeout_value (int) – queue timeout value.

start_and_subscribe_stream(stream=None)

Starts sensor and also subscribe to the stream.

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=None)

Stops sensor and also Unsubscribe the stream.

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=None)

Subscribe to the stream.

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=None)

Unsubscribe the stream.

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

temperature_application module

class adi_study_watch.application.temperature_application.TemperatureApplication(packet_manager)

Temperature Application class.

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_temperature_application()
delete_device_configuration_block()Dict

Deletes PPG Device configuration block.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_temperature_application()
application.delete_device_configuration_block()
static device_configuration_file_to_list(dcfg_file, address=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

disable_csv_logging(stream=<Stream.TEMPERATURE4: ['0xC4', '0x06']>)None

Stops logging stream data into CSV.

Returns

None

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_temperature_application()
x = application.disable_csv_logging()
enable_csv_logging(filename, header=None, stream=<Stream.TEMPERATURE4: ['0xC4', '0x06']>)None

Start logging stream data into CSV.

Parameters
  • filename – Name of the CSV file.

  • header – Header list of the CSV file.

  • stream – Stream for Temperature.

Returns

None

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_temperature_application()
x = application.enable_csv_logging("temp.csv")
get_device_configuration()List[Dict]

Returns device configuration data.

Returns

A response packet as dictionary.

Return type

List[Dict]

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_temperature_application()
x = application.get_device_configuration()
print(x[0]["payload"]["data"])
# [['0x9', '0x97'], ['0x7', '0x8FFF'], ['0xB', '0x2F6'], ... ]
get_packet_lost_count(stream=None)

This API returns the number of missing packets during a stream session.

Parameters

stream – Stream.

Returns

Int

get_sensor_status(stream=<Stream.TEMPERATURE1: ['0xC8', '0x16']>)Dict

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_temperature_application()
x = application.get_sensor_status(application.STREAM_TEMPERATURE1)
print(x["payload"]["num_subscribers"], x["payload"]["num_start_registered"])
# 0 0
static get_supported_streams()List[adi_study_watch.core.enums.common_enums.Stream]

List all supported streams for Temperature.

Returns

Array of stream ID enums.

Return type

List[Stream]

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_temperature_application()
x = application.get_supported_streams()
print(x)
# [<Stream.TEMPERATURE1: ['0xC8', '0x16']>, ... , <Stream.TEMPERATURE12: ['0xC8', '0x21']>]
read_device_configuration_block()Dict

Returns entire device configuration block.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_temperature_application()
x = application.read_device_configuration_block()
print(x["payload"]["data"])
# []
read_library_configuration(field: int)Dict

Reads library configuration from specified field values.

Parameters

field (int) – field values to read.

Returns

A response packet as dictionary

Return type

Dict

Fields Lower Limit

Fields Upper Limit

0x00

0x14

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_temperature_application()
x = application.read_library_configuration(0)
print(x["payload"]["data"])
# [['0x0', '0x0']]
set_callback(callback_function: Callable, args: Tuple = (), stream: adi_study_watch.core.enums.common_enums.Stream = <Stream.TEMPERATURE4: ['0xC4', '0x06']>)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.

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_temperature_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_correction_factor(correction_factor: float)

Set correction factor.

Returns

None

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_temperature_application()
application.set_correction_factor(2.5)
set_slope(slope: float)

Set slope.

Returns

None

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_temperature_application()
application.set_slope(1.5)
set_timeout(timeout_value: float)

Sets the time out for queue to wait for command packet response.

Parameters

timeout_value (int) – queue timeout value.

start_and_subscribe_stream(stream=None)

Starts sensor and also subscribe to the stream.

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=None)

Stops sensor and also Unsubscribe the stream.

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: adi_study_watch.core.enums.common_enums.Stream = <Stream.TEMPERATURE4: ['0xC4', '0x06']>)Dict

Subscribe to the specified TEMPERATURE stream.

Parameters

stream (Stream) – Stream to subscribe.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_watch import SDK

sdk = SDK("COM4")
subs_stream = application.subscribe_stream()
print(subs_stream["payload"]["status"])
# CommonStatus.SUBSCRIBER_ADDED
unsubscribe_stream(stream: adi_study_watch.core.enums.common_enums.Stream = <Stream.TEMPERATURE4: ['0xC4', '0x06']>)Dict

Unsubscribe the specified TEMPERATURE stream.

Parameters

stream (Stream) – Stream to unsubscribe.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_watch import SDK

sdk = SDK("COM4")
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_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_temperature_application()
x = application.write_dcb_to_lcfg()
print(x["payload"]["status"])
# CommonStatus.OK
write_device_configuration_block(addresses_values: List[List[int]])List

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_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_temperature_application()
x = application.write_device_configuration_block([[0x20, 2], [0x21, 0x1]])
print(x["payload"]["size"])
# 2
write_device_configuration_block_from_file(filename: str)List

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_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_temperature_application()
application.write_device_configuration_block_from_file("temperature_dcb.lcfg")
write_library_configuration(field: int, value)Dict

Writes library configuration from List of fields and values.

Parameters
  • field (int) – field index to write.

  • value – value needs to be int if field is 0,1 else it is a file address (str).

Returns

A response packet as dictionary.

Return type

Dict

Fields Lower Limit

Fields Upper Limit

0x00

0x14

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_temperature_application()
x = application.write_library_configuration(2, "temp.lcfg")
print(x["payload"]["data"])
# [['0x0', '0x1']]

user0_application module

class adi_study_watch.application.user0_application.User0Application(packet_manager)

User0 Application class.

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_user0_application()
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_study_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_study_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_study_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_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_user0_application()
application.delete_hardware_id()
static device_configuration_file_to_list(dcfg_file, address=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

disable_user0_bypass_timings()Dict

Disable user0 bypass timings.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_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_study_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_study_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_study_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_study_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_study_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_study_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_study_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_study_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_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_user0_application()
application.set_hardware_id(5)
set_state(state: adi_study_watch.core.enums.user0_enums.User0State)

Set User0 state.

Parameters

state (User0State) – User0 state.

Returns

A response packet as dictionary.

Return type

Dict

from adi_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_user0_application()
application.set_state(application.STATE_SLEEP)
set_timeout(timeout_value: float)

Sets the time out for queue to wait for command packet response.

Parameters

timeout_value (int) – queue timeout value.

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_study_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_study_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_study_watch import SDK

sdk = SDK("COM4")
application = sdk.get_user0_application()
x = application.write_library_configuration([[0x01, 0x2]])
print(x["payload"]["data"])
# [['0x0', '0x1']]