PDA

View Full Version : LEDUp - simple LED control program


_TB_TB_
16th November 2006, 07:41 PM
Hello!
I've written a simple, command-line controlled LED/VIbe control program. You can enable/disable the LEDs (at least partially...), the same goes to the vibe engine (if it is reported by the OS as LED).
It can be obtained here: http://bodz.elsat.net.pl/vis/uploader/index.php?plik=PDAClub.pl%20Forum%20LEDUp.cab&op=get

As it may be obvious to some of us, there are not all diodes available for software control, thus please run 'LEDUp Help' to run the test, which LED is which, and if vibe is reported as LED.

The default setup program creates some shortcuts. The 'vibe' may be misleading, cause on some (most?) devices LED1 is not a vibe at all;)

Oh, well... just try it, if you wish...

Treo_newb
17th November 2006, 01:08 AM
Hello!
I've written a simple, command-line controlled LED/VIbe control program. You can enable/disable the LEDs (at least partially...), the same goes to the vibe engine (if it is reported by the OS as LED).
It can be obtained here: http://bodz.elsat.net.pl/vis/uploader/index.php?plik=PDAClub.pl%20Forum%20LEDUp.cab&op=get

As it may be obvious to some of us, there are not all diodes available for software control, thus please run 'LEDUp Help' to run the test, which LED is which, and if vibe is reported as LED.

The default setup program creates some shortcuts. The 'vibe' may be misleading, cause on some (most?) devices LED1 is not a vibe at all;)

Oh, well... just try it, if you wish...Many members of ppc.greeks have been looking for this kind of softeware for the treo 700wx because of no led notifactions-many thanks to Malatesta for providing this link .TB_TB_Thanks for taking the time to put this kind of software together.Ive been looking for it for a long time with no luck till today.It works very well but can you tie the Ledup software to have the led blink when V-mail/miss call icon apears on screen giving the treo wx user some led alert when missed call/vmail comes in.

jonolim
17th November 2006, 09:12 AM
I second this. This is the last major thing I miss from my old Treo. I'm using the 750v which is very much like the 700wx.

Please continue to work on this application to get it to activate the LED (on a user selected behaviour) once a notification is received.
I used to set mine to a solid ORANGE led on new Notification.

_TB_TB_
17th November 2006, 12:46 PM
Does the test feature (activated via 'LEDUp Help' shortcut) turn the LEDs as you would like it to? I mean - does the led turn orange, etc. ?

Treo_newb
17th November 2006, 04:30 PM
Does the test feature (activated via 'LEDUp Help' shortcut) turn the LEDs as you would like it to? I mean - does the led turn orange, etc. ?
Orange hmmm I Think many of the treo 700 users are just happy to see the green:) When I have a message or voice mail present then actavate LEDup It blinks green untill I clear the call or message :) but when a call/message comes in there is no green blink :( :( The shortcut@control panel is GREATTTTT I LOVE IT.Its very clear and easy to understand.Why Palm Failed to add software you are building to the 700 series is beyond me.They built a pda leaving us in the dark of missed call,voice mail with no led alert what so ever.

malatesta
18th November 2006, 06:45 AM
Some more info for the Treo 700wx/750:

Colors available for LED: Red and Green (no orange)

Currently from my limited testing, this LED app only gets us the Green LED activated but it would be beneficial to try and nail down the RED too maybe for other events.

_TB_TB_ if a Registry export would be helpful, just drop the word and you can have one.

_TB_TB_
18th November 2006, 04:11 PM
I do not think, that LEDs are controlled via rgistry. You can only OBTAIN info about LED status, but not SET LED status via registry.

My BlueAngel has two leds - left and right. Left one is for BT and WiFi (not controllable at all via default SDK) - it may blink blue or green. The right LED can have one of the colors: red, blinking red, orange, green, blinking green. I may only set the state to 'active' (blinking red) via the default SDK.

Treo_newb
18th November 2006, 06:57 PM
I do not think, that LEDs are controlled via rgistry. You can only OBTAIN info about LED status, but not SET LED status via registry.

My BlueAngel has two leds - left and right. Left one is for BT and WiFi (not controllable at all via default SDK) - it may blink blue or green. The right LED can have one of the colors: red, blinking red, orange, green, blinking green. I may only set the state to 'active' (blinking red) via the default SDK.
On the treo 700 series the led stays solid red when you have it charging then turns solid green after charge is compleate.so lets say it on charge and missed call/v-mail is left would it go to blinking red. very cool for that to be the case or not to make it confusing TB_TB_ but missed call binking red and if a Voice mail is present going to blinking green.

vijay555
19th November 2006, 12:23 AM
Those of you with a Hermes or similar might be amused to try my VJPlumBum program. Just a little frivolity...

V

Treo_newb
19th November 2006, 02:11 AM
Those of you with a Hermes or similar might be amused to try my VJPlumBum program. Just a little frivolity...

V
oh yeah oh yeah I had that software in my ipaq 6315 hahaha good stuff;)

hannip
22nd December 2006, 01:04 AM
Does the test feature (activated via 'LEDUp Help' shortcut) turn the LEDs as you would like it to? I mean - does the led turn orange, etc. ?

I'm not sure you got a good answer for this question.

The LEDUp Help tests do the following on the Treo 700wx.

Total LEDs reported by Windows: 2
LEDUp 0 0 - led off
LEDUp 0 1 - led blinks green
LEDUp 0 2 - led blinks green (appears no different than 0 1)
LEDUp 1 0 - vib off
LEDUp 1 1 - repeating vibrate
LEDUp 1 2 - repeating vibrate (appears no different than 1 1)

Is the source for the LEDUp available or is there example code somewhere? It would be nice to have a service or plugin that monitors the active notifications in the registry that would turn on the LED blink when a missed call notification is active and turn it off when it is dismissed. Maybe it could be a hook into the notification somehow.

Thanks!

vijay555
22nd December 2006, 01:16 AM
hannip: this is standard api - nled.

V

hannip
22nd December 2006, 01:47 AM
hannip: this is standard api - nled.

V

Ah, notification led api. Found it. Thx.

Jeff
27th December 2006, 04:01 PM
Is there any way of integrating your LED program into the data flow from the USB cable as in newer versions of WM5torage?

WM5torage blinks the LEDs and even vibrates the device to reflect Read/Write access to the exported disk which is ingenious. Curious to know if there is someway of doing this programatically for data read in/out of device like some form of a visual bandwidth meter?

Thanks in advance...

vijay555
27th December 2006, 04:27 PM
It could be feasible to control the standard notification led in that way, or it's possible to hack the whole device to say show blue led for device reads, and red lead for device write etc.

V

Jeff
27th December 2006, 06:51 PM
Vijay555, thanks for yor quick reply, I know of your reputation as a wm5 programming God, I use many of your programs so I am sure that this could turn into something! Could this one be called Vlights or VLEDS or something along those lines? Keep us posted! :)

Regards

It could be feasible to control the standard notification led in that way, or it's possible to hack the whole device to say show blue led for device reads, and red lead for device write etc.

V

vijay555
27th December 2006, 07:02 PM
Lol, I'm no God, not even an anagram of the word!
http://ec1.images-amazon.com/images/P/0452287758.01._AA240_SCLZZZZZZZ_V59379357_.jpg

I've written code for control of the leds on some HTC devices (outside and expanded beyond the normal api) - try VJPlumBum for a test. However, for general device compatibility it'd be best to use the normal nled api. However, either way, you'd need access to the WM5torage source code ideally. Why not suggest the idea to the author?

V

Treo_newb
15th February 2007, 10:14 PM
Total LEDs reported by Windows: 2
LEDUp 0 0 - led off
LEDUp 0 1 - led blinks green
LEDUp 0 2 - led blinks green (appears no different than 0 1)
LEDUp 1 0 - vib off
LEDUp 1 1 - repeating vibrate
LEDUp 1 2 - repeating vibrate (appears no different than 1 1)


Question
ledup reports 2 leds on the treo 700 series . Ledup-02 is the same as 01.Can 02 be tweaked to get red led blink?If so how difficult would it be to tweak ledup making red blink a reality for the wm palm owner.

I'm now on mortscript level of building software.Any help would be much appreciated.:)

P.S
vijay555 I give VJPlumBum a try in the treo:) No led blink but the tune was great :D

Phil C

_TB_TB_
16th February 2007, 12:21 PM
Please remember, that "2 leds" means that there are two "signaling devices" available for the standard applications usage. This may be LEDs, Vibes, or anything else.

LEDUp 0 1 = LEDUp 0 2 is true for most of the devices, because the drivers implement both "active" and "blink" in the same way.

To controll the LEDs more extensively one should most propably use the drivers directly...

Source code below:

ledz.h:
# include <nled.h>

extern "C"
{
BOOL NLedGetDeviceInfo(INT nID, PVOID pOutput);
BOOL NLedSetDevice(INT nID, PVOID pOutput);
}

int GetLedCount()
{
NLED_COUNT_INFO nci;
int wCount = 0;

if(NLedGetDeviceInfo(NLED_COUNT_INFO_ID, (PVOID) &nci))
wCount = (int) nci.cLeds;

return wCount;
}

void SetLedStatus(int wLed, int wStatus)
{
NLED_SETTINGS_INFO nsi;

nsi.LedNum = (INT) wLed;
nsi.OffOnBlink = (INT) wStatus;

NLedSetDevice(NLED_SETTINGS_INFO_ID, &nsi);
}


Main cpp file:
// LEDUp.cpp : Defines the entry point for the application.
//

#include "stdafx.h"
#include "ledz.h"

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
{
if((_tcslen(lpCmdLine) < 1) || (_tcslen(lpCmdLine) > 3)){
TCHAR buf[50];
_stprintf(buf, _T("Total LEDs reported by Windows: %d"), GetLedCount());
MessageBox(GetForegroundWindow(), _T("LEDUp: a simple command - line tool for LED/vibe setup.\nUsage:\n\nLEDUp.exe ledno ledstate\n\nWhere ledstate:\n\t0\toff (normal)\n\t1\ton\n\t2\tblink\n\nledno is a LED number (sometimes vibe engine is reported as LED)."), _T("LEDUp info"), MB_OK|MB_ICONINFORMATION);
MessageBox(GetForegroundWindow(), buf, _T("LEDUp info"), MB_OK|MB_ICONINFORMATION);

if(IDYES == MessageBox(GetForegroundWindow(), _T("Test the LEDs now?"), _T("LEDUp Test"), MB_YESNO|MB_ICONQUESTION)){
for(int i = 0; i < GetLedCount(); i++){
for(int j = 0; j < 3; j++){
_stprintf(buf, _T("Testing LED #%d, state %d\ncmd. line: LEDUp %d %d"), i, j, i, j);
SetLedStatus(i, j);
MessageBox(GetForegroundWindow(), buf, _T("LEDUp LED test"), MB_OK|MB_ICONINFORMATION);
}
SetLedStatus(i, 0);
}
}

return 0;
}

_tcsrev(lpCmdLine);

SetLedStatus(_wtoi(_tcsrev(lpCmdLine) + 2), _wtoi(_tcsrev(lpCmdLine) + 2));
return 0;
}

Treo_newb
17th February 2007, 03:33 AM
Thanks TB for all your help:)