hemokit 0.6.5 → 0.6.6
raw patch · 5 files changed
+65/−42 lines, 5 filesdep ~aesondep ~bytestringdep ~conduitPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: aeson, bytestring, conduit, mtl, network-simple, optparse-applicative, vector, websockets
API changes (from Hackage documentation)
Files
- README.md +14/−1
- apps/Dump.hs +5/−6
- apps/DumpConduit.hs +5/−6
- hemokit.cabal +36/−24
- src/Hemokit/Start.hs +5/−5
README.md view
@@ -66,7 +66,7 @@ ``` Here you **have** to specify the serial since HIDAPI is not used to obtain it automatically.- + If you prefer a Websockets server over a raw TCP server, use `ws://0.0.0.0:1234` instead. * Output decrypted raw data to stdout:@@ -82,3 +82,16 @@ ``` We use `tee` and shell process substitution to duplicate the data stream, and tell *hemokit-dump* to read from `-` (stdin).+++Connecting with other Programs+------------------------------++* To use Hemokit as a data source from [OpenVibe](http://openvibe.inria.fr/), check out the corresponding entry in the [Wiki](https://github.com/nh2/hemokit/wiki)+* To read Hemokit data from Matlab, I recommend publishing the data on a local socket in text format using `hemokit-dump --format spaced --serve 127.0.0.1:1234`. Then you can read it with code like:++```matlab+t = tcpip('127.0.0.1', 1234);+fopen(t)+data = fscanf(t, '%d');+```
apps/Dump.hs view
@@ -58,9 +58,9 @@ dumpArgsParser :: Parser DumpArgs dumpArgsParser = DumpArgs <$> emotivArgsParser- <*> nullOption+ <*> option (eitherReader parseDumpMode) ( long "mode"- <> reader parseDumpMode <> value State+ <> value State <> help "What to dump. Can be 'raw', 'packets', 'state' or 'measure'" ) <*> switch ( long "realtime"@@ -68,13 +68,12 @@ <*> switch ( long "list" <> help "Show all available Emotiv devices and exit" )- <*> nullOption+ <*> option (eitherReader parseOutputFormat) ( long "format"- <> reader parseOutputFormat <> value Default+ <> value Default <> help "Format output as Haskell value, JSON or space-separated" )- <*> (optional . nullOption)+ <*> (optional . option (eitherReader parseHostPort)) ( long "serve" <> metavar "HOST:PORT"- <> eitherReader parseHostPort <> help ("Serve output via a TCP server, e.g. 127.0.0.1:1234 " ++ "(port 1234, only localhost) or 0.0.0.0:1234 (all interfaces). " ++ "Use 'ws://' before the host to serve via websockets") )
apps/DumpConduit.hs view
@@ -59,9 +59,9 @@ dumpArgsParser :: Parser DumpArgs dumpArgsParser = DumpArgs <$> emotivArgsParser- <*> nullOption+ <*> option (eitherReader parseDumpMode) ( long "mode"- <> reader parseDumpMode <> value State+ <> value State <> help "What to dump. Can be 'raw', 'packets', 'state' or 'measure'" ) <*> switch ( long "realtime"@@ -69,13 +69,12 @@ <*> switch ( long "list" <> help "Show all available Emotiv devices and exit" )- <*> nullOption+ <*> option (eitherReader parseOutputFormat) ( long "format"- <> reader parseOutputFormat <> value Default+ <> value Default <> help "Format output as Haskell value, JSON or space-separated" )- <*> (optional . nullOption)+ <*> (optional . option (eitherReader parseHostPort)) ( long "serve" <> metavar "HOST:PORT"- <> eitherReader parseHostPort <> help ("Serve output via a TCP server, e.g. 127.0.0.1:1234 " ++ "(port 1234, only localhost) or 0.0.0.0:1234 (all interfaces). " ++ "Use 'ws://' before the host to serve via websockets") )
hemokit.cabal view
@@ -1,5 +1,5 @@ name: hemokit-version: 0.6.5+version: 0.6.6 license: MIT copyright: 2013 Niklas Hambüchen <mail@nh2.me>, Patrick Chilton <chpatrick@gmail.com> author: Niklas Hambüchen <mail@nh2.me>, Patrick Chilton <chpatrick@gmail.com>@@ -9,8 +9,8 @@ stability: experimental tested-with: GHC==7.6.3, GHC==7.8.1 cabal-version: >= 1.10-homepage: https://github.com/nh2/haskell-hemokit-bug-reports: https://github.com/nh2/haskell-hemokit/issues+homepage: https://github.com/nh2/hemokit+bug-reports: https://github.com/nh2/hemokit/issues synopsis: Haskell port of the Emokit EEG project description: This package allows reading raw data from the Emotiv EPOC EEG devices.@@ -72,8 +72,8 @@ , hidapi >= 0.1.2 , mtl >= 2.1.2 -- network-simple 0.4.0.1 breaks on Windows: https://github.com/k0001/network-simple/issues/13- , network-simple >= 0.3.0 && < 0.4.0.1- , optparse-applicative >= 0.7.0 && < 0.10.0+ , network-simple >= 0.4.0.2+ , optparse-applicative >= 0.11 , text >= 0.11.1.1 , vector >= 0.9 , websockets >= 0.8.0.0@@ -112,17 +112,18 @@ build-depends: base , hemokit- , aeson >= 0.6.1.0- , bytestring >= 0.9.2.1- -- network-simple 0.4.0.1 breaks on Windows: https://github.com/k0001/network-simple/issues/13- , network-simple >= 0.3.0 && < 0.4.0.1- , optparse-applicative >= 0.7.0 && < 0.10.0+ -- Dependencies already present in the library (thus no version bounds)+ , aeson+ , bytestring+ , network-simple+ , optparse-applicative+ , vector+ , websockets+ -- Own dependencies , pretty-show >= 1.0 , split >= 0.2.2 , time >= 1.4 , transformers >= 0.3.0.0- , vector >= 0.9- , websockets >= 0.8.0.0 ghc-options: -Wall @@ -135,17 +136,18 @@ build-depends: base , hemokit- , aeson >= 0.6.1.0- , bytestring >= 0.9.2.1- , conduit >= 1- -- network-simple 0.4.0.1 breaks on Windows: https://github.com/k0001/network-simple/issues/13- , network-simple >= 0.3.0 && < 0.4.0.1- , optparse-applicative >= 0.7.0 && < 0.10.0+ -- Dependencies already present in the library (thus no version bounds)+ , aeson+ , bytestring+ , conduit+ , network-simple+ , optparse-applicative+ , vector+ -- Own dependencies , pretty-show >= 1.0 , split >= 0.2.2 , time >= 1.4 , transformers >= 0.3.0.0- , vector >= 0.9 ghc-options: -Wall @@ -161,10 +163,12 @@ build-depends: base , hemokit+ -- Dependencies already present in the library (thus no version bounds) , conduit- , mtl >= 2.1.2+ , mtl+ , vector+ -- Own dependencies , pretty-show >= 1.0- , vector >= 0.9 , vector-fftw >= 0.1.3.1 ghc-options: -Wall @@ -181,12 +185,14 @@ build-depends: base , hemokit+ -- Dependencies already present in the library (thus no version bounds)+ , mtl+ , vector+ -- Own dependencies , cairo >= 0.12.4 , gtk >= 0.12.4- , mtl >= 2.1.2 , pretty-show >= 1.0 , svgcairo >= 0.12.1.1- , vector >= 0.9 ghc-options: -Wall @@ -200,6 +206,8 @@ build-depends: base , hemokit+ -- Dependencies already present in the library (thus no version bounds)+ -- Own dependencies , bytestring >= 0.9.2.1 , hspec >= 1.8.3 , HUnit >= 1.2@@ -217,6 +225,8 @@ build-depends: base , hemokit+ -- Dependencies already present in the library (thus no version bounds)+ -- Own dependencies , criterion >= 0.8.0.0 ghc-options: -Wall @@ -230,8 +240,10 @@ ConduitRollingBufferBench.hs build-depends: base+ , hemokit+ -- Dependencies already present in the library (thus no version bounds) , conduit , mtl- , hemokit+ -- Own dependencies , criterion >= 0.8.0.0 ghc-options: -Wall
src/Hemokit/Start.hs view
@@ -40,19 +40,19 @@ -- | Command line parser for EEG selection. See `EmotivArgs`. emotivArgsParser :: Parser EmotivArgs emotivArgsParser = EmotivArgs- <$> nullOption+ <$> option (eitherReader parseModel) ( long "model" <> metavar "MODEL"- <> reader parseModel <> value Consumer+ <> value Consumer <> help "Consumer or Developer model, Consumer by default" )- <*> (optional . nullOption)+ <*> (optional . option (maybeReader makeSerialNumberFromString "Serial number of has invalid format")) ( long "serial" <> metavar "SERIALNUMBER"- <> maybeReader makeSerialNumberFromString "Serial number of has invalid format" <> help "The serial to use. If no --from-file is given, this will select the device" ) <*> (optional . strOption) ( long "from-file" <> metavar "PATH" <> help "The file path to read from (e.g. /dev/hidraw0 or myfile.dump)" ) where- maybeReader mbFn msg = reader $ maybe (fail msg) pure . mbFn+ maybeReader :: (String -> Maybe a) -> String -> ReadM a+ maybeReader mbFn msg = eitherReader (maybe (fail msg) pure . mbFn) -- | Runs a command line parser. The given program description is used for the