summaryrefslogtreecommitdiff
path: root/src/components/policy
diff options
context:
space:
mode:
authorAlexander <akutsan@luxoft.com>2018-08-15 10:47:07 +0300
committerAlexander <akutsan@luxoft.com>2018-08-16 16:16:59 +0300
commit3a775dd456dc75ffa4488d974eb5eb7db0f5d55b (patch)
treebbb11bef69fac8df0e467a894cc9b5a2245e5a46 /src/components/policy
parent946e25fa31411a4a00b547cee2d0f1dd12b94a7d (diff)
downloadsdl_core-3a775dd456dc75ffa4488d974eb5eb7db0f5d55b.tar.gz
New RC modules initial implementation
Mobile API and HMI capabilities for the rc new modules Fix RC defects - Fixed Mobile & HMI API: removed redundant default value - FIxed GetInteriorVehicleData request behavior - Fixed OnInteriorDataNotification behavior Fix header guards and add missed includes Fix control data checking by capabilities Answered to review comments Commit
Diffstat (limited to 'src/components/policy')
-rw-r--r--src/components/policy/policy_external/include/policy/policy_table/enums.h9
-rw-r--r--src/components/policy/policy_external/src/policy_table/enums.cc21
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_table/enums.h9
-rw-r--r--src/components/policy/policy_regular/src/policy_table/enums.cc24
4 files changed, 59 insertions, 4 deletions
diff --git a/src/components/policy/policy_external/include/policy/policy_table/enums.h b/src/components/policy/policy_external/include/policy/policy_table/enums.h
index d13c545a94..5fc43603d8 100644
--- a/src/components/policy/policy_external/include/policy/policy_table/enums.h
+++ b/src/components/policy/policy_external/include/policy/policy_table/enums.h
@@ -167,7 +167,14 @@ bool IsValidEnum(Input val);
const char* EnumToJsonString(Input val);
bool EnumFromJsonString(const std::string& literal, Input* result);
-enum ModuleType { MT_CLIMATE, MT_RADIO, MT_SEAT };
+enum ModuleType {
+ MT_CLIMATE,
+ MT_RADIO,
+ MT_SEAT,
+ MT_AUDIO,
+ MT_LIGHT,
+ MT_HMI_SETTINGS
+};
bool IsValidEnum(ModuleType val);
const char* EnumToJsonString(ModuleType val);
bool EnumFromJsonString(const std::string& literal, ModuleType* result);
diff --git a/src/components/policy/policy_external/src/policy_table/enums.cc b/src/components/policy/policy_external/src/policy_table/enums.cc
index 58bae43000..c2b304df67 100644
--- a/src/components/policy/policy_external/src/policy_table/enums.cc
+++ b/src/components/policy/policy_external/src/policy_table/enums.cc
@@ -771,6 +771,12 @@ bool IsValidEnum(ModuleType val) {
return true;
case MT_RADIO:
return true;
+ case MT_AUDIO:
+ return true;
+ case MT_LIGHT:
+ return true;
+ case MT_HMI_SETTINGS:
+ return true;
case MT_SEAT:
return true;
default:
@@ -783,6 +789,12 @@ const char* EnumToJsonString(ModuleType val) {
return "CLIMATE";
case MT_RADIO:
return "RADIO";
+ case MT_AUDIO:
+ return "AUDIO";
+ case MT_LIGHT:
+ return "LIGHT";
+ case MT_HMI_SETTINGS:
+ return "HMI_SETTINGS";
case MT_SEAT:
return "SEAT";
default:
@@ -800,6 +812,15 @@ bool EnumFromJsonString(const std::string& literal, ModuleType* result) {
} else if ("SEAT" == literal) {
*result = MT_SEAT;
return true;
+ } else if ("AUDIO" == literal) {
+ *result = MT_AUDIO;
+ return true;
+ } else if ("LIGHT" == literal) {
+ *result = MT_LIGHT;
+ return true;
+ } else if ("HMI_SETTINGS" == literal) {
+ *result = MT_HMI_SETTINGS;
+ return true;
} else {
return false;
}
diff --git a/src/components/policy/policy_regular/include/policy/policy_table/enums.h b/src/components/policy/policy_regular/include/policy/policy_table/enums.h
index 8d81a742e4..4107fad398 100644
--- a/src/components/policy/policy_regular/include/policy/policy_table/enums.h
+++ b/src/components/policy/policy_regular/include/policy/policy_table/enums.h
@@ -153,7 +153,14 @@ bool IsValidEnum(Input val);
const char* EnumToJsonString(Input val);
bool EnumFromJsonString(const std::string& literal, Input* result);
-enum ModuleType { MT_CLIMATE, MT_RADIO, MT_SEAT };
+enum ModuleType {
+ MT_CLIMATE,
+ MT_RADIO,
+ MT_SEAT,
+ MT_AUDIO,
+ MT_LIGHT,
+ MT_HMI_SETTINGS
+};
bool IsValidEnum(ModuleType val);
const char* EnumToJsonString(ModuleType val);
bool EnumFromJsonString(const std::string& literal, ModuleType* result);
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 2f5ba69ad7..83ace2feb2 100644
--- a/src/components/policy/policy_regular/src/policy_table/enums.cc
+++ b/src/components/policy/policy_regular/src/policy_table/enums.cc
@@ -643,6 +643,12 @@ bool IsValidEnum(ModuleType val) {
return true;
case MT_SEAT:
return true;
+ case MT_AUDIO:
+ return true;
+ case MT_LIGHT:
+ return true;
+ case MT_HMI_SETTINGS:
+ return true;
default:
return false;
}
@@ -655,6 +661,12 @@ const char* EnumToJsonString(ModuleType val) {
return "RADIO";
case MT_SEAT:
return "SEAT";
+ case MT_AUDIO:
+ return "AUDIO";
+ case MT_LIGHT:
+ return "LIGHT";
+ case MT_HMI_SETTINGS:
+ return "HMI_SETTINGS";
default:
return "";
}
@@ -670,9 +682,17 @@ bool EnumFromJsonString(const std::string& literal, ModuleType* result) {
} else if ("SEAT" == literal) {
*result = MT_SEAT;
return true;
- } else {
- return false;
+ } else if ("AUDIO" == literal) {
+ *result = MT_AUDIO;
+ return true;
+ } else if ("LIGHT" == literal) {
+ *result = MT_LIGHT;
+ return true;
+ } else if ("HMI_SETTINGS" == literal) {
+ *result = MT_HMI_SETTINGS;
+ return true;
}
+ return false;
}
const std::string kDefaultApp = "default";