PST SDK  5.2.0.0-0eac0f6
minimal/minimal.cs
// Copyright PS-Tech B.V. All Rights Reserved.
using System;
using System.Threading;
using PSTech.Pstsdk;
namespace PSTech.Minimal
{
public class Minimal
{
static void OnTrackerData(TrackerData data, ErrorStatus status)
{
// Do something with the tracker data in data
}
static void Main(string[] args)
{
// Implement error handling of PSTech.TrackerException exceptions to prevent
// improper PST Tracker shutdown on errors.
try
{
// Create an instance of the Tracker object using the default configuration path and file names.
Tracker tracker = new Tracker();
// Register the listener object to the tracker server.
tracker.AddTrackerListener(OnTrackerData);
// Start the tracker server.
tracker.StartTracker();
// Wait for 10 seconds, allowing for the detection of tracking targets.
Thread.Sleep(10000);
}
catch (Exception e)
{
// Do something with the error.
}
finally
{
// Make sure that the connection to the PST Tracker is shut down properly.
Tracker.Shutdown();
}
}
}
}
PSTech.Pstsdk
Definition: CApi.cs:8
PSTech.Pstsdk.ErrorStatus
ErrorStatus
Tracker error messages enum class.
Definition: ErrorHandler.cs:16
Exception
PSTech
Definition: CApi.cs:8