Chirp Connect SDK for Windows (UWP)

The Chirp Connect SDK for Windows allows you to send and receive data from your UWP application, directly communicating with the native audio interface.

Getting Started

Step 1 - Copy the Library folder to your project. It contains a compiled version of ChirpConnectNative for x86 only. In Visual Studio, while the project is selected, click on “Project” and “Add Reference…”. Use the “Browse” tab to look for the ChirpConnectNative.winmd file and select it.

For the moment this only works with Win32 as a target to ensure maximum compatibility. We will be releasing support for additional architectures in the future.

Step 2 - Your application will need to request access to the microphone and speaker in order to respectively receive and send data.

To do so, double click on the Package.appxmanifest file of your project and select “Background Media Playback” and “Microphone” from the “Capabilities” tab.

Step 3 - Import the namespace used by the SDK

using ChirpConnectNative;

s And instantiate the SDK with your app key and secret. You can get these from the Admin Centre.

ChirpConnect Connect;

String key = "YOUR_KEY";
String secret = "YOUR_SECRET";
String licence = "YOUR_LICENCE";

Connect = new ChirpConnect(key, secret);

The licence must be set for the SDK to be initialised properly. Make sure to check the return value for errors.

ChirpError err = Connect.SetLicence(licence);
System.Diagnostics.Debug.WriteLine($"ChirpConnect.SetLicence: {err.ToString()}");

We can now start the SDK for it to be able to send and receive data.

ChirpError err = Connect.Start();
System.Diagnostics.Debug.WriteLine($"ChirpConnect.Start: {err.ToString()}");

Make sure to stop this loop once your application quits or when you don’t need the SDK anymore.

ChirpError err = Connect.Stop();
System.Diagnostics.Debug.WriteLine($"ChirpConnect.Stop: {err.ToString()}");

We provide a set of events to be triggered when data is being received or sent.

Connect.Sending += (byte[] payload) => {
    System.Diagnostics.Debug.WriteLine($"ChirpConnect.Sending: {Connect.AsString(payload)}");

Connect.Sent += (byte[] payload) => {
    System.Diagnostics.Debug.WriteLine($"ChirpConnect.Sent: {Connect.AsString(payload)}");

Connect.Receiving += (byte[] payload) => {
    System.Diagnostics.Debug.WriteLine($"ChirpConnect.Receiving: {Connect.AsString(payload)}");

Connect.Received += (byte[] payload) => {
    System.Diagnostics.Debug.WriteLine($"ChirpConnect.Received: {Connect.AsString(payload)}");

Payloads are simply a byte array (byte[]) of any length between 1 and Connect.MaxPayloadLength. We provide utilities to manipulate payloads.

uint length = 12;

// Will return an empty byte array of `length` size
byte[] emptyPayload = Connect.NewPayload(length);

// Will return a random payload of `length` size
byte[] randomPayload = Connect.RandomPayload(length);

// Or create one of your own
byte[] myPayload = new byte[] { 1, 2, 3, 4, 5 };

Sending the data through the speaker is just as simple.

ChirpError err = Connect.Send(payload);
System.Diagnostics.Debug.WriteLine($"ChirpConnect.Send: {err.ToString()}");