Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Spokes SDK 5-Minute Quick-Start Blog!

15 Mar 2013 2  
Spokes SDK 5-Minute Quick-start blog!

This article is in the Product Showcase section for our sponsors at CodeProject. These articles are intended to provide you with information on products and services that we consider useful and of value to developers.

Hi All,

Adding Plantronics support to your app is as easy as this!

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Plantronics.UC.SpokesWrapper;
namespace SpokesQuickStartDemo
{
    class Program
    {
        static Spokes spokes;
        static void Main(string[] args)
        {
            spokes = Spokes.Instance;
            spokes.PutOn += spokes_PutOn;
            spokes.TakenOff += spokes_TakenOff;
            spokes.Connect("Spokes Quick Start");
            Console.WriteLine("Press enter to quit...");
            Console.ReadLine();
            spokes.PutOn -= spokes_PutOn;
            spokes.TakenOff -= spokes_TakenOff;
            spokes.Disconnect();
        }
        static void spokes_TakenOff(object sender, WearingStateArgs e)
        {
            Console.WriteLine("Headset is not worn");
        }
        static void spokes_PutOn(object sender, WearingStateArgs e)
        {
            Console.WriteLine("Headset is worn");
        }
    }
}

The above command line application will show you when the headset is put on and taken off, like this:

Background info

The Plantronics Spokes SDK contains all you need to integrate support into your app for Plantronics headset, speaker and multiline devices.

Spokes is a software runtime that talks to the Plantronics device on your behalf and exposes a set of APIs to program the device. Read more.

Spokes 2.7 has 3 main APIs:

  • COM Service, being a Win32 COM interface typically used from C++ apps
  • .NET Interop for COM Service, allowing C#/VB.NET apps to connect to above COM Service
  • REST Service, being a web service offering access to Spokes from language of your choice via HTTP requests

Note: iPlugin API will not be available in next major Spokes release. If you are using it you need to migrate to COM Service or .NET Interop for COM Service / SpokesWrapper.cs.

More detail: Integrate to Spokes in 5-minutes (or less)!

  1. Install Spokes software from Plantronics | Support | Downloads & Apps | Plantronics (don't bother with the SDK yet, you don't need for this quick-start)
  2. Launch Visual Studio
  3. Choose File | New | Project
  4. Choose Visual C# | Windows | .NET Framework 4 | Console Application (must be .NET 4 or higher to use Spokes C# API)
  5. In the Solution Explorer in the project References, right-click and Add Reference:
  6. Navigate to the Spoke runtime folder: C:\Program Files (x86)\Plantronics\PlantronicsURE, and select Interop.Plantronics.dll
  7. Right click on the reference in the project and choose properties, and set Embed Interop Types to False:
  8. Now download a copy of SpokesWrapper.cs, a source file that does a lot of hard work for you!
  9. Right click on project in Solution Explorer and click Add Existing Item
  10. Navigate to the location of the SpokesWrapper.cs file you just downloaded and click Add. This should now be added to your project in Solution Explorer.
  11. You can now write your program code like the sample at the top of this blog!
    • Visual Studio project is attached below...
  12. For a more comprehensive sample using the wrapper please refer to the Spokes Easy Demo.
    • This demo includes softphone call control, mobile call control / mobile caller id, multi-line control, serial numbers as well as status of: wearing sensor, proximity, docking, softphone calling, mobile calling, mute and multi-line.

Have fun! See you soon ...

This article was written by Lewis Collins. Lewis became a member of the Plantronics Engineering team in August 2011. In this role he provides software consulting and expertise internally across teams and to external development partners who want to integrate with the Plantronics SDK kits and headset products. Previously Lewis gained experience in a wide range of software engineering activities and technologies, working in the telecommunications and public safety sectors as a software engineer at Integraph, a consultant for Altran Technologies UK and as a software engineer for Teleca Ltd.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here