adi_spo2_watch.core package

Subpackages

Submodules

adi_spo2_watch.core.ble_manager module

class adi_spo2_watch.core.ble_manager.BLEManager(vendor_id, product_id, timeout=5, dongle_serial_number=None)

Bases: object

CMD_CONNECT = 2
CMD_DISCONNECT = 3
CMD_RESET = 127
CMD_SCAN_START = 0
CMD_SCAN_STOP = 1
MAX_LENGTH = 63
RID_CMD = 1
RID_NOT = 3
RID_RSP = 2
connect(mac_address)
disconnect()
receive_thread()

adi_spo2_watch.core.packet_manager module

class adi_spo2_watch.core.packet_manager.PacketManager(serial_object, filename=None)

Bases: object

close()

Closes serial port

disable_command_logging(command_type)
enable_command_logging(command_type)
process_file(display_progress, progress_callback)

Reads packet from file and store it in file queue.

process_queue()

Reads the packet from queue and send to relevant callback function.

receive_packet()

Reads packet from serial port and store it in queue.

send_packet(packet)

Receives packet from sdk and send it to the serial to port for device to process.

send_packet_to_callback(pkt)

Sends Packet to callback

set_ble_source()
set_usb_source()
start_receive_and_process_threads()

start process and receive thread.

subscribe(packet_id, callback)

Subscribe packet id to the callback.

subscribe_command_logger(log_command)
unsubscribe(packet_id, application_callback)

Unsubscribe packet id and removes the callback.

unsubscribe_command_logger()

adi_spo2_watch.core.utils module

adi_spo2_watch.core.utils.add_index_to_array(array, one_index=False, to_hex=False)
adi_spo2_watch.core.utils.convert_int_array_to_hex(arr)

Convert int to hex.

adi_spo2_watch.core.utils.get_updated_timestamp(reference_time, last_ts, timestamp)
adi_spo2_watch.core.utils.join_multi_length_packets(packet, sign=False, reverse=False, convert_to_hex=False)

Joins array of bytes into integer.

adi_spo2_watch.core.utils.missing_sequences(expected_seq_no, current_seq_no)
adi_spo2_watch.core.utils.pretty(value, tab_char='\t', next_line_char='\n', indent=0)

Print dict in clean format.

adi_spo2_watch.core.utils.split_int_in_bytes(value, length=None, reverse=False)

Breaks int into array of byte array of specified length.

adi_spo2_watch.core.utils.update_timestamp(packet, last_timestamp, is_syncppg=False)

Module contents