mercury-api 0.1.0.1 → 0.1.0.2
raw patch · 5 files changed
+131/−8 lines, 5 filesdep ~ansi-terminaldep ~bytestringdep ~clockPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: ansi-terminal, bytestring, clock, hashable, optparse-applicative
API changes (from Hackage documentation)
- System.Hardware.MercuryApi: instance GHC.Exception.Exception System.Hardware.MercuryApi.MercuryException
+ System.Hardware.MercuryApi: instance GHC.Exception.Type.Exception System.Hardware.MercuryApi.MercuryException
- System.Hardware.MercuryApi: SimpleReadPlan :: !Word32 -> !Bool -> ![AntennaPort] -> !TagProtocol -> !(Maybe TagFilter) -> !(Maybe TagOp) -> !Bool -> !(Maybe Word32) -> !(Maybe [Word8]) -> ReadPlan
+ System.Hardware.MercuryApi: SimpleReadPlan :: !Word32 -> !Bool -> ![AntennaPort] -> !TagProtocol -> !Maybe TagFilter -> !Maybe TagOp -> !Bool -> !Maybe Word32 -> !Maybe [Word8] -> ReadPlan
- System.Hardware.MercuryApi: TagData :: !ByteString -> !TagProtocol -> !Word16 -> !(Maybe (GEN2_TagData)) -> TagData
+ System.Hardware.MercuryApi: TagData :: !ByteString -> !TagProtocol -> !Word16 -> !Maybe GEN2_TagData -> TagData
- System.Hardware.MercuryApi: [rpFilter] :: ReadPlan -> !(Maybe TagFilter)
+ System.Hardware.MercuryApi: [rpFilter] :: ReadPlan -> !Maybe TagFilter
- System.Hardware.MercuryApi: [rpStopOnCount] :: ReadPlan -> !(Maybe Word32)
+ System.Hardware.MercuryApi: [rpStopOnCount] :: ReadPlan -> !Maybe Word32
- System.Hardware.MercuryApi: [rpTagop] :: ReadPlan -> !(Maybe TagOp)
+ System.Hardware.MercuryApi: [rpTagop] :: ReadPlan -> !Maybe TagOp
- System.Hardware.MercuryApi: [rpTriggerRead] :: ReadPlan -> !(Maybe [Word8])
+ System.Hardware.MercuryApi: [rpTriggerRead] :: ReadPlan -> !Maybe [Word8]
- System.Hardware.MercuryApi: [tdGen2] :: TagData -> !(Maybe (GEN2_TagData))
+ System.Hardware.MercuryApi: [tdGen2] :: TagData -> !Maybe GEN2_TagData
- System.Hardware.MercuryApi: type TransportListener = TransportDirection Direction of data transmission -> ByteString Binary data sent or received -> Word32 Timeout -> IO ()
+ System.Hardware.MercuryApi: type TransportListener = TransportDirection " Direction of data transmission" -> ByteString " Binary data sent or received" -> Word32 " Timeout" -> IO ()
Files
- ChangeLog.md +10/−2
- README.md +77/−0
- cbits/glue/glue.c +3/−1
- mercury-api.cabal +6/−5
- stack.yaml +35/−0
ChangeLog.md view
@@ -1,9 +1,17 @@-<!-- -*- text -*- prevent Emacs from formatting ChangeLog incorrectly -->+<!-- -*- text -*- (prevent Emacs from formatting ChangeLog incorrectly) -->+ # Revision history for mercury-api +## 0.1.0.2 -- 2019-01-09++* Avoid including `xlocale.h` on Linux. (Fixes [#1][1] and [#2][2].)++[1]: https://github.com/ppelleti/hs-mercury-api/issues/1+[2]: https://github.com/ppelleti/hs-mercury-api/issues/2+ ## 0.1.0.1 -- 2017-06-11 -* Fixed a crash that could occur when peeking the mask of a TagFilter. (I was rading the length as a 32-bit number instead of a 16-bit number, which could cause the length to be impossibly long.)+* Fixed a crash that could occur when peeking the mask of a TagFilter. (I was reading the length as a 32-bit number instead of a 16-bit number, which could cause the length to be impossibly long.) ## 0.1.0.0 -- 2017-06-05
README.md view
@@ -5,6 +5,8 @@ Windows: [](https://ci.appveyor.com/project/ppelleti/hs-mercury-api/branch/master) +## Description+ This package is a Haskell binding to the [Mercury API][5] C API for [ThingMagic][6] RFID readers. It is especially geared toward the [SparkFun Simultaneous RFID Reader][1], which uses ThingMagic's@@ -67,6 +69,80 @@ Additional examples are available in the `examples` directory. +## How to build++This package is mostly of interest to Haskell programmers, and if+you're a Haskell programmer, you already know how to build it with+`stack` or `cabal`.++However, some of the utilities like `tmr-firmware` might be of+interest to non-Haskellers, so here is how to build them if you don't+know anything about Haskell:++* Install [stack][11].++* Clone this repository.++* Run `stack --install-ghc install` at the top level of the repository.++* Add `~/.local/bin` to your `$PATH`.++Now the following utilities will be available in your `$PATH`:++```+tmr-firmware - write a new firmware image to reader++Usage: tmr-firmware [-u|--uri URI] [-t|--transport-listener] [FILENAME]+ If run without firmware file, just print current firmware version. Firmware+ file can be downloaded from:+ http://www.thingmagic.com/index.php/download-nano-firmware++Available options:+ -h,--help Show this help text+ -u,--uri URI Reader to connect to (default tmr:///dev/ttyUSB0)+ -t,--transport-listener Print bytes sent on serial port+++tmr-params - print parameters++Usage: tmr-params [-u|--uri URI] [-t|--transport-listener]++Available options:+ -h,--help Show this help text+ -u,--uri URI Reader to connect to (default tmr:///dev/ttyUSB0)+ -t,--transport-listener Print bytes sent on serial port+++tmr-read - read tags++Usage: tmr-read [-u|--uri URI] [-r|--region REGION] [-p|--power CENTI-DBM]+ [-t|--transport-listener] [-l|--long]++Available options:+ -h,--help Show this help text+ -u,--uri URI Reader to connect to (default tmr:///dev/ttyUSB0)+ -r,--region REGION Regulatory region (default na2)+ -p,--power CENTI-DBM Power level (0-2700, default 2300)+ -t,--transport-listener Print bytes sent on serial port+ -l,--long Print lots of information per tag+++tmr-write - write a string to user data of tag++Usage: tmr-write [-u|--uri URI] [-r|--region REGION] [-p|--power CENTI-DBM]+ [-t|--transport-listener] [-R|--rewrite] STRING++Available options:+ -h,--help Show this help text+ -u,--uri URI Reader to connect to (default tmr:///dev/ttyUSB0)+ -r,--region REGION Regulatory region (default na2)+ -p,--power CENTI-DBM Power level (0-2700, default 2300)+ -t,--transport-listener Print bytes sent on serial port+ -R,--rewrite Write to a tag even if written before+```++## Resources+ Additional resources: * [RFID Basics][8]@@ -88,3 +164,4 @@ [8]: https://learn.sparkfun.com/tutorials/rfid-basics [9]: https://github.com/ppelleti/hs-mercury-api/blob/master/UPGRADING.md [10]: https://github.com/gotthardp/python-mercuryapi+[11]: https://docs.haskellstack.org/en/stable/README/#how-to-install
cbits/glue/glue.c view
@@ -5,8 +5,10 @@ #include <stdlib.h> #include <string.h> #include <time.h>-#ifndef _WIN32+#if defined(__APPLE__) #include <xlocale.h>+#elif !defined(_WIN32)+#include <locale.h> #endif #include <HsFFI.h>
mercury-api.cabal view
@@ -10,7 +10,7 @@ -- PVP summary: +-+------- breaking API changes -- | | +----- non-breaking API additions -- | | | +--- code changes with no API change-version: 0.1.0.1+version: 0.1.0.2 -- A short (one-line) description of the package. synopsis: Haskell binding to Mercury API for ThingMagic RFID readers@@ -57,6 +57,7 @@ , README.md , UPGRADING.md , examples/LICENSE-FOR-EXAMPLES+ , stack.yaml , tests/*.result , tests/*.transport , cbits/api/*.h@@ -133,7 +134,7 @@ -- Other library packages from which modules are imported. build-depends: base >= 4.6 && < 5- , ansi-terminal >= 0.6.2.3 && < 0.7+ , ansi-terminal >= 0.6.2.3 && < 0.9 , bytestring >= 0.10.4 && < 0.11 , clock >= 0.7.2 && < 0.8 , hashable >= 1.2.4 && < 1.3@@ -154,7 +155,7 @@ main-is: tmr-params.hs other-modules: ExampleUtil build-depends: base >= 4.6 && < 5- , ansi-terminal >= 0.6.2.3 && < 0.7+ , ansi-terminal >= 0.6.2.3 && < 0.9 , bytestring >= 0.10.4 && < 0.11 , mercury-api , optparse-applicative >= 0.13 && < 0.15@@ -181,7 +182,7 @@ main-is: tmr-read.hs other-modules: ExampleUtil build-depends: base >= 4.6 && < 5- , ansi-terminal >= 0.6.2.3 && < 0.7+ , ansi-terminal >= 0.6.2.3 && < 0.9 , bytestring >= 0.10.4 && < 0.11 , mercury-api , optparse-applicative >= 0.13 && < 0.15@@ -195,7 +196,7 @@ main-is: tmr-write.hs other-modules: ExampleUtil build-depends: base >= 4.6 && < 5- , ansi-terminal >= 0.6.2.3 && < 0.7+ , ansi-terminal >= 0.6.2.3 && < 0.9 , bytestring >= 0.10.4 && < 0.11 , mercury-api , optparse-applicative >= 0.13 && < 0.15
+ stack.yaml view
@@ -0,0 +1,35 @@+# This file was automatically generated by stack init+# For more information, see: http://docs.haskellstack.org/en/stable/yaml_configuration/++# Specifies the GHC version and set of packages available (e.g., lts-3.5, nightly-2015-09-21, ghc-7.10.2)+resolver: lts-9.1++# Local packages, usually specified by relative directory name+packages:+- '.'+# Packages to be pulled from upstream that are not in the resolver (e.g., acme-missiles-0.3)+extra-deps: []++# Override default flag values for local packages and extra-deps+flags: {}++# Extra package databases containing global packages+extra-package-dbs: []++# Control whether we use the GHC we find on the path+# system-ghc: true++# Require a specific version of stack, using version ranges+# require-stack-version: -any # Default+# require-stack-version: >= 1.0.0++# Override the architecture used by stack, especially useful on Windows+# arch: i386+# arch: x86_64++# Extra directories used by stack for building+# extra-include-dirs: [/path/to/dir]+# extra-lib-dirs: [/path/to/dir]++# Allow a newer minor version of GHC than the snapshot specifies+# compiler-check: newer-minor