from ctypes import *
from secg40 import *
import sys
import time


device = SECG40(get_lib_path())

if device.connect(-1, 5000) == False:
    print('Error: device is not connected')
    sys.exit()

print('device is connected... ({})'.format(
    device.get_serial_number()))

device.reset()

res = device.load_ecg_txt("./sine-1hz-1mV.txt")
if res <= 0:
    print('Error: load data failed (', res, ')')
    sys.exit()

device.set_output_function(OutputFunction_E.Output_ECG_File.value)

time.sleep(10.0)

device.close()
