#!/bin/env python
"""
  Reading sensor-telegrams of easysens gateways
"""
 
import socket
 
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(("169.254.10.1",4000))
 
while 1:
        InBuffer=s.recv(1024)
        Buffer=[]
 
        while InBuffer:
                byte=InBuffer[0:2]
                Buffer += [int(byte,16)]
                InBuffer= InBuffer[2:len(InBuffer)]
        print 'C %i (%r): %r' % (Buffer[13],Buffer[8:12],Buffer[3:8])
 
wiki/projects/python/easysens.txt · Last modified: 2007/05/08 11:42 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki