コード例 #1
0
ファイル: tf_sensors.py プロジェクト: cutec-chris/halc
 def run(self):
     global ipcon
     isexception = False
     try:
         ipcon = IPConnection()
         if ipcon.get_connection_state(
         ) != IPConnection.CONNECTION_STATE_CONNECTED:
             ipcon.connect("localhost", 4223)
             ipcon.register_callback(IPConnection.CALLBACK_ENUMERATE,
                                     cb_enumerate)
             ipcon.time_out = 0.5
         ipcon.enumerate()
         time.sleep(0.3)
     except:
         logging.debug("Tinkerforge:failed connecting to IP Connection")
         pass