Arti3DPlayer / USBDeviceSwift

wrapper for IOKit.usb and IOKit.hid written on pure Swift that allows you convenient work with USB devices
MIT License
296 stars 57 forks source link

Trying to send data to device using RFControllerHIDExample #8

Closed HarmenSchouten closed 6 years ago

HarmenSchouten commented 6 years ago

Hi,

I am trying to send some data to a mouse using the RFControllerHIDExample. I can connect to the device and I can enter some data that the application will send. However, it isn't clear for me what data the application sends. I know how to do this in C# and I have some working hexcode that controls the light in the mouse, but when I paste that piece of code or the conversion of that hexcode in the field to send it to the mouse, nothing really happens. Do I need to send some data in a selected format, or can I use whatever I want? What kind of data does the application expect from me? Thanks in advance, Harmen

Arti3DPlayer commented 6 years ago

@HarmenSchouten You can send data that you want. For example as you see on .gif image I send word dump, then convert string to byte array: https://github.com/Arti3DPlayer/USBDeviceSwift/blob/master/RaceflightControllerHIDExample/RaceflightControllerHIDExample/RFDevice.swift#L19

the flight controller return me response, that i convert back to string