How to use USB / HID port with objective-c in Mac environment?

I have big problems connecting via USB, from a Mac to an external HID device. The hardware has worked well for Windows XP, but I can't find a good example of HID programming using Cocoa / objective-C. A few examples are available at the Apple Center, but they are either poorly documented or too complex (in terms of software with mixed objective-C and C, which makes it difficult to understand the file) or not updated. Well, I have to say that I'm more an electronic engineer than a software specialist! So far I can list the USB port, identify my device using the Apple HID tools (I read PID and VID), but I, unfortunately, could not send the report and / or read the report from an external device. I would definitely appreciateif one of you used the new Apple HID API and could share some know-how. On the other hand, is there any USB spy tool that works with Apple OSX? Thank you so much for your help.

Michael

+3
source share
2 answers

You will not find the Objective-c interface for HID. At least nothing more than a wrapper. Due to dynamic binding and delayed messaging, Objective-c is not well suited for programming time-dependent tasks, such as device drivers or for communicating with it. You will have to work in C.

Apple Resources: Accessing Hardware from Applications , the HID Class Device Interface Interface Guide will be your best resource. This technical note offers a good overview.

The Apple System Profiler scans your USB chain to see which devices are visible to the hardware itself.

Edit01:

, /Developer/Applications/Utilities/IORegistryExplorer. .

+1

, , C, Objective-C, .

, Apple, USB/HID Manager.

. / HID Apple

+1

Source: https://habr.com/ru/post/1724659/


All Articles