Changeset 48

Show
Ignore:
Timestamp:
09/24/07 15:24:12 (1 year ago)
Author:
devja..@anarkystic.com
Message:

updated bt arduino

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • fizzjik/fizzjik/input/btarduino.py

    r46 r48  
    11from twisted.internet import defer 
    2  
     2import re 
    33from fizzjik.serial import SerialPortClient, SerialPortProtocol 
    44from fizzjik.rfid import TagAddedEvent, TagPresentEvent, TagRemovedEvent 
     
    3131        match = self.TAG_RE.match(self.buffer) 
    3232        if match: 
    33             self.buffer = self.buffer[len(m.group(0)):] 
    34             tag = m.group(1) 
     33            self.buffer = self.buffer[len(match.group(0)):] 
     34            tag = match.group(1) 
    3535            self._tagSensed(tag) 
    3636 
  • fizzjik/test.mac.cfg

    r42 r48  
    1515#device = /dev/tty.USA19H1d1P1.1 
    1616 
     17[BTArduinoSensor] 
     18enabled = True 
     19device = /dev/tty.ARDUINOBT-BluetoothSeri-1 
     20 
    1721[SonMicroMifareSensor_0] 
    18 enabled = Tru
     22enabled = Fals
    1923#device = /dev/tty.USA19H1d1P1.1 
    2024#device = /dev/tty.usbserial-A3Q608EV 
     
    2529 
    2630[SonMicroMifareSensor_1] 
    27 enabled = Tru
     31enabled = Fals
    2832#device = /dev/tty.USA19H1d1P1.1 
    2933#device = /dev/tty.usbserial-A3Q608EV 
  • fizzjik/test.mac.py

    r36 r48  
    1 from fizzjik import cocoareactor 
    2 cocoareactor.install() 
     1#from fizzjik import cocoareactor 
     2#cocoareactor.install() 
    33 
    44from twisted.application import service 
     
    1313 
    1414from fizzjik.hub import Hub 
    15 from fizzjik.input.easyident import EasyIdentSensor 
     15#from fizzjik.input.easyident import EasyIdentSensor 
    1616from fizzjik.input.sonmicro import SonMicroMifareSensor 
    17 from fizzjik.input.bluetooth import BluetoothSensor 
     17from fizzjik.input.btarduino import BTArduinoSensor 
     18#from fizzjik.input.bluetooth import BluetoothSensor 
    1819from fizzjik.input.basic import LineReceiver 
    1920from fizzjik.input.network import NetworkConnectionSensor 
     
    2122from fizzjik.output.basic import Echo 
    2223from fizzjik.output.lpr import LPRService 
    23 from fizzjik.output.growl import GrowlService 
     24#from fizzjik.output.growl import GrowlService 
    2425 
    25 from fizzjik.controller.network import DHClientController 
     26#from fizzjik.controller.network import DHClientController 
    2627 
    27 from fizzjik.patch import Patch 
     28#from fizzjik.patch import Patch 
    2829 
    2930application = service.Application('easyident') 
     
    3233hub.setServiceParent(application) 
    3334 
    34 bluey = BluetoothSensor() 
    35 bluey.setServiceParent(hub) 
     35#bluey = BluetoothSensor() 
     36#bluey.setServiceParent(hub) 
    3637 
    3738 
    38 from fizzjik.event import Event 
    39 def _tagAddedToNo(evt): 
    40     if evt.__class__.__name__ == "TagAddedEvent": 
    41         return Event("blaaaa") 
    42     else: 
    43         return evt 
     39#from fizzjik.event import Event 
     40#def _tagAddedToNo(evt): 
     41#    if evt.__class__.__name__ == "TagAddedEvent": 
     42#        return Event("blaaaa") 
     43#    else: 
     44#        return evt 
    4445 
    45 patch_0 = Patch(_tagAddedToNo) 
    46 patch_0.setServiceParent(hub) 
     46#patch_0 = Patch(_tagAddedToNo) 
     47#patch_0.setServiceParent(hub) 
    4748 
    48 sonmicro_0 = SonMicroMifareSensor() 
    49 sonmicro_0.setServiceParent(patch_0) 
     49#sonmicro_0 = SonMicroMifareSensor() 
     50#sonmicro_0.setServiceParent(patch_0) 
    5051#sonmicro_0.setServiceParent(hub) 
    5152 
     53btarduino_0 = BTArduinoSensor() 
     54btarduino_0.setServiceParent(hub) 
    5255 
    5356#sonmicro_1 = SonMicroMifareSensor() 
     
    5659#easyident.setServiceParent(hub) 
    5760 
    58 network = NetworkConnectionSensor() 
    59 network.setServiceParent(hub) 
     61#network = NetworkConnectionSensor() 
     62#network.setServiceParent(hub) 
    6063 
    6164echo = Echo() 
    6265echo.setServiceParent(hub) 
    6366 
    64 dhclient = DHClientController() 
    65 dhclient.setServiceParent(hub) 
     67#dhclient = DHClientController() 
     68#dhclient.setServiceParent(hub) 
    6669 
    67 growler = GrowlService() 
    68 growler.setServiceParent(hub) 
     70#growler = GrowlService() 
     71#growler.setServiceParent(hub) 
    6972 
    70 hub.addObserver("TagAddedEvent", growler.defaultNotify) 
     73#hub.addObserver("TagAddedEvent", growler.defaultNotify) 
    7174 
    7275lr = LineReceiver(2336)