def CLS(RUN_MODE): # This function sends a VT100 Terminal Clear screen message to DB9 Serial Port # Input Parameter Definitions # RUN_MODE: # (0) Don't send clear screen message # (1) Send VT100 clear screen message via DB9 serial port "Script running in Telit module" try: if (RUN_MODE): GSM864QP_SER.send_DB9("\033[2J\r") except: print 'Script encountered an exception.' print 'Exception Type: ' + str(sys.exc_type) print 'MODULE -> DEBUG' + '\r' print 'METHOD -> CLS(' + RUN_MODE + ')' + '\r' return
def sendMsg(inSTR, RUN_MODE): # This function sends a debug message to print statement or DB9 Serial Port # Input Parameter Definitions # inSTR: Debug Message # RUN_MODE: # (0) Send message via print statement "Script running in IDE" # (1) Send message via DB9 serial port "Script running in Telit module" try: if (RUN_MODE): GSM864QP_SER.send_DB9(inSTR) else: print inSTR except: print 'Script encountered an exception.' print 'Exception Type: ' + str(sys.exc_type) print 'MODULE -> DEBUG' + '\r' print 'METHOD -> sendMsg(' + inSTR + ',' + RUN_MODE + ')' + '\r' return