Help - Search - Members - Calendar
Full Version: Led From Command Line?
OESF Forums > Distros, Development, and Model Specific Forums > Distro Support and Discussion > pdaXrom
Is there a way to turn on the green "mail" LED from a script in pdaXrom?
On my C-1000 (pdaXrom), I has device named sharp_led in /dev. Maybe this can help you...
not an answer but :
look at the command :

xset --help ... it talk about a led fonction ...

Perhaps ...
attached: ledmail

ledmail on
ledmail off (whatever in fact)

#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>

#include "sharp_char.h"

int main(int argc,char **argv)
 int fd;
 int status=0;
 sharp_led_status st;
 if ((argc>1) && (strcmp(argv[1],"on")==0))

 fd = open ("/dev/sharp_led", O_WRONLY);
 st.which = 9;
 st.status = status;
 ioctl(fd, SHARP_LED_SETSTATUS, &st);

 return 0;
Thanks pgas! I was just about to try patching something together when I saw your binary. Very cool, this is exactly what I needed!

FYI, you can set "which" to 13 instead of 9 and give several other status numbers to have the mail LED flash/blink in many different ways. If you set "which" to 12 you can control the battery LED.

If I get ambitios, I'll modify your code to take more options later this week, unless someone with real C++ skills gets to it first. smile.gif

Now it is just too bad that there is no way to keep that LED blinking after the Z goes to sleep. smile.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2016 Invision Power Services, Inc.