#include "wire_HidDisplay.hpp"
#include "../obapi_runtime.hpp"
#include <type_traits>
static_assert(std::is_same<decltype(::M_HidDisplay::ButtonDisplayInfoType::Index), uint32_t>::value, "M_HidDisplay::ButtonDisplayInfoType field Index differs from the data model");
static_assert(std::is_same<decltype(::M_HidDisplay::ButtonDisplayInfoType::Name), std::string>::value, "M_HidDisplay::ButtonDisplayInfoType field Name differs from the data model");
static_assert(std::is_same<decltype(::M_HidDisplay::ButtonDisplayInfoType::Label), std::string>::value, "M_HidDisplay::ButtonDisplayInfoType field Label differs from the data model");
static_assert(std::is_same<decltype(::M_HidDisplay::ButtonDisplayInfoType::Image), ::M_Common::ImageType>::value, "M_HidDisplay::ButtonDisplayInfoType field Image differs from the data model");
static_assert(std::is_same<decltype(::M_HidDisplay::ButtonDisplayInfoType::IsEnabled), bool>::value, "M_HidDisplay::ButtonDisplayInfoType field IsEnabled differs from the data model");
static_assert(std::is_same<decltype(::M_HidDisplay::ButtonDisplayInfoType::IsHighlighted), bool>::value, "M_HidDisplay::ButtonDisplayInfoType field IsHighlighted differs from the data model");
static_assert(std::is_same<::M_HidDisplay::ButtonDisplayInfoListType, std::vector<::M_HidDisplay::ButtonDisplayInfoType>>::value, "typedef M_HidDisplay::ButtonDisplayInfoListType differs from the data model");
static_assert(std::is_same<decltype(::M_HidDisplay::LedLightModeActionType::LedLightOn), bool>::value, "M_HidDisplay::LedLightModeActionType field LedLightOn differs from the data model");
static_assert(std::is_same<decltype(::M_HidDisplay::LedLightModeActionType::RgbColorCode), std::vector<uint32_t>>::value, "M_HidDisplay::LedLightModeActionType field RgbColorCode differs from the data model");
static_assert(std::is_same<decltype(::M_HidDisplay::LedLightModeActionType::durationInMilliseconds), std::vector<uint32_t>>::value, "M_HidDisplay::LedLightModeActionType field durationInMilliseconds differs from the data model");
static_assert(std::is_same<decltype(::M_HidDisplay::LedLightModeActionType::Brightness), std::vector<double>>::value, "M_HidDisplay::LedLightModeActionType field Brightness differs from the data model");
static_assert(std::is_same<::M_HidDisplay::LedLightModeActionListType, std::vector<::M_HidDisplay::LedLightModeActionType>>::value, "typedef M_HidDisplay::LedLightModeActionListType differs from the data model");
static_assert(std::is_same<decltype(::M_HidDisplay::LedLightModeType::Actions), std::vector<::M_HidDisplay::LedLightModeActionType>>::value, "M_HidDisplay::LedLightModeType field Actions differs from the data model");
static_assert(std::is_same<decltype(::M_HidDisplay::LedLightModeType::RepeatCount), std::vector<uint32_t>>::value, "M_HidDisplay::LedLightModeType field RepeatCount differs from the data model");
static_assert(std::is_same<decltype(::M_HidDisplay::AxisDisplayInfoType::Index), uint32_t>::value, "M_HidDisplay::AxisDisplayInfoType field Index differs from the data model");
static_assert(std::is_same<decltype(::M_HidDisplay::AxisDisplayInfoType::Name), std::string>::value, "M_HidDisplay::AxisDisplayInfoType field Name differs from the data model");
static_assert(std::is_same<decltype(::M_HidDisplay::AxisDisplayInfoType::NegativeLabel), std::string>::value, "M_HidDisplay::AxisDisplayInfoType field NegativeLabel differs from the data model");
static_assert(std::is_same<decltype(::M_HidDisplay::AxisDisplayInfoType::NegativeImage), ::M_Common::ImageType>::value, "M_HidDisplay::AxisDisplayInfoType field NegativeImage differs from the data model");
static_assert(std::is_same<decltype(::M_HidDisplay::AxisDisplayInfoType::PositiveLabel), std::string>::value, "M_HidDisplay::AxisDisplayInfoType field PositiveLabel differs from the data model");
static_assert(std::is_same<decltype(::M_HidDisplay::AxisDisplayInfoType::PositiveImage), ::M_Common::ImageType>::value, "M_HidDisplay::AxisDisplayInfoType field PositiveImage differs from the data model");
static_assert(std::is_same<::M_HidDisplay::AxisDisplayInfoListType, std::vector<::M_HidDisplay::AxisDisplayInfoType>>::value, "typedef M_HidDisplay::AxisDisplayInfoListType differs from the data model");
static_assert(std::is_same<decltype(::M_HidDisplay::LedDisplayInfoType::Index), uint32_t>::value, "M_HidDisplay::LedDisplayInfoType field Index differs from the data model");
static_assert(std::is_same<decltype(::M_HidDisplay::LedDisplayInfoType::Name), std::string>::value, "M_HidDisplay::LedDisplayInfoType field Name differs from the data model");
static_assert(std::is_same<decltype(::M_HidDisplay::LedDisplayInfoType::Label), std::string>::value, "M_HidDisplay::LedDisplayInfoType field Label differs from the data model");
static_assert(std::is_same<decltype(::M_HidDisplay::LedDisplayInfoType::LedLightMode), ::M_HidDisplay::LedLightModeType>::value, "M_HidDisplay::LedDisplayInfoType field LedLightMode differs from the data model");
static_assert(std::is_same<decltype(::M_HidDisplay::LedDisplayInfoType::SupportedRgbColorCodesList), std::vector<uint32_t>>::value, "M_HidDisplay::LedDisplayInfoType field SupportedRgbColorCodesList differs from the data model");
static_assert(std::is_same<::M_HidDisplay::LedDisplayInfoListType, std::vector<::M_HidDisplay::LedDisplayInfoType>>::value, "typedef M_HidDisplay::LedDisplayInfoListType differs from the data model");
static_assert(std::is_same<decltype(::M_HidDisplay::ValueInputInfoType::ValueInputIndex), uint32_t>::value, "M_HidDisplay::ValueInputInfoType field ValueInputIndex differs from the data model");
static_assert(std::is_same<decltype(::M_HidDisplay::ValueInputInfoType::Label), std::string>::value, "M_HidDisplay::ValueInputInfoType field Label differs from the data model");
static_assert(std::is_same<decltype(::M_HidDisplay::ValueInputInfoType::IsEnabled), bool>::value, "M_HidDisplay::ValueInputInfoType field IsEnabled differs from the data model");
static_assert(std::is_same<decltype(::M_HidDisplay::ValueInputInfoType::ValueInputMode), std::vector<::M_Common::PropertyType>>::value, "M_HidDisplay::ValueInputInfoType field ValueInputMode differs from the data model");
static_assert(std::is_same<decltype(::M_HidDisplay::ValueInputInfoType::DefaultValue), std::vector<::M_Common::PropertyType>>::value, "M_HidDisplay::ValueInputInfoType field DefaultValue differs from the data model");
static_assert(std::is_same<decltype(::M_HidDisplay::ValueInputInfoType::MinValue), std::vector<::M_Common::PropertyType>>::value, "M_HidDisplay::ValueInputInfoType field MinValue differs from the data model");
static_assert(std::is_same<decltype(::M_HidDisplay::ValueInputInfoType::MaxValue), std::vector<::M_Common::PropertyType>>::value, "M_HidDisplay::ValueInputInfoType field MaxValue differs from the data model");
static_assert(std::is_same<decltype(::M_HidDisplay::ValueInputInfoType::PresetList), std::vector<::M_Common::PropertyType>>::value, "M_HidDisplay::ValueInputInfoType field PresetList differs from the data model");
static_assert(std::is_same<::M_HidDisplay::ValueInputInfoListType, std::vector<::M_HidDisplay::ValueInputInfoType>>::value, "typedef M_HidDisplay::ValueInputInfoListType differs from the data model");
static_assert(std::is_same<decltype(::M_HidDisplay::MenuInfoType::MenuIndex), uint32_t>::value, "M_HidDisplay::MenuInfoType field MenuIndex differs from the data model");
static_assert(std::is_same<decltype(::M_HidDisplay::MenuInfoType::Label), std::string>::value, "M_HidDisplay::MenuInfoType field Label differs from the data model");
static_assert(std::is_same<decltype(::M_HidDisplay::MenuInfoType::IsEnabled), bool>::value, "M_HidDisplay::MenuInfoType field IsEnabled differs from the data model");
static_assert(std::is_same<::M_HidDisplay::MenuInfoListType, std::vector<::M_HidDisplay::MenuInfoType>>::value, "typedef M_HidDisplay::MenuInfoListType differs from the data model");
static_assert(std::is_same<decltype(::M_HidDisplay::HidInfoType::Axes), std::vector<::M_HidDisplay::AxisDisplayInfoType>>::value, "M_HidDisplay::HidInfoType field Axes differs from the data model");
static_assert(std::is_same<decltype(::M_HidDisplay::HidInfoType::Buttons), std::vector<::M_HidDisplay::ButtonDisplayInfoType>>::value, "M_HidDisplay::HidInfoType field Buttons differs from the data model");
static_assert(std::is_same<decltype(::M_HidDisplay::HidInfoType::Leds), std::vector<::M_HidDisplay::LedDisplayInfoType>>::value, "M_HidDisplay::HidInfoType field Leds differs from the data model");
static_assert(std::is_same<decltype(::M_HidDisplay::HidInfoType::ValueInputs), std::vector<::M_HidDisplay::ValueInputInfoType>>::value, "M_HidDisplay::HidInfoType field ValueInputs differs from the data model");
static_assert(std::is_same<decltype(::M_HidDisplay::HidInfoType::Menus), std::vector<::M_HidDisplay::MenuInfoType>>::value, "M_HidDisplay::HidInfoType field Menus differs from the data model");
static_assert(std::is_same<decltype(::M_HidDisplay::HidInfoType::BackgroundIlluminationLevel), std::vector<double>>::value, "M_HidDisplay::HidInfoType field BackgroundIlluminationLevel differs from the data model");
static_assert(std::is_same<decltype(::M_HidDisplay::HidInfoType::IsBlackoutModeEnabled), bool>::value, "M_HidDisplay::HidInfoType field IsBlackoutModeEnabled differs from the data model");
namespace M_HidDisplay {
void obapi_put(::obapi::Writer& w, ButtonDisplayInfoType const& v) {
::obapi::put(w, v.Index);
::obapi::put(w, v.Name);
::obapi::put(w, v.Label);
::obapi::put(w, v.Image);
::obapi::put(w, v.IsEnabled);
::obapi::put(w, v.IsHighlighted);
}
void obapi_get(::obapi::Reader& r, ButtonDisplayInfoType& v) {
::obapi::get(r, v.Index);
::obapi::get(r, v.Name);
::obapi::get(r, v.Label);
::obapi::get(r, v.Image);
::obapi::get(r, v.IsEnabled);
::obapi::get(r, v.IsHighlighted);
}
void obapi_put(::obapi::Writer& w, LedLightModeActionType const& v) {
::obapi::put(w, v.LedLightOn);
::obapi::put(w, v.RgbColorCode);
::obapi::put(w, v.durationInMilliseconds);
::obapi::put(w, v.Brightness);
}
void obapi_get(::obapi::Reader& r, LedLightModeActionType& v) {
::obapi::get(r, v.LedLightOn);
::obapi::get(r, v.RgbColorCode);
::obapi::get(r, v.durationInMilliseconds);
::obapi::get(r, v.Brightness);
}
void obapi_put(::obapi::Writer& w, LedLightModeType const& v) {
::obapi::put(w, v.Actions);
::obapi::put(w, v.RepeatCount);
}
void obapi_get(::obapi::Reader& r, LedLightModeType& v) {
::obapi::get(r, v.Actions);
::obapi::get(r, v.RepeatCount);
}
void obapi_put(::obapi::Writer& w, AxisDisplayInfoType const& v) {
::obapi::put(w, v.Index);
::obapi::put(w, v.Name);
::obapi::put(w, v.NegativeLabel);
::obapi::put(w, v.NegativeImage);
::obapi::put(w, v.PositiveLabel);
::obapi::put(w, v.PositiveImage);
}
void obapi_get(::obapi::Reader& r, AxisDisplayInfoType& v) {
::obapi::get(r, v.Index);
::obapi::get(r, v.Name);
::obapi::get(r, v.NegativeLabel);
::obapi::get(r, v.NegativeImage);
::obapi::get(r, v.PositiveLabel);
::obapi::get(r, v.PositiveImage);
}
void obapi_put(::obapi::Writer& w, LedDisplayInfoType const& v) {
::obapi::put(w, v.Index);
::obapi::put(w, v.Name);
::obapi::put(w, v.Label);
::obapi::put(w, v.LedLightMode);
::obapi::put(w, v.SupportedRgbColorCodesList);
}
void obapi_get(::obapi::Reader& r, LedDisplayInfoType& v) {
::obapi::get(r, v.Index);
::obapi::get(r, v.Name);
::obapi::get(r, v.Label);
::obapi::get(r, v.LedLightMode);
::obapi::get(r, v.SupportedRgbColorCodesList);
}
void obapi_put(::obapi::Writer& w, ValueInputInfoType const& v) {
::obapi::put(w, v.ValueInputIndex);
::obapi::put(w, v.Label);
::obapi::put(w, v.IsEnabled);
::obapi::put(w, v.ValueInputMode);
::obapi::put(w, v.DefaultValue);
::obapi::put(w, v.MinValue);
::obapi::put(w, v.MaxValue);
::obapi::put(w, v.PresetList);
}
void obapi_get(::obapi::Reader& r, ValueInputInfoType& v) {
::obapi::get(r, v.ValueInputIndex);
::obapi::get(r, v.Label);
::obapi::get(r, v.IsEnabled);
::obapi::get(r, v.ValueInputMode);
::obapi::get(r, v.DefaultValue);
::obapi::get(r, v.MinValue);
::obapi::get(r, v.MaxValue);
::obapi::get(r, v.PresetList);
}
void obapi_put(::obapi::Writer& w, MenuInfoType const& v) {
::obapi::put(w, v.MenuIndex);
::obapi::put(w, v.Label);
::obapi::put(w, v.IsEnabled);
}
void obapi_get(::obapi::Reader& r, MenuInfoType& v) {
::obapi::get(r, v.MenuIndex);
::obapi::get(r, v.Label);
::obapi::get(r, v.IsEnabled);
}
void obapi_put(::obapi::Writer& w, HidInfoType const& v) {
::obapi::put(w, v.Axes);
::obapi::put(w, v.Buttons);
::obapi::put(w, v.Leds);
::obapi::put(w, v.ValueInputs);
::obapi::put(w, v.Menus);
::obapi::put(w, v.BackgroundIlluminationLevel);
::obapi::put(w, v.IsBlackoutModeEnabled);
}
void obapi_get(::obapi::Reader& r, HidInfoType& v) {
::obapi::get(r, v.Axes);
::obapi::get(r, v.Buttons);
::obapi::get(r, v.Leds);
::obapi::get(r, v.ValueInputs);
::obapi::get(r, v.Menus);
::obapi::get(r, v.BackgroundIlluminationLevel);
::obapi::get(r, v.IsBlackoutModeEnabled);
}
}
namespace {
struct ServiceCallbacks final : ::M_HidDisplay::IService {
::obapi::Dispatcher dispatcher;
void ConfigAxisLabel(uint32_t KeyAxisIndex, std::string const& NegativeLabel, ::M_Common::ImageType const& NegativeImage, std::string const& PositiveLabel, ::M_Common::ImageType const& PositiveImage, bool IsRemoved) override {
::obapi::Writer w;
::obapi::put(w, KeyAxisIndex);
::obapi::put(w, NegativeLabel);
::obapi::put(w, NegativeImage);
::obapi::put(w, PositiveLabel);
::obapi::put(w, PositiveImage);
::obapi::put(w, IsRemoved);
dispatcher.dispatch(0u, w);
}
void ConfigStatusLed(uint32_t KeyLedIndex, ::M_HidDisplay::LedLightModeType const& LedLightMode, bool IsRemoved) override {
::obapi::Writer w;
::obapi::put(w, KeyLedIndex);
::obapi::put(w, LedLightMode);
::obapi::put(w, IsRemoved);
dispatcher.dispatch(1u, w);
}
void ConfigBackgroundIllumination(::M_Common::PercentType Level) override {
::obapi::Writer w;
::obapi::put(w, Level);
dispatcher.dispatch(2u, w);
}
void ConfigBlackoutMode(bool Enable) override {
::obapi::Writer w;
::obapi::put(w, Enable);
dispatcher.dispatch(3u, w);
}
void ConfigButtonLabel(uint32_t KeyButtonIndex, std::string const& Label, ::M_Common::ImageType const& Image, bool IsEnabled, bool IsHighlighted, bool IsRemoved) override {
::obapi::Writer w;
::obapi::put(w, KeyButtonIndex);
::obapi::put(w, Label);
::obapi::put(w, Image);
::obapi::put(w, IsEnabled);
::obapi::put(w, IsHighlighted);
::obapi::put(w, IsRemoved);
dispatcher.dispatch(4u, w);
}
void ConfigValueInput(uint32_t KeyValueInputIndex, std::string const& Label, bool IsEnabled, ::M_Common::PropertyOptionalType const& ValueInputMode, ::M_Common::PropertyOptionalType const& DefaultValue, ::M_Common::PropertyOptionalType const& MinValue, ::M_Common::PropertyOptionalType const& MaxValue, ::M_Common::PropertyListType const& PresetList, bool IsRemoved) override {
::obapi::Writer w;
::obapi::put(w, KeyValueInputIndex);
::obapi::put(w, Label);
::obapi::put(w, IsEnabled);
::obapi::put(w, ValueInputMode);
::obapi::put(w, DefaultValue);
::obapi::put(w, MinValue);
::obapi::put(w, MaxValue);
::obapi::put(w, PresetList);
::obapi::put(w, IsRemoved);
dispatcher.dispatch(5u, w);
}
void ConfigMenuLabel(uint32_t KeyMenuIndex, std::string const& Label, bool IsEnabled, bool IsRemoved) override {
::obapi::Writer w;
::obapi::put(w, KeyMenuIndex);
::obapi::put(w, Label);
::obapi::put(w, IsEnabled);
::obapi::put(w, IsRemoved);
dispatcher.dispatch(6u, w);
}
void CmdSelectButton(uint32_t ButtonIndex, bool IsSelected) override {
::obapi::Writer w;
::obapi::put(w, ButtonIndex);
::obapi::put(w, IsSelected);
dispatcher.dispatch(7u, w);
}
};
struct ClientCallbacks final : ::M_HidDisplay::IClient {
::obapi::Dispatcher dispatcher;
void ReportHidInfo(::M_HidDisplay::HidInfoType const& Info) override {
::obapi::Writer w;
::obapi::put(w, Info);
dispatcher.dispatch(0u, w);
}
};
void service_send(::obapi::Holder<::M_HidDisplay::Service, ServiceCallbacks>& h, uint32_t op, ::obapi::Reader& r) {
switch (op) {
case 0u: {
::M_HidDisplay::HidInfoType Info{};
::obapi::get(r, Info);
r.finish();
h.endpoint->ReportHidInfo(Info);
return;
}
default: throw ::obapi::UnknownOp(op);
}
}
void client_send(::obapi::Holder<::M_HidDisplay::Client, ClientCallbacks>& h, uint32_t op, ::obapi::Reader& r) {
switch (op) {
case 0u: {
uint32_t KeyAxisIndex{};
::obapi::get(r, KeyAxisIndex);
std::string NegativeLabel{};
::obapi::get(r, NegativeLabel);
::M_Common::ImageType NegativeImage{};
::obapi::get(r, NegativeImage);
std::string PositiveLabel{};
::obapi::get(r, PositiveLabel);
::M_Common::ImageType PositiveImage{};
::obapi::get(r, PositiveImage);
bool IsRemoved{};
::obapi::get(r, IsRemoved);
r.finish();
h.endpoint->ConfigAxisLabel(KeyAxisIndex, NegativeLabel, NegativeImage, PositiveLabel, PositiveImage, IsRemoved);
return;
}
case 1u: {
uint32_t KeyLedIndex{};
::obapi::get(r, KeyLedIndex);
::M_HidDisplay::LedLightModeType LedLightMode{};
::obapi::get(r, LedLightMode);
bool IsRemoved{};
::obapi::get(r, IsRemoved);
r.finish();
h.endpoint->ConfigStatusLed(KeyLedIndex, LedLightMode, IsRemoved);
return;
}
case 2u: {
::M_Common::PercentType Level{};
::obapi::get(r, Level);
r.finish();
h.endpoint->ConfigBackgroundIllumination(Level);
return;
}
case 3u: {
bool Enable{};
::obapi::get(r, Enable);
r.finish();
h.endpoint->ConfigBlackoutMode(Enable);
return;
}
case 4u: {
uint32_t KeyButtonIndex{};
::obapi::get(r, KeyButtonIndex);
std::string Label{};
::obapi::get(r, Label);
::M_Common::ImageType Image{};
::obapi::get(r, Image);
bool IsEnabled{};
::obapi::get(r, IsEnabled);
bool IsHighlighted{};
::obapi::get(r, IsHighlighted);
bool IsRemoved{};
::obapi::get(r, IsRemoved);
r.finish();
h.endpoint->ConfigButtonLabel(KeyButtonIndex, Label, Image, IsEnabled, IsHighlighted, IsRemoved);
return;
}
case 5u: {
uint32_t KeyValueInputIndex{};
::obapi::get(r, KeyValueInputIndex);
std::string Label{};
::obapi::get(r, Label);
bool IsEnabled{};
::obapi::get(r, IsEnabled);
::M_Common::PropertyOptionalType ValueInputMode{};
::obapi::get(r, ValueInputMode);
::M_Common::PropertyOptionalType DefaultValue{};
::obapi::get(r, DefaultValue);
::M_Common::PropertyOptionalType MinValue{};
::obapi::get(r, MinValue);
::M_Common::PropertyOptionalType MaxValue{};
::obapi::get(r, MaxValue);
::M_Common::PropertyListType PresetList{};
::obapi::get(r, PresetList);
bool IsRemoved{};
::obapi::get(r, IsRemoved);
r.finish();
h.endpoint->ConfigValueInput(KeyValueInputIndex, Label, IsEnabled, ValueInputMode, DefaultValue, MinValue, MaxValue, PresetList, IsRemoved);
return;
}
case 6u: {
uint32_t KeyMenuIndex{};
::obapi::get(r, KeyMenuIndex);
std::string Label{};
::obapi::get(r, Label);
bool IsEnabled{};
::obapi::get(r, IsEnabled);
bool IsRemoved{};
::obapi::get(r, IsRemoved);
r.finish();
h.endpoint->ConfigMenuLabel(KeyMenuIndex, Label, IsEnabled, IsRemoved);
return;
}
case 7u: {
uint32_t ButtonIndex{};
::obapi::get(r, ButtonIndex);
bool IsSelected{};
::obapi::get(r, IsSelected);
r.finish();
h.endpoint->CmdSelectButton(ButtonIndex, IsSelected);
return;
}
default: throw ::obapi::UnknownOp(op);
}
}
}
extern "C" const obapi_vtable obapi_HidDisplay_service_vtable = ::obapi::Endpoint<::M_HidDisplay::Service, ServiceCallbacks, &service_send, false>::vtable("M_HidDisplay", "Service");
extern "C" const obapi_vtable obapi_HidDisplay_client_vtable = ::obapi::Endpoint<::M_HidDisplay::Client, ClientCallbacks, &client_send, true>::vtable("M_HidDisplay", "Client");