-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHardwareAbstract.h
41 lines (31 loc) · 1.23 KB
/
HardwareAbstract.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//
// m1-orientationmanager
// Copyright © 2022 Mach1. All rights reserved.
//
#pragma once
#include <JuceHeader.h>
#include "m1_orientation_client/M1OrientationTypes.h"
#include "m1_orientation_client/M1OrientationSettings.h"
class HardwareAbstract {
std::mutex mtx;
public:
using TrackingCallback = std::function<void(bool success, std::string message, std::string connectedDeviceName, int connectedDeviceType, std::string connectedDeviceAddress)>;
virtual int setup() = 0;
virtual int update() = 0;
virtual int close() = 0;
std::function<void()> orientationDeviceLostCallback = [](){};
void lock() {
mtx.lock();
}
void unlock() {
mtx.unlock();
}
virtual std::vector<M1OrientationDeviceInfo> getDevices() = 0;
virtual void refreshDevices() = 0;
virtual M1OrientationDeviceInfo getConnectedDevice() = 0;
virtual M1OrientationTrackingResult getOrientation() = 0;
virtual void calibrateDevice() = 0;
virtual void recenter() = 0;
virtual void startTrackingUsingDevice(M1OrientationDeviceInfo device, TrackingCallback callback) = 0;
virtual void setAdditionalDeviceSettings(std::string settingsChange) = 0; // used to send a blob string to be parsed for specific device class calls
};