Skip to content

Commit

Permalink
Update Gadget DLL from internal build
Browse files Browse the repository at this point in the history
(add IMXRT support)
  • Loading branch information
docsteer committed Oct 25, 2022
1 parent 1592ec9 commit d0eb7f3
Show file tree
Hide file tree
Showing 16 changed files with 294 additions and 192 deletions.
Binary file modified Win32/bin/GadgetDLL.dll
Binary file not shown.
8 changes: 4 additions & 4 deletions Win32/include/RDM_CmdC.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class RDM_CmdC
m_Buffer = 0;
reset();
}
RDM_CmdC(uint8_t cmd, uint16_t parameter, uint16_t subdevice = 0, uint8_t len = 0,
RDM_CmdC(uint8_t cmd, uint16_t parameter, uint16_t subdevice = 0, size_t len = 0,
const void *buffer = 0, uint16_t manu = 0, uint32_t dev = 0)
{
m_Buffer = 0;
Expand Down Expand Up @@ -91,7 +91,7 @@ class RDM_CmdC
uint8_t getCommand(void) const { return m_Command; };
uint16_t getParameter(void) const { return m_Parameter; };
uint16_t getSubdevice(void) const { return m_Subdevice; };
uint8_t getLength(void) const { return m_Length; };
size_t getLength(void) const { return m_Length; };
const void *getBuffer(void) const { return m_Buffer; };
uint8_t getTransactionNum(void) const { return m_TransactionNum; }
uint8_t getResponseType(void) const { return m_ResponseType; };
Expand All @@ -102,7 +102,7 @@ class RDM_CmdC
void setCommand(uint8_t newVal) { m_Command = newVal; };
void setParameter(uint16_t newVal) { m_Parameter = newVal; };
void setSubdevice(uint16_t newVal) { m_Subdevice = newVal; };
void setLength(uint8_t newVal) { m_Length = newVal; };
void setLength(size_t newVal) { m_Length = newVal; };
void setBuffer(const void *newVal) { if(m_Buffer) {delete [] m_Buffer; m_Buffer = 0;}
if(newVal) {m_Buffer = new uint8_t[m_Length]; memcpy(m_Buffer, newVal, m_Length);}
};
Expand All @@ -116,7 +116,7 @@ class RDM_CmdC
uint8_t m_Command; // Which RDM command (E120_GET_COMMAND or E120_SET_COMMAND)
uint16_t m_Parameter; // Which PID (e.g. E120_DEVICE_INFO or E120_DEVICE_LABEL)
uint16_t m_Subdevice; // Which subdevice command is for (0 = root)
uint8_t m_Length; // Length of data in "buffer" for this command
size_t m_Length; // Length of data in "buffer" for this command
uint8_t *m_Buffer; // Data to include with this command
uint8_t m_TransactionNum; // RDM transaction number
uint8_t m_ResponseType; // RDM response type (e.g. E120_RESPONSE_TYPE_ACK, E120_RESPONSE_TYPE_ACK_TIMER)
Expand Down
77 changes: 34 additions & 43 deletions Win32/include/RdmDeviceInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,60 +17,51 @@
#ifndef RDM_DEVICE_INFO_H_
#define RDM_DEVICE_INFO_H_

#include <stdint.h>
#include <string.h>
#include <cstdint>
#include <cstring>
#include <set>

#include "rdmEtcConsts.h"
#include "uid.h"

struct RdmDeviceInfo
{
// Constructor for RdmDeviceInfo; two flags determine if the information is valid yet
explicit RdmDeviceInfo(uid i)
: manufacturer_id (i.manu),
device_id (i.id),
rdm_protocol_version(0),
device_model_id(0),
product_category_type(0),
software_version_id(0),
dmx_footprint(0),
dmx_personality(0),
dmx_start_address(0),
subdevice_count(0),
sensor_count(0),
port_number(0),
subdevice_id(0),
software_version_label_valid(false),
e120_device_info_valid(false)
{
memset(software_version_label, 0, sizeof(software_version_label));
}
RdmDeviceInfo() {}
uint16_t manufacturer_id; // ESTA-assigned manufacturer id
uint32_t device_id; // Unique to the manufacturer
uint8_t software_version_label[RDM_MAX_TEXT + 1]; // text, up to 32 characters
uint16_t manufacturer_id{}; // ESTA-assigned manufacturer id
uint32_t device_id{}; // Unique to the manufacturer
uint8_t software_version_label[RDM_MAX_TEXT + 1]{}; // text, up to 32 characters

uint16_t rdm_protocol_version;
uint16_t device_model_id; // manufacturer-unique, assigned to device/model
uint16_t product_category_type; // enumerated
uint32_t software_version_id;
uint16_t rdm_protocol_version{};
uint16_t device_model_id{}; // manufacturer-unique, assigned to device/model
uint16_t product_category_type{}; // enumerated
uint32_t software_version_id{};

// DMX universe footprint of the device
uint16_t dmx_footprint; // up to 512
uint16_t dmx_personality;
uint16_t dmx_start_address; // start at slot 1
// DMX universe footprint of the device
uint16_t dmx_footprint{}; // up to 512
uint16_t dmx_personality{};
uint16_t dmx_start_address{}; // start at slot 1

uint16_t subdevice_count;
uint8_t sensor_count;
uint16_t subdevice_count{};
uint8_t sensor_count{};

// Other Device Properties
uint8_t port_number; // Port number on which the device has been discovered (1-based)
// Other Device Properties
uint8_t port_number{}; // Port number on which the device has been discovered (1-based)

uint16_t subdevice_id;
uint16_t subdevice_id{};

// Used to test for full completion of the struct
bool software_version_label_valid;
bool e120_device_info_valid;
std::set<uint16_t> supported_parameters;

// Used to test for full completion of the struct
bool software_version_label_valid{};
bool rdm_device_info_valid{};
bool supported_parameters_valid{};

bool IsComplete() const noexcept
{
return software_version_label_valid && rdm_device_info_valid; // && supported_parameters_valid;
}

RdmDeviceInfo() = default;
explicit RdmDeviceInfo(uid i) : manufacturer_id(i.manu), device_id(i.id) {}
};

#endif // RDM_DEVICE_INFO_H_
#endif // RDM_DEVICE_INFO_H_
41 changes: 37 additions & 4 deletions Win32/include/rdmEtcConsts.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,16 +150,42 @@
#define E120_ETC_LED_ENUM_FREQUENCY_DESCRIPTION 0x8124
#define E120_ETC_RGBI_PRESETCONFIG 0x8125
#define E120_ETC_CCT_PRESETCONFIG 0x8126
#define E120_ETC_SENSOR_VERBOSITY 0x8127
#define E120_ETC_SECRET_CONTROL_MODE 0x8128
#define E120_ETC_ADVANCED_RGB_PRESETCONFIG 0x8129
#define E120_ETC_RGBA_PRESETCONFIG 0x812A

#define E120_ETC_SUPPLEMENTARY_DEVICE_VERSION 0x8130
#define E120_ETC_START_UWB_DISCOVER 0x8150
#define E120_ETC_START_UWB_MEASURE 0x8151
#define E120_ETC_POSITION 0x8152
#define E120_ETC_START_UWB_DISCOVER 0x8150
#define E120_ETC_START_UWB_MEASURE 0x8151
#define E120_ETC_POSITION 0x8152

#define E120_ETC_LEDSPECTRALDATA 0x8160

#define E120_ETC_EFFECTS_PROPERTIES 0x81F0
#define E120_ETC_STUDIO_PRESET_CONFIG 0x81F1
/**** AUTOMATED LIGHTING *****/
#define E120_ETC_HOME_FIXTURE 0x8200
#define E120_ETC_HOME_FIXTURE_DESCRIPTION 0x8201

#define E120_ETC_DMX_LOSS_WAIT_TIME 0x8202
#define E120_ETC_DMX_LOSS_FADE_TIME 0x8203

#define E120_ETC_PAN_LIMIT_MIN 0x8204
#define E120_ETC_PAN_LIMIT_MAX 0x8205
//#define E120_ETC_PAN_LIMIT_DESCRIPTION 0x8205

#define E120_ETC_TILT_LIMIT_MIN 0x8206
#define E120_ETC_TILT_LIMIT_MAX 0x8207
//#define E120_ETC_TILT_LIMIT_DESCRIPTION 0x8207
/**** END AUTOMATED LIGHTING ****/

#define E120_ETC_MULTIVERSE_SHOWID 0x8C00
#define E120_ETC_MULTIVERSE_INCOMPLETE_PACKETS 0x8C01
#define E120_ETC_MULTIVERSE_RX_RSSI 0x8C02
#define E120_ETC_MULTIVERSE_SHOWKEY 0x8C03
#define E120_ETC_MULTIVERSE_ENABLE 0x8C04
#define E120_ETC_MULTIVERSE_UNIVERSE 0x8C05

#define E120_ETC_S4DIM_CALIBRATE 0x9000
#define E120_ETC_S4DIM_CALIBRATE_DESCRIPTION 0x9001
Expand All @@ -178,7 +204,8 @@

#define E120_ETC_PACKET_DELAY 0xB000

#define E120_RAYN_GET_SPD_UUID 0xC000
#define E120_RAYN_SPD_UUID 0xC000
#define E120_RAYN_SPD 0xC001

#define E120_ETC_HAS_ENUM_TEXT 0xE000
#define E120_ETC_GET_ENUM_TEXT 0xE001
Expand All @@ -199,6 +226,10 @@
#define E120_DS_ETC_SEQUENCECONFIG 0xA5
#define E120_DS_ETC_RGBI_PRESETCONFIG 0xA6
#define E120_DS_ETC_CCT_PRESETCONFIG 0xA7
#define E120_DS_ETC_EFFECTPROPS 0xA8
#define E120_DS_ETC_STUDIOPRESET 0xA9
#define E120_DS_ETC_ADVANCED_RGBI_PRESETCONFIG 0xAA
#define E120_DS_ETC_RGBA_PRESETCONFIG 0xAB

// The following are typically defined in estardm_StatusSlots.h since they are NOT ETC specific
#ifndef E120_STS_CAL_FAIL
Expand Down Expand Up @@ -267,6 +298,8 @@
/* Table C-2: Slot ID Definitions */
/********************************************************/

// TODO: Rename E120_SD_INTENSITY_MASTER once it has been changed in the standard.

#define E120_SD_INTENSITY 0x0001
#define E120_SD_INTENSITY_MASTER 0x0002
#define E120_SD_PAN 0x0101
Expand Down
Binary file modified Win32/lib/GadgetDLL.lib
Binary file not shown.
37 changes: 28 additions & 9 deletions Win32/lib/cmake/GadgetDLL/GadgetDLLConfigVersion.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,45 @@
# The variable CVF_VERSION must be set before calling configure_file().


set(PACKAGE_VERSION "2.1.0.1")
set(PACKAGE_VERSION "3.0.0.1")

if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
set(PACKAGE_VERSION_COMPATIBLE FALSE)
else()

if("2.1.0.1" MATCHES "^([0-9]+)\\.")
if("3.0.0.1" MATCHES "^([0-9]+)\\.")
set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}")
if(NOT CVF_VERSION_MAJOR VERSION_EQUAL 0)
string(REGEX REPLACE "^0+" "" CVF_VERSION_MAJOR "${CVF_VERSION_MAJOR}")
endif()
else()
set(CVF_VERSION_MAJOR "2.1.0.1")
set(CVF_VERSION_MAJOR "3.0.0.1")
endif()

if(PACKAGE_FIND_VERSION_MAJOR STREQUAL CVF_VERSION_MAJOR)
set(PACKAGE_VERSION_COMPATIBLE TRUE)
if(PACKAGE_FIND_VERSION_RANGE)
# both endpoints of the range must have the expected major version
math (EXPR CVF_VERSION_MAJOR_NEXT "${CVF_VERSION_MAJOR} + 1")
if (NOT PACKAGE_FIND_VERSION_MIN_MAJOR STREQUAL CVF_VERSION_MAJOR
OR ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND NOT PACKAGE_FIND_VERSION_MAX_MAJOR STREQUAL CVF_VERSION_MAJOR)
OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND NOT PACKAGE_FIND_VERSION_MAX VERSION_LESS_EQUAL CVF_VERSION_MAJOR_NEXT)))
set(PACKAGE_VERSION_COMPATIBLE FALSE)
elseif(PACKAGE_FIND_VERSION_MIN_MAJOR STREQUAL CVF_VERSION_MAJOR
AND ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_LESS_EQUAL PACKAGE_FIND_VERSION_MAX)
OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION_MAX)))
set(PACKAGE_VERSION_COMPATIBLE TRUE)
else()
set(PACKAGE_VERSION_COMPATIBLE FALSE)
endif()
else()
set(PACKAGE_VERSION_COMPATIBLE FALSE)
endif()
if(PACKAGE_FIND_VERSION_MAJOR STREQUAL CVF_VERSION_MAJOR)
set(PACKAGE_VERSION_COMPATIBLE TRUE)
else()
set(PACKAGE_VERSION_COMPATIBLE FALSE)
endif()

if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
set(PACKAGE_VERSION_EXACT TRUE)
endif()
endif()
endif()

Expand All @@ -40,7 +59,7 @@ endif()

# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it:
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "4" STREQUAL "")
return()
return()
endif()

# check that the installed version has the same 32/64bit-ness as the one which is currently searching:
Expand Down
4 changes: 2 additions & 2 deletions Win32/lib/cmake/GadgetDLL/GadgetDLLTargets-release.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ set_target_properties(GadgetDLL::GadgetDLL PROPERTIES
IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/bin/GadgetDLL.dll"
)

list(APPEND _IMPORT_CHECK_TARGETS GadgetDLL::GadgetDLL )
list(APPEND _IMPORT_CHECK_FILES_FOR_GadgetDLL::GadgetDLL "${_IMPORT_PREFIX}/lib/GadgetDLL.lib" "${_IMPORT_PREFIX}/bin/GadgetDLL.dll" )
list(APPEND _cmake_import_check_targets GadgetDLL::GadgetDLL )
list(APPEND _cmake_import_check_files_for_GadgetDLL::GadgetDLL "${_IMPORT_PREFIX}/lib/GadgetDLL.lib" "${_IMPORT_PREFIX}/bin/GadgetDLL.dll" )

# Commands beyond this point should not need to know the version.
set(CMAKE_IMPORT_FILE_VERSION)
76 changes: 42 additions & 34 deletions Win32/lib/cmake/GadgetDLL/GadgetDLLTargets.cmake
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# Generated by CMake

if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.5)
message(FATAL_ERROR "CMake >= 2.6.0 required")
if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.8)
message(FATAL_ERROR "CMake >= 2.8.0 required")
endif()
if(CMAKE_VERSION VERSION_LESS "2.8.3")
message(FATAL_ERROR "CMake >= 2.8.3 required")
endif()
cmake_policy(PUSH)
cmake_policy(VERSION 2.6)
cmake_policy(VERSION 2.8.3...3.22)
#----------------------------------------------------------------
# Generated CMake target import file.
#----------------------------------------------------------------
Expand All @@ -13,32 +16,34 @@ cmake_policy(VERSION 2.6)
set(CMAKE_IMPORT_FILE_VERSION 1)

# Protect against multiple inclusion, which would fail when already imported targets are added once more.
set(_targetsDefined)
set(_targetsNotDefined)
set(_expectedTargets)
foreach(_expectedTarget GadgetDLL::GadgetDLL)
list(APPEND _expectedTargets ${_expectedTarget})
if(NOT TARGET ${_expectedTarget})
list(APPEND _targetsNotDefined ${_expectedTarget})
endif()
if(TARGET ${_expectedTarget})
list(APPEND _targetsDefined ${_expectedTarget})
set(_cmake_targets_defined "")
set(_cmake_targets_not_defined "")
set(_cmake_expected_targets "")
foreach(_cmake_expected_target IN ITEMS GadgetDLL::GadgetDLL)
list(APPEND _cmake_expected_targets "${_cmake_expected_target}")
if(TARGET "${_cmake_expected_target}")
list(APPEND _cmake_targets_defined "${_cmake_expected_target}")
else()
list(APPEND _cmake_targets_not_defined "${_cmake_expected_target}")
endif()
endforeach()
if("${_targetsDefined}" STREQUAL "${_expectedTargets}")
unset(_targetsDefined)
unset(_targetsNotDefined)
unset(_expectedTargets)
set(CMAKE_IMPORT_FILE_VERSION)
unset(_cmake_expected_target)
if(_cmake_targets_defined STREQUAL _cmake_expected_targets)
unset(_cmake_targets_defined)
unset(_cmake_targets_not_defined)
unset(_cmake_expected_targets)
unset(CMAKE_IMPORT_FILE_VERSION)
cmake_policy(POP)
return()
endif()
if(NOT "${_targetsDefined}" STREQUAL "")
message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_targetsDefined}\nTargets not yet defined: ${_targetsNotDefined}\n")
if(NOT _cmake_targets_defined STREQUAL "")
string(REPLACE ";" ", " _cmake_targets_defined_text "${_cmake_targets_defined}")
string(REPLACE ";" ", " _cmake_targets_not_defined_text "${_cmake_targets_not_defined}")
message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_cmake_targets_defined_text}\nTargets not yet defined: ${_cmake_targets_not_defined_text}\n")
endif()
unset(_targetsDefined)
unset(_targetsNotDefined)
unset(_expectedTargets)
unset(_cmake_targets_defined)
unset(_cmake_targets_not_defined)
unset(_cmake_expected_targets)


# Compute the installation prefix relative to this file.
Expand All @@ -58,21 +63,22 @@ set_target_properties(GadgetDLL::GadgetDLL PROPERTIES
)

# Load information for each installed configuration.
get_filename_component(_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
file(GLOB CONFIG_FILES "${_DIR}/GadgetDLLTargets-*.cmake")
foreach(f ${CONFIG_FILES})
include(${f})
file(GLOB _cmake_config_files "${CMAKE_CURRENT_LIST_DIR}/GadgetDLLTargets-*.cmake")
foreach(_cmake_config_file IN LISTS _cmake_config_files)
include("${_cmake_config_file}")
endforeach()
unset(_cmake_config_file)
unset(_cmake_config_files)

# Cleanup temporary variables.
set(_IMPORT_PREFIX)

# Loop over all imported files and verify that they actually exist
foreach(target ${_IMPORT_CHECK_TARGETS} )
foreach(file ${_IMPORT_CHECK_FILES_FOR_${target}} )
if(NOT EXISTS "${file}" )
message(FATAL_ERROR "The imported target \"${target}\" references the file
\"${file}\"
foreach(_cmake_target IN LISTS _cmake_import_check_targets)
foreach(_cmake_file IN LISTS "_cmake_import_check_files_for_${_cmake_target}")
if(NOT EXISTS "${_cmake_file}")
message(FATAL_ERROR "The imported target \"${_cmake_target}\" references the file
\"${_cmake_file}\"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
Expand All @@ -82,9 +88,11 @@ but not all the files it references.
")
endif()
endforeach()
unset(_IMPORT_CHECK_FILES_FOR_${target})
unset(_cmake_file)
unset("_cmake_import_check_files_for_${_cmake_target}")
endforeach()
unset(_IMPORT_CHECK_TARGETS)
unset(_cmake_target)
unset(_cmake_import_check_targets)

# This file does not depend on other imported targets which have
# been exported from the same project but in a separate export set.
Expand Down
Binary file modified x64/bin/GadgetDLL.dll
Binary file not shown.
Loading

0 comments on commit d0eb7f3

Please sign in to comment.