Changeset 48
- Timestamp:
- 09/24/07 15:24:12 (1 year ago)
- Files:
-
- fizzjik/fizzjik/input/btarduino.py (modified) (2 diffs)
- fizzjik/test.mac.cfg (modified) (2 diffs)
- fizzjik/test.mac.py (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
fizzjik/fizzjik/input/btarduino.py
r46 r48 1 1 from twisted.internet import defer 2 2 import re 3 3 from fizzjik.serial import SerialPortClient, SerialPortProtocol 4 4 from fizzjik.rfid import TagAddedEvent, TagPresentEvent, TagRemovedEvent … … 31 31 match = self.TAG_RE.match(self.buffer) 32 32 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) 35 35 self._tagSensed(tag) 36 36 fizzjik/test.mac.cfg
r42 r48 15 15 #device = /dev/tty.USA19H1d1P1.1 16 16 17 [BTArduinoSensor] 18 enabled = True 19 device = /dev/tty.ARDUINOBT-BluetoothSeri-1 20 17 21 [SonMicroMifareSensor_0] 18 enabled = True22 enabled = False 19 23 #device = /dev/tty.USA19H1d1P1.1 20 24 #device = /dev/tty.usbserial-A3Q608EV … … 25 29 26 30 [SonMicroMifareSensor_1] 27 enabled = True31 enabled = False 28 32 #device = /dev/tty.USA19H1d1P1.1 29 33 #device = /dev/tty.usbserial-A3Q608EV fizzjik/test.mac.py
r36 r48 1 from fizzjik import cocoareactor2 cocoareactor.install()1 #from fizzjik import cocoareactor 2 #cocoareactor.install() 3 3 4 4 from twisted.application import service … … 13 13 14 14 from fizzjik.hub import Hub 15 from fizzjik.input.easyident import EasyIdentSensor15 #from fizzjik.input.easyident import EasyIdentSensor 16 16 from fizzjik.input.sonmicro import SonMicroMifareSensor 17 from fizzjik.input.bluetooth import BluetoothSensor 17 from fizzjik.input.btarduino import BTArduinoSensor 18 #from fizzjik.input.bluetooth import BluetoothSensor 18 19 from fizzjik.input.basic import LineReceiver 19 20 from fizzjik.input.network import NetworkConnectionSensor … … 21 22 from fizzjik.output.basic import Echo 22 23 from fizzjik.output.lpr import LPRService 23 from fizzjik.output.growl import GrowlService24 #from fizzjik.output.growl import GrowlService 24 25 25 from fizzjik.controller.network import DHClientController26 #from fizzjik.controller.network import DHClientController 26 27 27 from fizzjik.patch import Patch28 #from fizzjik.patch import Patch 28 29 29 30 application = service.Application('easyident') … … 32 33 hub.setServiceParent(application) 33 34 34 bluey = BluetoothSensor()35 bluey.setServiceParent(hub)35 #bluey = BluetoothSensor() 36 #bluey.setServiceParent(hub) 36 37 37 38 38 from fizzjik.event import Event39 def _tagAddedToNo(evt):40 if evt.__class__.__name__ == "TagAddedEvent":41 return Event("blaaaa")42 else:43 return evt39 #from fizzjik.event import Event 40 #def _tagAddedToNo(evt): 41 # if evt.__class__.__name__ == "TagAddedEvent": 42 # return Event("blaaaa") 43 # else: 44 # return evt 44 45 45 patch_0 = Patch(_tagAddedToNo)46 patch_0.setServiceParent(hub)46 #patch_0 = Patch(_tagAddedToNo) 47 #patch_0.setServiceParent(hub) 47 48 48 sonmicro_0 = SonMicroMifareSensor()49 sonmicro_0.setServiceParent(patch_0)49 #sonmicro_0 = SonMicroMifareSensor() 50 #sonmicro_0.setServiceParent(patch_0) 50 51 #sonmicro_0.setServiceParent(hub) 51 52 53 btarduino_0 = BTArduinoSensor() 54 btarduino_0.setServiceParent(hub) 52 55 53 56 #sonmicro_1 = SonMicroMifareSensor() … … 56 59 #easyident.setServiceParent(hub) 57 60 58 network = NetworkConnectionSensor()59 network.setServiceParent(hub)61 #network = NetworkConnectionSensor() 62 #network.setServiceParent(hub) 60 63 61 64 echo = Echo() 62 65 echo.setServiceParent(hub) 63 66 64 dhclient = DHClientController()65 dhclient.setServiceParent(hub)67 #dhclient = DHClientController() 68 #dhclient.setServiceParent(hub) 66 69 67 growler = GrowlService()68 growler.setServiceParent(hub)70 #growler = GrowlService() 71 #growler.setServiceParent(hub) 69 72 70 hub.addObserver("TagAddedEvent", growler.defaultNotify)73 #hub.addObserver("TagAddedEvent", growler.defaultNotify) 71 74 72 75 lr = LineReceiver(2336)
