kafka-device-joystick 0.2.1.0 → 0.2.1.2
raw patch · 3 files changed
+42/−15 lines, 3 filesdep −milenadep ~aesondep ~binarydep ~bytestringPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependencies removed: milena
Dependency ranges changed: aeson, binary, bytestring, cereal, kafka-device, yaml
API changes (from Hackage documentation)
- Network.UI.Kafka.Joystick.Interpretation: joystickLoop :: Interpretation Double -> IO (ExitAction, LoopAction)
+ Network.UI.Kafka.Joystick.Interpretation: joystickLoop :: Interpretation FilePath Double -> IO (ExitAction, LoopAction)
Files
- kafka-device-joystick.cabal +11/−12
- sample.yaml +28/−0
- src/Network/UI/Kafka/Joystick/Interpretation.hs +3/−3
kafka-device-joystick.cabal view
@@ -1,5 +1,5 @@ name: kafka-device-joystick-version: 0.2.1.0+version: 0.2.1.2 synopsis: Linux joystick events via a Kafka message broker description: This package contains functions for passing Linux joystick events to topics on a Kafka message broker \<<https://kafka.apache.org/>\>. The joystick's driver must conform to the Linux Joystick API \<<https://www.kernel.org/doc/Documentation/input/joystick-api.txt>\>. Also see \<<https://hackage.haskell.org/package/kafka-device/>\>. license: MIT@@ -13,9 +13,10 @@ stability: Experimental homepage: https://bitbucket.org/functionally/kafka-device-joystick bug-reports: https://bwbush.atlassian.net/projects/HKAFDEV/issues/-package-url: https://bitbucket.org/functionally/kafka-device-joystick/downloads/kafka-device-joystick-0.1.5.0.tar.gz+package-url: https://bitbucket.org/functionally/kafka-device-joystick/downloads/kafka-device-joystick-$version.tar.gz extra-source-files: ReadMe.md+ sample.yaml source-repository head type: git@@ -26,14 +27,13 @@ Network.UI.Kafka.Joystick.Interpretation System.Hardware.Linux.Joystick build-depends: base >= 4.8 && < 5- , aeson- , binary- , bytestring- , cereal- , kafka-device- , milena+ , aeson >= 0.11.3+ , binary >= 0.7.2+ , bytestring >= 0.10.6+ , cereal >= 0.5.4+ , kafka-device >= 0.2.1.2 hs-source-dirs: src- ghc-options: -O2 -Wall+ ghc-options: -Wall default-language: Haskell2010 executable kafka-device-joystick@@ -44,8 +44,7 @@ , bytestring , cereal , kafka-device- , milena- , yaml+ , yaml >= 0.8.22 hs-source-dirs: src- ghc-options: -O2 -Wall -threaded+ ghc-options: -Wall -threaded default-language: Haskell2010
+ sample.yaml view
@@ -0,0 +1,28 @@+kafka :+ client : joystick-interpretation+ address : [localhost, 9092]+ topic : events+sensor : joystick+path : /dev/input/js0+xAxis :+ axisNumber: 0+ increment : 0.020+yAxis :+ axisNumber: 1+ increment : 0.020+zAxis :+ axisNumber: 2+ increment : 0.020+phiAxis :+ axisNumber: 3+ increment : 0.020+thetaAxis :+ axisNumber: 4+ increment : 0.020+psiAxis :+ axisNumber: 5+ increment : 0.020+location : [0, 0.5, 0]+orientation : [0, 0, 0]+flying : false+resetButton : 1
src/Network/UI/Kafka/Joystick/Interpretation.hs view
@@ -27,8 +27,8 @@ -- | Interpret events from a Linux SpaceNav.-joystickLoop :: Interpretation Double -- ^ Instructions for interpretation.- -> IO (ExitAction, LoopAction) -- ^ Action to create the exit and loop actions.+joystickLoop :: Interpretation FilePath Double -- ^ Instructions for interpretation.+ -> IO (ExitAction, LoopAction) -- ^ Action to create the exit and loop actions. joystickLoop interpretation@TrackInterpretation{..} = do let@@ -36,7 +36,7 @@ analogHandler _ = Nothing buttonHandler (Joystick _ pressed number True False _) = Just (number, pressed /= 0) buttonHandler _ = Nothing- joystick <- openFile path ReadMode+ joystick <- openFile device ReadMode (exit, loop) <- interpretationLoop analogHandler buttonHandler interpretation $ interpretJoystick <$> hGet joystick byteLength