-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Environment issues? #5
Comments
Same issue with latest Haskell. |
For anyone curious, this seems to fix it: diff --git a/EnableRazer.cabal b/EnableRazer.cabal
index 5db0cf0..6b87d0f 100644
--- a/EnableRazer.cabal
+++ b/EnableRazer.cabal
@@ -3,7 +3,7 @@ version: 0.0.4
cabal-version: -any
build-type: Simple
license: AllRightsReserved
-build-depends: base -any, bytestring -any, vector -any, usb -any
+build-depends: base -any, bytestring -any, vector -any, usb >= 1.3.0.2
description: .
author: Audrius Šaikūnas
executable: EnableRazer
diff --git a/src/Main.hs b/src/Main.hs
index 03b8e01..889601d 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -49,22 +49,24 @@ withDevice venId prodIds hnd = do
if V.null devs1
then return $ error "Device not found"
else V.mapM_ hnd devs1
+
+controlSetup :: ControlSetup
+controlSetup = ControlSetup
+ { controlSetupRequestType = Class
+ , controlSetupRecipient = ToInterface
+ , controlSetupRequest = _SET_REPORT
+ , controlSetupValue = 0x0300
+ , controlSetupIndex = 2
+ }
enableRazer :: DeviceHandle -> IO ()
enableRazer devHndl = do
putStrLn "WRITING SET_REPORT"
- writeControlExact devHndl
- Class
- ToInterface
- _SET_REPORT
- 0x0300
- 2
- cdata
- noTimeout
+ writeControlExact devHndl controlSetup cdata noTimeout
main :: IO ()
main = do
- withDevice 0x1532 [0x010d, 0x010e, 0x010f] $ \dev -> do
+ withDevice 0x1532 [0x0040, 0x010d, 0x010e, 0x010f] $ \dev -> do
withDeviceHandle dev $ \devHndl ->
withDetachedKernelDriver devHndl 2 $
withClaimedInterface devHndl 2 $ do |
Closed
Yes, this works for me perfectly; on XUbuntu 16.04 LTS. Thanks ! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Attempting to build on Ubuntu 14.04.2 LTS. See errors below. Any ideas?
The text was updated successfully, but these errors were encountered: