Click or drag to resize
NewAer.SDK Namespace
NewAer
NewAer Proximity Platform
=========================

Welcome to the NewAer Proximity Platform for Windows.

The NewAer Proximity Platform SDK consists of a set of compiled dlls.
NewAer.dll references NewAer.BLEBgApi.dll, Newtonsoft.Json.dll,
ManagedWifi.dll and BgApiDriver.dll.

Reference NewAer.dll to access the NewAer SDK:

* Extract the contents of the release archive to your libraries directory

* Select the "References" item in the Solution Explorer

* Right-click and choose 'Add Reference'

* Browse for "NewAer.dll" from the libraries directory you extracted
and select it.

* Click the "OK" button to confirm.

* The NewAer reference should appear in the References item.

You may now reference the SDK in your project.

Demo
====

Please refer to the sample program for a more thorough demonstration.

Examples
========

This section gives a quick run through the basics of using the sdk.

Important: You will need to register your program on the NewAer Dev Portal to received your unique NewAer App Id

// Implement the INAHost interface
public class YourApp : INAHostApp

// Create a new instance of the platform.
var mPlatform = new NAPlatform(this);

// Set event callbacks
mPlatform.FoundDevice += deviceFound;

// Start scanning for nearby wifi networks!
mPlatform.StartScanWithDeviceType(NADeviceType.WiFi);

// At this point scan events will trigger event callbacks as they come in

Advanced
--------

// Scan for devices
mPlatform.StartScanWithDeviceTypes(NADeviceType.WiFi, NADeviceType.Bluetooth);
mPlatform.StartScanWithDeviceTypes(NADeviceType.BTLE);

// Optionally scan for specific BTLE devices (line above will scan for ALL BTLE devices, use this code for specific BTLE devices)
mPlatform.StartScanWithDeviceTypes(NADeviceType.NADevice);
mPlatform.StartScanWithDeviceTypes(NADeviceType.Wearables);
mPlatform.StartScanWithDeviceTypes(NADeviceType.Beacon);

// To turn off scanning:
mPlatform.StopScanWithDeviceTypes(NADeviceType.WiFi, NADeviceType.Beacon);

// Set up event callbacks
mPlatform.FoundDevice += deviceFound;
mPlatform.LostDevice += deviceLeft;
mPlatform.UpdatedDevice += deviceUpdated;
mPlatform.ReceivedMessage += messageReceived;

// Callback for when a new device is found
private void deviceFound(object sender, NADevice device)
{
    Console.WriteLine(String.Format("Found new {0} device ==> {1}", device.DeviceType, device.DeviceId));
}

// Callback for when a device goes out of range
private void deviceLeft(object sender, NADevice device)
{
    Console.WriteLine(String.Format("{0} device left ==> {1}", device.DeviceType, device.DeviceId));
}

// Callback for when a device is updated
private void deviceUpdated(object sender, NADevice device)
{
    Console.WriteLine(String.Format("Updating existing {0} device ==> {1}", device.DeviceType, device.DeviceId));
}

// Callback for when a message is recieved from a NewAer device
private void messageReceived(object sender, NAMessage msg)
{
    Console.WriteLine(String.Format("BTLE Message Received Id: {0}, Message: {1}", msg.DeviceId, msg.Message));
}
Classes
  ClassDescription
Public classNADevice
The representation of a device in the system. This class also provides static methods for working with devices the platform knows about. An instance of NADevice is actively backed by the device in the system, so any calls into the device return the current state of the device as known to the system.
Public classNAMessage
Represents a message to be passed to another NewAer device over BTLE.
Public classNAPlatform
This class provides methods for starting and stopping scanning, checking if scanning is running, and checking if radio interfaces are enabled.
Interfaces
  InterfaceDescription
Public interfaceINAHostApp
Host App interface allows the host app to provide app check data