Method and device for communicating with usb equipment in mac system
A device and communication technology, applied in the field of communication, can solve problems such as error reporting and lower user experience
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0129] Embodiment 1 of the present invention provides a method for communicating with a USB device in a Mac system, such as figure 1 shown, including:
[0130] Step 101: the application obtains the device information of the inserted USB device, and finds the first device information matching the target USB device in the obtained device information;
[0131] In this embodiment, before step 101, it also includes: the application creates a first device dictionary, and adds the device information of the target USB device to the first device dictionary;
[0132] Correspondingly, finding the first device information that matches the target USB device in the obtained device information, specifically: finding the same first device information as the device information in the first device dictionary in the obtained device information ;
[0133] It should be noted that in this embodiment, the application program registers a monitoring function in the system to monitor the insertion of...
Embodiment 2
[0176] Embodiment 2 of the present invention provides a method for communicating with a USB device in a Mac system. The device type of the USB device in this embodiment is SCSI, such as figure 2 shown, including:
[0177] Step 201: the application program creates the first device dictionary, and starts the monitoring thread to monitor the insertion of the USB device in real time, and when the USB device is detected to be inserted, perform step 202;
[0178] Specifically, the application program calls the master port, creates a first device dictionary in the master port and adds the device information of the target USB device to the first device dictionary; preferably, in this embodiment, the master port called is IOMasterPort(MACH_PORT_NULL ,&masterPort), wherein, &masterPort is specifically the handle of the called master port, the first device dictionary created is matchingDict, and the application program adds the PID and VID of the target USB device to the matchingDict; ...
Embodiment 3
[0228] Embodiment 3 of the present invention provides a method for communicating with a USB device in a Mac system, such as image 3 shown, including:
[0229] Step 301: the application program creates the first device dictionary, and starts the monitoring thread to monitor the insertion of the USB device in real time, and when the USB device is detected to be inserted, perform step 302;
[0230] Specifically, the application program calls the master port, creates a first device dictionary in the master port and adds the device information of the target USB device to the first device dictionary; preferably, in this embodiment, the master port called is IOMasterPort(MACH_PORT_NULL ,&masterPort), wherein, &masterPort is specifically the handle of the called master port, the first device dictionary created is matchingDict, and the application program adds the PID and VID of the target USB device to the matchingDict;
[0231] For example, if the PID of the target USB device is 06...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 


