iokit

how to get Device id, vendor id and product id of a mounted usb device in Mac OS cocoa

Hi I am trying to write a Cocoa program which detects iPods connected to Mac OS. I am listening to NSWorkspaceDidMountNotification and NSWorkspaceDidUnmountNotification for the USB device mount and unmount notifications. I can get the device path of the mounted device using NSString *path = [[notif userInfo] objectForKey:@"NSDevicePath"...

Detect SSD in Mac OS X (Cocoa)

Is there a reliable, quick, deterministic way (definitely not benchmark) to check whether system drive in Mac OS X is on Solid State Drive? Is there any other indicator how well disk handles parallel access? I'm trying to adjust number of threads that my program is going to use for disk-bound operations. I'm not interested in raw spee...

Help writing a DVB driver for OS X

I'm looking at options to access DVB data on OS X. Initially I want to support the EyeTV DTT USB device, but in the long-run I'd like to support a number of popular devices. The problem I have is that there is no standard way of controlling such devices. All the applications I know of that use them either hide the driver code within t...

How can I test-drive IOKit userspace driver development?

I'm about to attempt to write a USB driver for my application on OS X using IOKit. I've opted for the userspace route rather than developing a kext since it's so much easier to debug etc, but I'm having trouble working out how I could possibly test-drive my development. If possible, I'd like to find a way to insert a fake USB device i...

What is the '245' in the IOKit USB libraries?

I'm getting started with IOKit on OS X, and I've been puzzled by the '245' tagged onto data types in the IOKit USB library, such as IOUSBInterfaceInterface245. What does the 245 mean? I'm just curious what this number tacked onto the end is supposed to indicate. It seems like a version number of something. Is there a generic version ...

How to get cpu temperature and fan speed on osx?

Can anyone shed some light on how to get CPU temperature and fan speeds in osx? I understand that information is obtained from IOHWSensor in IOKit, but I'm unable to find any reliable information on how to exactly do that. I've found an article with a sample program - http://www.booktou.com/node/148/0321278542/ch10lev1sec7.html but all ...

Publishing information from IOKit KEXT on OS X.

Hello everyone, I have an IOKit-based kernel extension on Mac OS X, a subclass of IOService. When this service loads i need to publish additional specific runtime information from it and i need it to be accessible from user space without making some specific IOUserClient requests. The information in question is basically field\value pai...

Send signals over USB using cocoa?

Just wondering, is there any "API" for sending signals through a USB cable to a device using Apple's cocoa programming language, so I could incorporate it with an app? is it much more complicated than a couple of commands, or do i need a library? I have no experience with external device communication so any help is welcomed! ...

OSX: How to get a volume name (or bsd name) from a IOUSBDeviceInterface or location id

Hi, I'm trying to write an app that associates a particular USB string descriptor (of a USB mass storage device) with its volume or bsd name. So the code goes through all the connected USB devices, gets the string descriptors and extracts information from one of them. I would like to get the volume name of those USB devices. I can't ...

IOKit header assert.h gone? [answered]

I want to get the hardware address of my mac's ethernet card. In all samples I saw in include on IOKit/assert.h . Which doesn't seem to exist on my system. GCC throws an error saying he doesn't know the type IOEthernetAddress. Is assert.h necessary for my task? It would be great if someone coud give me a working sample. [edit] here's my ...

Can't edit IORegistryEntry

Hi, I am creating a software on Mac and I would like to change the value of an IORegistryEntry. I can view it on the IORegistryExplorer, but I can't edit it. So it's my understanding that I have to edit it via code. Here is my code: CFMutableDictionaryRef matchingDict = IOServiceNameMatching("AppleUSBMultitouchDriver"); io_service_t se...

Why aren't IOKit notifications being delivered with this code?

I wrote this code to subscribe to USB devices being plugged in and unplugged; the point is for IOKit to deliver notifications to my iAttached() and iDetached() functions when the corresponding events occur. However, I don't get notifications. The code can be seen here: http://gist.github.com/402391 I didn't want to over-populate this p...

How to resolve CGDirectDisplayID changing issues on newer multi-GPU Apple laptops in Core Foundation/IO Kit?

In Mac OS X, every display gets a unique CGDirectDisplayID number assigned to it. You can use CGGetActiveDisplayList() or [NSScreen screens] to access them, among others. Per Apple's docs: A display ID can persist across processes and system reboot, and typically remains constant as long as certain display parameters do not ...

Detecting user-activity on mac os x

I use the function "IOPMSchedulePowerEvent" to schedule Sleep or Wake-Events and registered my daemon with "IORegisterForSystemPower" to receive power-state-changes. Everything works fine! When system going sleep and later waking up at scheduled time, my daemon do some work, and after it system should going sleep again. Now my question...

Trying to find USB device on iphone with IOKit.framework

Hi all, i'm working on a project were i need the usb port to communicate with a external device. I have been looking for exemple on the net (Apple and /developer/IOKit/usb exemple) and trying some other but i can't even find the device. In my code i blocking at the place where the fucntion looks for a next iterator (pointer in fact) wit...

iPad (iphone os) kernel extension

Hello, I have previously written an application for Mac OSX that includes a kernel extension. It does not drive any real hardware but is instead an in-kernel IOKit service. Now the task is to figure out if porting of the whole application is possible on the iPad which basically means if kernel extensions can be written for iPad. I hav...

Need help tracking down USB error

Currently I have an objective-C program that detects when a Fujitsu scanner is added and removed from the computer. I'm trying to add the ability to ask the scanner information about itself. I know the command for this, however, something is going wrong. I'm doing a bit of cargo-cult programming, from two different cargo cults (How do yo...

Getting iPhone's battery level

I have a simple question. How do I get iPhone's battery level? [UIDevice currentDevice] batteryLevel] Simple enough? However there is a little catch - I can't use UIKit. Here is what I wrote so far, but I don't think it works: // notification port IONotificationPortRef nport = IONotificationPortCreate(kIOMasterPortDefault); CFRu...

USB communcation on jailbroken ipad

Hi all, I would like to build a controller for a robot which would communicate through USB to an iPad. However I don't have an iPad yet as I don't if it is ever possible to build such software (even with jailbreak). So I have a few questions for those iPad owners: In a jailbroken iPad is it possible to use iokit for usb communication th...

Get a string representation of Constant or Enum in IOKit, possible?

Hello, Is there a way to get a string representation for the Constants and enums defined in IOKit? I making a forage into IOKit and trying to console log out some parameter which USB devices return. But I'm ending up with lists of numbers. Is there another way to list what these mean? For example in IOHIDKeys.h enum IOHIDElementType ...