PlantronicsSpokes SDK是一个强大的工具集,它包含了集成Plantronics耳机、扬声器和多线设备到应用程序所需的一切。Spokes 是一个软件运行时,它代表与Plantronics设备通信,并暴露了一系列API供编程设备。本文将向展示如何快速开始使用Spokes SDK。
Spokes 2.7 版本提供了三个主要的API:
注意:iPlugin API将在下一个主要的Spokes版本中不再可用。如果正在使用它,需要迁移到COM Service或.NET Interop for COM Service / SpokesWrapper.cs。
以下是如何快速开始使用Spokes SDK的步骤:
以下是一个简单的控制台应用程序示例,它将显示耳机何时被戴上和取下:
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");
}
}
}