import threading
import time
import file
from client3 import *
from server3 import *

def f():
    print("get_samples")
    cmd = "ANST"
    datarpta2 =  absObj.getControlModuleStatus(cmd = cmd)
    
    fobj = open("monitoreo.txt","a")
    fobj.write(datarpta2)
    fobj.close()
    threading.Timer(30, f).start()

if __name__ == '__main__':
    
#    absObj = ABSServer(ipDestino="10.10.10.97",rx_buffer = "1")   # Adding the same parameter to all the commands
    absObj = ABSServer(ipDestino="192.168.1.117",rx_buffer = "1")   # Adding the same parameter to all the commands
    cmd = "NTST"
    datarpta1 =  absObj.getConnectionStatus(cmd = cmd)
    
    fobj = open("monitoreo.txt","w")
    fobj.write("Monitoring\n")
    fobj.write("----------\n")
    fobj.close()

    f()
    while 1:
        pass
    
    