5,276,156 members and growing! (15,205 online)
Email Password   helpLost your password?
General Programming » DLLs & Assemblies » General     Intermediate License: The Code Project Open License (CPOL)

Control LED lights on your Dell XPS Laptop

By Broken Bokken

Utilze Dell's XPS Light FX API to create your own LED effects
C# (C# 1.0, C# 2.0, C#), .NET (.NET, .NET 1.1, .NET 2.0), WinForms, Dev

Posted: 12 May 2008
Updated: 12 May 2008
Views: 5,567
Announcements
Want a new Job?



Search    
Advanced Search
Sitemap
3 votes for this Article.
Popularity: 1.98 Rating: 4.14 out of 5
0 votes, 0.0%
1
1 vote, 33.3%
2
0 votes, 0.0%
3
0 votes, 0.0%
4
2 votes, 66.7%
5
Note: This is an unedited contribution. If this article is inappropriate, needs attention or copies someone else's work without reference then please Report This Article

Introduction

I recently came across an article from 2006 by Scott Quibell about changing the LED's on an XPS notbook. I own an XPS M1710 and decided I would set out to discover how to control the LED's myself.

I started by downloading QuickSet from Dell, which is an application that allows you to control a lot of items on your laptop. It even has some built in effects for your LED's but none of them were impressive enough. The 0.5 minimum wait time made the effects seem too jumpy for my taste, so I began a search for to see how Dell was controlling the LED's from an application.

Dell QuickSet Application

I found my answer to controlling the LED's with Dell XPS LightFX - a prebuilt C++ library that controls the LED's. I wanted to use this with .NET applications so my only choice was to take the GamingSDK.dll shipped in XPS Light FX and write a .NET wrapper around it. I called this library LightFX.

Requirements

To utilize XPS Light FX you need the following:
  • An XPS Notebook (Note that the LightFX site says it is for M1710 notebooks. This is not entirely accurate as I have found that other models, such as the M170 also support XPS Light FX. Also, it appears that there is support for XPS Desktops.)
  • QuickSet for testing to see if XPS Light FX works on your computer.

LightFX

LightFX is a simple .NET wrapper around using XPS Light FX. I designed this library using the code from Björn Carlsson as a template. My code is very similar to his, but has been simplifed and modifed to match my own coding standards.

The files included in LightFX:
  • Capability.cs
    An enumeration of capabilities (notebook, desktop, none)
  • Color.cs
    An enumeration of the possible LED colors
  • GamingSDK.dll
    The C++ dll added as content and "copy always" to pass along to any projects using LightFX
  • Intensity.cs
    An enumeration of the levels of LED brightness or intensity
  • Led.cs
    The exposed class managing the LED control workflows
  • NativeSettings.cs
    A struct for storing LED Settings in memory to pass to the C++ code
  • Setting.cs
    The .NET struct with alterations to the names for the LED settings
  • Touchpad.cs
    An enum containing the only two settings for the touchpad: On and Off
  • XPSLightFX.cs
    The wrapper around the C++ code

LightFX Usage

Usage has been simplified greatly. The LightFX.Led class handles the logic between Initializing the SDK and Releasing it. There are two methods of controlling the LED's. The first is by using an XML script file with SetEffectFile.

<Effect>
  <Sequence Zone1="5" Zone2="5" Zone3="5" Zone4="0" Intensity="7" Time="6000" />
  <Sequence Zone1="2" Zone2="2" Zone3="2" Zone4="0" Intensity="7" Time="4000" />
  <Sequence Zone1="1" Zone2="1" Zone3="1" Zone4="1" Intensity="7" Time="250" />
  <Sequence Zone1="1" Zone2="1" Zone3="1" Zone4="0" Intensity="2" Time="250" />
  <Sequence Zone1="1" Zone2="1" Zone3="1" Zone4="1" Intensity="7" Time="250" />
  <Sequence Zone1="1" Zone2="1" Zone3="1" Zone4="0" Intensity="2" Time="250" />
  <Sequence Zone1="1" Zone2="1" Zone3="1" Zone4="1" Intensity="7" Time="250" />
  <Sequence Zone1="1" Zone2="1" Zone3="1" Zone4="0" Intensity="2" Time="250" />
  <Sequence Zone1="1" Zone2="1" Zone3="1" Zone4="1" Intensity="7" Time="250" />
  <Sequence Zone1="1" Zone2="1" Zone3="1" Zone4="0" Intensity="2" Time="250" />
  <Sequence Zone1="1" Zone2="1" Zone3="1" Zone4="1" Intensity="7" Time="250" />
  <Sequence Zone1="1" Zone2="1" Zone3="1" Zone4="0" Intensity="2" Time="250" />
  <Sequence Zone1="1" Zone2="1" Zone3="1" Zone4="1" Intensity="7" Time="250" />
  <Sequence Zone1="1" Zone2="1" Zone3="1" Zone4="0" Intensity="2" Time="250" />
</Effect>
  • Zone 1 = Fans
  • Zone 2 = Speakers
  • Zone 3 = Lid
  • Zone 4 = Touch Pad

The script contains color definintions for the first three zones (0-16) the touchpad for zone 4 (0 or 1) the intensity (0-7) and the time in milliseconds. This script must be passed in as an XML file.

The other way to set the LED colors and brightness is to use the LightFX.Setting struct in SetLed.

Led led = new Led();
Setting settings = led.GetLedSettings();

settings.Fans = LightFX.Color.Ruby;
settings.Speakers = LightFX.Color.Ruby;
settings.Lid = LightFX.Color.Ruby;
setting.Intensity = LightFX.Intensity.Brightest;
setting.TouchPad = TouchPad.On;

led.SetLed(settings);
The above code will set all zones to Ruby at the highest intensity with the touchpad on. The zones can be altered by color independantly of one another, however the intensity applies to all zones, including the touchpad.

Current Deficiencies

While the code I offer has much of the functionality, there may be methods I am missing. The included methods are only known thanks to Björn Carlsson's work. One particular missing feature is the ability to retrieve the current "Power On" settings. If you would like to delve further into the API and extract any more methods, please post the dll import delcarion in the comments and I will add your additions to the article (and give credit).

I have not tested this code on a desktop, but according to the documentation, Setting (and NativeSetting) cannot be used for anything other than a laptop. If you have an XPS desktop, play around with the code and see what you can get it to do. If you write an article on how to use XPS Light FX on a desktop, let me know and I will link to it from this article.

Conclusion

You could create a hook into online games (such as World of Warcraft) to make your lights change depending on the status of your character. You could make your computer perform lightshows on specific events, such as new e-mail or just one effect all the time. The QuickSet application even has plugins for Media Player and WinAmp to change the colors based on the music you are listening to. With the ability to change the LED colors and intensity, the opportunities are endless. If you are looking for a great idea in a professional environment, check out this article by Mike Swanson on Automated Continuous Integration and the Ambient Orb™. Using visual aids to augment the build lifecycle can be a very useful tool.

Updates

May 15, 2008
Altered the project by removing unnecessary references.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Broken Bokken


I am a Techincal Consultant in Omaha, NE specializing in .NET technology. My last year has been spent as a .NET Technical Consultant on various projects, including hyperspectral imaging, Learning Management Systems, Content Management Systems, Online StoreFronts, and other websites. Before becoming a consultant I spent 2 years developing ASP.NET websites for a large market research company. My favorite programming language is C#.

In my free time I enjoy studying the Japanese culture and language, practicing a Japanese sword art called Shinkendo, and spending time with my family.
Occupation: Other
Location: United States United States

Other popular DLLs & Assemblies articles:

Article Top
Sign Up to vote for this article
You must Sign In to use this message board.
FAQ FAQ Noise ToleranceSearch Search Messages 
 Layout  Per page   
 Msgs 1 to 6 of 6 (Total in Forum: 6) (Refresh)FirstPrevNext
Subject  Author Date 
Generalcsproj no workeymemberRRRRRyan5:29 14 May '08  
GeneralRe: csproj no workeymemberBroken Bokken5:40 15 May '08  
GeneralRe: csproj no workeymemberRRRRRyan6:43 15 May '08  
GeneralRe: csproj no workeymemberBroken Bokken4:12 16 May '08  
GeneralNeeds a bunch of work...mvpDave Kreskowiak7:29 12 May '08  
GeneralRe: Needs a bunch of work...memberBroken Bokken7:37 12 May '08  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 12 May 2008
Editor:
Copyright 2008 by Broken Bokken
Everything else Copyright © CodeProject, 1999-2008
Web10 | Advertise on the Code Project