Is anyone around here, working with the IOKit library?
I'm following this : http://iphonedevwiki.net/index.php/AppleISL29003
And it keeps crashing and crashing.
With this code underneath, I'm able to read out the 'PrimaryUsage and the PrimaryUsagePage', and also the backlight level and more.
But this issnt exactly what I'm looking for. Backlight level I already read out by brightness, thats just basicly the same but only works if I lock the screen, block the sensors and open back up the app.
I would like to read out the lux level itself from the sensor. But I cant find any way to acomplish this.
BTW I'm doing the [logs setText:, because the app will crash once I'm calling the IOKit Library, so I cant log from xcode itself, thats just a bit of weird...
I hope someone can help me out
I'm following this : http://iphonedevwiki.net/index.php/AppleISL29003
And it keeps crashing and crashing.
With this code underneath, I'm able to read out the 'PrimaryUsage and the PrimaryUsagePage', and also the backlight level and more.
But this issnt exactly what I'm looking for. Backlight level I already read out by brightness, thats just basicly the same but only works if I lock the screen, block the sensors and open back up the app.
Code:
CFMutableDictionaryRef matching , properties = NULL;
io_registry_entry_t entry = 0;
matching = IOServiceMatching( "AppleEmbeddedI2CLightSensor" );
//matching = IOServiceNameMatching( "AppleSmartBattery" );
entry = IOServiceGetMatchingService( kIOMasterPortDefault , matching );
IORegistryEntryCreateCFProperties( entry , &properties , NULL , 0 );
NSLog( @"%@" , properties );
[logs setText: [NSString stringWithFormat: @"%@", properties]];
CFRelease( properties );
IOObjectRelease( entry );
I would like to read out the lux level itself from the sensor. But I cant find any way to acomplish this.
BTW I'm doing the [logs setText:, because the app will crash once I'm calling the IOKit Library, so I cant log from xcode itself, thats just a bit of weird...
I hope someone can help me out
Last edited: