Unified Sensor API now supports the Omnia Light Sensor

Around a month ago I got a tip from an anonymous reader (I think it's a Samsung developer) on how to access the Samsung's light sensor. The tip seems to work correctly [0], so I added support for that sensor in the Sensor API.

I ended up having to refactor the API a little to support the Samsung light sensor transparently: the changes are similar to the ones I made a few months ago for transparently creating the proper IGSensor implementation on a given device.

So, the change log:

  • HTCLightSensor is now a private class.
  • SamsungLightSensor is a new private class.
  • Refactored HTCGSensor and SamsungGSensor to derive from GSensorBase which inherits from PollingSensor. This change was made to consolidate much of the sensor code.
  • Instead of creating an HTCLightSensor or SamsungLightSensor explicitly, developers should use the new LightSensorFactory.CreateLightSensor method to get the appropriate ILightSensor object for the phone the application is running on.

Here's the link for the updated API and code samples.

I'll be recompiling Klaxon shortly to accommodate the new changes.

[0] It looks like the way this is done is by reading the backlight intensity value, rather than actually reading the light sensor. The Omnia sets the backlight value based on that reading.

8 comments:

Anonymous said...

Hi Koush!

Would you be interested in further expanding your API to cover the new Glofiish devices being released with G-Sensors? I can provide you with copies of the needed DLL's for reverse engineering if you are.

Anonymous said...

Hello,

This is "anonymous", I am very happy that you have used my tip in your great SDK !
I have a comment on your comment.
In fact the light sensor calls are deeply buried in the backlight driver (there are I2C debug traces here and there). The IOCTL 0x220004 really reports what seems to be a value got from the light sensor.
IOCTL 0x220008 reports the backlight intensity value.

And big big thx for the SDK !

Koush said...

Post #1: Sure, send me a copy of the DLLs to koushikdutta@hotmail.com. Post on this forum when you do (in case your email doesn't make it past my spam filter).

I'm not sure if I'll be able to reverse engineer the DLLs without an actual phone though. It would be nice if the Glofiish developers just provided me with their proprietary API calls and I could just add them to the Sensor API. :)

Anonymous said...

Hi Koush. #1 here again. I've emailed you the DLL's in a ZIP file, please AV scan them if you have any worries. The email will be from floating_fat_man at hotmail dot com and is titled "Glofiish GSensor DLLs".

Good luck, and thanks for trying! :)

GCrao said...

Hi Koushmy,
You are doing a great job with the SDK.

I have an Omnia and I want to tell you that LumensMapping array should have 16 cells, the extra value is for very bright light (under a spotlight).

I am a C# Developer and I would like to contribute for dev and test. Do you have a public sourceSafe or SVN to do collaborative work ?

Vincent (gcrao78 at gmail.com)

Koush said...

The source will be hosted on CodePlex soon. After it is, I can add whoever to the list of contributors.

Anonymous said...

Hi, you can look at http://forum.xda-developers.com/showthread.php?t=465613.

/ppaajjaa/

Anonymous said...

Is there a way I can extend Unified Sensor API to include the CT810(LG incite)?

Regards