Skip to content
This repository has been archived by the owner on May 3, 2021. It is now read-only.

Commit

Permalink
Moving shared constants from PSMoveProtocolInterface.h to SharedConst…
Browse files Browse the repository at this point in the history
…ants.h

* Updated ClientConstants.h to include SharedConstants.h
* Updated PSMoveProtocolInterface.h to use SharedConstants.h
* Fixed up cmake files to copy SharedConstants.h into install include folder
  • Loading branch information
HipsterSloth committed Aug 8, 2017
1 parent d45efc1 commit b8345bc
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 13 deletions.
10 changes: 1 addition & 9 deletions src/psmoveclient/ClientConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@
#define CLIENT_CONSTANTS_H

//-- includes -----
#include "../psmoveprotocol/PSMoveProtocolInterface.h"
#include "SharedConstants.h"

/**
\addtogroup PSMoveClient_CAPI
@{
*/

//-- constants -----
#define PSMOVESERVICE_DEFAULT_ADDRESS "localhost"
#define PSMOVESERVICE_DEFAULT_PORT "9512"
#define PSM_DEFAULT_TIMEOUT 1000 // milliseconds

// The length of a controller serial string: "xx:xx:xx:xx:xx:xx\0"
Expand All @@ -20,12 +18,6 @@
// The max length of the service version string
#define PSMOVESERVICE_MAX_VERSION_STRING_LEN 32

// The max number of axes allowed on a virtual controller
#define PSM_MAX_VIRTUAL_CONTROLLER_AXES 32

// The max number of buttons allowed on a virtual controller
#define PSM_MAX_VIRTUAL_CONTROLLER_BUTTONS 32

// Defines a standard _PAUSE function
#if __cplusplus >= 199711L // if C++11
#include <thread>
Expand Down
4 changes: 2 additions & 2 deletions src/psmoveprotocol/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ set_target_properties(PSMoveProtocol PROPERTIES

# Install
IF(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
install(FILES ProtocolVersion.h
install(FILES ProtocolVersion.h SharedConstants.h
DESTINATION ${ROOT_DIR}/${PSM_PROJECT_NAME}/${ARCH_LABEL}/include)
ELSE() #Linux/Darwin
install(FILES ProtocolVersion.h
install(FILES ProtocolVersion.h SharedConstants.h
DESTINATION include)
ENDIF()
1 change: 1 addition & 0 deletions src/psmoveprotocol/PSMoveProtocolInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

//-- includes -----
#include <memory>
#include "SharedConstants.h"

//-- constants -----
#define MAX_OUTPUT_DATA_FRAME_MESSAGE_SIZE 500
Expand Down
2 changes: 1 addition & 1 deletion src/psmoveprotocol/ProtocolVersion.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#define PSM_RELEASE_VERSION_PHASE alpha
#define PSM_RELEASE_VERSION_MINOR 8
#define PSM_RELEASE_VERSION_RELEASE 7
#define PSM_RELEASE_VERSION_HOTFIX 0
#define PSM_RELEASE_VERSION_HOTFIX 1

/// "Product.Major-Phase Minor.Release.Hotfix"
#if !defined(PSM_RELEASE_VERSION_STRING)
Expand Down
26 changes: 26 additions & 0 deletions src/psmoveprotocol/SharedConstants.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#ifndef SHARED_CONSTANTS_H
#define SHARED_CONSTANTS_H

#define PSMOVESERVICE_DEFAULT_ADDRESS "localhost"
#define PSMOVESERVICE_DEFAULT_PORT "9512"

#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

// The max number of axes allowed on a virtual controller
#define PSM_MAX_VIRTUAL_CONTROLLER_AXES 32

// The max number of buttons allowed on a virtual controller
#define PSM_MAX_VIRTUAL_CONTROLLER_BUTTONS 32


#endif // SHARED_CONSTANTS_H
6 changes: 5 additions & 1 deletion src/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@ ENDIF()
# We could include the PSMoveService project but we want our test as isolated as possible.
list(APPEND TEST_CAMERA_INCL_DIRS
${ROOT_DIR}/src/psmoveclient/
${ROOT_DIR}/src/psmoveprotocol/
${ROOT_DIR}/src/psmoveservice/PSMoveTracker/PSEye)
list(APPEND TEST_CAMERA_SRC
${ROOT_DIR}/src/psmoveclient/ClientConstants.h
${ROOT_DIR}/src/psmoveprotocol/SharedConstants.h
${ROOT_DIR}/src/psmoveservice/PSMoveTracker/PSEye/PSEyeVideoCapture.h
${ROOT_DIR}/src/psmoveservice/PSMoveTracker/PSEye/PSEyeVideoCapture.cpp)

Expand Down Expand Up @@ -423,7 +425,9 @@ ENDIF()
# TEST_CONSOLE_CAPI
#
add_executable(test_console_CAPI test_console_CAPI.cpp)
target_include_directories(test_console_CAPI PUBLIC ${ROOT_DIR}/src/psmoveclient/)
target_include_directories(test_console_CAPI PUBLIC
${ROOT_DIR}/src/psmoveclient/
${ROOT_DIR}/src/psmoveprotocol/)
target_link_libraries(test_console_CAPI PSMoveClient_CAPI)
SET_TARGET_PROPERTIES(test_console_CAPI PROPERTIES FOLDER Test)
# Install
Expand Down

0 comments on commit b8345bc

Please sign in to comment.