Skip to content

Commit

Permalink
Merge pull request xbmc#24392 from garbear/peripheral-locations
Browse files Browse the repository at this point in the history
Peripheral API v3.0.2: Stable peripheral locations
  • Loading branch information
garbear committed Jan 6, 2024
2 parents 29da457 + 53bc4a9 commit a24a80f
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,20 @@ class Peripheral
/// @brief Destructor.
virtual ~Peripheral(void) = default;

/// @brief Comparison operator
///
/// @note The index is not included in the comparison because it is affected
/// by the presence of other peripherals
bool operator==(const Peripheral& rhs) const
{
// clang-format off
return m_type == rhs.m_type &&
m_strName == rhs.m_strName &&
m_vendorId == rhs.m_vendorId &&
m_productId == rhs.m_productId;
// clang-format on
}

/// @brief Get peripheral type.
///
/// @return Type defined with @ref PERIPHERAL_TYPE
Expand Down Expand Up @@ -637,6 +651,21 @@ class Joystick : public Peripheral
return *this;
}

/// @brief Comparison operator
bool operator==(const Joystick& rhs) const
{
// clang-format off
return Peripheral::operator==(rhs) &&
m_provider == rhs.m_provider &&
m_requestedPort == rhs.m_requestedPort &&
m_buttonCount == rhs.m_buttonCount &&
m_hatCount == rhs.m_hatCount &&
m_axisCount == rhs.m_axisCount &&
m_motorCount == rhs.m_motorCount &&
m_supportsPowerOff == rhs.m_supportsPowerOff;
// clang-format on
}

/// @brief Get provider name.
///
/// @return Name of provider
Expand Down Expand Up @@ -1234,7 +1263,7 @@ class JoystickFeature

/// @brief Get all primitives on this class (as constant).
///
/// @return Constant a´rray list of primitives
/// @return Constant array list of primitives
const std::array<DriverPrimitive, JOYSTICK_PRIMITIVE_MAX>& Primitives() const
{
return m_primitives;
Expand Down
2 changes: 1 addition & 1 deletion xbmc/addons/kodi-dev-kit/include/kodi/versions.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
"addon-instance/inputstream/StreamCrypto.h" \
"addon-instance/inputstream/TimingConstants.h"

#define ADDON_INSTANCE_VERSION_PERIPHERAL "3.0.1"
#define ADDON_INSTANCE_VERSION_PERIPHERAL "3.0.2"
#define ADDON_INSTANCE_VERSION_PERIPHERAL_MIN "3.0.0"
#define ADDON_INSTANCE_VERSION_PERIPHERAL_XML_ID "kodi.binary.instance.peripheral"
#define ADDON_INSTANCE_VERSION_PERIPHERAL_DEPENDS "addon-instance/Peripheral.h" \
Expand Down

0 comments on commit a24a80f

Please sign in to comment.