PST SDK 7.0.0.0-ebe6e713
Loading...
Searching...
No Matches
minimal/minimal.cs
// Copyright PS-Tech B.V. All Rights Reserved.
using System;
using System.Threading;
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.
}
}
}
}
Tracking information retrieved from tracker.
Definition TrackerData.cs:25
Main PST SDK class implementing tracker communication.
Definition Tracker.cs:198
void StartTracker()
Start tracking.
Definition Tracker.cs:524
void AddTrackerListener(TrackerListener listener)
Add a listener for tracker data and/or mode change reporting.
Definition Tracker.cs:476
Implements the TrackerListener class to receive tracking information and tracking mode updates.
Definition Tracker.cs:166
Definition CApi.cs:9
ErrorStatus
Tracker error messages enum class.
Definition ErrorHandler.cs:17