Loading...
Searching...
No Matches
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
{
class MyTrackerListener : TrackerListener
{
public override 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.
// Wrap the Tracker in a using statement to ensure Dispose() is called automatically
using (Tracker tracker = new Tracker())
{
//Create tracker listener with callback functions for data and/or mode updates.
TrackerListener listener = new MyTrackerListener();
// Register the TrackerListener object to the tracker server.
tracker.AddTrackerListener(listener);
// 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.
}
}
}
}
Exception
PSTech.Pstsdk.TrackerData
Tracking information retrieved from tracker.
Definition TrackerData.cs:25
PSTech.Pstsdk.Tracker
Main PST SDK class implementing tracker communication.
Definition Tracker.cs:198
PSTech.Pstsdk.Tracker.StartTracker
void StartTracker()
Start tracking.
Definition Tracker.cs:524
PSTech.Pstsdk.Tracker.AddTrackerListener
void AddTrackerListener(TrackerListener listener)
Add a listener for tracker data and/or mode change reporting.
Definition Tracker.cs:476
PSTech.Pstsdk.TrackerListener
Implements the TrackerListener class to receive tracking information and tracking mode updates.
Definition Tracker.cs:166
PSTech.Pstsdk
Definition CApi.cs:9
PSTech.Pstsdk.ErrorStatus
ErrorStatus
Tracker error messages enum class.
Definition ErrorHandler.cs:17