Well, I think it's high time we started researching the leds; Here's my proxy dll for led manager, it writes all IOControl requests to \kovsled.bin file. Just install the certificate, copy dll to \windows and edit the registry:
hklm\drivers\n5ledmgr
change "Dll" to "PeripheralProxy.dll"
and here's the code I am using to control the leds. I have actually figured out the correct sequences for rainbow and vibra patterns, but further development would require some driver disassembly or patient tracing and log analyzing
Code:#include "stdafx.h" #include "Winbase.h" int _tmain(int argc, _TCHAR* argv[]) { HANDLE hLed = NULL; DWORD klRet = 0; unsigned char rainbow[] = {17,0,7,0,100,30,141,1,0,0,141,1,0,0,141,1,0,0,0,0}; //unsigned char vibe[] = {1,0,0,2,52,242,180,203,95,243,91,72,164,144,173,199,0,0,0,0}; //unsigned char vibe_off[] = {0,0,0,2,52,242,180,203,95,243,91,72,164,144,173,199,0,0,0,0}; hLed = CreateFile(L"LED1:", GENERIC_WRITE, FILE_SHARE_WRITE|FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); if (!hLed) return 1; DeviceIoControl(hLed, 0x80020004L, rainbow, 20, NULL, 20, &klRet, NULL); CloseHandle(hLed); return 0; }
Hello,
This topic has been inactive for quite some time but i found it such a shame to let this great piece of software go to waste...
Brins0, I hope you're still here because I may have something that could be of interest to you.
http://msdn.microsoft.com/en-us/library/aa452934.aspx
On that website; particularly important is the PostMessage part; with which you can tell windows mobile that a registry setting has occured; making it to reload the registry and thus updating the values that your program has changed. If that worked we wouldn't have to restart every time something has changed anymore.
If you stopped developing this application; I'd gladly continue your work!
Regards
Well, I think it's high time we started researching the leds; Here's my proxy dll for led manager, it writes all IOControl requests to \kovsled.bin file. Just install the certificate, copy dll to \windows and edit the registry:
hklm\drivers\n5ledmgr
change "Dll" to "PeripheralProxy.dll"
and here's the code I am using to control the leds. I have actually figured out the correct sequences for rainbow and vibra patterns, but further development would require some driver disassembly or patient tracing and log analyzing
Code:#include "stdafx.h" #include "Winbase.h" int _tmain(int argc, _TCHAR* argv[]) { HANDLE hLed = NULL; DWORD klRet = 0; unsigned char rainbow[] = {17,0,7,0,100,30,141,1,0,0,141,1,0,0,141,1,0,0,0,0}; //unsigned char vibe[] = {1,0,0,2,52,242,180,203,95,243,91,72,164,144,173,199,0,0,0,0}; //unsigned char vibe_off[] = {0,0,0,2,52,242,180,203,95,243,91,72,164,144,173,199,0,0,0,0}; hLed = CreateFile(L"LED1:", GENERIC_WRITE, FILE_SHARE_WRITE|FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); if (!hLed) return 1; DeviceIoControl(hLed, 0x80020004L, rainbow, 20, NULL, 20, &klRet, NULL); CloseHandle(hLed); return 0; }
#define LED_PATTERN_ENABLE 0x80020024
#define LED_PATTERN_DISABLE 0x80020028
enum pattern_types
{
STANDBY=0,
BATTERY_CHARGING,
BATTERY_LOW,
KEYPAD_ON,
QWERTY_OPEN,
QWERTY_CLOSE,
QWERTY_ON,
PANEL_BUTTONPRESSED,
PANEL_SELECTED,
NOTIFICATION_MISSEDCALL,
NOTIFICATION_VOICEMAIL,
NOTIFICATION_ALARM,
NOTIFICATION_EMAIL,
NOTIFICATION_INSTMSG,
SYSTEM_BOOTUP,
SYSTEM_SHUTDOWN,
SYSTEM_ACTIVE,
SYSTEM_UNREADMSG,
COMM_VOICE_INCOMINGCALL,
COMM_VOICE_CALLONGOING,
COMM_DATA_WLAN,
COMM_DATA_EDGE,
BATTERY_PENDING,
NOTIFICATION_MSG
};
example:
HANDLE device=CreateFileW(L"LED1:",0xC0000000,0,0,3,0,0);
int *patternid=new int;
patternid[0]=KEYPAD_ON;
DeviceIoControl(device,LED_PATTERN_ENABLE,patternid,4,0,0,0,0);
Sleep(1000);
DeviceIoControl(device,LED_PATTERN_DISABLE,patternid,4,0,0,0,0);
CloseHandle(device);
delete(patternid);
typedef struct
{
int patterncode;
char dummy[16];
}LED_CONTROL;
#define LED_CALL_PATTERN 0x80020004
//patterns, not all:
#define LED_PATTERN_PANELMANAGER_BUTTON_PRESSED 0x70011
#define LED_PATTERN_PANELMANAGER_PANEL_SELECTED 0x70021
#define LED_PATTERN_BATTERY_CHARGING 0x40000
#define LED_PATTERN_BATTERY_LOW 0x40004
#define LED_PATTERN_BATTERY_PENDING 0x40008
#define LED_PATTERN_COMM_VOICE_INCOMINGCALL 0x100011
#define LED_PATTERN_SYSTEM_BOOTUP 0x90011
#define LED_PATTERN_SYSTEM_SHUTDOWN 0x90021
#define LED_PATTERN_SYSTEM_ACTIVE 0x90031
#define LED_PATTERN_KEYPAD_ON 0x50031
#define LED_PATTERN_QWERTY_OPEN 0x60011
#define LED_PATTERN_QWERTY_ON 0x60021
#define LED_PATTERN_QWERTY_CLOSE 0x60031
#define LED_ENABLE_COLOR_LEDS 0x80020018 //these codes can enable/disable color leds at all.
#define LED_DISABLE_COLOR_LEDS 0x80020014
example:
LED_CONTROL *led=new LED_CONTROL;
memset(led,0,sizeof(LED_CONTROL));
led->patterncode=LED_PATTERN_PANELMANAGER_BUTTON_PRESSED;
HANDLE device=CreateFileW(L"LED1:",0xC0000000,0,0,3,0,0);
DeviceIoControl(device,LED_CALL_PATTERN, led, 0x14, 0, 0, 0, 0);
delete(led);
CloseHandle(device);
and
HANDLE device=CreateFileW(L"LED1:",0xC0000000,0,0,3,0,0);
DeviceIoControl(device,LED_DISABLE_COLOR_LEDS, 0, 0, 0, 0, 0, 0);
CloseHandle(device);
Hi,
thanks for this app. It is great, but I would be glad if you sometimes will work on this program. Preview can be very very useful thing (i have to restart and test every my new pattern - so I wait more then I work and the GUI should be more "user-friendly". I know, I want too much But still thank you!
I think you dont have to do restart... Try close app with settings but without restart, and go to system settings - illumination and click preview on thoose events you have changed... I think it worked for me but it was long time ago... however, try it