diff --git a/src/psmoveclient/ClientConstants.h b/src/psmoveclient/ClientConstants.h index fee6feac..6a567aef 100644 --- a/src/psmoveclient/ClientConstants.h +++ b/src/psmoveclient/ClientConstants.h @@ -1,6 +1,9 @@ #ifndef CLIENT_CONSTANTS_H #define CLIENT_CONSTANTS_H +//-- includes ----- +#include "../psmoveprotocol/PSMoveProtocolInterface.h" + /** \addtogroup PSMoveClient_CAPI @{ @@ -11,15 +14,6 @@ #define PSMOVESERVICE_DEFAULT_PORT "9512" #define PSM_DEFAULT_TIMEOUT 1000 // milliseconds -// See ControllerManager.h in PSMoveService -#define PSMOVESERVICE_MAX_CONTROLLER_COUNT 5 - -// See TrackerManager.h in PSMoveService -#define PSMOVESERVICE_MAX_TRACKER_COUNT 8 - -// See HMDManager.h in PSMoveService -#define PSMOVESERVICE_MAX_HMD_COUNT 4 - // The length of a controller serial string: "xx:xx:xx:xx:xx:xx\0" #define PSMOVESERVICE_CONTROLLER_SERIAL_LEN 18 diff --git a/src/psmoveprotocol/PSMoveProtocolInterface.h b/src/psmoveprotocol/PSMoveProtocolInterface.h index b66b4b3d..b84dc091 100644 --- a/src/psmoveprotocol/PSMoveProtocolInterface.h +++ b/src/psmoveprotocol/PSMoveProtocolInterface.h @@ -7,6 +7,15 @@ //-- constants ----- #define MAX_OUTPUT_DATA_FRAME_MESSAGE_SIZE 500 #define MAX_INPUT_DATA_FRAME_MESSAGE_SIZE 64 + +// See ControllerManager.h in PSMoveService +#define PSMOVESERVICE_MAX_CONTROLLER_COUNT 5 + +// See TrackerManager.h in PSMoveService +#define PSMOVESERVICE_MAX_TRACKER_COUNT 8 + +// See HMDManager.h in PSMoveService +#define PSMOVESERVICE_MAX_HMD_COUNT 4 //-- pre-declarations ----- namespace PSMoveProtocol diff --git a/src/psmoveservice/Device/Manager/ControllerManager.h b/src/psmoveservice/Device/Manager/ControllerManager.h index 82eb7583..1a451c86 100644 --- a/src/psmoveservice/Device/Manager/ControllerManager.h +++ b/src/psmoveservice/Device/Manager/ControllerManager.h @@ -48,7 +48,7 @@ class ControllerManager : public DeviceTypeManager return cfg; } - static const int k_max_devices = 5; + static const int k_max_devices = PSMOVESERVICE_MAX_CONTROLLER_COUNT; int getMaxDevices() const override { return ControllerManager::k_max_devices; diff --git a/src/psmoveservice/Device/Manager/DeviceTypeManager.h b/src/psmoveservice/Device/Manager/DeviceTypeManager.h index 824d3ca9..91b31719 100644 --- a/src/psmoveservice/Device/Manager/DeviceTypeManager.h +++ b/src/psmoveservice/Device/Manager/DeviceTypeManager.h @@ -3,6 +3,7 @@ //-- includes ----- #include "DevicePlatformInterface.h" +#include "PSMoveProtocolInterface.h" #include #include diff --git a/src/psmoveservice/Device/Manager/HMDManager.h b/src/psmoveservice/Device/Manager/HMDManager.h index b61c225c..7da3f25b 100644 --- a/src/psmoveservice/Device/Manager/HMDManager.h +++ b/src/psmoveservice/Device/Manager/HMDManager.h @@ -40,7 +40,7 @@ class HMDManager : public DeviceTypeManager void updateStateAndPredict(TrackerManager* tracker_manager); - static const int k_max_devices = 4; + static const int k_max_devices = PSMOVESERVICE_MAX_HMD_COUNT; int getMaxDevices() const override { return HMDManager::k_max_devices; diff --git a/src/psmoveservice/Device/Manager/TrackerManager.h b/src/psmoveservice/Device/Manager/TrackerManager.h index 140b21b6..6cf659a5 100644 --- a/src/psmoveservice/Device/Manager/TrackerManager.h +++ b/src/psmoveservice/Device/Manager/TrackerManager.h @@ -78,7 +78,7 @@ class TrackerManager : public DeviceTypeManager void closeAllTrackers(); - static const int k_max_devices = 4; + static const int k_max_devices = PSMOVESERVICE_MAX_TRACKER_COUNT; int getMaxDevices() const override { return TrackerManager::k_max_devices;