packages feed

hidapi 0.1.3 → 0.1.4

raw patch · 2 files changed

+17/−6 lines, 2 filesdep +deepseqPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependencies added: deepseq

API changes (from Hackage documentation)

- System.HIDAPI: instance Constructor C1_0DeviceInfo
- System.HIDAPI: instance Constructor C1_0HIDAPIException
- System.HIDAPI: instance Data HIDAPIException
- System.HIDAPI: instance Datatype D1DeviceInfo
- System.HIDAPI: instance Datatype D1HIDAPIException
- System.HIDAPI: instance Exception HIDAPIException
- System.HIDAPI: instance Generic DeviceInfo
- System.HIDAPI: instance Generic HIDAPIException
- System.HIDAPI: instance NFData DeviceInfo
- System.HIDAPI: instance NFData HIDAPIException
- System.HIDAPI: instance Selector S1_0_0DeviceInfo
- System.HIDAPI: instance Selector S1_0_1DeviceInfo
- System.HIDAPI: instance Selector S1_0_2DeviceInfo
- System.HIDAPI: instance Selector S1_0_3DeviceInfo
- System.HIDAPI: instance Selector S1_0_4DeviceInfo
- System.HIDAPI: instance Selector S1_0_5DeviceInfo
- System.HIDAPI: instance Selector S1_0_6DeviceInfo
- System.HIDAPI: instance Selector S1_0_7DeviceInfo
- System.HIDAPI: instance Selector S1_0_8DeviceInfo
- System.HIDAPI: instance Selector S1_0_9DeviceInfo
- System.HIDAPI: instance Show DeviceInfo
- System.HIDAPI: instance Show DeviceInfoInternal
- System.HIDAPI: instance Show HIDAPIException
- System.HIDAPI: instance Storable DeviceInfoInternal
- System.HIDAPI: instance Typeable HIDAPIException
- System.HIDAPI: interfaceNumber :: DeviceInfo -> InterfaceNumber
- System.HIDAPI: manufacturerString :: DeviceInfo -> Maybe String
- System.HIDAPI: path :: DeviceInfo -> DevicePath
- System.HIDAPI: productId :: DeviceInfo -> ProductID
- System.HIDAPI: productString :: DeviceInfo -> Maybe String
- System.HIDAPI: releaseNumber :: DeviceInfo -> ReleaseNumber
- System.HIDAPI: serialNumber :: DeviceInfo -> Maybe SerialNumber
- System.HIDAPI: usage :: DeviceInfo -> Word16
- System.HIDAPI: usagePage :: DeviceInfo -> Word16
- System.HIDAPI: vendorId :: DeviceInfo -> VendorID
+ System.HIDAPI: [interfaceNumber] :: DeviceInfo -> InterfaceNumber
+ System.HIDAPI: [manufacturerString] :: DeviceInfo -> Maybe String
+ System.HIDAPI: [path] :: DeviceInfo -> DevicePath
+ System.HIDAPI: [productId] :: DeviceInfo -> ProductID
+ System.HIDAPI: [productString] :: DeviceInfo -> Maybe String
+ System.HIDAPI: [releaseNumber] :: DeviceInfo -> ReleaseNumber
+ System.HIDAPI: [serialNumber] :: DeviceInfo -> Maybe SerialNumber
+ System.HIDAPI: [usagePage] :: DeviceInfo -> Word16
+ System.HIDAPI: [usage] :: DeviceInfo -> Word16
+ System.HIDAPI: [vendorId] :: DeviceInfo -> VendorID
+ System.HIDAPI: instance Control.DeepSeq.NFData System.HIDAPI.DeviceInfo
+ System.HIDAPI: instance Control.DeepSeq.NFData System.HIDAPI.HIDAPIException
+ System.HIDAPI: instance Data.Data.Data System.HIDAPI.HIDAPIException
+ System.HIDAPI: instance Foreign.Storable.Storable System.HIDAPI.DeviceInfoInternal
+ System.HIDAPI: instance GHC.Exception.Exception System.HIDAPI.HIDAPIException
+ System.HIDAPI: instance GHC.Generics.Generic System.HIDAPI.DeviceInfo
+ System.HIDAPI: instance GHC.Generics.Generic System.HIDAPI.HIDAPIException
+ System.HIDAPI: instance GHC.Show.Show System.HIDAPI.DeviceInfo
+ System.HIDAPI: instance GHC.Show.Show System.HIDAPI.DeviceInfoInternal
+ System.HIDAPI: instance GHC.Show.Show System.HIDAPI.HIDAPIException

Files

System/HIDAPI.hsc view
@@ -23,6 +23,7 @@   ) where  import Control.Applicative+import Control.DeepSeq import Control.DeepSeq.Generics import Control.Exception import Control.Monad@@ -54,6 +55,7 @@  #let alignment t = "%lu", (unsigned long)offsetof(struct {char x__; t (y__); }, y__) +-- | Note: This is currently a read-only instance. `poke` is not yet implemented. instance Storable DeviceInfoInternal where   alignment _ = #{alignment struct hid_device_info}   sizeOf _ = #{size struct hid_device_info}@@ -162,8 +164,8 @@  exit :: IO () exit = do-	r <- hid_exit-	check (r == 0) "HIDAPI shutdown failed" "hid_exit /= 0"+  r <- hid_exit+  check (r == 0) "HIDAPI shutdown failed" "hid_exit /= 0"  withHIDAPI :: IO a -> IO a withHIDAPI = bracket_ System.HIDAPI.init exit@@ -241,9 +243,9 @@    write :: Device -> ByteString -> IO Int write dev b = do-	n' <- useAsCStringLen b $ \(cs, csLen) -> hid_write dev cs (fromIntegral csLen)-	checkWithHidError (n' /= -1) dev "Write failed" "hid_write returned -1"-	return $ fromIntegral n'+  n' <- useAsCStringLen b $ \(cs, csLen) -> hid_write dev cs (fromIntegral csLen)+  checkWithHidError (n' /= -1) dev "Write failed" "hid_write returned -1"+  return $ fromIntegral n'  foreign import ccall unsafe "hidapi/hidapi.h hid_get_serial_number_string"   hid_get_serial_number_string :: Device -> CWString -> CSize -> IO CInt
hidapi.cabal view
@@ -1,5 +1,5 @@ name:              hidapi-version:           0.1.3+version:           0.1.4 build-type:        Simple cabal-version:     >= 1.6 category:          Hardware@@ -9,6 +9,10 @@ bug-reports:       https://github.com/vahokif/haskell-hidapi/issues synopsis:          Haskell bindings to HIDAPI description:       Haskell bindings to the HIDAPI library (<http://www.signal11.us/oss/hidapi/>).+                   .+                   Note you need need to have the corresponding low-level+                   library installed for your OS, e.g. libudev-dev on Debian/Ubuntu,+                   or just udev on distributions that don't split dev libraries. license:           MIT license-file:      LICENSE @@ -24,6 +28,11 @@   build-depends:       base < 5     , bytestring >= 0.9.2.1+    -- Note: If at some point we require deepseq >= 1.4, we can+    --       throw out deepseq-generics, as starting from 1.4+    --       deepseq's own default implementation is no longer+    --       a no-op (== rubbish).+    , deepseq >= 1.3     , deepseq-generics >= 0.1    -- hidapi is not packaged for many distributions, and seems to