IT

Controlling the backlight of Nokia N8

After playing around with the CHWRMLight interface of Nokia N8, I got the following values:

TInt val = iLight->SupportedTargets();

The returned value is: 241 (0xF1)

It supports all the defines in CHWRMLight (such as EPrimaryDisplay, EPrimaryDisplayAndKeyboard, and so on), and 4 custom lights.

In the firmware that came with my N8, they are like this:

ECustomTarget1 -> Charging battery LED, the white one next to the USB port.
ECustomTarget2 -> Menu button light, appearing as fade in / fade out.
ECustomTarget3 -> Menu button light, but blinking like when you have a missed call / missed SMS.
ECustomTarget4 -> Menu button light – just on, without any other light effects on it.

Following the extensive Light tutorial from here: http://wiki.forum.nokia.com/index.php/CS000912_-_Controlling_light_settings_using_CHWRMLight

the simplest way to achieve the light control is:

#include 
...
CHWRMLight* iLight;
iLight = CHWRMLight::NewL();
...
if (iLight != NULL) {
	iLight->LightOnL(CHWRMLight::ECustomTarget1, 2000);
}

In your .mmp file you also have to link against the HWRMLightClient.lib library.

PS: I don’t know if it’s needed but I do have the WriteDeviceData specified on the CAPABILITY line in my .mmp file.

Leave a Reply