diff options
author | Alexander Kutsan <akutsan@luxoft.com> | 2017-08-10 14:07:09 +0300 |
---|---|---|
committer | Andrey Oleynik <aoleynik@luxoft.com> | 2017-08-16 22:34:23 +0300 |
commit | 59f437dc8608e1ec54c517416a39860d9a7be3b8 (patch) | |
tree | 2908c276bd5ea066741c034eb2bd144682ba8649 /src/components/policy/policy_regular/src/policy_table/enums.cc | |
parent | 06729e8b744374a4d9694f669101b6c554ce42e0 (diff) | |
download | sdl_core-59f437dc8608e1ec54c517416a39860d9a7be3b8.tar.gz |
Implementation of Remote Control plugin
Stype changes after integration
Fix policy handler remote unit tests
Diffstat (limited to 'src/components/policy/policy_regular/src/policy_table/enums.cc')
-rw-r--r-- | src/components/policy/policy_regular/src/policy_table/enums.cc | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/components/policy/policy_regular/src/policy_table/enums.cc b/src/components/policy/policy_regular/src/policy_table/enums.cc index 6de065148a..e0f77be989 100644 --- a/src/components/policy/policy_regular/src/policy_table/enums.cc +++ b/src/components/policy/policy_regular/src/policy_table/enums.cc @@ -326,6 +326,8 @@ bool IsValidEnum(AppHMIType val) { return true; case AHT_PROJECTION: return true; + case AHT_REMOTE_CONTROL: + return true; default: return false; } @@ -354,6 +356,8 @@ const char* EnumToJsonString(AppHMIType val) { return "SYSTEM"; case AHT_PROJECTION: return "PROJECTION"; + case AHT_REMOTE_CONTROL: + return "REMOTE_CONTROL"; default: return ""; } @@ -392,6 +396,9 @@ bool EnumFromJsonString(const std::string& literal, AppHMIType* result) { } else if ("PROJECTION" == literal) { *result = AHT_PROJECTION; return true; + } else if ("REMOTE_CONTROL" == literal) { + *result = AHT_REMOTE_CONTROL; + return true; } else { return false; } @@ -576,6 +583,41 @@ bool EnumFromJsonString(const std::string& literal, RequestType* result) { } } +#ifdef SDL_REMOTE_CONTROL +bool IsValidEnum(ModuleType val) { + switch (val) { + case MT_CLIMATE: + return true; + case MT_RADIO: + return true; + default: + return false; + } +} +const char* EnumToJsonString(ModuleType val) { + switch (val) { + case MT_CLIMATE: + return "CLIMATE"; + case MT_RADIO: + return "RADIO"; + default: + return ""; + } +} + +bool EnumFromJsonString(const std::string& literal, ModuleType* result) { + if ("CLIMATE" == literal) { + *result = MT_CLIMATE; + return true; + } else if ("RADIO" == literal) { + *result = MT_RADIO; + return true; + } else { + return false; + } +} +#endif // SDL_REMOTE_CONTROL + const std::string kDefaultApp = "default"; const std::string kPreDataConsentApp = "pre_DataConsent"; const std::string kDeviceApp = "device"; |