Pages Menu
TwitterRssFacebook

Posted by on May 18, 2013 in Skype for Business® (Lync®)

Busylight Lync SDK Released! (inc. code samples)

Busylight Lync SDK Released! (inc. code samples)

With the new SDK, you can use the Busylight as a system status alert for SCOM, Twitter, CI Builds – whatever you want!

Update 29th May 2013

Plenom have updated their SDK, and made it easier to instantiate the BusylightController object. There are now two constructors, one for the Busylight Lync and one for the Busylight UC. I’ve updated the instructions and the code samples below, but if you’re returning to this page, be aware that it’s changed.

A while ago, I blogged about how you could use the DLL that came with the Busylight to create your own colours and control it from within your application.

The Busylight is a USB device with a speaker and light. It’s designed to show your presence from Microsoft Lync and other UC applications in a more visual way. In open plan offices, it’s a good way of signalling that you’re on a call and don’t want to be disturbed. There’s a good write-up by Scott Hanselman about it.

When I blogged this before, I used the DLL that came with the stock application to control some of the functionality of the Busylight, and I moaned about the lack of an SDK. At the time, Morten Ostergaard, a Partner at Plenom a/s (the people behind Busylight) made contact, gave me some hints and tips, and confirmed that an SDK would be coming for Busylight.

Well, it’s arrived! The official SDK from Busylight is now available, via their Developer section at http://www.busylight.com/develop.

When I last looked at the DLL that came with the Busylight, it was possible to get it to display colours on demand, but it wasn’t particuarly simple, and it was a bit too hacky to be used comfortably in a production environment. However, the SDK has made it really simple to control the Busylight, which makes it ideal for hundreds of use cases outside of the standard Lync presence reporting.

Download the Busylight SDK

In the examples below I created a new Console Application in Visual Studio. You can do this if you want to follow along. Either way, add a reference to Busylight.Sdk.dll which is included in the download.

Busylight-References

Busylight UC vs. Busylight Lync

The SDK works with both Busylight UC and Busylight Lync, although the website only talks about the Busylight UC.

In an early version of the SDK, the default constructor for the controller object only worked with the Busylight UC and you had to call an overloaded method, passing IDs, in order to use it with the Busylight Lync.

Plenom have since updated the SDK to make it easier to use with the Busylight Lync. There is now a separate controller object especially for Busylight Lync.

All the samples below are for Busylight Lync, but include the Busylight UC constructor as a comment. If you have a Busylight UC, just comment & uncomment accordingly.

Lighting Up

Here’s how simple Plenom have made it to control the Busylight from your application:

There’s a choice of 4 colours: Red, Blue, Green and Yellow. I found that if you set the light, it will stay on for about 10 seconds before turning off. If that’s too long, you can call Light() with the color enumeration Off. In the future, it would be cool to be able to specify custom colour combinations, maybe using RGB values, to allow for a range of different colours. Plenom actually got back to me about this. It turns out it IS possible to create your own colours rather than just using the 4 enumerations, I’d just not noticed it. You can create a new BusylightColour object and specify the RGB parts as properties. Here’s an example of doing this to create a nice purple colour:

Pulse It

As well as just displaying a light colour, you can also draw attraction by altering the opacity of the light, to create a pulsating effect:

The SDK allows you to specify a colour, and up to 8 steps. Each step property is a tinyint (0-255) representing the opacitiy of the light. 0 is off, 255 is full brightness. The steps are executed in order, very quickly (I would say about 250 milliseconds between them). The example above gives a sort of fade in and fade out effect. Each sequence is executed in full 7 times, before the light turns off. You can also use this to save yourself writing loop code, if you want to show a flashing light. Just set each odd step at zero and each even step at 255. It turns out looking like this:

Light and Sound

One of the big things I couldn’t work out how to do before the SDK was sound. It’s included in this SDK however, as part of the Alert() method:

There’s a choice of 8 different sound clips and 4 different volume settings.

I noticed that when using the Alert() method, the alert never seemed to stop. The light would turn off after about 10 seconds, but the sound continued. I waited 3 minutes for it to stop, and ended up unplugging it to get it to shut up!

However, calling Light() will stop the sound. I use this trick in the code sample to cancel the sound after 10 seconds.

There’s also a method called AlertAndReturn(), but I couldn’t work out what this did differently from Alert(), apart from always using a blue light regardless of what you chose.

Conclusion

Plenom have made it really simple to integrate use of the Busylight into your own applications. Building a simple hardware notification to react to events such as system errors, or notifications is usually either expensive or complicated. However, the Busylight is an inexpensive and simple solution and you won’t have to spend ages putting it together.

To take just one example: Continuous Integration server build notifications. There are many ingenious and cool solutions out there, but sometimes you don’t have time, and just want something that works. I reckon I could hook this into TFS in less than a day. If I get time to try it, I’ll post up the code.

Written by Tom Morgan

Tom is a Microsoft Teams Platform developer and Microsoft MVP who has been blogging for over a decade. Find out more.
Buy the book: Building and Developing Apps & Bots for Microsoft Teams. Now available to purchase online with free updates.

4 Comments

  1. I am looking for some help in writing a simple app for the BusyLight Lync that allows work at home users without Lync Calling abilities to manually set the light for things such as on a call with blinking colored light. Would love to make this app a windows 7 widget.

  2. I have written a Program in MFC.
    Can I use the busylink_SDK in My MFC product?
    Please tel me, how can I use the BusyLight_SDK in my MFC Program.

  3. I have written a Program in MFC.
    Can I use the busylink_SDK in My MFC product?
    Please tel me, how can I use the BusyLight_SDK in my MFC Program.

  4. Do you know how to get the current light status?
    or know the light is changed success?

Trackbacks/Pingbacks

  1. Busylight SDK – Showing Custom Colours | thoughtstuff | Tom Morgan - [...] my previous post on the new Busylight SDK, I said that I didn’t think it was possible to display…
  2. SDK for Busylight - Lyncstore.se - [...] på http://www.busylight.com/develop. Vill du ha hjälp med att komma igång kan du läsa mer på följande blogginlägg av Tom…
  3. Guest Blog Post: Third Day of Work Experience (2014) | endjin blog - […] did not just turn off straight away. We then tried the light so it would turn on. After following…

Post a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.