diff options
68 files changed, 6 insertions, 7534 deletions
diff --git a/src/components/application_manager/CMakeLists.txt b/src/components/application_manager/CMakeLists.txt index 21f92418fe..d3f813a3bf 100644 --- a/src/components/application_manager/CMakeLists.txt +++ b/src/components/application_manager/CMakeLists.txt @@ -345,9 +345,6 @@ set (HMI_COMMANDS_SOURCES ${COMMANDS_SOURCE_DIR}/hmi/rc_get_capabilities_response.cc ${COMMANDS_SOURCE_DIR}/hmi/ui_send_haptic_data_request.cc ${COMMANDS_SOURCE_DIR}/hmi/ui_send_haptic_data_response.cc -) - -set (HMI_COMMANDS_SOURCES_JSON ${COMMANDS_SOURCE_DIR}/hmi/vi_get_vehicle_data_request.cc ${COMMANDS_SOURCE_DIR}/hmi/vi_get_vehicle_data_response.cc ${COMMANDS_SOURCE_DIR}/hmi/vi_subscribe_vehicle_data_request.cc @@ -357,36 +354,6 @@ set (HMI_COMMANDS_SOURCES_JSON ${COMMANDS_SOURCE_DIR}/hmi/on_vi_vehicle_data_notification.cc ) -set (HMI_COMMANDS_SOURCES_DBUS - ${COMMANDS_SOURCE_DIR}/hmi/on_vi_gps_data_notification.cc - ${COMMANDS_SOURCE_DIR}/hmi/on_vi_speed_notification.cc - ${COMMANDS_SOURCE_DIR}/hmi/on_vi_rpm_notification.cc - ${COMMANDS_SOURCE_DIR}/hmi/on_vi_fuel_level_notification.cc - ${COMMANDS_SOURCE_DIR}/hmi/on_vi_fuel_level_state_notification.cc - ${COMMANDS_SOURCE_DIR}/hmi/on_vi_instant_fuel_consumption_notification.cc - ${COMMANDS_SOURCE_DIR}/hmi/on_vi_external_temperature_notification.cc - ${COMMANDS_SOURCE_DIR}/hmi/on_vi_vin_notification.cc - ${COMMANDS_SOURCE_DIR}/hmi/on_vi_prndl_notification.cc - ${COMMANDS_SOURCE_DIR}/hmi/on_vi_tire_pressure_notification.cc - ${COMMANDS_SOURCE_DIR}/hmi/on_vi_odometer_notification.cc - ${COMMANDS_SOURCE_DIR}/hmi/on_vi_belt_status_notification.cc - ${COMMANDS_SOURCE_DIR}/hmi/on_vi_body_information_notification.cc - ${COMMANDS_SOURCE_DIR}/hmi/on_vi_device_status_notification.cc - ${COMMANDS_SOURCE_DIR}/hmi/on_vi_driver_braking_notification.cc - ${COMMANDS_SOURCE_DIR}/hmi/on_vi_wiper_status_notification.cc - ${COMMANDS_SOURCE_DIR}/hmi/on_vi_head_lamp_status_notification.cc - ${COMMANDS_SOURCE_DIR}/hmi/on_vi_engine_torque_notification.cc - ${COMMANDS_SOURCE_DIR}/hmi/on_vi_acc_pedal_position_notification.cc - ${COMMANDS_SOURCE_DIR}/hmi/on_vi_steering_wheel_angle_notification.cc - ${COMMANDS_SOURCE_DIR}/hmi/on_vi_my_key_notification.cc -) - -if (${HMI_JSON_API}) - set (HMI_COMMANDS_SOURCES ${HMI_COMMANDS_SOURCES} ${HMI_COMMANDS_SOURCES_JSON}) -endif (${HMI_JSON_API}) - -set (HMI_COMMANDS_SOURCES ${HMI_COMMANDS_SOURCES} ${HMI_COMMANDS_SOURCES_DBUS}) - set(EXCLUDE_PATHS ${COMMANDS_SOURCE_DIR} ${EVENT_ENGINE_SOURCE_DIR} diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_acc_pedal_position_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_acc_pedal_position_notification.h deleted file mode 100644 index 9c5a8cd955..0000000000 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_acc_pedal_position_notification.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2013, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_ACC_PEDAL_POSITION_NOTIFICATION_H_ -#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_ACC_PEDAL_POSITION_NOTIFICATION_H_ - -#include "application_manager/commands/hmi/notification_from_hmi.h" -#include "application_manager/application_manager.h" - -namespace application_manager { - -namespace commands { - -/** - * @brief OnVIAccPedalPositionNotification command class - **/ -class OnVIAccPedalPositionNotification : public NotificationFromHMI { - public: - /** - * @brief OnVIAccPedalPositionNotification class constructor - * - * @param message Incoming SmartObject message - **/ - OnVIAccPedalPositionNotification(const MessageSharedPtr& message, - ApplicationManager& application_manager); - - /** - * @brief OnVIAccPedalPositionNotification class destructor - **/ - virtual ~OnVIAccPedalPositionNotification(); - - /** - * @brief Execute command - **/ - virtual void Run(); - - private: - DISALLOW_COPY_AND_ASSIGN(OnVIAccPedalPositionNotification); -}; - -} // namespace commands - -} // namespace application_manager - -#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_ACC_PEDAL_POSITION_NOTIFICATION_H_ diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_belt_status_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_belt_status_notification.h deleted file mode 100644 index c4f92269bb..0000000000 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_belt_status_notification.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2013, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_BELT_STATUS_NOTIFICATION_H_ -#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_BELT_STATUS_NOTIFICATION_H_ - -#include "application_manager/commands/hmi/notification_from_hmi.h" -#include "application_manager/application_manager.h" - -namespace application_manager { - -namespace commands { - -/** - * @brief OnVIBeltStatusNotification command class - **/ -class OnVIBeltStatusNotification : public NotificationFromHMI { - public: - /** - * @brief OnVIBeltStatusNotification class constructor - * - * @param message Incoming SmartObject message - **/ - OnVIBeltStatusNotification(const MessageSharedPtr& message, - ApplicationManager& application_manager); - - /** - * @brief OnVIBeltStatusNotification class destructor - **/ - virtual ~OnVIBeltStatusNotification(); - - /** - * @brief Execute command - **/ - virtual void Run(); - - private: - DISALLOW_COPY_AND_ASSIGN(OnVIBeltStatusNotification); -}; - -} // namespace commands - -} // namespace application_manager - -#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_BELT_STATUS_NOTIFICATION_H_ diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_body_information_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_body_information_notification.h deleted file mode 100644 index 9d9854c50b..0000000000 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_body_information_notification.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2013, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_BODY_INFORMATION_NOTIFICATION_H_ -#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_BODY_INFORMATION_NOTIFICATION_H_ - -#include "application_manager/commands/hmi/notification_from_hmi.h" -#include "application_manager/application_manager.h" - -namespace application_manager { - -namespace commands { - -/** - * @brief OnVIBodyInformationNotification command class - **/ -class OnVIBodyInformationNotification : public NotificationFromHMI { - public: - /** - * @brief OnVIBodyInformationNotification class constructor - * - * @param message Incoming SmartObject message - **/ - OnVIBodyInformationNotification(const MessageSharedPtr& message, - ApplicationManager& application_manager); - - /** - * @brief OnVIBodyInformationNotification class destructor - **/ - virtual ~OnVIBodyInformationNotification(); - - /** - * @brief Execute command - **/ - virtual void Run(); - - private: - DISALLOW_COPY_AND_ASSIGN(OnVIBodyInformationNotification); -}; - -} // namespace commands - -} // namespace application_manager - -#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_BODY_INFORMATION_NOTIFICATION_H_ diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_device_status_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_device_status_notification.h deleted file mode 100644 index c31ee1f209..0000000000 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_device_status_notification.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2013, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_DEVICE_STATUS_NOTIFICATION_H_ -#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_DEVICE_STATUS_NOTIFICATION_H_ - -#include "application_manager/commands/hmi/notification_from_hmi.h" -#include "application_manager/application_manager.h" - -namespace application_manager { - -namespace commands { - -/** - * @brief OnVIDeviceStatusNotification command class - **/ -class OnVIDeviceStatusNotification : public NotificationFromHMI { - public: - /** - * @brief OnVIDeviceStatusNotification class constructor - * - * @param message Incoming SmartObject message - **/ - OnVIDeviceStatusNotification(const MessageSharedPtr& message, - ApplicationManager& application_manager); - - /** - * @brief OnVIDeviceStatusNotification class destructor - **/ - virtual ~OnVIDeviceStatusNotification(); - - /** - * @brief Execute command - **/ - virtual void Run(); - - private: - DISALLOW_COPY_AND_ASSIGN(OnVIDeviceStatusNotification); -}; - -} // namespace commands - -} // namespace application_manager - -#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_DEVICE_STATUS_NOTIFICATION_H_ diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_driver_braking_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_driver_braking_notification.h deleted file mode 100644 index 108f02b5a4..0000000000 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_driver_braking_notification.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2013, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_DRIVER_BRAKING_NOTIFICATION_H_ -#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_DRIVER_BRAKING_NOTIFICATION_H_ - -#include "application_manager/commands/hmi/notification_from_hmi.h" -#include "application_manager/application_manager.h" - -namespace application_manager { - -namespace commands { - -/** - * @brief OnVIDriverBrakingNotification command class - **/ -class OnVIDriverBrakingNotification : public NotificationFromHMI { - public: - /** - * @brief OnVIDriverBrakingNotification class constructor - * - * @param message Incoming SmartObject message - **/ - OnVIDriverBrakingNotification(const MessageSharedPtr& message, - ApplicationManager& application_manager); - - /** - * @brief OnVIDriverBrakingNotification class destructor - **/ - virtual ~OnVIDriverBrakingNotification(); - - /** - * @brief Execute command - **/ - virtual void Run(); - - private: - DISALLOW_COPY_AND_ASSIGN(OnVIDriverBrakingNotification); -}; - -} // namespace commands - -} // namespace application_manager - -#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_DRIVER_BRAKING_NOTIFICATION_H_ diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_engine_torque_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_engine_torque_notification.h deleted file mode 100644 index bbd13963aa..0000000000 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_engine_torque_notification.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2013, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_ENGINE_TORQUE_NOTIFICATION_H_ -#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_ENGINE_TORQUE_NOTIFICATION_H_ - -#include "application_manager/commands/hmi/notification_from_hmi.h" -#include "application_manager/application_manager.h" - -namespace application_manager { - -namespace commands { - -/** - * @brief OnVIEngineTorqueNotification command class - **/ -class OnVIEngineTorqueNotification : public NotificationFromHMI { - public: - /** - * @brief OnVIEngineTorqueNotification class constructor - * - * @param message Incoming SmartObject message - **/ - OnVIEngineTorqueNotification(const MessageSharedPtr& message, - ApplicationManager& application_manager); - - /** - * @brief OnVIEngineTorqueNotification class destructor - **/ - virtual ~OnVIEngineTorqueNotification(); - - /** - * @brief Execute command - **/ - virtual void Run(); - - private: - DISALLOW_COPY_AND_ASSIGN(OnVIEngineTorqueNotification); -}; - -} // namespace commands - -} // namespace application_manager - -#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_ENGINE_TORQUE_NOTIFICATION_H_ diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_external_temperature_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_external_temperature_notification.h deleted file mode 100644 index b996febacf..0000000000 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_external_temperature_notification.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2013, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_EXTERNAL_TEMPERATURE_NOTIFICATION_H_ -#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_EXTERNAL_TEMPERATURE_NOTIFICATION_H_ - -#include "application_manager/commands/hmi/notification_from_hmi.h" -#include "application_manager/application_manager.h" - -namespace application_manager { - -namespace commands { - -/** - * @brief OnVIExternalTemperatureNotification command class - **/ -class OnVIExternalTemperatureNotification : public NotificationFromHMI { - public: - /** - * @brief OnVIExternalTemperatureNotification class constructor - * - * @param message Incoming SmartObject message - **/ - OnVIExternalTemperatureNotification(const MessageSharedPtr& message, - ApplicationManager& application_manager); - - /** - * @brief OnVIExternalTemperatureNotification class destructor - **/ - virtual ~OnVIExternalTemperatureNotification(); - - /** - * @brief Execute command - **/ - virtual void Run(); - - private: - DISALLOW_COPY_AND_ASSIGN(OnVIExternalTemperatureNotification); -}; - -} // namespace commands - -} // namespace application_manager - -#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_EXTERNAL_TEMPERATURE_NOTIFICATION_H_ diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_fuel_level_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_fuel_level_notification.h deleted file mode 100644 index 9c30b6c32c..0000000000 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_fuel_level_notification.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2013, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_FUEL_LEVEL_NOTIFICATION_H_ -#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_FUEL_LEVEL_NOTIFICATION_H_ - -#include "application_manager/commands/hmi/notification_from_hmi.h" -#include "application_manager/application_manager.h" - -namespace application_manager { - -namespace commands { - -/** - * @brief OnVIFuelLevelNotification command class - **/ -class OnVIFuelLevelNotification : public NotificationFromHMI { - public: - /** - * @brief OnVIFuelLevelNotification class constructor - * - * @param message Incoming SmartObject message - **/ - OnVIFuelLevelNotification(const MessageSharedPtr& message, - ApplicationManager& application_manager); - - /** - * @brief OnVIFuelLevelNotification class destructor - **/ - virtual ~OnVIFuelLevelNotification(); - - /** - * @brief Execute command - **/ - virtual void Run(); - - private: - DISALLOW_COPY_AND_ASSIGN(OnVIFuelLevelNotification); -}; - -} // namespace commands - -} // namespace application_manager - -#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_FUEL_LEVEL_NOTIFICATION_H_ diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_fuel_level_state_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_fuel_level_state_notification.h deleted file mode 100644 index 53b6ea209f..0000000000 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_fuel_level_state_notification.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2013, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_FUEL_LEVEL_STATE_NOTIFICATION_H_ -#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_FUEL_LEVEL_STATE_NOTIFICATION_H_ - -#include "application_manager/commands/hmi/notification_from_hmi.h" -#include "application_manager/application_manager.h" - -namespace application_manager { - -namespace commands { - -/** - * @brief OnVIFuelLevelStateNotification command class - **/ -class OnVIFuelLevelStateNotification : public NotificationFromHMI { - public: - /** - * @brief OnVIFuelLevelStateNotification class constructor - * - * @param message Incoming SmartObject message - **/ - OnVIFuelLevelStateNotification(const MessageSharedPtr& message, - ApplicationManager& application_manager); - - /** - * @brief OnVIFuelLevelStateNotification class destructor - **/ - virtual ~OnVIFuelLevelStateNotification(); - - /** - * @brief Execute command - **/ - virtual void Run(); - - private: - DISALLOW_COPY_AND_ASSIGN(OnVIFuelLevelStateNotification); -}; - -} // namespace commands - -} // namespace application_manager - -#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_FUEL_LEVEL_STATE_NOTIFICATION_H_ diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_gps_data_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_gps_data_notification.h deleted file mode 100644 index 579344b538..0000000000 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_gps_data_notification.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2013, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_GPS_DATA_NOTIFICATION_H_ -#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_GPS_DATA_NOTIFICATION_H_ - -#include "application_manager/commands/hmi/notification_from_hmi.h" -#include "application_manager/application_manager.h" - -namespace application_manager { - -namespace commands { - -/** - * @brief OnVIGpsDataNotification command class - **/ -class OnVIGpsDataNotification : public NotificationFromHMI { - public: - /** - * @brief OnVIGpsDataNotification class constructor - * - * @param message Incoming SmartObject message - **/ - OnVIGpsDataNotification(const MessageSharedPtr& message, - ApplicationManager& application_manager); - - /** - * @brief OnVIGpsDataNotification class destructor - **/ - virtual ~OnVIGpsDataNotification(); - - /** - * @brief Execute command - **/ - virtual void Run(); - - private: - DISALLOW_COPY_AND_ASSIGN(OnVIGpsDataNotification); -}; - -} // namespace commands - -} // namespace application_manager - -#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_GPS_DATA_NOTIFICATION_H_ diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_head_lamp_status_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_head_lamp_status_notification.h deleted file mode 100644 index 5fd3be85a4..0000000000 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_head_lamp_status_notification.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2013, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_HEAD_LAMP_STATUS_NOTIFICATION_H_ -#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_HEAD_LAMP_STATUS_NOTIFICATION_H_ - -#include "application_manager/commands/hmi/notification_from_hmi.h" -#include "application_manager/application_manager.h" - -namespace application_manager { - -namespace commands { - -/** - * @brief OnVIHeadLampStatusNotification command class - **/ -class OnVIHeadLampStatusNotification : public NotificationFromHMI { - public: - /** - * @brief OnVIHeadLampStatusNotification class constructor - * - * @param message Incoming SmartObject message - **/ - OnVIHeadLampStatusNotification(const MessageSharedPtr& message, - ApplicationManager& application_manager); - - /** - * @brief OnVIHeadLampStatusNotification class destructor - **/ - virtual ~OnVIHeadLampStatusNotification(); - - /** - * @brief Execute command - **/ - virtual void Run(); - - private: - DISALLOW_COPY_AND_ASSIGN(OnVIHeadLampStatusNotification); -}; - -} // namespace commands - -} // namespace application_manager - -#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_HEAD_LAMP_STATUS_NOTIFICATION_H_ diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_instant_fuel_consumption_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_instant_fuel_consumption_notification.h deleted file mode 100644 index ee82b1397f..0000000000 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_instant_fuel_consumption_notification.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2013, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_INSTANT_FUEL_CONSUMPTION_NOTIFICATION_H_ -#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_INSTANT_FUEL_CONSUMPTION_NOTIFICATION_H_ - -#include "application_manager/commands/hmi/notification_from_hmi.h" -#include "application_manager/application_manager.h" - -namespace application_manager { - -namespace commands { - -/** - * @brief OnVIInstantFuelConsumptionNotification command class - **/ -class OnVIInstantFuelConsumptionNotification : public NotificationFromHMI { - public: - /** - * @brief OnVIInstantFuelConsumptionNotification class constructor - * - * @param message Incoming SmartObject message - **/ - OnVIInstantFuelConsumptionNotification( - const MessageSharedPtr& message, ApplicationManager& application_manager); - - /** - * @brief OnVIInstantFuelConsumptionNotification class destructor - **/ - virtual ~OnVIInstantFuelConsumptionNotification(); - - /** - * @brief Execute command - **/ - virtual void Run(); - - private: - DISALLOW_COPY_AND_ASSIGN(OnVIInstantFuelConsumptionNotification); -}; - -} // namespace commands - -} // namespace application_manager - -#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_INSTANT_FUEL_CONSUMPTION_NOTIFICATION_H_ diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_my_key_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_my_key_notification.h deleted file mode 100644 index 364e42081c..0000000000 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_my_key_notification.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2013, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_MY_KEY_NOTIFICATION_H_ -#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_MY_KEY_NOTIFICATION_H_ - -#include "application_manager/commands/hmi/notification_from_hmi.h" -#include "application_manager/application_manager.h" - -namespace application_manager { - -namespace commands { - -/** - * @brief OnVIMyKeyNotification command class - **/ -class OnVIMyKeyNotification : public NotificationFromHMI { - public: - /** - * @brief OnVIMyKeyNotification class constructor - * - * @param message Incoming SmartObject message - **/ - OnVIMyKeyNotification(const MessageSharedPtr& message, - ApplicationManager& application_manager); - - /** - * @brief OnVIMyKeyNotification class destructor - **/ - virtual ~OnVIMyKeyNotification(); - - /** - * @brief Execute command - **/ - virtual void Run(); - - private: - DISALLOW_COPY_AND_ASSIGN(OnVIMyKeyNotification); -}; - -} // namespace commands - -} // namespace application_manager - -#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_MY_KEY_NOTIFICATION_H_ diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_odometer_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_odometer_notification.h deleted file mode 100644 index 7d93530f04..0000000000 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_odometer_notification.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2013, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_ODOMETER_NOTIFICATION_H_ -#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_ODOMETER_NOTIFICATION_H_ - -#include "application_manager/commands/hmi/notification_from_hmi.h" -#include "application_manager/application_manager.h" - -namespace application_manager { - -namespace commands { - -/** - * @brief OnVIOdometerNotification command class - **/ -class OnVIOdometerNotification : public NotificationFromHMI { - public: - /** - * @brief OnVIOdometerNotification class constructor - * - * @param message Incoming SmartObject message - **/ - OnVIOdometerNotification(const MessageSharedPtr& message, - ApplicationManager& application_manager); - - /** - * @brief OnVIOdometerNotification class destructor - **/ - virtual ~OnVIOdometerNotification(); - - /** - * @brief Execute command - **/ - virtual void Run(); - - private: - DISALLOW_COPY_AND_ASSIGN(OnVIOdometerNotification); -}; - -} // namespace commands - -} // namespace application_manager - -#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_ODOMETER_NOTIFICATION_H_ diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_prndl_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_prndl_notification.h deleted file mode 100644 index c09220d2a6..0000000000 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_prndl_notification.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2013, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_PRNDL_NOTIFICATION_H_ -#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_PRNDL_NOTIFICATION_H_ - -#include "application_manager/commands/hmi/notification_from_hmi.h" -#include "application_manager/application_manager.h" - -namespace application_manager { - -namespace commands { - -/** - * @brief OnVIPrndlNotification command class - **/ -class OnVIPrndlNotification : public NotificationFromHMI { - public: - /** - * @brief OnVIPrndlNotification class constructor - * - * @param message Incoming SmartObject message - **/ - OnVIPrndlNotification(const MessageSharedPtr& message, - ApplicationManager& application_manager); - - /** - * @brief OnVIPrndlNotification class destructor - **/ - virtual ~OnVIPrndlNotification(); - - /** - * @brief Execute command - **/ - virtual void Run(); - - private: - DISALLOW_COPY_AND_ASSIGN(OnVIPrndlNotification); -}; - -} // namespace commands - -} // namespace application_manager - -#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_PRNDL_NOTIFICATION_H_ diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_rpm_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_rpm_notification.h deleted file mode 100644 index d05e1221df..0000000000 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_rpm_notification.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2013, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_RPM_NOTIFICATION_H_ -#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_RPM_NOTIFICATION_H_ - -#include "application_manager/commands/hmi/notification_from_hmi.h" -#include "application_manager/application_manager.h" - -namespace application_manager { - -namespace commands { - -/** - * @brief OnVIRpmNotification command class - **/ -class OnVIRpmNotification : public NotificationFromHMI { - public: - /** - * @brief OnVIRpmNotification class constructor - * - * @param message Incoming SmartObject message - **/ - OnVIRpmNotification(const MessageSharedPtr& message, - ApplicationManager& application_manager); - - /** - * @brief OnVIRpmNotification class destructor - **/ - virtual ~OnVIRpmNotification(); - - /** - * @brief Execute command - **/ - virtual void Run(); - - private: - DISALLOW_COPY_AND_ASSIGN(OnVIRpmNotification); -}; - -} // namespace commands - -} // namespace application_manager - -#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_RPM_NOTIFICATION_H_ diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_speed_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_speed_notification.h deleted file mode 100644 index b1908cde28..0000000000 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_speed_notification.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2013, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_SPEED_NOTIFICATION_H_ -#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_SPEED_NOTIFICATION_H_ - -#include "application_manager/commands/hmi/notification_from_hmi.h" -#include "application_manager/application_manager.h" - -namespace application_manager { - -namespace commands { - -/** - * @brief OnVISpeedNotification command class - **/ -class OnVISpeedNotification : public NotificationFromHMI { - public: - /** - * @brief OnVISpeedNotification class constructor - * - * @param message Incoming SmartObject message - **/ - OnVISpeedNotification(const MessageSharedPtr& message, - ApplicationManager& application_manager); - - /** - * @brief OnVISpeedNotification class destructor - **/ - virtual ~OnVISpeedNotification(); - - /** - * @brief Execute command - **/ - virtual void Run(); - - private: - DISALLOW_COPY_AND_ASSIGN(OnVISpeedNotification); -}; - -} // namespace commands - -} // namespace application_manager - -#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_SPEED_NOTIFICATION_H_ diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_steering_wheel_angle_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_steering_wheel_angle_notification.h deleted file mode 100644 index 28f78ac4d5..0000000000 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_steering_wheel_angle_notification.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2013, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_STEERING_WHEEL_ANGLE_NOTIFICATION_H_ -#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_STEERING_WHEEL_ANGLE_NOTIFICATION_H_ - -#include "application_manager/commands/hmi/notification_from_hmi.h" -#include "application_manager/application_manager.h" - -namespace application_manager { - -namespace commands { - -/** - * @brief OnVISteeringWheelAngleNotification command class - **/ -class OnVISteeringWheelAngleNotification : public NotificationFromHMI { - public: - /** - * @brief OnVISteeringWheelAngleNotification class constructor - * - * @param message Incoming SmartObject message - **/ - OnVISteeringWheelAngleNotification(const MessageSharedPtr& message, - ApplicationManager& application_manager); - - /** - * @brief OnVISteeringWheelAngleNotification class destructor - **/ - virtual ~OnVISteeringWheelAngleNotification(); - - /** - * @brief Execute command - **/ - virtual void Run(); - - private: - DISALLOW_COPY_AND_ASSIGN(OnVISteeringWheelAngleNotification); -}; - -} // namespace commands - -} // namespace application_manager - -#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_STEERING_WHEEL_ANGLE_NOTIFICATION_H_ diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_tire_pressure_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_tire_pressure_notification.h deleted file mode 100644 index eef4f0e4a4..0000000000 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_tire_pressure_notification.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2013, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_TIRE_PRESSURE_NOTIFICATION_H_ -#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_TIRE_PRESSURE_NOTIFICATION_H_ - -#include "application_manager/commands/hmi/notification_from_hmi.h" -#include "application_manager/application_manager.h" - -namespace application_manager { - -namespace commands { - -/** - * @brief OnVITirePressureNotification command class - **/ -class OnVITirePressureNotification : public NotificationFromHMI { - public: - /** - * @brief OnVITirePressureNotification class constructor - * - * @param message Incoming SmartObject message - **/ - OnVITirePressureNotification(const MessageSharedPtr& message, - ApplicationManager& application_manager); - - /** - * @brief OnVITirePressureNotification class destructor - **/ - virtual ~OnVITirePressureNotification(); - - /** - * @brief Execute command - **/ - virtual void Run(); - - private: - DISALLOW_COPY_AND_ASSIGN(OnVITirePressureNotification); -}; - -} // namespace commands - -} // namespace application_manager - -#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_TIRE_PRESSURE_NOTIFICATION_H_ diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_vin_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_vin_notification.h deleted file mode 100644 index 4ea04fbb0d..0000000000 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_vin_notification.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2013, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_VIN_NOTIFICATION_H_ -#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_VIN_NOTIFICATION_H_ - -#include "application_manager/commands/hmi/notification_from_hmi.h" -#include "application_manager/application_manager.h" - -namespace application_manager { - -namespace commands { - -/** - * @brief OnVIVinNotification command class - **/ -class OnVIVinNotification : public NotificationFromHMI { - public: - /** - * @brief OnVIVinNotification class constructor - * - * @param message Incoming SmartObject message - **/ - OnVIVinNotification(const MessageSharedPtr& message, - ApplicationManager& application_manager); - - /** - * @brief OnVIVinNotification class destructor - **/ - virtual ~OnVIVinNotification(); - - /** - * @brief Execute command - **/ - virtual void Run(); - - private: - DISALLOW_COPY_AND_ASSIGN(OnVIVinNotification); -}; - -} // namespace commands - -} // namespace application_manager - -#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_VIN_NOTIFICATION_H_ diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_wiper_status_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_wiper_status_notification.h deleted file mode 100644 index 2b57ef1dd3..0000000000 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_wiper_status_notification.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2013, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_WIPER_STATUS_NOTIFICATION_H_ -#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_WIPER_STATUS_NOTIFICATION_H_ - -#include "application_manager/commands/hmi/notification_from_hmi.h" -#include "application_manager/application_manager.h" - -namespace application_manager { - -namespace commands { - -/** - * @brief OnVIWiperStatusNotification command class - **/ -class OnVIWiperStatusNotification : public NotificationFromHMI { - public: - /** - * @brief OnVIWiperStatusNotification class constructor - * - * @param message Incoming SmartObject message - **/ - OnVIWiperStatusNotification(const MessageSharedPtr& message, - ApplicationManager& application_manager); - - /** - * @brief OnVIWiperStatusNotification class destructor - **/ - virtual ~OnVIWiperStatusNotification(); - - /** - * @brief Execute command - **/ - virtual void Run(); - - private: - DISALLOW_COPY_AND_ASSIGN(OnVIWiperStatusNotification); -}; - -} // namespace commands - -} // namespace application_manager - -#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_WIPER_STATUS_NOTIFICATION_H_ diff --git a/src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_request.h b/src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_request.h index 030a3afedc..ff721319d8 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_request.h @@ -69,22 +69,6 @@ class GetVehicleDataRequest : public CommandRequestImpl { protected: virtual void on_event(const event_engine::Event& event); -#ifdef HMI_DBUS_API - private: - void SendRequestsToHmi(const int32_t app_id); - - struct HmiRequest { - hmi_apis::Common_Result::eType status; - bool complete; - smart_objects::SmartObject value; - const char* str; - hmi_apis::FunctionID::eType func_id; - }; - - typedef std::vector<HmiRequest> HmiRequests; - HmiRequests hmi_requests_; -#endif // #ifdef HMI_DBUS_API - DISALLOW_COPY_AND_ASSIGN(GetVehicleDataRequest); }; diff --git a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_request.h b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_request.h index f556f81764..ecb4a78bda 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_request.h @@ -77,20 +77,6 @@ class SubscribeVehicleDataRequest : public CommandRequestImpl { */ bool Init() FINAL; -#ifdef HMI_DBUS_API - private: - struct HmiRequest { - hmi_apis::Common_Result::eType status; - bool complete; - smart_objects::SmartObject value; - const char* str; - hmi_apis::FunctionID::eType func_id; - }; - - typedef std::vector<HmiRequest> HmiRequests; - HmiRequests hmi_requests_; -#endif // #ifdef HMI_DBUS_API - private: /** * @brief Checks, if any app is subscribed for particular VI parameter diff --git a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_vehicle_data_request.h b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_vehicle_data_request.h index 1c7d80797d..d38e22a563 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_vehicle_data_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_vehicle_data_request.h @@ -77,20 +77,6 @@ class UnsubscribeVehicleDataRequest : public CommandRequestImpl { */ bool Init() FINAL; -#ifdef HMI_DBUS_API - private: - struct HmiRequest { - hmi_apis::Common_Result::eType status; - bool complete; - smart_objects::SmartObject value; - const char* str; - hmi_apis::FunctionID::eType func_id; - }; - - typedef std::vector<HmiRequest> HmiRequests; - HmiRequests hmi_requests_; -#endif // #ifdef HMI_DBUS_API - private: /** * @brief Checks, if any app is subscribed for particular VI parameter diff --git a/src/components/application_manager/src/commands/hmi/on_vi_acc_pedal_position_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_acc_pedal_position_notification.cc deleted file mode 100644 index 9b10055e2c..0000000000 --- a/src/components/application_manager/src/commands/hmi/on_vi_acc_pedal_position_notification.cc +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2013, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include "application_manager/commands/hmi/on_vi_acc_pedal_position_notification.h" -#include "interfaces/MOBILE_API.h" - -namespace application_manager { - -namespace commands { - -OnVIAccPedalPositionNotification::OnVIAccPedalPositionNotification( - const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) {} - -OnVIAccPedalPositionNotification::~OnVIAccPedalPositionNotification() {} - -void OnVIAccPedalPositionNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); - - // prepare SmartObject for mobile factory - (*message_)[strings::params][strings::function_id] = - static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID); - - SendNotificationToMobile(message_); -} - -} // namespace commands - -} // namespace application_manager diff --git a/src/components/application_manager/src/commands/hmi/on_vi_belt_status_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_belt_status_notification.cc deleted file mode 100644 index 58f9add514..0000000000 --- a/src/components/application_manager/src/commands/hmi/on_vi_belt_status_notification.cc +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2013, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include "application_manager/commands/hmi/on_vi_belt_status_notification.h" -#include "interfaces/MOBILE_API.h" - -namespace application_manager { - -namespace commands { - -OnVIBeltStatusNotification::OnVIBeltStatusNotification( - const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) {} - -OnVIBeltStatusNotification::~OnVIBeltStatusNotification() {} - -void OnVIBeltStatusNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); - - // prepare SmartObject for mobile factory - (*message_)[strings::params][strings::function_id] = - static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID); - - SendNotificationToMobile(message_); -} - -} // namespace commands - -} // namespace application_manager diff --git a/src/components/application_manager/src/commands/hmi/on_vi_body_information_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_body_information_notification.cc deleted file mode 100644 index 33f2944c38..0000000000 --- a/src/components/application_manager/src/commands/hmi/on_vi_body_information_notification.cc +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2013, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include "application_manager/commands/hmi/on_vi_body_information_notification.h" -#include "interfaces/MOBILE_API.h" - -namespace application_manager { - -namespace commands { - -OnVIBodyInformationNotification::OnVIBodyInformationNotification( - const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) {} - -OnVIBodyInformationNotification::~OnVIBodyInformationNotification() {} - -void OnVIBodyInformationNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); - - // prepare SmartObject for mobile factory - (*message_)[strings::params][strings::function_id] = - static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID); - - SendNotificationToMobile(message_); -} - -} // namespace commands - -} // namespace application_manager diff --git a/src/components/application_manager/src/commands/hmi/on_vi_device_status_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_device_status_notification.cc deleted file mode 100644 index 9cbf612be1..0000000000 --- a/src/components/application_manager/src/commands/hmi/on_vi_device_status_notification.cc +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2013, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include "application_manager/commands/hmi/on_vi_device_status_notification.h" -#include "interfaces/MOBILE_API.h" - -namespace application_manager { - -namespace commands { - -OnVIDeviceStatusNotification::OnVIDeviceStatusNotification( - const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) {} - -OnVIDeviceStatusNotification::~OnVIDeviceStatusNotification() {} - -void OnVIDeviceStatusNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); - - // prepare SmartObject for mobile factory - (*message_)[strings::params][strings::function_id] = - static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID); - - SendNotificationToMobile(message_); -} - -} // namespace commands - -} // namespace application_manager diff --git a/src/components/application_manager/src/commands/hmi/on_vi_driver_braking_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_driver_braking_notification.cc deleted file mode 100644 index e521ac3a37..0000000000 --- a/src/components/application_manager/src/commands/hmi/on_vi_driver_braking_notification.cc +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2013, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include "application_manager/commands/hmi/on_vi_driver_braking_notification.h" -#include "interfaces/MOBILE_API.h" - -namespace application_manager { - -namespace commands { - -OnVIDriverBrakingNotification::OnVIDriverBrakingNotification( - const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) {} - -OnVIDriverBrakingNotification::~OnVIDriverBrakingNotification() {} - -void OnVIDriverBrakingNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); - - // prepare SmartObject for mobile factory - (*message_)[strings::params][strings::function_id] = - static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID); - - SendNotificationToMobile(message_); -} - -} // namespace commands - -} // namespace application_manager diff --git a/src/components/application_manager/src/commands/hmi/on_vi_engine_torque_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_engine_torque_notification.cc deleted file mode 100644 index ebed955270..0000000000 --- a/src/components/application_manager/src/commands/hmi/on_vi_engine_torque_notification.cc +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2013, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include "application_manager/commands/hmi/on_vi_engine_torque_notification.h" -#include "interfaces/MOBILE_API.h" - -namespace application_manager { - -namespace commands { - -OnVIEngineTorqueNotification::OnVIEngineTorqueNotification( - const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) {} - -OnVIEngineTorqueNotification::~OnVIEngineTorqueNotification() {} - -void OnVIEngineTorqueNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); - - // prepare SmartObject for mobile factory - (*message_)[strings::params][strings::function_id] = - static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID); - - SendNotificationToMobile(message_); -} - -} // namespace commands - -} // namespace application_manager diff --git a/src/components/application_manager/src/commands/hmi/on_vi_external_temperature_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_external_temperature_notification.cc deleted file mode 100644 index 9f0696fdc6..0000000000 --- a/src/components/application_manager/src/commands/hmi/on_vi_external_temperature_notification.cc +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2013, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include "application_manager/commands/hmi/on_vi_external_temperature_notification.h" -#include "interfaces/MOBILE_API.h" - -namespace application_manager { - -namespace commands { - -OnVIExternalTemperatureNotification::OnVIExternalTemperatureNotification( - const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) {} - -OnVIExternalTemperatureNotification::~OnVIExternalTemperatureNotification() {} - -void OnVIExternalTemperatureNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); - - // prepare SmartObject for mobile factory - (*message_)[strings::params][strings::function_id] = - static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID); - - SendNotificationToMobile(message_); -} - -} // namespace commands - -} // namespace application_manager diff --git a/src/components/application_manager/src/commands/hmi/on_vi_fuel_level_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_fuel_level_notification.cc deleted file mode 100644 index ef650a9f99..0000000000 --- a/src/components/application_manager/src/commands/hmi/on_vi_fuel_level_notification.cc +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2013, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include "application_manager/commands/hmi/on_vi_fuel_level_notification.h" -#include "interfaces/MOBILE_API.h" - -namespace application_manager { - -namespace commands { - -OnVIFuelLevelNotification::OnVIFuelLevelNotification( - const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) {} - -OnVIFuelLevelNotification::~OnVIFuelLevelNotification() {} - -void OnVIFuelLevelNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); - - // prepare SmartObject for mobile factory - (*message_)[strings::params][strings::function_id] = - static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID); - - SendNotificationToMobile(message_); -} - -} // namespace commands - -} // namespace application_manager diff --git a/src/components/application_manager/src/commands/hmi/on_vi_fuel_level_state_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_fuel_level_state_notification.cc deleted file mode 100644 index a5267d8dac..0000000000 --- a/src/components/application_manager/src/commands/hmi/on_vi_fuel_level_state_notification.cc +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2013, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include "application_manager/commands/hmi/on_vi_fuel_level_state_notification.h" -#include "interfaces/MOBILE_API.h" - -namespace application_manager { - -namespace commands { - -OnVIFuelLevelStateNotification::OnVIFuelLevelStateNotification( - const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) {} - -OnVIFuelLevelStateNotification::~OnVIFuelLevelStateNotification() {} - -void OnVIFuelLevelStateNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); - - // prepare SmartObject for mobile factory - (*message_)[strings::params][strings::function_id] = - static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID); - - SendNotificationToMobile(message_); -} - -} // namespace commands - -} // namespace application_manager diff --git a/src/components/application_manager/src/commands/hmi/on_vi_gps_data_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_gps_data_notification.cc deleted file mode 100644 index 63b95bf6dc..0000000000 --- a/src/components/application_manager/src/commands/hmi/on_vi_gps_data_notification.cc +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2013, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include "application_manager/commands/hmi/on_vi_gps_data_notification.h" -#include "interfaces/MOBILE_API.h" - -namespace application_manager { - -namespace commands { - -OnVIGpsDataNotification::OnVIGpsDataNotification( - const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) {} - -OnVIGpsDataNotification::~OnVIGpsDataNotification() {} - -void OnVIGpsDataNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); - - // prepare SmartObject for mobile factory - (*message_)[strings::params][strings::function_id] = - static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID); - - SendNotificationToMobile(message_); -} - -} // namespace commands - -} // namespace application_manager diff --git a/src/components/application_manager/src/commands/hmi/on_vi_head_lamp_status_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_head_lamp_status_notification.cc deleted file mode 100644 index 7d494f02d3..0000000000 --- a/src/components/application_manager/src/commands/hmi/on_vi_head_lamp_status_notification.cc +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2013, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include "application_manager/commands/hmi/on_vi_head_lamp_status_notification.h" -#include "interfaces/MOBILE_API.h" - -namespace application_manager { - -namespace commands { - -OnVIHeadLampStatusNotification::OnVIHeadLampStatusNotification( - const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) {} - -OnVIHeadLampStatusNotification::~OnVIHeadLampStatusNotification() {} - -void OnVIHeadLampStatusNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); - - // prepare SmartObject for mobile factory - (*message_)[strings::params][strings::function_id] = - static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID); - - SendNotificationToMobile(message_); -} - -} // namespace commands - -} // namespace application_manager diff --git a/src/components/application_manager/src/commands/hmi/on_vi_instant_fuel_consumption_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_instant_fuel_consumption_notification.cc deleted file mode 100644 index a62f4cacea..0000000000 --- a/src/components/application_manager/src/commands/hmi/on_vi_instant_fuel_consumption_notification.cc +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2013, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include "application_manager/commands/hmi/on_vi_instant_fuel_consumption_notification.h" -#include "interfaces/MOBILE_API.h" - -namespace application_manager { - -namespace commands { - -OnVIInstantFuelConsumptionNotification::OnVIInstantFuelConsumptionNotification( - const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) {} - -OnVIInstantFuelConsumptionNotification:: - ~OnVIInstantFuelConsumptionNotification() {} - -void OnVIInstantFuelConsumptionNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); - - // prepare SmartObject for mobile factory - (*message_)[strings::params][strings::function_id] = - static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID); - - SendNotificationToMobile(message_); -} - -} // namespace commands - -} // namespace application_manager diff --git a/src/components/application_manager/src/commands/hmi/on_vi_my_key_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_my_key_notification.cc deleted file mode 100644 index 229d50667b..0000000000 --- a/src/components/application_manager/src/commands/hmi/on_vi_my_key_notification.cc +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2013, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include "application_manager/commands/hmi/on_vi_my_key_notification.h" -#include "interfaces/MOBILE_API.h" - -namespace application_manager { - -namespace commands { - -OnVIMyKeyNotification::OnVIMyKeyNotification( - const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) {} - -OnVIMyKeyNotification::~OnVIMyKeyNotification() {} - -void OnVIMyKeyNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); - - // prepare SmartObject for mobile factory - (*message_)[strings::params][strings::function_id] = - static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID); - - SendNotificationToMobile(message_); -} - -} // namespace commands - -} // namespace application_manager diff --git a/src/components/application_manager/src/commands/hmi/on_vi_odometer_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_odometer_notification.cc deleted file mode 100644 index 10f236539c..0000000000 --- a/src/components/application_manager/src/commands/hmi/on_vi_odometer_notification.cc +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2013, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include "application_manager/commands/hmi/on_vi_odometer_notification.h" -#include "interfaces/MOBILE_API.h" - -namespace application_manager { - -namespace commands { - -OnVIOdometerNotification::OnVIOdometerNotification( - const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) {} - -OnVIOdometerNotification::~OnVIOdometerNotification() {} - -void OnVIOdometerNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); - - // prepare SmartObject for mobile factory - (*message_)[strings::params][strings::function_id] = - static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID); - - SendNotificationToMobile(message_); -} - -} // namespace commands - -} // namespace application_manager diff --git a/src/components/application_manager/src/commands/hmi/on_vi_prndl_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_prndl_notification.cc deleted file mode 100644 index 81585eabca..0000000000 --- a/src/components/application_manager/src/commands/hmi/on_vi_prndl_notification.cc +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2013, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include "application_manager/commands/hmi/on_vi_prndl_notification.h" -#include "interfaces/MOBILE_API.h" - -namespace application_manager { - -namespace commands { - -OnVIPrndlNotification::OnVIPrndlNotification( - const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) {} - -OnVIPrndlNotification::~OnVIPrndlNotification() {} - -void OnVIPrndlNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); - - // prepare SmartObject for mobile factory - (*message_)[strings::params][strings::function_id] = - static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID); - - SendNotificationToMobile(message_); -} - -} // namespace commands - -} // namespace application_manager diff --git a/src/components/application_manager/src/commands/hmi/on_vi_rpm_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_rpm_notification.cc deleted file mode 100644 index b5c0703917..0000000000 --- a/src/components/application_manager/src/commands/hmi/on_vi_rpm_notification.cc +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2013, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include "application_manager/commands/hmi/on_vi_rpm_notification.h" -#include "interfaces/MOBILE_API.h" - -namespace application_manager { - -namespace commands { - -OnVIRpmNotification::OnVIRpmNotification( - const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) {} - -OnVIRpmNotification::~OnVIRpmNotification() {} - -void OnVIRpmNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); - - // prepare SmartObject for mobile factory - (*message_)[strings::params][strings::function_id] = - static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID); - - SendNotificationToMobile(message_); -} - -} // namespace commands - -} // namespace application_manager diff --git a/src/components/application_manager/src/commands/hmi/on_vi_speed_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_speed_notification.cc deleted file mode 100644 index aacafb71c9..0000000000 --- a/src/components/application_manager/src/commands/hmi/on_vi_speed_notification.cc +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2013, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include "application_manager/commands/hmi/on_vi_speed_notification.h" -#include "interfaces/MOBILE_API.h" - -namespace application_manager { - -namespace commands { - -OnVISpeedNotification::OnVISpeedNotification( - const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) {} - -OnVISpeedNotification::~OnVISpeedNotification() {} - -void OnVISpeedNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); - - // prepare SmartObject for mobile factory - (*message_)[strings::params][strings::function_id] = - static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID); - - SendNotificationToMobile(message_); -} - -} // namespace commands - -} // namespace application_manager diff --git a/src/components/application_manager/src/commands/hmi/on_vi_steering_wheel_angle_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_steering_wheel_angle_notification.cc deleted file mode 100644 index af102ea926..0000000000 --- a/src/components/application_manager/src/commands/hmi/on_vi_steering_wheel_angle_notification.cc +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2013, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include "application_manager/commands/hmi/on_vi_steering_wheel_angle_notification.h" -#include "interfaces/MOBILE_API.h" - -namespace application_manager { - -namespace commands { - -OnVISteeringWheelAngleNotification::OnVISteeringWheelAngleNotification( - const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) {} - -OnVISteeringWheelAngleNotification::~OnVISteeringWheelAngleNotification() {} - -void OnVISteeringWheelAngleNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); - - // prepare SmartObject for mobile factory - (*message_)[strings::params][strings::function_id] = - static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID); - - SendNotificationToMobile(message_); -} - -} // namespace commands - -} // namespace application_manager diff --git a/src/components/application_manager/src/commands/hmi/on_vi_tire_pressure_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_tire_pressure_notification.cc deleted file mode 100644 index 99506e6171..0000000000 --- a/src/components/application_manager/src/commands/hmi/on_vi_tire_pressure_notification.cc +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2013, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include "application_manager/commands/hmi/on_vi_tire_pressure_notification.h" -#include "interfaces/MOBILE_API.h" - -namespace application_manager { - -namespace commands { - -OnVITirePressureNotification::OnVITirePressureNotification( - const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) {} - -OnVITirePressureNotification::~OnVITirePressureNotification() {} - -void OnVITirePressureNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); - - // prepare SmartObject for mobile factory - (*message_)[strings::params][strings::function_id] = - static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID); - - SendNotificationToMobile(message_); -} - -} // namespace commands - -} // namespace application_manager diff --git a/src/components/application_manager/src/commands/hmi/on_vi_vin_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_vin_notification.cc deleted file mode 100644 index c360e41dff..0000000000 --- a/src/components/application_manager/src/commands/hmi/on_vi_vin_notification.cc +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2013, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include "application_manager/commands/hmi/on_vi_vin_notification.h" -#include "interfaces/MOBILE_API.h" - -namespace application_manager { - -namespace commands { - -OnVIVinNotification::OnVIVinNotification( - const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) {} - -OnVIVinNotification::~OnVIVinNotification() {} - -void OnVIVinNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); - - // prepare SmartObject for mobile factory - (*message_)[strings::params][strings::function_id] = - static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID); - - SendNotificationToMobile(message_); -} - -} // namespace commands - -} // namespace application_manager diff --git a/src/components/application_manager/src/commands/hmi/on_vi_wiper_status_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_wiper_status_notification.cc deleted file mode 100644 index 08fb3f31d4..0000000000 --- a/src/components/application_manager/src/commands/hmi/on_vi_wiper_status_notification.cc +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2013, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include "application_manager/commands/hmi/on_vi_wiper_status_notification.h" -#include "interfaces/MOBILE_API.h" - -namespace application_manager { - -namespace commands { - -OnVIWiperStatusNotification::OnVIWiperStatusNotification( - const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) {} - -OnVIWiperStatusNotification::~OnVIWiperStatusNotification() {} - -void OnVIWiperStatusNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); - - // prepare SmartObject for mobile factory - (*message_)[strings::params][strings::function_id] = - static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID); - - SendNotificationToMobile(message_); -} - -} // namespace commands - -} // namespace application_manager diff --git a/src/components/application_manager/src/commands/mobile/get_vehicle_data_request.cc b/src/components/application_manager/src/commands/mobile/get_vehicle_data_request.cc index 84c6e0ba7c..3d08b4f107 100644 --- a/src/components/application_manager/src/commands/mobile/get_vehicle_data_request.cc +++ b/src/components/application_manager/src/commands/mobile/get_vehicle_data_request.cc @@ -45,7 +45,6 @@ namespace commands { namespace str = strings; -#ifdef HMI_DBUS_API GetVehicleDataRequest::GetVehicleDataRequest( const MessageSharedPtr& message, ApplicationManager& application_manager) : CommandRequestImpl(message, application_manager) {} @@ -65,171 +64,6 @@ void GetVehicleDataRequest::Run() { return; } - const VehicleData& vehicle_data = MessageHelper::vehicle_data(); - VehicleData::const_iterator it = vehicle_data.begin(); - - for (; vehicle_data.end() != it; ++it) { - if (true == (*message_)[str::msg_params].keyExists(it->first) && - true == (*message_)[str::msg_params][it->first].asBool()) { - SendRequestsToHmi(app->app_id()); - return; - } - } - - SendResponse(false, mobile_apis::Result::INVALID_DATA); -} - -namespace { -struct Subrequest { - hmi_apis::FunctionID::eType func_id; - const char* str; -}; -Subrequest subrequests[] = { - {hmi_apis::FunctionID::VehicleInfo_GetGpsData, str::gps}, - {hmi_apis::FunctionID::VehicleInfo_GetSpeed, str::speed}, - {hmi_apis::FunctionID::VehicleInfo_GetRpm, str::rpm}, - {hmi_apis::FunctionID::VehicleInfo_GetFuelLevel, str::fuel_level}, - {hmi_apis::FunctionID::VehicleInfo_GetFuelLevelState, - str::fuel_level_state}, - {hmi_apis::FunctionID::VehicleInfo_GetInstantFuelConsumption, - str::instant_fuel_consumption}, - {hmi_apis::FunctionID::VehicleInfo_GetExternalTemperature, - str::external_temp}, - {hmi_apis::FunctionID::VehicleInfo_GetVin, str::vin}, - {hmi_apis::FunctionID::VehicleInfo_GetPrndl, str::prndl}, - {hmi_apis::FunctionID::VehicleInfo_GetTirePressure, str::tire_pressure}, - {hmi_apis::FunctionID::VehicleInfo_GetOdometer, str::odometer}, - {hmi_apis::FunctionID::VehicleInfo_GetBeltStatus, str::belt_status}, - {hmi_apis::FunctionID::VehicleInfo_GetBodyInformation, - str::body_information}, - {hmi_apis::FunctionID::VehicleInfo_GetDeviceStatus, str::device_status}, - {hmi_apis::FunctionID::VehicleInfo_GetDriverBraking, str::driver_braking}, - {hmi_apis::FunctionID::VehicleInfo_GetWiperStatus, str::wiper_status}, - {hmi_apis::FunctionID::VehicleInfo_GetHeadLampStatus, - str::head_lamp_status}, - {hmi_apis::FunctionID::VehicleInfo_GetEngineTorque, str::engine_torque}, - {hmi_apis::FunctionID::VehicleInfo_GetAccPedalPosition, str::acc_pedal_pos}, - {hmi_apis::FunctionID::VehicleInfo_GetSteeringWheelAngle, - str::steering_wheel_angle}, - {hmi_apis::FunctionID::VehicleInfo_GetECallInfo, str::e_call_info}, - {hmi_apis::FunctionID::VehicleInfo_GetAirbagStatus, str::airbag_status}, - {hmi_apis::FunctionID::VehicleInfo_GetEmergencyEvent, str::emergency_event}, - {hmi_apis::FunctionID::VehicleInfo_GetClusterModeStatus, - str::cluster_mode_status}, - {hmi_apis::FunctionID::VehicleInfo_GetMyKey, str::my_key}, -}; -} - -void GetVehicleDataRequest::SendRequestsToHmi(const int32_t app_id) { - smart_objects::SmartObject msg_params(smart_objects::SmartType_Map); - msg_params[strings::app_id] = app_id; - - for (size_t i = 0; i < sizeof(subrequests) / sizeof(subrequests[0]); ++i) { - const Subrequest& sr = subrequests[i]; - if (true == (*message_)[str::msg_params].keyExists(sr.str) && - true == (*message_)[str::msg_params][sr.str].asBool()) { - HmiRequest hmi_request; - hmi_request.str = sr.str; - hmi_request.func_id = sr.func_id; - hmi_request.complete = false; - hmi_requests_.push_back(hmi_request); - } - } - - LOG4CXX_INFO(logger_, - hmi_requests_.size() << " requests are going to be sent to HMI"); - - for (HmiRequests::const_iterator it = hmi_requests_.begin(); - it != hmi_requests_.end(); - ++it) { - SendHMIRequest(it->func_id, &msg_params, true); - } -} - -void GetVehicleDataRequest::on_event(const event_engine::Event& event) { - LOG4CXX_INFO(logger_, "GetVehicleDataRequest::on_event " << event.id()); - - const smart_objects::SmartObject& message = event.smart_object(); - - for (HmiRequests::iterator it = hmi_requests_.begin(); - it != hmi_requests_.end(); - ++it) { - HmiRequest& hmi_request = *it; - if (hmi_request.func_id == event.id()) { - hmi_request.status = static_cast<hmi_apis::Common_Result::eType>( - message[strings::params][hmi_response::code].asInt()); - if (hmi_apis::Common_Result::SUCCESS == hmi_request.status) - hmi_request.value = message[str::msg_params][hmi_request.str]; - hmi_request.complete = true; - break; - } - } - - bool all_complete = true; - bool any_arg_success = false; - mobile_api::Result::eType status = mobile_api::Result::eType::SUCCESS; - for (HmiRequests::const_iterator it = hmi_requests_.begin(); - it != hmi_requests_.end(); - ++it) { - if (!it->complete) { - all_complete = false; - break; - } - if (hmi_apis::Common_Result::SUCCESS != it->status) { - if (mobile_api::Result::SUCCESS == status) { - status = static_cast<mobile_apis::Result::eType>(it->status); - } else if (status != - static_cast<mobile_apis::Result::eType>(it->status)) { - status = mobile_api::Result::eType::GENERIC_ERROR; - } - LOG4CXX_TRACE(logger_, - "Status from HMI: " << it->status - << ", so response status become " - << status); - } else { - any_arg_success = true; - } - } - - if (all_complete) { - smart_objects::SmartObject response_params(smart_objects::SmartType_Map); - if (any_arg_success) { - for (HmiRequests::const_iterator it = hmi_requests_.begin(); - it != hmi_requests_.end(); - ++it) { - response_params[it->str] = it->value; - } - } - LOG4CXX_INFO(logger_, "All HMI requests are complete"); - const char* info = NULL; - std::string error_message; - if (true == message[strings::params].keyExists(strings::error_msg)) { - error_message = message[strings::params][strings::error_msg].asString(); - info = error_message.c_str(); - } - SendResponse(any_arg_success, status, info, &response_params); - } -} -#else -GetVehicleDataRequest::GetVehicleDataRequest( - const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandRequestImpl(message, application_manager) {} - -GetVehicleDataRequest::~GetVehicleDataRequest() {} - -void GetVehicleDataRequest::Run() { - LOG4CXX_AUTO_TRACE(logger_); - - int32_t app_id = - (*message_)[strings::params][strings::connection_key].asUInt(); - ApplicationSharedPtr app = application_manager_.application(app_id); - - if (!app) { - LOG4CXX_ERROR(logger_, "NULL pointer"); - SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); - return; - } - if (app->AreCommandLimitsExceeded( static_cast<mobile_apis::FunctionID::eType>(function_id()), application_manager::TLimitSource::CONFIG_FILE)) { @@ -299,8 +133,6 @@ void GetVehicleDataRequest::on_event(const event_engine::Event& event) { } } -#endif // #ifdef HMI_DBUS_API - } // namespace commands } // namespace application_manager diff --git a/src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_request.cc b/src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_request.cc index 28cf4c754c..fc2361c4af 100644 --- a/src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_request.cc +++ b/src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_request.cc @@ -46,59 +46,6 @@ SubscribeVehicleDataRequest::SubscribeVehicleDataRequest( SubscribeVehicleDataRequest::~SubscribeVehicleDataRequest() {} -#ifdef HMI_DBUS_API -namespace { -struct Subrequest { - hmi_apis::FunctionID::eType func_id; - const char* str; -}; -Subrequest subrequests[] = { - {hmi_apis::FunctionID::VehicleInfo_SubscribeGps, strings::gps}, - {hmi_apis::FunctionID::VehicleInfo_SubscribeSpeed, strings::speed}, - {hmi_apis::FunctionID::VehicleInfo_SubscribeRpm, strings::rpm}, - {hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel, strings::fuel_level}, - {hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel_State, - strings::fuel_level_state}, - {hmi_apis::FunctionID::VehicleInfo_SubscribeInstantFuelConsumption, - strings::instant_fuel_consumption}, - {hmi_apis::FunctionID::VehicleInfo_SubscribeExternalTemperature, - strings::external_temp}, - {hmi_apis::FunctionID::VehicleInfo_SubscribeVin, strings::vin}, - {hmi_apis::FunctionID::VehicleInfo_SubscribePrndl, strings::prndl}, - {hmi_apis::FunctionID::VehicleInfo_SubscribeTirePressure, - strings::tire_pressure}, - {hmi_apis::FunctionID::VehicleInfo_SubscribeOdometer, strings::odometer}, - {hmi_apis::FunctionID::VehicleInfo_SubscribeBeltStatus, - strings::belt_status}, - {hmi_apis::FunctionID::VehicleInfo_SubscribeBodyInformation, - strings::body_information}, - {hmi_apis::FunctionID::VehicleInfo_SubscribeDeviceStatus, - strings::device_status}, - {hmi_apis::FunctionID::VehicleInfo_SubscribeDriverBraking, - strings::driver_braking}, - {hmi_apis::FunctionID::VehicleInfo_SubscribeWiperStatus, - strings::wiper_status}, - {hmi_apis::FunctionID::VehicleInfo_SubscribeHeadLampStatus, - strings::head_lamp_status}, - {hmi_apis::FunctionID::VehicleInfo_SubscribeEngineTorque, - strings::engine_torque}, - {hmi_apis::FunctionID::VehicleInfo_SubscribeAccPedalPosition, - strings::acc_pedal_pos}, - {hmi_apis::FunctionID::VehicleInfo_SubscribeSteeringWheelAngle, - strings::steering_wheel_angle}, - {hmi_apis::FunctionID::VehicleInfo_SubscribeECallInfo, - strings::e_call_info}, - {hmi_apis::FunctionID::VehicleInfo_SubscribeAirbagStatus, - strings::airbag_status}, - {hmi_apis::FunctionID::VehicleInfo_SubscribeEmergencyEvent, - strings::emergency_event}, - {hmi_apis::FunctionID::VehicleInfo_SubscribeClusterModeStatus, - strings::cluster_mode_status}, - {hmi_apis::FunctionID::VehicleInfo_SubscribeMyKey, strings::my_key}, -}; -} -#endif // #ifdef HMI_DBUS_API - void SubscribeVehicleDataRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -127,33 +74,10 @@ void SubscribeVehicleDataRequest::Run() { return; } -#ifdef HMI_DBUS_API - // Generate list of subrequests - for (size_t i = 0; i < sizeof(subrequests) / sizeof(subrequests[0]); ++i) { - const Subrequest& sr = subrequests[i]; - if (true == (*message_)[strings::msg_params].keyExists(sr.str) && - true == (*message_)[strings::msg_params][sr.str].asBool()) { - HmiRequest hmi_request; - hmi_request.str = sr.str; - hmi_request.func_id = sr.func_id; - hmi_request.complete = false; - hmi_requests_.push_back(hmi_request); - } - } - LOG4CXX_DEBUG( - logger_, hmi_requests_.size() << " requests are going to be sent to HMI"); - - // Send subrequests - for (HmiRequests::const_iterator it = hmi_requests_.begin(); - it != hmi_requests_.end(); - ++it) - SendHMIRequest(it->func_id, &msg_params, true); -#else StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo); SendHMIRequest(hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData, &msg_params, true); -#endif // #ifdef HMI_DBUS_API } void SubscribeVehicleDataRequest::on_event(const event_engine::Event& event) { @@ -175,64 +99,6 @@ void SubscribeVehicleDataRequest::on_event(const event_engine::Event& event) { return; } -#ifdef HMI_DBUS_API - for (HmiRequests::iterator it = hmi_requests_.begin(); - it != hmi_requests_.end(); - ++it) { - HmiRequest& hmi_request = *it; - if (hmi_request.func_id == event.id()) { - hmi_request.status = static_cast<hmi_apis::Common_Result::eType>( - message[strings::params][hmi_response::code].asInt()); - if (hmi_apis::Common_Result::SUCCESS == hmi_request.status) - hmi_request.value = message[strings::msg_params][hmi_request.str]; - hmi_request.complete = true; - break; - } - } - bool all_complete = true; - bool any_arg_success = false; - mobile_api::Result::eType status = mobile_api::Result::eType::SUCCESS; - for (HmiRequests::const_iterator it = hmi_requests_.begin(); - it != hmi_requests_.end(); - ++it) { - if (!it->complete) { - all_complete = false; - break; - } - if (hmi_apis::Common_Result::SUCCESS != it->status) { - if (mobile_api::Result::SUCCESS == status) { - status = static_cast<mobile_apis::Result::eType>(it->status); - } else if (status != - static_cast<mobile_apis::Result::eType>(it->status)) { - status = mobile_api::Result::eType::GENERIC_ERROR; - } - LOG4CXX_TRACE(logger_, - "Status from HMI: " << it->status - << ", so response status become " - << status); - } else { - any_arg_success = true; - } - } - - if (all_complete) { - smart_objects::SmartObject response_params(smart_objects::SmartType_Map); - if (any_arg_success) { - for (HmiRequests::const_iterator it = hmi_requests_.begin(); - it != hmi_requests_.end(); - ++it) { - response_params[it->str] = it->value; - } - } - LOG4CXX_DEBUG(logger_, "All HMI requests are complete"); - const bool result = any_arg_success; - SendResponse(any_arg_success, status, NULL, &response_params); - if (result) { - app->UpdateHash(); - } - } -#else - hmi_apis::Common_Result::eType hmi_result = static_cast<hmi_apis::Common_Result::eType>( message[strings::params][hmi_response::code].asInt()); @@ -274,7 +140,6 @@ void SubscribeVehicleDataRequest::on_event(const event_engine::Event& event) { result_code, response_info.empty() ? NULL : response_info.c_str(), &(message[strings::msg_params])); -#endif // #ifdef HMI_DBUS_API } bool SubscribeVehicleDataRequest::Init() { diff --git a/src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_request.cc b/src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_request.cc index f7317d72f9..442172bea5 100644 --- a/src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_request.cc +++ b/src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_request.cc @@ -50,60 +50,6 @@ UnsubscribeVehicleDataRequest::UnsubscribeVehicleDataRequest( UnsubscribeVehicleDataRequest::~UnsubscribeVehicleDataRequest() {} -#ifdef HMI_DBUS_API -namespace { -struct Subrequest { - hmi_apis::FunctionID::eType func_id; - const char* str; -}; -Subrequest subrequests[] = { - {hmi_apis::FunctionID::VehicleInfo_UnsubscribeGps, strings::gps}, - {hmi_apis::FunctionID::VehicleInfo_UnsubscribeSpeed, strings::speed}, - {hmi_apis::FunctionID::VehicleInfo_UnsubscribeRpm, strings::rpm}, - {hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel, - strings::fuel_level}, - {hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel_State, - strings::fuel_level_state}, - {hmi_apis::FunctionID::VehicleInfo_UnsubscribeInstantFuelConsumption, - strings::instant_fuel_consumption}, - {hmi_apis::FunctionID::VehicleInfo_UnsubscribeExternalTemperature, - strings::external_temp}, - {hmi_apis::FunctionID::VehicleInfo_UnsubscribeVin, strings::vin}, - {hmi_apis::FunctionID::VehicleInfo_UnsubscribePrndl, strings::prndl}, - {hmi_apis::FunctionID::VehicleInfo_UnsubscribeTirePressure, - strings::tire_pressure}, - {hmi_apis::FunctionID::VehicleInfo_UnsubscribeOdometer, strings::odometer}, - {hmi_apis::FunctionID::VehicleInfo_UnsubscribeBeltStatus, - strings::belt_status}, - {hmi_apis::FunctionID::VehicleInfo_UnsubscribeBodyInformation, - strings::body_information}, - {hmi_apis::FunctionID::VehicleInfo_UnsubscribeDeviceStatus, - strings::device_status}, - {hmi_apis::FunctionID::VehicleInfo_UnsubscribeDriverBraking, - strings::driver_braking}, - {hmi_apis::FunctionID::VehicleInfo_UnsubscribeWiperStatus, - strings::wiper_status}, - {hmi_apis::FunctionID::VehicleInfo_UnsubscribeHeadLampStatus, - strings::head_lamp_status}, - {hmi_apis::FunctionID::VehicleInfo_UnsubscribeEngineTorque, - strings::engine_torque}, - {hmi_apis::FunctionID::VehicleInfo_UnsubscribeAccPedalPosition, - strings::acc_pedal_pos}, - {hmi_apis::FunctionID::VehicleInfo_UnsubscribeSteeringWheelAngle, - strings::steering_wheel_angle}, - {hmi_apis::FunctionID::VehicleInfo_UnsubscribeECallInfo, - strings::e_call_info}, - {hmi_apis::FunctionID::VehicleInfo_UnsubscribeAirbagStatus, - strings::airbag_status}, - {hmi_apis::FunctionID::VehicleInfo_UnsubscribeEmergencyEvent, - strings::emergency_event}, - {hmi_apis::FunctionID::VehicleInfo_UnsubscribeClusterModeStatus, - strings::cluster_mode_status}, - {hmi_apis::FunctionID::VehicleInfo_UnsubscribeMyKey, strings::my_key}, -}; -} -#endif // #ifdef HMI_DBUS_API - void UnsubscribeVehicleDataRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -211,34 +157,10 @@ void UnsubscribeVehicleDataRequest::Run() { } return; } - -#ifdef HMI_DBUS_API - // Generate list of subrequests - for (size_t i = 0; i < sizeof(subrequests) / sizeof(subrequests[0]); ++i) { - const Subrequest& sr = subrequests[i]; - if (true == (*message_)[strings::msg_params].keyExists(sr.str) && - true == (*message_)[strings::msg_params][sr.str].asBool()) { - HmiRequest hmi_request; - hmi_request.str = sr.str; - hmi_request.func_id = sr.func_id; - hmi_request.complete = false; - hmi_requests_.push_back(hmi_request); - } - } - LOG4CXX_INFO(logger_, - hmi_requests_.size() << " requests are going to be sent to HMI"); - - // Send subrequests - for (HmiRequests::const_iterator it = hmi_requests_.begin(); - it != hmi_requests_.end(); - ++it) - SendHMIRequest(it->func_id, &msg_params, true); -#else StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo); SendHMIRequest(hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData, &msg_params, true); -#endif // #ifdef HMI_DBUS_API } void UnsubscribeVehicleDataRequest::on_event(const event_engine::Event& event) { @@ -253,65 +175,6 @@ void UnsubscribeVehicleDataRequest::on_event(const event_engine::Event& event) { } EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo); -#ifdef HMI_DBUS_API - for (HmiRequests::iterator it = hmi_requests_.begin(); - it != hmi_requests_.end(); - ++it) { - HmiRequest& hmi_request = *it; - if (hmi_request.func_id == event.id()) { - hmi_request.status = static_cast<hmi_apis::Common_Result::eType>( - message[strings::params][hmi_response::code].asInt()); - if (hmi_apis::Common_Result::SUCCESS == hmi_request.status) - hmi_request.value = message[strings::msg_params][hmi_request.str]; - hmi_request.complete = true; - break; - } - } - bool all_complete = true; - bool any_arg_success = false; - mobile_api::Result::eType status = mobile_api::Result::eType::SUCCESS; - for (HmiRequests::const_iterator it = hmi_requests_.begin(); - it != hmi_requests_.end(); - ++it) { - if (!it->complete) { - all_complete = false; - break; - } - if (hmi_apis::Common_Result::SUCCESS != it->status) { - if (mobile_api::Result::SUCCESS == status) { - status = static_cast<mobile_apis::Result::eType>(it->status); - } else if (status != - static_cast<mobile_apis::Result::eType>(it->status)) { - status = mobile_api::Result::eType::GENERIC_ERROR; - } - LOG4CXX_TRACE(logger_, - "Status from HMI: " << it->status - << ", so response status become " - << status); - } else { - any_arg_success = true; - } - } - if (all_complete) { - smart_objects::SmartObject response_params(smart_objects::SmartType_Map); - if (any_arg_success) { - for (HmiRequests::const_iterator it = hmi_requests_.begin(); - it != hmi_requests_.end(); - ++it) { - response_params[it->str] = it->value; - } - } - - LOG4CXX_INFO(logger_, "All HMI requests are complete"); - if (true == any_arg_success) { - SetAllowedToTerminate(false); - } - SendResponse(any_arg_success, status, NULL, &response_params); - if (true == any_arg_success) { - UpdateHash(); - } - } -#else hmi_apis::Common_Result::eType hmi_result = static_cast<hmi_apis::Common_Result::eType>( message[strings::params][hmi_response::code].asInt()); @@ -347,7 +210,6 @@ void UnsubscribeVehicleDataRequest::on_event(const event_engine::Event& event) { application_manager_.TerminateRequest( connection_key(), correlation_id(), function_id()); } -#endif // #ifdef HMI_DBUS_API } bool UnsubscribeVehicleDataRequest::Init() { diff --git a/src/components/application_manager/src/hmi_command_factory.cc b/src/components/application_manager/src/hmi_command_factory.cc index a7f3ce7e6b..618b36be72 100644 --- a/src/components/application_manager/src/hmi_command_factory.cc +++ b/src/components/application_manager/src/hmi_command_factory.cc @@ -165,35 +165,6 @@ #include "application_manager/commands/hmi/decrypt_certificate_response.h" #endif // EXTERNAL_PROPRIETARY_MODE -#ifdef HMI_DBUS_API -#include "application_manager/commands/hmi/vi_get_vehicle_data_request_template.h" -#include "application_manager/commands/hmi/vi_get_vehicle_data_response_template.h" -#include "application_manager/commands/hmi/vi_subscribe_vehicle_data_request_template.h" -#include "application_manager/commands/hmi/vi_subscribe_vehicle_data_response_template.h" -#include "application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request_template.h" -#include "application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response_template.h" -#include "application_manager/commands/hmi/on_vi_gps_data_notification.h" -#include "application_manager/commands/hmi/on_vi_speed_notification.h" -#include "application_manager/commands/hmi/on_vi_rpm_notification.h" -#include "application_manager/commands/hmi/on_vi_fuel_level_notification.h" -#include "application_manager/commands/hmi/on_vi_fuel_level_state_notification.h" -#include "application_manager/commands/hmi/on_vi_instant_fuel_consumption_notification.h" -#include "application_manager/commands/hmi/on_vi_external_temperature_notification.h" -#include "application_manager/commands/hmi/on_vi_vin_notification.h" -#include "application_manager/commands/hmi/on_vi_prndl_notification.h" -#include "application_manager/commands/hmi/on_vi_tire_pressure_notification.h" -#include "application_manager/commands/hmi/on_vi_odometer_notification.h" -#include "application_manager/commands/hmi/on_vi_belt_status_notification.h" -#include "application_manager/commands/hmi/on_vi_body_information_notification.h" -#include "application_manager/commands/hmi/on_vi_device_status_notification.h" -#include "application_manager/commands/hmi/on_vi_driver_braking_notification.h" -#include "application_manager/commands/hmi/on_vi_wiper_status_notification.h" -#include "application_manager/commands/hmi/on_vi_head_lamp_status_notification.h" -#include "application_manager/commands/hmi/on_vi_engine_torque_notification.h" -#include "application_manager/commands/hmi/on_vi_acc_pedal_position_notification.h" -#include "application_manager/commands/hmi/on_vi_steering_wheel_angle_notification.h" -#include "application_manager/commands/hmi/on_vi_my_key_notification.h" -#else #include "application_manager/commands/hmi/vi_get_vehicle_data_request.h" #include "application_manager/commands/hmi/vi_get_vehicle_data_response.h" #include "application_manager/commands/hmi/on_vi_vehicle_data_notification.h" @@ -201,7 +172,6 @@ #include "application_manager/commands/hmi/vi_subscribe_vehicle_data_response.h" #include "application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request.h" #include "application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response.h" -#endif // #ifdef HMI_DBUS_API #include "application_manager/commands/hmi/vi_get_dtcs_request.h" #include "application_manager/commands/hmi/vi_get_dtcs_response.h" @@ -852,283 +822,6 @@ CommandSharedPtr HMICommandFactory::CreateCommand( } break; } -#ifdef HMI_DBUS_API - case hmi_apis::FunctionID::VehicleInfo_GetGpsData: { - if (is_response) - command.reset(new commands::VISubscribeVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_GetGpsData>(message, - application_manager)); - else - command.reset(new commands::VISubscribeVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_GetGpsData>(message, - application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_GetSpeed: { - if (is_response) - command.reset(new commands::VIGetVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_GetSpeed>(message, - application_manager)); - else - command.reset(new commands::VIGetVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_GetSpeed>(message, - application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_GetRpm: { - if (is_response) - command.reset(new commands::VIGetVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_GetRpm>(message, - application_manager)); - else - command.reset(new commands::VIGetVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_GetRpm>(message, - application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_GetFuelLevel: { - if (is_response) - command.reset(new commands::VIGetVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_GetFuelLevel>( - message, application_manager)); - else - command.reset(new commands::VIGetVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_GetFuelLevel>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_GetFuelLevelState: { - if (is_response) - command.reset(new commands::VIGetVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_GetFuelLevelState>( - message, application_manager)); - else - command.reset(new commands::VIGetVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_GetFuelLevelState>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_GetInstantFuelConsumption: { - if (is_response) - command.reset(new commands::VIGetVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_GetInstantFuelConsumption>( - message, application_manager)); - else - command.reset(new commands::VIGetVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_GetInstantFuelConsumption>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_GetExternalTemperature: { - if (is_response) - command.reset(new commands::VIGetVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_GetExternalTemperature>( - message, application_manager)); - else - command.reset(new commands::VIGetVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_GetExternalTemperature>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_GetPrndl: { - if (is_response) - command.reset(new commands::VIGetVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_GetPrndl>(message, - application_manager)); - else - command.reset(new commands::VIGetVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_GetPrndl>(message, - application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_GetVin: { - if (is_response) - command.reset(new commands::VIGetVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_GetVin>(message, - application_manager)); - else - command.reset(new commands::VIGetVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_GetVin>(message, - application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_GetTirePressure: { - if (is_response) - command.reset(new commands::VIGetVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_GetTirePressure>( - message, application_manager)); - else - command.reset(new commands::VIGetVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_GetTirePressure>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_GetOdometer: { - if (is_response) - command.reset(new commands::VIGetVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_GetOdometer>( - message, application_manager)); - else - command.reset(new commands::VIGetVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_GetOdometer>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_GetBeltStatus: { - if (is_response) - command.reset(new commands::VIGetVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_GetBeltStatus>( - message, application_manager)); - else - command.reset(new commands::VIGetVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_GetBeltStatus>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_GetBodyInformation: { - if (is_response) - command.reset(new commands::VIGetVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_GetBodyInformation>( - message, application_manager)); - else - command.reset(new commands::VIGetVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_GetBodyInformation>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_GetDeviceStatus: { - if (is_response) - command.reset(new commands::VIGetVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_GetDeviceStatus>( - message, application_manager)); - else - command.reset(new commands::VIGetVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_GetDeviceStatus>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_GetDriverBraking: { - if (is_response) - command.reset(new commands::VIGetVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_GetDriverBraking>( - message, application_manager)); - else - command.reset(new commands::VIGetVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_GetDriverBraking>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_GetWiperStatus: { - if (is_response) - command.reset(new commands::VIGetVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_GetWiperStatus>( - message, application_manager)); - else - command.reset(new commands::VIGetVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_GetWiperStatus>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_GetHeadLampStatus: { - if (is_response) - command.reset(new commands::VIGetVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_GetHeadLampStatus>( - message, application_manager)); - else - command.reset(new commands::VIGetVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_GetHeadLampStatus>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_GetEngineTorque: { - if (is_response) - command.reset(new commands::VIGetVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_GetEngineTorque>( - message, application_manager)); - else - command.reset(new commands::VIGetVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_GetEngineTorque>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_GetAccPedalPosition: { - if (is_response) - command.reset(new commands::VIGetVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_GetAccPedalPosition>( - message, application_manager)); - else - command.reset(new commands::VIGetVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_GetAccPedalPosition>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_GetSteeringWheelAngle: { - if (is_response) - command.reset(new commands::VIGetVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_GetSteeringWheelAngle>( - message, application_manager)); - else - command.reset(new commands::VIGetVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_GetSteeringWheelAngle>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_GetECallInfo: { - if (is_response) - command.reset(new commands::VIGetVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_GetECallInfo>( - message, application_manager)); - else - command.reset(new commands::VIGetVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_GetECallInfo>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_GetAirbagStatus: { - if (is_response) - command.reset(new commands::VIGetVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_GetAirbagStatus>( - message, application_manager)); - else - command.reset(new commands::VIGetVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_GetAirbagStatus>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_GetEmergencyEvent: { - if (is_response) - command.reset(new commands::VIGetVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_GetEmergencyEvent>( - message, application_manager)); - else - command.reset(new commands::VIGetVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_GetEmergencyEvent>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_GetClusterModeStatus: { - if (is_response) - command.reset(new commands::VIGetVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_GetClusterModeStatus>( - message, application_manager)); - else - command.reset(new commands::VIGetVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_GetClusterModeStatus>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_GetMyKey: { - if (is_response) - command.reset(new commands::VIGetVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_GetMyKey>(message, - application_manager)); - else - command.reset(new commands::VIGetVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_GetMyKey>(message, - application_manager)); - break; - } -#else case hmi_apis::FunctionID::VehicleInfo_GetVehicleData: { if (is_response) { command.reset(new commands::VIGetVehicleDataResponse( @@ -1139,7 +832,6 @@ CommandSharedPtr HMICommandFactory::CreateCommand( } break; } -#endif // #ifdef HMI_DBUS_API case hmi_apis::FunctionID::VehicleInfo_GetDTCs: { if (is_response) { command.reset( @@ -1385,283 +1077,6 @@ CommandSharedPtr HMICommandFactory::CreateCommand( message, application_manager)); break; } -#ifdef HMI_DBUS_API - case hmi_apis::FunctionID::VehicleInfo_SubscribeGps: { - if (is_response) - command.reset(new commands::VISubscribeVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_SubscribeGps>( - message, application_manager)); - else - command.reset(new commands::VISubscribeVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_SubscribeGps>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_SubscribeSpeed: { - if (is_response) - command.reset(new commands::VISubscribeVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_SubscribeSpeed>( - message, application_manager)); - else - command.reset(new commands::VISubscribeVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_SubscribeSpeed>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_SubscribeRpm: { - if (is_response) - command.reset(new commands::VISubscribeVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_SubscribeRpm>( - message, application_manager)); - else - command.reset(new commands::VISubscribeVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_SubscribeRpm>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel: { - if (is_response) - command.reset(new commands::VISubscribeVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel>( - message, application_manager)); - else - command.reset(new commands::VISubscribeVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel_State: { - if (is_response) - command.reset(new commands::VISubscribeVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel_State>( - message, application_manager)); - else - command.reset(new commands::VISubscribeVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel_State>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_SubscribeInstantFuelConsumption: { - if (is_response) - command.reset(new commands::VISubscribeVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_SubscribeInstantFuelConsumption>( - message, application_manager)); - else - command.reset(new commands::VISubscribeVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_SubscribeInstantFuelConsumption>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_SubscribeExternalTemperature: { - if (is_response) - command.reset(new commands::VISubscribeVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_SubscribeExternalTemperature>( - message, application_manager)); - else - command.reset(new commands::VISubscribeVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_SubscribeExternalTemperature>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_SubscribePrndl: { - if (is_response) - command.reset(new commands::VISubscribeVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_SubscribePrndl>( - message, application_manager)); - else - command.reset(new commands::VISubscribeVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_SubscribePrndl>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_SubscribeVin: { - if (is_response) - command.reset(new commands::VISubscribeVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_SubscribeVin>( - message, application_manager)); - else - command.reset(new commands::VISubscribeVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_SubscribeVin>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_SubscribeTirePressure: { - if (is_response) - command.reset(new commands::VISubscribeVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_SubscribeTirePressure>( - message, application_manager)); - else - command.reset(new commands::VISubscribeVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_SubscribeTirePressure>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_SubscribeOdometer: { - if (is_response) - command.reset(new commands::VISubscribeVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_SubscribeOdometer>( - message, application_manager)); - else - command.reset(new commands::VISubscribeVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_SubscribeOdometer>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_SubscribeBeltStatus: { - if (is_response) - command.reset(new commands::VISubscribeVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_SubscribeBeltStatus>( - message, application_manager)); - else - command.reset(new commands::VISubscribeVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_SubscribeBeltStatus>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_SubscribeBodyInformation: { - if (is_response) - command.reset(new commands::VISubscribeVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_SubscribeBodyInformation>( - message, application_manager)); - else - command.reset(new commands::VISubscribeVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_SubscribeBodyInformation>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_SubscribeDeviceStatus: { - if (is_response) - command.reset(new commands::VISubscribeVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_SubscribeDeviceStatus>( - message, application_manager)); - else - command.reset(new commands::VISubscribeVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_SubscribeDeviceStatus>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_SubscribeDriverBraking: { - if (is_response) - command.reset(new commands::VISubscribeVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_SubscribeDriverBraking>( - message, application_manager)); - else - command.reset(new commands::VISubscribeVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_SubscribeDriverBraking>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_SubscribeWiperStatus: { - if (is_response) - command.reset(new commands::VISubscribeVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_SubscribeWiperStatus>( - message, application_manager)); - else - command.reset(new commands::VISubscribeVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_SubscribeWiperStatus>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_SubscribeHeadLampStatus: { - if (is_response) - command.reset(new commands::VISubscribeVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_SubscribeHeadLampStatus>( - message, application_manager)); - else - command.reset(new commands::VISubscribeVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_SubscribeHeadLampStatus>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_SubscribeEngineTorque: { - if (is_response) - command.reset(new commands::VISubscribeVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_SubscribeEngineTorque>( - message, application_manager)); - else - command.reset(new commands::VISubscribeVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_SubscribeEngineTorque>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_SubscribeAccPedalPosition: { - if (is_response) - command.reset(new commands::VISubscribeVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_SubscribeAccPedalPosition>( - message, application_manager)); - else - command.reset(new commands::VISubscribeVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_SubscribeAccPedalPosition>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_SubscribeSteeringWheelAngle: { - if (is_response) - command.reset(new commands::VISubscribeVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_SubscribeSteeringWheelAngle>( - message, application_manager)); - else - command.reset(new commands::VISubscribeVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_SubscribeSteeringWheelAngle>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_SubscribeECallInfo: { - if (is_response) - command.reset(new commands::VISubscribeVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_SubscribeECallInfo>( - message, application_manager)); - else - command.reset(new commands::VISubscribeVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_SubscribeECallInfo>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_SubscribeAirbagStatus: { - if (is_response) - command.reset(new commands::VISubscribeVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_SubscribeAirbagStatus>( - message, application_manager)); - else - command.reset(new commands::VISubscribeVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_SubscribeAirbagStatus>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_SubscribeEmergencyEvent: { - if (is_response) - command.reset(new commands::VISubscribeVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_SubscribeEmergencyEvent>( - message, application_manager)); - else - command.reset(new commands::VISubscribeVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_SubscribeEmergencyEvent>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_SubscribeClusterModeStatus: { - if (is_response) - command.reset(new commands::VISubscribeVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_SubscribeClusterModeStatus>( - message, application_manager)); - else - command.reset(new commands::VISubscribeVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_SubscribeClusterModeStatus>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_SubscribeMyKey: { - if (is_response) - command.reset(new commands::VISubscribeVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_SubscribeMyKey>( - message, application_manager)); - else - command.reset(new commands::VISubscribeVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_SubscribeMyKey>( - message, application_manager)); - break; - } -#else case hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData: { if (is_response) { command.reset(new commands::VISubscribeVehicleDataResponse( @@ -1672,286 +1087,6 @@ CommandSharedPtr HMICommandFactory::CreateCommand( } break; } -#endif // #ifdef HMI_DBUS_API -#ifdef HMI_DBUS_API - case hmi_apis::FunctionID::VehicleInfo_UnsubscribeGps: { - if (is_response) - command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_UnsubscribeGps>( - message, application_manager)); - else - command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_UnsubscribeGps>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_UnsubscribeSpeed: { - if (is_response) - command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_UnsubscribeSpeed>( - message, application_manager)); - else - command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_UnsubscribeSpeed>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_UnsubscribeRpm: { - if (is_response) - command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_UnsubscribeRpm>( - message, application_manager)); - else - command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_UnsubscribeRpm>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel: { - if (is_response) - command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel>( - message, application_manager)); - else - command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel_State: { - if (is_response) - command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel_State>( - message, application_manager)); - else - command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel_State>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_UnsubscribeInstantFuelConsumption: { - if (is_response) - command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< - hmi_apis::FunctionID:: - VehicleInfo_UnsubscribeInstantFuelConsumption>( - message, application_manager)); - else - command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< - hmi_apis::FunctionID:: - VehicleInfo_UnsubscribeInstantFuelConsumption>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_UnsubscribeExternalTemperature: { - if (is_response) - command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_UnsubscribeExternalTemperature>( - message, application_manager)); - else - command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_UnsubscribeExternalTemperature>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_UnsubscribePrndl: { - if (is_response) - command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_UnsubscribePrndl>( - message, application_manager)); - else - command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_UnsubscribePrndl>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_UnsubscribeVin: { - if (is_response) - command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_UnsubscribeVin>( - message, application_manager)); - else - command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_UnsubscribeVin>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_UnsubscribeTirePressure: { - if (is_response) - command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_UnsubscribeTirePressure>( - message, application_manager)); - else - command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_UnsubscribeTirePressure>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_UnsubscribeOdometer: { - if (is_response) - command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_UnsubscribeOdometer>( - message, application_manager)); - else - command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_UnsubscribeOdometer>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_UnsubscribeBeltStatus: { - if (is_response) - command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_UnsubscribeBeltStatus>( - message, application_manager)); - else - command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_UnsubscribeBeltStatus>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_UnsubscribeBodyInformation: { - if (is_response) - command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_UnsubscribeBodyInformation>( - message, application_manager)); - else - command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_UnsubscribeBodyInformation>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_UnsubscribeDeviceStatus: { - if (is_response) - command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_UnsubscribeDeviceStatus>( - message, application_manager)); - else - command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_UnsubscribeDeviceStatus>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_UnsubscribeDriverBraking: { - if (is_response) - command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_UnsubscribeDriverBraking>( - message, application_manager)); - else - command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_UnsubscribeDriverBraking>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_UnsubscribeWiperStatus: { - if (is_response) - command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_UnsubscribeWiperStatus>( - message, application_manager)); - else - command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_UnsubscribeWiperStatus>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_UnsubscribeHeadLampStatus: { - if (is_response) - command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_UnsubscribeHeadLampStatus>( - message, application_manager)); - else - command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_UnsubscribeHeadLampStatus>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_UnsubscribeEngineTorque: { - if (is_response) - command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_UnsubscribeEngineTorque>( - message, application_manager)); - else - command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_UnsubscribeEngineTorque>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_UnsubscribeAccPedalPosition: { - if (is_response) - command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_UnsubscribeAccPedalPosition>( - message, application_manager)); - else - command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_UnsubscribeAccPedalPosition>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_UnsubscribeSteeringWheelAngle: { - if (is_response) - command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_UnsubscribeSteeringWheelAngle>( - message, application_manager)); - else - command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_UnsubscribeSteeringWheelAngle>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_UnsubscribeECallInfo: { - if (is_response) - command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_UnsubscribeECallInfo>( - message, application_manager)); - else - command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_UnsubscribeECallInfo>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_UnsubscribeAirbagStatus: { - if (is_response) - command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_UnsubscribeAirbagStatus>( - message, application_manager)); - else - command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_UnsubscribeAirbagStatus>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_UnsubscribeEmergencyEvent: { - if (is_response) - command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_UnsubscribeEmergencyEvent>( - message, application_manager)); - else - command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_UnsubscribeEmergencyEvent>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_UnsubscribeClusterModeStatus: { - if (is_response) - command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_UnsubscribeClusterModeStatus>( - message, application_manager)); - else - command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_UnsubscribeClusterModeStatus>( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_UnsubscribeMyKey: { - if (is_response) - command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_UnsubscribeMyKey>( - message, application_manager)); - else - command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_UnsubscribeMyKey>( - message, application_manager)); - break; - } -#else case hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData: { if (is_response) { command.reset(new commands::VIUnsubscribeVehicleDataResponse( @@ -1962,120 +1097,11 @@ CommandSharedPtr HMICommandFactory::CreateCommand( } break; } -#endif // #ifdef HMI_DBUS_API -#ifdef HMI_DBUS_API - case hmi_apis::FunctionID::VehicleInfo_OnGpsData: { - command.reset( - new commands::OnVIGpsDataNotification(message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_OnSpeed: { - command.reset( - new commands::OnVISpeedNotification(message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_OnRpm: { - command.reset( - new commands::OnVIRpmNotification(message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_OnFuelLevel: { - command.reset(new commands::OnVIFuelLevelNotification( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_OnFuelLevelState: { - command.reset(new commands::OnVIFuelLevelStateNotification( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_OnInstantFuelConsumption: { - command.reset(new commands::OnVIInstantFuelConsumptionNotification( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_OnExternalTemperature: { - command.reset(new commands::OnVIExternalTemperatureNotification( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_OnVin: { - command.reset( - new commands::OnVIVinNotification(message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_OnPrndl: { - command.reset( - new commands::OnVIPrndlNotification(message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_OnTirePressure: { - command.reset(new commands::OnVITirePressureNotification( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_OnOdometer: { - command.reset( - new commands::OnVIOdometerNotification(message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_OnBeltStatus: { - command.reset(new commands::OnVIBeltStatusNotification( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_OnBodyInformation: { - command.reset(new commands::OnVIBodyInformationNotification( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_OnDeviceStatus: { - command.reset(new commands::OnVIDeviceStatusNotification( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_OnDriverBraking: { - command.reset(new commands::OnVIDriverBrakingNotification( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_OnWiperStatus: { - command.reset(new commands::OnVIWiperStatusNotification( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_OnHeadLampStatus: { - command.reset(new commands::OnVIHeadLampStatusNotification( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_OnEngineTorque: { - command.reset(new commands::OnVIEngineTorqueNotification( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_OnAccPedalPosition: { - command.reset(new commands::OnVIAccPedalPositionNotification( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_OnSteeringWheelAngle: { - command.reset(new commands::OnVISteeringWheelAngleNotification( - message, application_manager)); - break; - } - case hmi_apis::FunctionID::VehicleInfo_OnMyKey: { - command.reset( - new commands::OnVIMyKeyNotification(message, application_manager)); - break; - } -#else case hmi_apis::FunctionID::VehicleInfo_OnVehicleData: { command.reset(new commands::OnVIVehicleDataNotification( message, application_manager)); break; } -#endif // #ifdef HMI_DBUS_API case hmi_apis::FunctionID::Navigation_OnTBTClientState: { command.reset(new commands::OnNaviTBTClientStateNotification( message, application_manager)); diff --git a/src/components/application_manager/src/message_helper/message_helper.cc b/src/components/application_manager/src/message_helper/message_helper.cc index 4ae6ce4024..e06ca87282 100644 --- a/src/components/application_manager/src/message_helper/message_helper.cc +++ b/src/components/application_manager/src/message_helper/message_helper.cc @@ -219,59 +219,6 @@ const VehicleData MessageHelper::vehicle_data_( kVehicleDataInitializer, kVehicleDataInitializer + ARRAYSIZE(kVehicleDataInitializer)); -#ifdef HMI_DBUS_API -namespace { -struct VehicleInfo_Requests { - hmi_apis::FunctionID::eType func_id; - const char* str; -}; -static VehicleInfo_Requests ivi_subrequests[] = { - {hmi_apis::FunctionID::VehicleInfo_SubscribeGps, strings::gps}, - {hmi_apis::FunctionID::VehicleInfo_SubscribeSpeed, strings::speed}, - {hmi_apis::FunctionID::VehicleInfo_SubscribeRpm, strings::rpm}, - {hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel, strings::fuel_level}, - {hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel_State, - strings::fuel_level_state}, - {hmi_apis::FunctionID::VehicleInfo_SubscribeInstantFuelConsumption, - strings::instant_fuel_consumption}, - {hmi_apis::FunctionID::VehicleInfo_SubscribeExternalTemperature, - strings::external_temp}, - {hmi_apis::FunctionID::VehicleInfo_SubscribeVin, strings::vin}, - {hmi_apis::FunctionID::VehicleInfo_SubscribePrndl, strings::prndl}, - {hmi_apis::FunctionID::VehicleInfo_SubscribeTirePressure, - strings::tire_pressure}, - {hmi_apis::FunctionID::VehicleInfo_SubscribeOdometer, strings::odometer}, - {hmi_apis::FunctionID::VehicleInfo_SubscribeBeltStatus, - strings::belt_status}, - {hmi_apis::FunctionID::VehicleInfo_SubscribeBodyInformation, - strings::body_information}, - {hmi_apis::FunctionID::VehicleInfo_SubscribeDeviceStatus, - strings::device_status}, - {hmi_apis::FunctionID::VehicleInfo_SubscribeDriverBraking, - strings::driver_braking}, - {hmi_apis::FunctionID::VehicleInfo_SubscribeWiperStatus, - strings::wiper_status}, - {hmi_apis::FunctionID::VehicleInfo_SubscribeHeadLampStatus, - strings::head_lamp_status}, - {hmi_apis::FunctionID::VehicleInfo_SubscribeEngineTorque, - strings::engine_torque}, - {hmi_apis::FunctionID::VehicleInfo_SubscribeAccPedalPosition, - strings::acc_pedal_pos}, - {hmi_apis::FunctionID::VehicleInfo_SubscribeSteeringWheelAngle, - strings::steering_wheel_angle}, - {hmi_apis::FunctionID::VehicleInfo_SubscribeECallInfo, - strings::e_call_info}, - {hmi_apis::FunctionID::VehicleInfo_SubscribeAirbagStatus, - strings::airbag_status}, - {hmi_apis::FunctionID::VehicleInfo_SubscribeEmergencyEvent, - strings::emergency_event}, - {hmi_apis::FunctionID::VehicleInfo_SubscribeClusterModeStatus, - strings::cluster_mode_status}, - {hmi_apis::FunctionID::VehicleInfo_SubscribeMyKey, strings::my_key}, -}; -} -#endif // #ifdef HMI_DBUS_API - const uint32_t MessageHelper::GetPriorityCode(const std::string& priority) { CommonAppPriorityMap::const_iterator it = app_priority_values.find(priority); if (app_priority_values.end() != it) { @@ -840,100 +787,11 @@ std::string MessageHelper::StringifiedFunctionID( return std::string(); } -#ifdef HMI_DBUS_API -namespace { -const std::map<std::string, uint16_t> create_get_vehicle_data_args() { - std::map<std::string, uint16_t> rc; - rc.insert(std::make_pair(strings::gps, - hmi_apis::FunctionID::VehicleInfo_GetGpsData)); - rc.insert(std::make_pair(strings::speed, - hmi_apis::FunctionID::VehicleInfo_GetSpeed)); - rc.insert( - std::make_pair(strings::rpm, hmi_apis::FunctionID::VehicleInfo_GetRpm)); - rc.insert(std::make_pair(strings::fuel_level, - hmi_apis::FunctionID::VehicleInfo_GetFuelLevel)); - rc.insert( - std::make_pair(strings::fuel_level_state, - hmi_apis::FunctionID::VehicleInfo_GetFuelLevelState)); - rc.insert(std::make_pair( - strings::instant_fuel_consumption, - hmi_apis::FunctionID::VehicleInfo_GetInstantFuelConsumption)); - rc.insert( - std::make_pair(strings::external_temp, - hmi_apis::FunctionID::VehicleInfo_GetExternalTemperature)); - rc.insert( - std::make_pair(strings::vin, hmi_apis::FunctionID::VehicleInfo_GetVin)); - rc.insert(std::make_pair(strings::prndl, - hmi_apis::FunctionID::VehicleInfo_GetPrndl)); - rc.insert(std::make_pair(strings::tire_pressure, - hmi_apis::FunctionID::VehicleInfo_GetTirePressure)); - rc.insert(std::make_pair(strings::odometer, - hmi_apis::FunctionID::VehicleInfo_GetOdometer)); - rc.insert(std::make_pair(strings::belt_status, - hmi_apis::FunctionID::VehicleInfo_GetBeltStatus)); - rc.insert( - std::make_pair(strings::body_information, - hmi_apis::FunctionID::VehicleInfo_GetBodyInformation)); - rc.insert(std::make_pair(strings::device_status, - hmi_apis::FunctionID::VehicleInfo_GetDeviceStatus)); - rc.insert(std::make_pair(strings::driver_braking, - hmi_apis::FunctionID::VehicleInfo_GetDriverBraking)); - rc.insert(std::make_pair(strings::wiper_status, - hmi_apis::FunctionID::VehicleInfo_GetWiperStatus)); - rc.insert( - std::make_pair(strings::head_lamp_status, - hmi_apis::FunctionID::VehicleInfo_GetHeadLampStatus)); - rc.insert(std::make_pair(strings::engine_torque, - hmi_apis::FunctionID::VehicleInfo_GetEngineTorque)); - rc.insert( - std::make_pair(strings::acc_pedal_pos, - hmi_apis::FunctionID::VehicleInfo_GetAccPedalPosition)); - rc.insert( - std::make_pair(strings::steering_wheel_angle, - hmi_apis::FunctionID::VehicleInfo_GetSteeringWheelAngle)); - rc.insert(std::make_pair(strings::e_call_info, - hmi_apis::FunctionID::VehicleInfo_GetECallInfo)); - rc.insert(std::make_pair(strings::airbag_status, - hmi_apis::FunctionID::VehicleInfo_GetAirbagStatus)); - rc.insert( - std::make_pair(strings::emergency_event, - hmi_apis::FunctionID::VehicleInfo_GetEmergencyEvent)); - rc.insert( - std::make_pair(strings::cluster_mode_status, - hmi_apis::FunctionID::VehicleInfo_GetClusterModeStatus)); - rc.insert(std::make_pair(strings::my_key, - hmi_apis::FunctionID::VehicleInfo_GetMyKey)); - return rc; -} -static std::map<std::string, uint16_t> vehicle_data_args = - create_get_vehicle_data_args(); -} -#endif - void MessageHelper::CreateGetVehicleDataRequest( const uint32_t correlation_id, const std::vector<std::string>& params, ApplicationManager& app_mngr) { LOG4CXX_AUTO_TRACE(logger_); -#ifdef HMI_DBUS_API - for (std::vector<std::string>::const_iterator it = params.begin(); - it != params.end(); - it++) { - smart_objects::SmartObjectSPtr request = - utils::MakeShared<smart_objects::SmartObject>(); - - (*request)[strings::params][strings::message_type] = - static_cast<int>(kRequest); - (*request)[strings::params][strings::correlation_id] = correlation_id; - (*request)[strings::params][strings::protocol_version] = - commands::CommandImpl::protocol_version_; - (*request)[strings::params][strings::protocol_type] = - commands::CommandImpl::hmi_protocol_type_; - (*request)[strings::params][strings::function_id] = - static_cast<int>(vehicle_data_args[*it]); - app_mngr.ManageHMICommand(request); - } -#else smart_objects::SmartObjectSPtr request = utils::MakeShared<smart_objects::SmartObject>(); @@ -955,7 +813,6 @@ void MessageHelper::CreateGetVehicleDataRequest( (*request)[strings::msg_params][*it] = true; } app_mngr.ManageHMICommand(request); -#endif } smart_objects::SmartObjectSPtr MessageHelper::CreateBlockedByPoliciesResponse( @@ -1106,26 +963,10 @@ smart_objects::SmartObjectList MessageHelper::GetIVISubscriptionRequests( } } -#ifdef HMI_JSON_API smart_objects::SmartObjectSPtr request = MessageHelper::CreateModuleInfoSO( hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData, app_mngr); (*request)[strings::msg_params] = msg_params; hmi_requests.push_back(request); -#endif // #ifdef HMI_JSON_API -#ifdef HMI_DBUS_API - // Generate list of ivi_subrequests - for (size_t i = 0; i < sizeof(ivi_subrequests) / sizeof(ivi_subrequests[0]); - ++i) { - const VehicleInfo_Requests& sr = ivi_subrequests[i]; - if (true == msg_params.keyExists(sr.str) && - true == msg_params[sr.str].asBool()) { - smart_objects::SmartObjectSPtr request = - MessageHelper::CreateModuleInfoSO(sr.func_id); - (*request)[strings::msg_params] = msg_params; - hmi_requests.push_back(request); - } - } -#endif // #ifdef HMI_DBUS_API return hmi_requests; } diff --git a/src/components/application_manager/src/policies/policy_event_observer.cc b/src/components/application_manager/src/policies/policy_event_observer.cc index 828f2d923a..f397814005 100644 --- a/src/components/application_manager/src/policies/policy_event_observer.cc +++ b/src/components/application_manager/src/policies/policy_event_observer.cc @@ -63,14 +63,6 @@ void PolicyEventObserver::on_event(const event_engine::Event& event) { const smart_objects::SmartObject& message = event.smart_object(); switch (event.id()) { -#ifdef HMI_DBUS_API - case hmi_apis::FunctionID::VehicleInfo_GetOdometer: { - ProcessOdometerEvent(message); - break; - } - default: { break; } - unsubscribe_from_event(hmi_apis::FunctionID::VehicleInfo_GetOdometer); -#else case hmi_apis::FunctionID::VehicleInfo_GetVehicleData: { ProcessOdometerEvent(message); unsubscribe_from_event(hmi_apis::FunctionID::VehicleInfo_GetVehicleData); @@ -82,7 +74,6 @@ void PolicyEventObserver::on_event(const event_engine::Event& event) { break; } default: { break; } -#endif } } diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc index b6b208b39b..be92c4803a 100644 --- a/src/components/application_manager/src/policies/policy_handler.cc +++ b/src/components/application_manager/src/policies/policy_handler.cc @@ -1080,12 +1080,7 @@ bool PolicyHandler::ReceiveMessageFromSDK(const std::string& file, SetDaysAfterEpoch(); event_observer_->subscribe_on_event( -#ifdef HMI_DBUS_API - hmi_apis::FunctionID::VehicleInfo_GetOdometer, correlation_id -#else - hmi_apis::FunctionID::VehicleInfo_GetVehicleData, correlation_id -#endif - ); + hmi_apis::FunctionID::VehicleInfo_GetVehicleData, correlation_id); std::vector<std::string> vehicle_data_args; vehicle_data_args.push_back(strings::odometer); MessageHelper::CreateGetVehicleDataRequest( diff --git a/src/components/application_manager/test/commands/hmi/dummy_hmi_commands_test.cc b/src/components/application_manager/test/commands/hmi/dummy_hmi_commands_test.cc index 7c95a4ca2f..a98e50fa82 100644 --- a/src/components/application_manager/test/commands/hmi/dummy_hmi_commands_test.cc +++ b/src/components/application_manager/test/commands/hmi/dummy_hmi_commands_test.cc @@ -241,27 +241,6 @@ #include "application_manager/commands/hmi/on_tts_reset_timeout_notification.h" #include "application_manager/commands/hmi/dial_number_request.h" #include "application_manager/commands/hmi/dial_number_response.h" -#include "application_manager/commands/hmi/on_vi_gps_data_notification.h" -#include "application_manager/commands/hmi/on_vi_speed_notification.h" -#include "application_manager/commands/hmi/on_vi_rpm_notification.h" -#include "application_manager/commands/hmi/on_vi_fuel_level_notification.h" -#include "application_manager/commands/hmi/on_vi_fuel_level_state_notification.h" -#include "application_manager/commands/hmi/on_vi_instant_fuel_consumption_notification.h" -#include "application_manager/commands/hmi/on_vi_external_temperature_notification.h" -#include "application_manager/commands/hmi/on_vi_vin_notification.h" -#include "application_manager/commands/hmi/on_vi_prndl_notification.h" -#include "application_manager/commands/hmi/on_vi_tire_pressure_notification.h" -#include "application_manager/commands/hmi/on_vi_odometer_notification.h" -#include "application_manager/commands/hmi/on_vi_belt_status_notification.h" -#include "application_manager/commands/hmi/on_vi_body_information_notification.h" -#include "application_manager/commands/hmi/on_vi_device_status_notification.h" -#include "application_manager/commands/hmi/on_vi_driver_braking_notification.h" -#include "application_manager/commands/hmi/on_vi_wiper_status_notification.h" -#include "application_manager/commands/hmi/on_vi_head_lamp_status_notification.h" -#include "application_manager/commands/hmi/on_vi_engine_torque_notification.h" -#include "application_manager/commands/hmi/on_vi_acc_pedal_position_notification.h" -#include "application_manager/commands/hmi/on_vi_steering_wheel_angle_notification.h" -#include "application_manager/commands/hmi/on_vi_my_key_notification.h" #include "application_manager/commands/hmi/ui_set_icon_request.h" #include "application_manager/mock_application.h" @@ -549,28 +528,7 @@ typedef Types<commands::hmi::OnButtonEventNotification, commands::OnVRLanguageChangeNotification, commands::OnTTSLanguageChangeNotification> HMICommandsListFourth; -typedef Types<commands::OnVIGpsDataNotification, - commands::OnVISpeedNotification, - commands::OnVIRpmNotification, - commands::OnVIFuelLevelNotification, - commands::OnVIFuelLevelStateNotification, - commands::OnVIInstantFuelConsumptionNotification, - commands::OnVIExternalTemperatureNotification, - commands::OnVIVinNotification, - commands::OnVIPrndlNotification, - commands::OnVITirePressureNotification, - commands::OnVIOdometerNotification, - commands::OnVIBeltStatusNotification, - commands::OnVIBodyInformationNotification, - commands::OnVIDeviceStatusNotification, - commands::OnVIDriverBrakingNotification, - commands::OnVIWiperStatusNotification, - commands::OnVIHeadLampStatusNotification, - commands::OnVIEngineTorqueNotification, - commands::OnVIAccPedalPositionNotification, - commands::OnVISteeringWheelAngleNotification, - commands::OnVIMyKeyNotification, - commands::AllowAllAppsRequest, +typedef Types<commands::AllowAllAppsRequest, commands::AllowAllAppsResponse, commands::AllowAppRequest, commands::AllowAppResponse> HMICommandsListFifth; diff --git a/src/components/application_manager/test/commands/hmi/hmi_notifications/hmi_notifications_test.cc b/src/components/application_manager/test/commands/hmi/hmi_notifications/hmi_notifications_test.cc index 5a40a4e582..488be9d6b4 100644 --- a/src/components/application_manager/test/commands/hmi/hmi_notifications/hmi_notifications_test.cc +++ b/src/components/application_manager/test/commands/hmi/hmi_notifications/hmi_notifications_test.cc @@ -42,28 +42,7 @@ #include "application_manager/commands/hmi/on_ui_command_notification.h" #include "application_manager/commands/hmi/on_ui_keyboard_input_notification.h" #include "application_manager/commands/hmi/on_ui_touch_event_notification.h" -#include "application_manager/commands/hmi/on_vi_acc_pedal_position_notification.h" -#include "application_manager/commands/hmi/on_vi_belt_status_notification.h" -#include "application_manager/commands/hmi/on_vi_body_information_notification.h" -#include "application_manager/commands/hmi/on_vi_device_status_notification.h" -#include "application_manager/commands/hmi/on_vi_driver_braking_notification.h" -#include "application_manager/commands/hmi/on_vi_engine_torque_notification.h" -#include "application_manager/commands/hmi/on_vi_external_temperature_notification.h" -#include "application_manager/commands/hmi/on_vi_fuel_level_notification.h" -#include "application_manager/commands/hmi/on_vi_fuel_level_state_notification.h" -#include "application_manager/commands/hmi/on_vi_gps_data_notification.h" -#include "application_manager/commands/hmi/on_vi_head_lamp_status_notification.h" -#include "application_manager/commands/hmi/on_vi_instant_fuel_consumption_notification.h" -#include "application_manager/commands/hmi/on_vi_my_key_notification.h" -#include "application_manager/commands/hmi/on_vi_odometer_notification.h" -#include "application_manager/commands/hmi/on_vi_prndl_notification.h" -#include "application_manager/commands/hmi/on_vi_rpm_notification.h" -#include "application_manager/commands/hmi/on_vi_speed_notification.h" -#include "application_manager/commands/hmi/on_vi_steering_wheel_angle_notification.h" -#include "application_manager/commands/hmi/on_vi_tire_pressure_notification.h" #include "application_manager/commands/hmi/on_vi_vehicle_data_notification.h" -#include "application_manager/commands/hmi/on_vi_vin_notification.h" -#include "application_manager/commands/hmi/on_vi_wiper_status_notification.h" #include "application_manager/commands/hmi/on_app_permission_changed_notification.h" #include "application_manager/commands/hmi/on_app_registered_notification.h" #include "application_manager/commands/hmi/on_audio_data_streaming_notification.h" @@ -339,29 +318,6 @@ class HMIOnNotificationsEventDispatcher NiceMock<event_engine_test::MockEventDispatcher> mock_event_dispatcher_; }; -typedef Types<OnVIAccPedalPositionNotification, - OnVIBeltStatusNotification, - OnVIBodyInformationNotification, - OnVIDeviceStatusNotification, - OnVIDriverBrakingNotification, - OnVIEngineTorqueNotification, - OnVIExternalTemperatureNotification, - OnVIFuelLevelNotification, - OnVIFuelLevelStateNotification, - OnVIGpsDataNotification, - OnVIHeadLampStatusNotification, - OnVIInstantFuelConsumptionNotification, - OnVIMyKeyNotification, - OnVIOdometerNotification, - OnVIPrndlNotification, - OnVIRpmNotification, - OnVISpeedNotification, - OnVISteeringWheelAngleNotification, - OnVITirePressureNotification, - OnVIVehicleDataNotification, - OnVIVinNotification, - OnVIWiperStatusNotification> HMIOnViNotificationsTypes; - typedef Types<OnAppPermissionChangedNotification, OnAudioDataStreamingNotification, hmi::OnButtonSubscriptionNotification, @@ -375,6 +331,8 @@ typedef Types<OnAppPermissionChangedNotification, OnVideoDataStreamingNotification, OnRecordStartdNotification> HMIOnNotificationsListToHMITypes; +typedef Types<OnVIVehicleDataNotification> HMIOnViNotificationsTypes; + typedef Types< CommandPair<OnAppActivatedNotification, hmi_apis::FunctionID::BasicCommunication_OnAppActivated>, diff --git a/src/components/application_manager/test/commands/mobile/get_vehicle_data_request_test.cc b/src/components/application_manager/test/commands/mobile/get_vehicle_data_request_test.cc index 52aed6feb8..c3ebbabae4 100644 --- a/src/components/application_manager/test/commands/mobile/get_vehicle_data_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/get_vehicle_data_request_test.cc @@ -85,10 +85,6 @@ class UnwrappedGetVehicleDataRequest : public GetVehicleDataRequest { using GetVehicleDataRequest::on_event; }; -#ifdef HMI_DBUS_API -// HMI_DBUS_API currently not supported -#else - TEST_F(GetVehicleDataRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) { GetVehicleDataRequestPtr command(CreateCommand<GetVehicleDataRequest>()); @@ -245,8 +241,6 @@ TEST_F(GetVehicleDataRequestTest, OnEvent_DataNotAvailable_SUCCESS) { command->on_event(event); } -#endif // HMI_DBUS_API - } // namespace get_vehicle_data_request } // namespace mobile_commands_test } // namespace commands_test diff --git a/src/components/dbus/CMakeLists.txt b/src/components/dbus/CMakeLists.txt index 211310d885..6e541126c2 100644 --- a/src/components/dbus/CMakeLists.txt +++ b/src/components/dbus/CMakeLists.txt @@ -55,24 +55,6 @@ set(LIBRARIES dbus-1 -L${DBUS_LIBS_DIRECTORY} ) -add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/message_descriptions.cc - COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/codegen/make_message_descriptions.py - --infile ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/QT_HMI_API.xml - --outdir ${CMAKE_CURRENT_BINARY_DIR} - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/QT_HMI_API.xml - ${CMAKE_CURRENT_SOURCE_DIR}/codegen/make_message_descriptions.py -) - -add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/introspection_xml.cc - COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/codegen/make_introspection_c.py - --infile ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/QT_HMI_API.xml - --outdir ${CMAKE_CURRENT_BINARY_DIR} - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/QT_HMI_API.xml - ${CMAKE_CURRENT_SOURCE_DIR}/codegen/make_introspection_c.py -) - add_library("DBus" ${SOURCES}) add_dependecnies("DBus" Utils install-3rd_party_dbus) diff --git a/src/components/dbus/codegen/code_formatter.py b/src/components/dbus/codegen/code_formatter.py deleted file mode 100644 index c3eb1b7815..0000000000 --- a/src/components/dbus/codegen/code_formatter.py +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# -# @file code_formatter.py -# @brief Utility that helps to manage indents in generated code -# -# This file is a part of HMI D-Bus layer. -# -# Copyright (c) 2013, Ford Motor Company -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# -# Redistributions of source code must retain the above copyright notice, this -# list of conditions and the following disclaimer. -# -# Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following -# disclaimer in the documentation and/or other materials provided with the -# distribution. -# -# Neither the name of the Ford Motor Company nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. - -class CodeBlock: - indent = 0 - def __init__(self, out): - self.out = out - if type(out) == file: - self.indent = 0 - elif type(out) == CodeBlock: - self.indent = out.indent - def __enter__(self): - self.indent += 1 - return self - def __exit__(self, exc_type, exc_value, traceback): - if self.indent >= 1: - self.indent -= 1 - def write(self, s): - for string in s.splitlines(True): - self.out.write(' ' * self.indent + string) - -# vim: set ts=4 sw=4 et: - diff --git a/src/components/dbus/codegen/ford_xml_parser.py b/src/components/dbus/codegen/ford_xml_parser.py deleted file mode 100644 index 4f9f222d24..0000000000 --- a/src/components/dbus/codegen/ford_xml_parser.py +++ /dev/null @@ -1,231 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# -# @file ford_xml_parser.py -# @brief Parser for HMI_API.xml -# -# This file is a part of HMI D-Bus layer. -# -# Copyright (c) 2013, Ford Motor Company -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# -# Redistributions of source code must retain the above copyright notice, this -# list of conditions and the following disclaimer. -# -# Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following -# disclaimer in the documentation and/or other materials provided with the -# distribution. -# -# Neither the name of the Ford Motor Company nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. - -from xml.etree import ElementTree -from collections import OrderedDict - -node_name = '/com/ford/hmi' - -class ParamDesc: - pass - -class FordXmlParser: - def __init__(self, in_el_tree, interface_path=None): - self.interface_path = interface_path - self.el_tree = in_el_tree - self.find_enums() - self.find_structs() - - def find_enums(self): - self.enums = dict() - for interface_el in self.el_tree.findall('interface'): - interface_name = interface_el.get('name') - for enum_el in interface_el.findall('enum'): - enum_name = enum_el.get('name') - self.enums[(interface_name,enum_name)] = enum_el - - - def make_param_desc(self, param_el, iface=None): - param_desc = ParamDesc() - param_desc.name = param_el.get('name') - param_desc.type = param_el.get('type') - param_desc.enum = False - param_desc.struct = False - param_desc.fulltype = param_desc.type - if param_el.get('mandatory') == 'false': - param_desc.mandatory = False - else: - param_desc.mandatory = True - if param_el.get('array') == 'true': - param_desc.array = True - else: - param_desc.array = False - param_desc.minValue = param_el.get('minvalue') if param_el.get('minvalue') else 0 - param_desc.maxValue = param_el.get('maxvalue') - param_desc.minLength = param_el.get('minlength') if param_el.get('minlength') else 0 - param_desc.maxLength = param_el.get('maxlength') - param_desc.minSize = param_el.get('minsize') - param_desc.maxSize = param_el.get('maxsize') - - param_desc.restricted = param_desc.minValue != None or \ - param_desc.maxValue != None or \ - param_desc.minLength > 0 or \ - param_desc.maxLength > 0 - param_desc.restrictedArray = param_desc.array and (param_desc.minSize > 0 or param_desc.maxSize > 0) - if iface is None: - return param_desc - if param_desc.type not in ['Integer', 'String', 'Boolean', 'Float']: - param_type = param_desc.type.split('.') - if len(param_type) > 1: - param_type = (param_type[0], param_type[1]) - else: - param_type = (iface, param_type[0]) - param_desc.fulltype = param_type - if param_type in self.enums: param_desc.enum = True - elif param_type in self.structs: param_desc.struct = True - return param_desc - - - def find_structs(self): - self.structs = OrderedDict() - for interface_el in self.el_tree.findall('interface'): - interface_name = interface_el.get('name') - for struct_el in interface_el.findall('struct'): - struct_name = struct_el.get('name') - self.structs[(interface_name, struct_name)] = [] - - for interface_el in self.el_tree.findall('interface'): - interface_name = interface_el.get('name') - for struct_el in interface_el.findall('struct'): - struct_name = struct_el.get('name') - for param_el in struct_el.findall('param'): - param_desc = self.make_param_desc(param_el, interface_name) - self.structs[(interface_name, struct_name)].append(param_desc) - - - def convert_struct_to_dbus(self, param_type): - ret = '(' - struct = self.structs[param_type] - for param in struct: - ret = ret + self.convert_to_dbus_type(param) - ret = ret + ')' - return ret - - - def convert_to_dbus_type(self, param): - if param.type == 'Integer': restype = 'i' - elif param.type == 'String': restype = 's' - elif param.type == 'Boolean': restype = 'b' - elif param.type == 'Float': restype = 'd' # D-Bus double - elif param.enum: restype = 'i' # D-Bus 32-bit signed int - elif param.struct: restype = self.convert_struct_to_dbus(param.fulltype) - else: raise RuntimeError('Unknown type: ' + param.type) - if param.array: restype = 'a' + restype - if not param.mandatory: restype = '(b' + restype + ')' - return restype - - - def find_notifications(self, interface_el): - notifications = list() - for function_el in interface_el.findall('function[@messagetype="notification"]'): - notifications.append(function_el) - return notifications - - - def find_notifications_by_provider(self, interface_el, provider): - notifications = list() - condition = 'function[@messagetype="notification"][@provider="%s"]' % provider - for function_el in interface_el.findall(condition): - notifications.append(function_el) - return notifications - - - def find_request_response_pairs(self, interface_el): - result = list() - request_els = interface_el.findall('function[@messagetype="request"]') - response_els = interface_el.findall('function[@messagetype="response"]') - for request_el in request_els: - name = request_el.get('name') - response_el = next(r for r in response_els if r.get('name') == name) - result.append((request_el, response_el)) - return result - - - def find_request_response_pairs_by_provider(self, interface_el, provider): - result = list() - condition = 'function[@messagetype="request"][@provider="%s"]' % provider - request_els = interface_el.findall(condition) - response_els = interface_el.findall('function[@messagetype="response"]') - for request_el in request_els: - name = request_el.get('name') - response_el = next(r for r in response_els if r.get('name') == name) - result.append((request_el, response_el)) - return result - - - def convert_to_signal(self, notification_el, interface): - result = ElementTree.Element('signal') - result.set('name', notification_el.get('name')) - for param_el in notification_el.findall('param'): - self.create_arg_element(result, param_el, interface) - return result - - - def convert_to_method(self, (request_el, response_el), interface): - result = ElementTree.Element('method') - result.set('name', request_el.get('name')) - for param_el in request_el.findall('param'): - arg_el = self.create_arg_element(result, param_el, interface) - arg_el.set('direction', 'in') - - arg_el = ElementTree.SubElement(result, 'arg') - arg_el.set('name', 'retCode') - arg_el.set('type', 'i') - arg_el.set('direction', 'out') - - for param_el in response_el.findall('param'): - arg_el = self.create_arg_element(result, param_el, interface) - arg_el.set('direction', 'out') - return result - - - def create_arg_element(self, parent, param_el, interface): - arg_el = ElementTree.SubElement(parent, 'arg') - arg_el.set('name', param_el.get('name')) - arg_el.set('type', self.convert_to_dbus_type(self.make_param_desc(param_el, interface))) - return arg_el - - - def create_introspection_iface_el(self, interface_el, provider): - interface = interface_el.get('name') - interface_name = self.interface_path + '.' + interface - - notifications = self.find_notifications_by_provider(interface_el, provider) - signals = [self.convert_to_signal(n, interface) for n in notifications] - - request_responses = self.find_request_response_pairs_by_provider(interface_el, provider) - methods = [self.convert_to_method(r, interface) for r in request_responses] - - if signals or methods: - el = ElementTree.Element('interface', attrib={'name':interface_name}) - for m in methods: el.append(m) - for s in signals: el.append(s) - return el - - - diff --git a/src/components/dbus/codegen/make_hmi_requests.py b/src/components/dbus/codegen/make_hmi_requests.py deleted file mode 100755 index 4716d40439..0000000000 --- a/src/components/dbus/codegen/make_hmi_requests.py +++ /dev/null @@ -1,343 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# -# @file make_qml_dbus_cpp.py -# @brief Generator of QML to QDbus C++ part -# -# This file is a part of HMI D-Bus layer. -# -# Copyright (c) 2014, Ford Motor Company -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# -# Redistributions of source code must retain the above copyright notice, this -# list of conditions and the following disclaimer. -# -# Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following -# disclaimer in the documentation and/or other materials provided with the -# distribution. -# -# Neither the name of the Ford Motor Company nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. - -from argparse import ArgumentParser -import os.path -from sys import argv -from xml.etree import ElementTree -from copy import copy -from ford_xml_parser import FordXmlParser, ParamDesc -from code_formatter import CodeBlock - -prefix_class_item = 'Declarative' -invoke_type_connection = 'Direct' - -def defaultValue(param): - if param.type == "Integer": - return "0" - elif param.type == "Float": - return "0.0" - elif param.type == "Boolean": - return "false" - elif param.enum: - return "0" - -class Impl(FordXmlParser): - def make_requests_classes_header(self, out): - for interface_el in self.el_tree.findall('interface'): - request_responses = self.find_request_response_pairs_by_provider(interface_el, "sdl") - for (request, response) in request_responses: - request_full_name = interface_el.get('name') + '_' +request.get('name') - out.write('class ' + request_full_name + ': public HMIRequest {\n') - with CodeBlock(out) as output: - output.write('Q_OBJECT\n') - out.write(' public:\n') - with CodeBlock(out) as output: - output.write(request_full_name + '(QJSValue hmi_callback, QDBusInterface *interface, QList<QVariant> args, QString name):\n') - output.write(' HMIRequest(hmi_callback, interface, args, name) {}\n') - out.write(' private:\n') - with CodeBlock(out) as output: - output.write('QJSValueList fillArgsList();\n};\n\n') - - - def make_header_file(self, out): - out.write("namespace requests {\n") - out.write("class HMIRequest: public QObject {\n") - with CodeBlock(out) as output: - output.write('Q_OBJECT\n') - out.write('public:\n') - with CodeBlock(out) as output: - output.write('HMIRequest(QJSValue hmi_callback, QDBusInterface *interface, QList<QVariant> args, QString name );\n') - out.write('protected:\n') - with CodeBlock(out) as output: - output.write('virtual QJSValueList fillArgsList() = 0;\n') - output.write('QDBusPendingCallWatcher *watcher_;\n') - output.write('QJSValue hmi_callback_;\n\n') - output.write('template<typename T>\n') - output.write('QJSValue CreateQJSValue(T value) {\n') - output.write(' return QJSValue(value);\n') - output.write('}\n\n') - output.write('template<typename T>\n') - output.write('QJSValue CreateQJSValue(QList<T> value) {\n') - with CodeBlock(output) as output: - output.write('QJSValue array = hmi_callback_.engine()->newArray();\n') - output.write('int i = 0;\n') - output.write('foreach (T item, value) {\n') - output.write(' QJSValue value = CreateQJSValue(item);\n') - output.write(' array.setProperty(i, value);\n') - output.write(' ++i;\n') - output.write('}\n') - output.write('return array;\n') - output.write('}\n') - out.write('private:\n') - with CodeBlock(out) as output: - output.write('QDBusInterface *interface_;\n') - output.write('QList<QVariant> args_;\n') - out.write('public slots:\n') - with CodeBlock(out) as output: - output.write('void invokeCallback();\n') - out.write('};\n\n') - output.write('template<>\n') - output.write('QJSValue HMIRequest::CreateQJSValue(QStringList value);\n') - for (interface_name, struct_name) in self.structs: - out.write('template<>\n') - out.write('QJSValue HMIRequest::CreateQJSValue(Common_' + struct_name + ' value);\n\n') - impl.make_requests_classes_header(out) - out.write("} // namespace requests\n") - - - def qt_param_type(self, param): - if not param.mandatory: - param_copy = copy(param) - param_copy.mandatory = True - return "OptionalArgument< " + self.qt_param_type(param_copy) + " >" - if param.array: - param_copy = copy(param) - param_copy.array = False - if param.type == 'String': - return "QStringList" - return "QList< " + self.qt_param_type(param_copy) + " >" - if param.type == 'Integer' or param.enum: - return 'int' - elif param.type == 'String': - return 'QString' - elif param.type == 'Boolean': - return 'bool' - elif param.type == 'Float': - return 'double' - elif param.struct: - return "_".join(param.fulltype) - return "xxx" - - - def make_requests_methods_source(self, out): - for interface_el in self.el_tree.findall('interface'): - request_responses = self.find_request_response_pairs_by_provider(interface_el, "sdl") - for (request, response) in request_responses: - iface_name = interface_el.get('name') - request_full_name = iface_name + '_' +request.get('name') - out.write('QJSValueList ' + request_full_name + '::fillArgsList() {\n') - out.write(' QDBusPendingReply< ') - count = 0 - for param_el in response.findall('param'): - param = self.make_param_desc(param_el, iface_name) - out.write(self.qt_param_type(param)) - count += 1 - if count < len(response.findall('param')): - out.write(',') - out.write(' > reply = *watcher_;\n') - - with CodeBlock(out) as out: - out.write('QJSValueList qjsValueList;\n\n') - out.write('QJSValue param;\n\n') - count = 0 - for param_el in response.findall('param'): - if param_el.get('mandatory') == 'false': - out.write('if (reply.argumentAt<' + str(count) + '>().presence) {\n') - out.write(' param = CreateQJSValue(reply.argumentAt<' + str(count) + '>().val);\n') - out.write('} else {\n') - out.write(' param = QJSValue();\n') - out.write('}\n') - out.write('qjsValueList.append(param);\n') - else: - out.write('param = CreateQJSValue(reply.argumentAt<' + str(count) + '>());\n') - out.write('qjsValueList.append(param);\n') - count += 1 - out.write('return qjsValueList;\n') - out.write('}\n\n') - - - def make_source_file(self, out): - out.write("namespace requests {\n") - for interface_el in self.el_tree.findall('interface'): - for struct_el in interface_el.findall('struct'): - out.write('template<>\n') - out.write('QJSValue HMIRequest::CreateQJSValue(Common_' + struct_el.get('name') + ' value){\n') - with CodeBlock(out) as output: - output.write('QJSValue object = hmi_callback_.engine()->newObject();\n') - for param_el in struct_el.findall('param'): - param_name = param_el.get('name') - if param_el.get('mandatory') == 'true': - with CodeBlock(out) as output: - output.write('object.setProperty("' + param_name + '", CreateQJSValue(value.' + param_name + '));\n') - elif param_el.get('mandatory') == 'false': - with CodeBlock(out) as output: - output.write('object.setProperty("' + param_name + '", value.' + param_name + '.presence ? CreateQJSValue(value.' + param_name + '.val) : QJSValue());\n') - out.write('return object;\n') - out.write('}\n\n') - - - out.write('HMIRequest::HMIRequest(QJSValue hmi_callback, QDBusInterface *interface, QList<QVariant> args, QString name) :\n') - out.write(' hmi_callback_(hmi_callback), interface_(interface), args_(args) {\n') - with CodeBlock(out) as output: - output.write('QDBusPendingCall pcall = interface->asyncCallWithArgumentList(name, args);\n') - output.write('watcher_ = new QDBusPendingCallWatcher(pcall);\n') - output.write('QObject::connect(watcher_, SIGNAL(finished(QDBusPendingCallWatcher*)), this, SLOT(invokeCallback()));\n}\n\n') - out.write('void HMIRequest::invokeCallback() {\n') - with CodeBlock(out) as output: - output.write('if (!hmi_callback_.isUndefined()) {\n') - with CodeBlock(output) as output: - output.write('QJSValueList qjsValueList;\n') - output.write('qjsValueList = this->fillArgsList();\n') - output.write('hmi_callback_.call(qjsValueList);\n') - output.write('}\n') - output.write('watcher_->deleteLater();\n') - output.write('this->deleteLater();\n}\n\n') - impl.make_requests_methods_source(out) - out.write("} // namespace requests\n") - - -arg_parser = ArgumentParser(description="Generator of Qt to QDbus C++ part") -arg_parser.add_argument('--infile', required=True, help="full name of input file, e.g. applink/src/components/interfaces/QT_HMI_API.xml") -arg_parser.add_argument('--version', required=False, help="Qt version 4.8.5 (default) or 5.1.0") -arg_parser.add_argument('--outdir', required=True, help="path to directory where output files request_to_sdl.h, request_to_sdl.cc will be saved") -args = arg_parser.parse_args() - -if args.version == "4.8.5": - prefix_class_item = 'Declarative' - invoke_type_connection = 'Direct' -elif args.version == "5.1.0": - prefix_class_item = 'Quick' - invoke_type_connection = 'BlockingQueued' - -header_name = 'hmi_requests.h' -source_name = 'hmi_requests.cc' - -in_tree = ElementTree.parse(args.infile) -in_tree_root = in_tree.getroot() - -impl = Impl(in_tree_root, 'com.ford.sdl.hmi') - -header_out = open(args.outdir + '/' + header_name, "w") -source_out = open(args.outdir + '/' + source_name, "w") - -header_out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0]) -header_out.write("""/** - * @file hmi_requests.h - * @brief Generated class that process requests from qtHMI - * - * This file is a part of HMI D-Bus layer. - */ -// Copyright (c) 2014, Ford Motor Company -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following -// disclaimer in the documentation and/or other materials provided with the -// distribution. -// -// Neither the name of the Ford Motor Company nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. - -""") -header_out.write("#ifndef SRC_COMPONENTS_QTHMI_QMLMODELQT5_HMIREQUESTS_\n"); -header_out.write("#define SRC_COMPONENTS_QTHMI_QMLMODELQT5_HMIREQUESTS_\n\n"); -header_out.write("#include <QObject>\n"); -header_out.write("#include <QJSValue>\n"); -header_out.write("#include <QDBusPendingCall>\n"); -header_out.write("#include <QDBusPendingCallWatcher>\n"); -header_out.write('#include <QDBusPendingReply>\n'); -header_out.write("#include <QDBusAbstractInterface>\n"); -header_out.write("#include <QDBusInterface>\n"); -header_out.write("#include <QJSEngine>\n"); - -header_out.write('#include "qml_dbus.h"\n\n'); - -impl.make_header_file(header_out) - -header_out.write("#endif // SRC_COMPONENTS_QTHMI_QMLMODELQT5_HMIREQUESTS_\n"); - -source_out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0]) -source_out.write("""/** - * @file hmi_requests.cc - * @brief Generated class that process requests from qtHMI - * - * This file is a part of HMI D-Bus layer. - */ -// Copyright (c) 2014, Ford Motor Company -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following -// disclaimer in the documentation and/or other materials provided with the -// distribution. -// -// Neither the name of the Ford Motor Company nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. - -""") -source_out.write('#include "hmi_requests.h"\n\n') -impl.make_source_file(source_out) diff --git a/src/components/dbus/codegen/make_introspection_c.py b/src/components/dbus/codegen/make_introspection_c.py deleted file mode 100755 index 22a53f308d..0000000000 --- a/src/components/dbus/codegen/make_introspection_c.py +++ /dev/null @@ -1,126 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# -# @file make_introspection_c.py -# @brief Converts introspection.xml to C-string -# -# This file is a part of HMI D-Bus layer. -# -# Copyright (c) 2013, Ford Motor Company -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# -# Redistributions of source code must retain the above copyright notice, this -# list of conditions and the following disclaimer. -# -# Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following -# disclaimer in the documentation and/or other materials provided with the -# distribution. -# -# Neither the name of the Ford Motor Company nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. - -from argparse import ArgumentParser -from ford_xml_parser import FordXmlParser -from ford_xml_parser import node_name -from xml.etree import ElementTree -from os import path -from sys import argv - -class Impl(FordXmlParser): - def convert_to_introspection(self, out_el_tree): - for interface_el in self.el_tree.findall('interface'): - el = self.create_introspection_iface_el(interface_el, 'sdl') - if el is not None: - out_el_tree.append(el) - -arg_parser = ArgumentParser(description='Converts introspection.xml to C-string') -arg_parser.add_argument('--infile', required=True, help="Full name of input file, e.g. applink/src/components/interfaces/QT_HMI_API.xml") -arg_parser.add_argument('--outdir', required=True, help="Path to directory where output file introspection_xml.cc will be saved") -args = arg_parser.parse_args() - -if not path.isdir(args.outdir): - makedirs(args.outdir) - -out_file = open(args.outdir + '/' + 'introspection_xml.cc', "w") - -in_tree = ElementTree.parse(args.infile) -in_tree_root = in_tree.getroot() -out_tree_root = ElementTree.Element('node', attrib={'name':node_name}) - -impl = Impl(in_tree_root, 'com.ford.hmi.sdl') -impl.convert_to_introspection(out_tree_root) - -introspection_string = '<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">' -introspection_string += "\n" -introspection_string += ElementTree.tostring(out_tree_root) - -out_file.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0]) -out_file.write("""/** - * @file instrospections_xml.cc - * @brief D-Bus introspection XML as C-string - * - * This file is a part of HMI D-Bus layer. - */ -// Copyright (c) 2013, Ford Motor Company -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following -// disclaimer in the documentation and/or other materials provided with the -// distribution. -// -// Neither the name of the Ford Motor Company nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. - -""") - -out_file.write("char introspection_xml[] = {") - -cnt = 0 -for char in introspection_string: - if cnt % 12 == 0: - out_file.write("\n ") - else: - out_file.write(" ") - out_file.write("0x%02x," % ord(char)) - cnt = cnt + 1 - -out_file.write(" 0x00\n") -out_file.write("};") - diff --git a/src/components/dbus/codegen/make_message_descriptions.py b/src/components/dbus/codegen/make_message_descriptions.py deleted file mode 100755 index 0079666392..0000000000 --- a/src/components/dbus/codegen/make_message_descriptions.py +++ /dev/null @@ -1,273 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# -# @file make_message_descriptions.py -# @brief Generates HMI API message descriptions for D-Bus -# -# This file is a part of HMI D-Bus layer. -# -# Copyright (c) 2013, Ford Motor Company -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# -# Redistributions of source code must retain the above copyright notice, this -# list of conditions and the following disclaimer. -# -# Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following -# disclaimer in the documentation and/or other materials provided with the -# distribution. -# -# Neither the name of the Ford Motor Company nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. - -from argparse import ArgumentParser -from xml.etree import ElementTree -from copy import copy -from ford_xml_parser import FordXmlParser -from os import path -from sys import argv - -namespace_name = 'ford_message_descriptions' -namespace = namespace_name + '::' - - -class Impl(FordXmlParser): - def write_param_definition(self, param_var_name, param, out): - if param.array: - tmp_param = copy(param) - tmp_param.array = False - tmp_param.mandatory = True - dbus_sig = self.convert_to_dbus_type(tmp_param) - self.write_param_definition(param_var_name + '_array', tmp_param, out) - - if param.array: out.write('const ' + namespace + 'ArrayDescription ') - elif param.struct: out.write('const ' + namespace + 'StructDescription ') - else: out.write('const ' + namespace + 'ParameterDescription ') - - out.write(param_var_name + " = {\n") - - if param.struct or param.array: - out.write(" {\n") - shift = ' ' * 4 - else: - shift = ' ' * 2 - - out.write(shift + "\"" + param.name + "\",\n") - - if param.array: - out.write(shift + namespace + "Array,\n") - elif param.struct: - out.write(shift + namespace + "Struct,\n") - elif param.enum: - out.write(shift + namespace + "Enum,\n") - else: - out.write(shift + namespace + param.type + ",\n") - - if param.mandatory: - out.write(shift + "true\n") - else: - out.write(shift + "false\n") - - if param.struct or param.array: - out.write(" },\n") - if param.array: - out.write(" (const " + namespace + "ParameterDescription*)&" + param_var_name + "_array,\n") - out.write(" \"" + dbus_sig + "\"\n") - elif param.struct: - out.write(" Structs::" + param.fulltype[0] + "__" + param.fulltype[1] + "__parameters\n") - out.write("};\n") - - - def write_struct_params_declarations(self, out): - out.write("struct Structs {\n"); - for (interface, name), params in self.structs.iteritems(): - params_var_name = interface + '__' + name + '__parameters' - out.write(" static const " + namespace + "ParameterDescription* " + params_var_name + "[];\n") - out.write("};\n\n") - - - def write_enum_entries_declarations(self, out): - out.write("struct Enums {\n"); - for interface, name in self.enums: - entries_var_name = interface + '__' + name + '__entries' - out.write(" static const " + namespace + "EnumDescription::Entry* " + entries_var_name + "[];\n") - out.write("};\n\n") - - - def write_parameters(self, params, out, name): - n = 1 - for param in params: - param_var_name = name + str(n) - n = n + 1 - self.write_param_definition(param_var_name, param, out) - - - def write_struct_params_definitions(self, out): - for (interface, name), params in self.structs.iteritems(): - param_var_name = interface + '__' + name + '__parameter' - self.write_parameters(params, out, param_var_name) - params_var_name = 'Structs::' + interface + '__' + name + '__parameters' - out.write("const " + namespace + "ParameterDescription* " + params_var_name + "[] = {\n") - for n in range(1, len(params) + 1): - name = param_var_name + str(n) - out.write(" (const " + namespace + "ParameterDescription*)&" + name + ",\n") - out.write( " NULL };\n\n") - - - def write_enum_entries_definitions(self, out): - for (interface, name), enum_el in self.enums.iteritems(): - n = 1 - for element_el in enum_el.findall('element'): - entry_var_name = interface + '__' + name + '__entry' + str(n) - value = element_el.get("value") - if value is None: - value = str(n) - out.write(namespace + "EnumDescription::Entry " + entry_var_name + " = {\"" + element_el.get("name") + "\", " + value + "};\n") - n = n + 1 - - entries_var_name = "Enums::" + interface + '__' + name + '__entries' - out.write("const " + namespace + "EnumDescription::Entry* " + entries_var_name + "[] = {\n") - for n in range(1, len(enum_el.findall('element')) + 1): - entry_var_name = interface + '__' + name + '__entry' + str(n) - out.write(" &" + entry_var_name + ",\n") - out.write(" NULL };\n\n") - - - def write_message_definition(self, message_el, interface, out): - name = message_el.get('name') - messagetype = message_el.get('messagetype') - params = list() - for param_el in message_el.findall('param'): - param_desc = self.make_param_desc(param_el, interface) - params.append(param_desc) - param_var_name = interface + '__' + name + '__' + messagetype + '__parameter' - self.write_parameters(params, out, param_var_name) - - params_var_name = param_var_name + 's' - out.write("const " + namespace + "ParameterDescription* " + params_var_name + "[] = {\n") - for n in range(1, len(params) + 1): - param_name = param_var_name + str(n) - out.write(" (const " + namespace + "ParameterDescription*)&" + param_name + ",\n") - out.write(" NULL };\n") - - message_desc_name = interface + '__' + name + '__' + messagetype - out.write("const " + namespace + "MessageDescription " + message_desc_name + " = {\n") - out.write(" \"" + interface + "\",\n") - out.write(" \"" + name + "\",\n") - out.write(" hmi_apis::messageType::" + messagetype + ",\n") - out.write(" hmi_apis::FunctionID::" + interface + "_" + name + ",\n") - out.write(" " + params_var_name + "\n") - out.write("};\n\n") - - - def write_message_definitions(self, out): - for interface_el in self.el_tree.findall('interface'): - interface = interface_el.get('name') - message_els = interface_el.findall('function') - for message_el in message_els: - self.write_message_definition(message_el, interface, out) - - - def make_message_descriptions(self, out): - self.write_struct_params_declarations(out) - #self.write_enum_entries_declarations(out) - self.write_struct_params_definitions(out) - #self.write_enum_entries_definitions(out) - self.write_message_definitions(out) - - - def make_message_array(self, out): - out.write("const MessageDescription* message_descriptions[] = {\n") - for interface_el in self.el_tree.findall('interface'): - interface = interface_el.get('name') - message_els = interface_el.findall('function') - for message_el in message_els: - name = message_el.get('name') - messagetype = message_el.get('messagetype') - message_desc_name = interface + '__' + name + '__' + messagetype - out.write(" &" + message_desc_name + ",\n") - out.write(" NULL\n") - out.write("};\n") - - -arg_parser = ArgumentParser(description="Generates HMI API message descriptions for D-Bus on SDL core side") -arg_parser.add_argument('--infile', required=True, help="full name of input file, e.g. applink/src/components/interfaces/QT_HMI_API.xml") -arg_parser.add_argument('--outdir', required=True, help="path to directory where output file message_descriptions.cc will be saved") -args = arg_parser.parse_args() - -if not path.isdir(args.outdir): - makedirs(args.outdir) - -outfile = 'message_descriptions.cc' - -in_tree = ElementTree.parse(args.infile) -in_tree_root = in_tree.getroot() - -impl = Impl(in_tree_root) - -out = open(args.outdir + "/" + outfile, "w") - -out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0]) -out.write("""/** - * @file message_descriptions.cc - * @brief Generated HMI API message descriptions for D-Bus - * - * This file is a part of HMI D-Bus layer. - */ -// Copyright (c) 2013, Ford Motor Company -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following -// disclaimer in the documentation and/or other materials provided with the -// distribution. -// -// Neither the name of the Ford Motor Company nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. - -""") - -out.write("#include \"dbus/message_descriptions.h\"\n\n"); -out.write("namespace {\n\n"); -impl.make_message_descriptions(out) -out.write("}\n\n"); - -out.write("namespace " + namespace_name + " {\n\n"); -impl.make_message_array(out) -out.write("}\n\n"); - diff --git a/src/components/dbus/codegen/make_notifications_qml.py b/src/components/dbus/codegen/make_notifications_qml.py deleted file mode 100755 index 3c173e8b4f..0000000000 --- a/src/components/dbus/codegen/make_notifications_qml.py +++ /dev/null @@ -1,387 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# -# @file make_qml_dbus_cpp.py -# @brief Generator of QML to QDbus C++ part -# -# This file is a part of HMI D-Bus layer. -# -# Copyright (c) 2014, Ford Motor Company -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# -# Redistributions of source code must retain the above copyright notice, this -# list of conditions and the following disclaimer. -# -# Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following -# disclaimer in the documentation and/or other materials provided with the -# distribution. -# -# Neither the name of the Ford Motor Company nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. - -from argparse import ArgumentParser -import os.path -from sys import argv -from xml.etree import ElementTree -from copy import copy -from ford_xml_parser import FordXmlParser, ParamDesc -from code_formatter import CodeBlock - -class Notifications_qml(FordXmlParser): - #Used for qt signal names, because qt signals cannot begin with a capital letter - def first_letter_to_lower_case(self, s): - if len(s) == 0: - return s - else: - return s[0].lower() + s[1:] - - def make_header(self, out): - out.write("class SdlProxy: public Item {\n") - with CodeBlock(out) as out: - out.write("Q_OBJECT\n") - out.write("Q_DISABLE_COPY(SdlProxy)\n") - out.write("public:\n") - out.write("explicit SdlProxy(Item* parent = 0);\n") - out.write("private:\n") - out.write("QDBusInterface *sdlBasicCommunicationInterface;\n") - out.write("signals:\n") - for interface_el in self.el_tree.findall('interface'): - iface_name = interface_el.get('name') - notifications = self.find_notifications_by_provider(interface_el, "sdl") - for notification_el in notifications: - with CodeBlock(out) as out: - out.write("void %s(" % self.first_letter_to_lower_case( notification_el.get("name")) ) - param_el_count = 1 - list_of_params = notification_el.findall("param") - list_of_params_len = len(list_of_params) - for param_el in list_of_params: - param = self.make_param_desc(param_el, iface_name) - out.write("QVariant %s" % param_el.get("name")) - if param_el_count < list_of_params_len: - out.write(", ") - param_el_count += 1 - out.write(");\n") - with CodeBlock(out) as out: - out.write("private slots:\n") - for interface_el in self.el_tree.findall('interface'): - iface_name = interface_el.get('name') - notifications = self.find_notifications_by_provider(interface_el, "sdl") - for notification_el in notifications: - with CodeBlock(out) as out: - out.write("void slot_%s(" % notification_el.get("name")) - param_el_count = 1 - list_of_params = notification_el.findall("param") - list_of_params_len = len(list_of_params) - for param_el in list_of_params: - param = self.make_param_desc(param_el, iface_name) - out.write("%s %s" % (self.qt_param_type(param), param_el.get("name"))) - if param_el_count < list_of_params_len: - out.write(", ") - param_el_count += 1 - out.write(");\n") - out.write("};\n") - - - def qt_param_type(self, param): - if not param.mandatory: - param_copy = copy(param) - param_copy.mandatory = True - return "OptionalArgument< " + self.qt_param_type(param_copy) + " >" - if param.array: - param_copy = copy(param) - param_copy.array = False - if param.type == 'String': - return "QStringList" - return "QList< " + self.qt_param_type(param_copy) + " >" - if param.type == 'Integer' or param.enum: - return 'int' - elif param.type == 'String': - return 'QString' - elif param.type == 'Boolean': - return 'bool' - elif param.type == 'Float': - return 'double' - elif param.struct: - return "_".join(param.fulltype) - else: - raise RuntimeError('Unknown type: ' + param.type) - - - def qml_param_type(self, param): - if not param.mandatory: - return "QVariant" - if param.array: - return "QVariant" - if param.type == 'Integer' or param.enum: - return 'int' - elif param.type == 'String': - return 'QString' - elif param.type == 'Boolean': - return 'bool' - elif param.type == 'Float': - return 'double' - elif param.struct: - return "QVariant" - else: - raise RuntimeError('Unknown type: ' + param.type) - - - def make_source(self, out): - def qml_args(variable_name_needed): - param_el_count = 1 - list_of_params = notification_el.findall("param") - list_of_params_len = len(list_of_params) - for param_el in list_of_params: - param = self.make_param_desc(param_el, iface_name) - if variable_name_needed: - out.write("%s %s" % (self.qt_param_type(param), param_el.get("name"))) - else: - out.write("%s" % self.qt_param_type(param)) - if param_el_count < list_of_params_len: - out.write(", ") - param_el_count += 1 - out.write("SdlProxy::SdlProxy(Item *parent): Item(parent) {\n") - for interface_el in self.el_tree.findall('interface'): - iface_name = interface_el.get('name') - notifications = self.find_notifications_by_provider(interface_el, "sdl") - for notification_el in notifications: - notification_name = notification_el.get('name') - with CodeBlock(out) as out: - out.write("QDBusConnection::sessionBus().connect(\n") - with CodeBlock(out) as out: - out.write("\"com.ford.sdl.core\", \"/\", \"com.ford.sdl.core.%s\",\n" % iface_name) - out.write("\"%s\", this, SLOT(slot_%s(" % (notification_name, notification_el.get("name"))) - qml_args(variable_name_needed = False) - out.write(")));\n") - out.write("}\n\n") - for interface_el in self.el_tree.findall('interface'): - iface_name = interface_el.get('name') - notifications = self.find_notifications_by_provider(interface_el, "sdl") - for notification_el in notifications: - notific_full_name = interface_el.get("name") + "_" + notification_el.get("name") - out.write("void SdlProxy::slot_%s(" % notification_el.get("name")) - qml_args(variable_name_needed = True) - out.write(") {\n") - with CodeBlock(out) as out: - out.write("LOG4CXX_TRACE(logger_, \"ENTER\");\n\n") - for param_el in notification_el.findall("param"): - param = self.make_param_desc(param_el, iface_name) - tmp_param_name = param.name + "_qvariant" - out.write("QVariant %s;\n" % tmp_param_name) - out.write("%s = ValueToVariant(%s);\n" % (tmp_param_name, param.name)) - self.write_param_validation(param, param.name, "\nLOG4CXX_ERROR(logger_, \"%s in %s out of bounds\")" % (param.name, notific_full_name), out) - out.write("\n") - out.write("emit %s(" % self.first_letter_to_lower_case( notification_el.get("name")) ) - param_el_count = 1 - list_of_params = notification_el.findall("param") - list_of_params_len = len(list_of_params) - for param_el in list_of_params: - param = self.make_param_desc(param_el, iface_name) - out.write("%s" % param.name + "_qvariant") - if param_el_count < list_of_params_len: - out.write(", ") - param_el_count += 1 - out.write(");\n") - with CodeBlock(out) as out: - out.write("LOG4CXX_TRACE(logger_, \"EXIT\");\n") - out.write("}\n\n") - - - - def write_param_validation(self, param, param_name, fail_statement, out, level=0): - if not param.mandatory and (param.restricted or param.restrictedArray or (param.struct and any(map(lambda x: x.restricted, self.structs[param.fulltype])))): - out.write("if (%s.presence) {\n" % param_name) - param_copy = copy(param) - param_copy.mandatory = True - with CodeBlock(out) as out: - self.write_param_validation(param_copy, param_name + ".val", fail_statement, out, level+1) - out.write("}\n") - elif param.array: - if param.minSize > 0: - out.write("if ({0}.count() < {1}) {{".format(param_name, param.minSize)) - with CodeBlock(out) as out: - out.write("{0};\n".format(fail_statement)) - out.write("}\n") - if param.maxSize != None: - out.write("if ({0}.count() > {1}) {{".format(param_name, param.maxSize)) - with CodeBlock(out) as out: - out.write("{0};\n".format(fail_statement)) - out.write("}\n") - if param.restricted: - out.write('for ({0}::const_iterator it_{2} = {1}.begin(); it_{2} != {1}.end(); ++it_{2}) {{\n'.format(self.qt_param_type(param), param_name, level)) - with CodeBlock(out) as out: - param_copy = copy(param) - param_copy.array = False - self.write_param_validation(param_copy, "(*it_{0})".format(level), fail_statement, out, level+1) - out.write("}\n") - elif param.struct: - for p in self.structs[param.fulltype]: - self.write_param_validation(p, "{0}.{1}".format(param_name, p.name), fail_statement, out, level+1) - elif param.type == "Integer" or param.type == "Float": - conditions = [] - if (param.minValue != None): - conditions.append("(%s < %s)" % (param_name, param.minValue)) - if (param.maxValue != None): - conditions.append("(%s > %s)" % (param_name, param.maxValue)) - if conditions: - out.write('if (%s) {' % ' || '.join(conditions)) - with CodeBlock(out) as out: - out.write('%s;\n' % fail_statement) - out.write("}\n") - elif param.type == "String": - conditions = [] - if (param.minLength > 0): - conditions.append("(%s.size() < %s)" % (param_name, param.minLength)) - if (param.maxLength > 0): - conditions.append("(%s.size() > %s)" % (param_name, param.maxLength)) - if conditions: - out.write('if (%s) {' % ' || '.join(conditions)) - with CodeBlock(out) as out: - out.write('%s;\n' % (fail_statement)) - out.write("}\n") - - -#QVarian name; -#if (ttsName.presence) { - - - -arg_parser = ArgumentParser(description="Generator of classes which Qt to QDbus C++ part") -arg_parser.add_argument('--infile', required=True, help="full name of input file, e.g. applink/src/components/interfaces/QT_HMI_API.xml") -arg_parser.add_argument('--version', required=False, help="Qt version 4.8.5 (default) or 5.1.0") -arg_parser.add_argument('--outdir', required=True, help="path to directory where output files request_to_sdl.h, request_to_sdl.cc will be saved") -args = arg_parser.parse_args() - - -if args.version == "4.8.5": - prefix_class_item = 'Script' - invoke_type_connection = 'Direct' -elif args.version == "5.1.0": - prefix_class_item = 'JS' - invoke_type_connection = 'BlockingQueued' -else: - prefix_class_item = 'JS' - invoke_type_connection = 'BlockingQueued' - -header_name = 'sdl_proxy.h' -source_name = 'sdl_proxy.cc' - -in_tree = ElementTree.parse(args.infile) -in_tree_root = in_tree.getroot() - -impl = Notifications_qml(in_tree_root, 'com.ford.sdl.hmi') - -header_out = open(args.outdir + '/' + header_name, "w") -source_out = open(args.outdir + '/' + source_name, "w") - -header_out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0]) -header_out.write(""" -/* - Copyright (c) 2014, Ford Motor Company - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following - disclaimer in the documentation and/or other materials provided with the - distribution. - - Neither the name of the Ford Motor Company nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ -""") -header_out.write("#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_SDL_PROXY_H_\n") -header_out.write("#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_SDL_PROXY_H_\n\n") -header_out.write("#include \"qml_dbus.h\"\n") -header_out.write("#include \"qt_version.h\"\n\n") -header_out.write("#include <QtCore/QVariant>\n") -header_out.write("#include <QtDBus/QDBusInterface>\n") -header_out.write("#if QT_4\n") -header_out.write("#include <QtDeclarative/QDeclarativeItem>\n") -header_out.write("typedef QDeclarativeItem Item;\n") -header_out.write("#elif QT_5\n") -header_out.write("#include <QtQuick/QQuickItem>\n") -header_out.write("typedef QQuickItem Item;\n") -header_out.write("#endif // QT_VERSION\n") - -impl.make_header(header_out) - -header_out.write("#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_REQUEST_TO_SDL_H_") - - -source_out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0]) -source_out.write(""" -/* - Copyright (c) 2014, Ford Motor Company - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following - disclaimer in the documentation and/or other materials provided with the - distribution. - - Neither the name of the Ford Motor Company nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ - -""") - -source_out.write("#include \"sdl_proxy.h\"\n") -source_out.write("#include \"utils/logger.h\"\n") -source_out.write("CREATE_LOGGERPTR_GLOBAL(logger_, \"DBusPlugin\")\n\n") - -impl.make_source(source_out) diff --git a/src/components/dbus/codegen/make_qml_dbus_cpp.py b/src/components/dbus/codegen/make_qml_dbus_cpp.py deleted file mode 100755 index f40bc74df8..0000000000 --- a/src/components/dbus/codegen/make_qml_dbus_cpp.py +++ /dev/null @@ -1,736 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# -# @file make_qml_dbus_cpp.py -# @brief Generator of QML to QDbus C++ part -# -# This file is a part of HMI D-Bus layer. -# -# Copyright (c) 2013, Ford Motor Company -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# -# Redistributions of source code must retain the above copyright notice, this -# list of conditions and the following disclaimer. -# -# Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following -# disclaimer in the documentation and/or other materials provided with the -# distribution. -# -# Neither the name of the Ford Motor Company nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. - -from argparse import ArgumentParser -import os.path -from sys import argv -from xml.etree import ElementTree -from copy import copy -from ford_xml_parser import FordXmlParser, ParamDesc -from code_formatter import CodeBlock - -prefix_class_item = 'Declarative' -invoke_type_connection = 'Direct' - -def defaultValue(param): - if param.type == "Integer": - return "0" - elif param.type == "Float": - return "0.0" - elif param.type == "Boolean": - return "false" - elif param.enum: - return "0" - -class Impl(FordXmlParser): - def make_dbus_type_declarations(self, out): - for struct in self.structs.items(): - self.write_struct_declaration(struct, out) - - def make_dbus_metatype_declarations(self, out): - for struct in self.structs.items(): - self.write_struct_metatype_declaration(struct, out) - - - def write_struct_declaration(self, ((iface, name), params), out): - struct_name = "{0}_{1}".format(iface, name) - out.write("struct {0} {{\n".format(struct_name)) - with CodeBlock(out) as out: - for param in params: - out.write("{0} {1};\n".format(self.qt_param_type(param), param.name)) - out.write("{0}()\n".format(struct_name)) - initializersList = map(lambda x: "{0}({1})".format(x.name, defaultValue(x)), [p for p in params if p.type != "String" and not p.struct and not p.array]) - if initializersList: - out.write(": " + ",\n ".join(initializersList)) - - out.write("{ }\n") - - out.write("};\n") - out.write('QDBusArgument& operator << (QDBusArgument&, const ' + struct_name + "&);\n") - out.write('const QDBusArgument& operator >> (const QDBusArgument&, ' + struct_name + "&);\n") - out.write('void PutArgToMap(QVariantMap& map, const char* name, const ' + struct_name + "& v);\n") - out.write('QVariant ValueToVariant(const ' + struct_name + "& v);\n") - out.write('QVariant ValueToVariant(const QList<' + struct_name + " >& v);\n") - out.write('bool GetArgFromMap(const QVariantMap& map, const char* name, ' + struct_name + "& v);\n") - out.write('bool VariantToValue(const QVariant& variant, ' + struct_name + "& v);\n") - out.write('bool VariantToValue(const QVariant& variant, QList<' + struct_name + " >& v);\n") - - - def write_struct_metatype_declaration(self, ((iface, name), params), out): - struct_name = iface + '_' + name - out.write('Q_DECLARE_METATYPE(' + struct_name + ")\n") - out.write('Q_DECLARE_METATYPE(OptionalArgument<' + struct_name + ">)\n") - out.write('Q_DECLARE_METATYPE(QList<' + struct_name + ">)\n") - out.write('Q_DECLARE_METATYPE(OptionalArgument<QList<' + struct_name + "> >)\n\n") - - - def make_dbus_type_definitions(self, out): - for struct in self.structs.items(): - self.write_struct_definition(struct, out) - - def write_struct_definition(self, ((iface, name), params), out): - struct_name = iface + '_' + name - - out.write('QDBusArgument& operator << (QDBusArgument& arg, const ' + struct_name + "& v) {\n") - with CodeBlock(out) as out: - out.write("arg.beginStructure();\n") - for param in params: - out.write("arg << v.{0};\n".format(param.name)) - out.write("arg.endStructure();\n") - out.write("return arg;\n") - out.write("}\n\n") - - out.write('const QDBusArgument& operator >> (const QDBusArgument& arg, ' + struct_name + "& v) {\n") - with CodeBlock(out) as out: - out.write("arg.beginStructure();\n") - for param in params: - out.write("arg >> v.{0};\n".format(param.name)) - out.write("arg.endStructure();\n") - out.write("return arg;\n") - out.write("}\n\n") - - out.write('QVariant ValueToVariant(const ' + struct_name + "& v) {\n") - with CodeBlock(out) as out: - out.write("QVariantMap map;\n") - for param in params: - out.write("""PutArgToMap(map, "{0}", v.{0});\n""".format(param.name)) - out.write("return QVariant::fromValue(map);\n") - out.write("}\n\n") - - out.write('QVariant ValueToVariant(const QList<' + struct_name + ">& v) {\n") - with CodeBlock(out) as out: - out.write("QList<QVariant> ret;\n") - out.write("for (QList<{0}>::const_iterator i = v.begin(); i != v.end(); ++i)\n".format(struct_name)) - with CodeBlock(out) as out: - out.write("ret.append(ValueToVariant(*i));\n") - out.write("return QVariant::fromValue(ret);\n") - out.write("}\n\n") - - out.write('void PutArgToMap(QVariantMap& map, const char* name, const ' + struct_name + "& v) {\n") - with CodeBlock(out) as out: - out.write("map.insert(name, ValueToVariant(v));\n") - out.write("}\n\n") - - out.write('bool VariantToValue(const QVariant& variant, ' + struct_name + "& v) {\n") - with CodeBlock(out) as out: - out.write("if (variant.type() != QVariant::Map) {\n") - with CodeBlock(out) as out: - out.write("""LOG4CXX_ERROR(logger_, "Input argument isn't a map");\n""") - out.write("return false;\n") - out.write("}\n") - out.write("QVariantMap map = variant.toMap();\n") - for param in params: - out.write("if (!GetArgFromMap(map, \"" + param.name + "\", v." + param.name + ")) return false;\n") - out.write("return true;\n") - out.write("}\n\n") - - out.write('bool VariantToValue(const QVariant& variant, QList<' + struct_name + ">& v) {\n") - with CodeBlock(out) as out: - out.write("if (variant.type() != QVariant::List) {\n") - with CodeBlock(out) as out: - out.write("""LOG4CXX_ERROR(logger_, "Input argument isn't a list");\n""") - out.write("return false;\n") - out.write("}\n") - out.write("QList<QVariant> list = variant.toList();\n") - out.write("for (QList<QVariant>::const_iterator i = list.begin(); i != list.end(); ++i) {\n"); - with CodeBlock(out) as out: - out.write(struct_name + " s;\n"); - out.write("if (!VariantToValue(*i, s)) return false;\n"); - out.write("v.append(s);\n"); - out.write("}\n") - out.write("return true;\n") - out.write("}\n\n") - - out.write('bool GetArgFromMap(const QVariantMap& map, const char* name, ' + struct_name + "& v) {\n") - with CodeBlock(out) as out: - out.write("QVariantMap::const_iterator it = map.find(name);\n") - out.write("if (map.end() == it) {\n") - with CodeBlock(out) as out: - out.write("""LOG4CXX_WARN(logger_, "Argument '" << name << "' not found");\n""") - out.write("return false;\n") - out.write("}\n") - out.write("if (it->type() != QVariant::Map) {\n") - with CodeBlock(out) as out: - out.write("""LOG4CXX_ERROR(logger_, "Argument '" << name << "' isn't a map");\n""") - out.write("return false;\n") - out.write("}\n") - out.write("const QVariantMap& inmap = it->toMap();\n") - for param in params: - out.write("if (!GetArgFromMap(inmap, \"" + param.name + "\", v." + param.name + ")) return false;\n") - out.write("return true;\n") - out.write("}\n\n") - - def write_param_validation(self, param, param_name, fail_statement, out, level=0): - if not param.mandatory and (param.restricted or param.restrictedArray or (param.struct and any(map(lambda x: x.restricted, self.structs[param.fulltype])))): - out.write("if (%s.presence) {\n" % param_name) - param_copy = copy(param) - param_copy.mandatory = True - with CodeBlock(out) as out: - self.write_param_validation(param_copy, param_name + ".val", fail_statement, out, level+1) - out.write("}\n") - elif param.array: - if param.minSize > 0: - out.write("if ({0}.count() < {1}) {{ {2}; }}\n".format(param_name, param.minSize, fail_statement)) - if param.maxSize != None: - out.write("if ({0}.count() > {1}) {{ {2}; }}\n".format(param_name, param.maxSize, fail_statement)) - if param.restricted: - out.write('for ({0}::const_iterator it_{2} = {1}.begin(); it_{2} != {1}.end(); ++it_{2}) {{\n'.format(self.qt_param_type(param), param_name, level)) - with CodeBlock(out) as out: - param_copy = copy(param) - param_copy.array = False - self.write_param_validation(param_copy, "(*it_{0})".format(level), fail_statement, out, level+1) - out.write("}\n") - elif param.struct: - for p in self.structs[param.fulltype]: - self.write_param_validation(p, "{0}.{1}".format(param_name, p.name), fail_statement, out, level+1) - elif param.type == "Integer" or param.type == "Float": - conditions = [] - if (param.minValue != None): - conditions.append("(%s < %s)" % (param_name, param.minValue)) - if (param.maxValue != None): - conditions.append("(%s > %s)" % (param_name, param.maxValue)) - if conditions: - out.write('if (%s) { %s; }\n' % (' || '.join(conditions), fail_statement)) - elif param.type == "String": - conditions = [] - if (param.minLength > 0): - conditions.append("(%s.size() < %s)" % (param_name, param.minLength)) - if (param.maxLength > 0): - conditions.append("(%s.size() > %s)" % (param_name, param.maxLength)) - if conditions: - with CodeBlock(out) as out: - out.write('if (%s) { %s;\n }\n' % (' || '.join(conditions), fail_statement)) - - def qt_param_type(self, param): - if not param.mandatory: - param_copy = copy(param) - param_copy.mandatory = True - return "OptionalArgument< " + self.qt_param_type(param_copy) + " >" - if param.array: - param_copy = copy(param) - param_copy.array = False - if param.type == 'String': - return "QStringList" - return "QList< " + self.qt_param_type(param_copy) + " >" - if param.type == 'Integer' or param.enum: - return 'int' - elif param.type == 'String': - return 'QString' - elif param.type == 'Boolean': - return 'bool' - elif param.type == 'Float': - return 'double' - elif param.struct: - return "_".join(param.fulltype) - return "xxx" - - - def from_variant_func_name(self, param, interface): - prefix = '' - if not param.mandatory: - param_copy = copy(param) - param_copy.mandatory = True - return 'opt_' + self.from_variant_func_name(param_copy, interface) - if param.array: - param_copy = copy(param) - param_copy.array = False - return 'arr_' + self.from_variant_func_name(param_copy, interface) - - if param.type in ['Integer', 'String', 'Boolean', 'Float']: - param_type = param.type - else: - param_type = param.type.split('.') - if len(param_type) > 1: - param_type = (param_type[0], param_type[1]) - else: - param_type = (interface, param_type[0]) - if param_type in self.structs: - param_type = param_type[0] + '_' + param_type[1] - elif param_type in self.enums: - param_type = 'Integer' - return param_type + '_from_variant' - - - def make_method_signature(self, request, response, interface, add_classname): - in_params = [self.make_param_desc(x, interface) for x in request.findall('param')] - out_params = [self.make_param_desc(x, interface) for x in response.findall('param')] - - signature_len = len(''.join(map(lambda x: self.convert_to_dbus_type(x), in_params + out_params))) - if signature_len > 255: - raise RuntimeError("Too long signature of {0} method. Maximum valid length is 255, actual is {1}", request.get('name'), signature_len) - - return "int {0}{1} ({2}{3}const QDBusMessage& message, QString& userMessage_out{4}{5})".format( - interface + "Adaptor::" if add_classname else "", - request.get('name'), - ", ".join(map(lambda x: "const {0}& {1}_in".format(self.qt_param_type(x), x.name), in_params)), - ", " if in_params else "", - ", " if out_params else "", - ", ".join(map(lambda x: "{0}& {1}_out".format(self.qt_param_type(x), x.name), out_params))) - - - def make_signal_signature(self, signal, interface, add_void): - params = signal.findall('param') - if add_void: - retstr = 'void ' - else: - retstr = '' - retstr = retstr + signal.get('name') + '(' - params_num = len(params) - for i in range(0, params_num): - param_desc = self.make_param_desc(params[i], interface) - param_type = self.qt_param_type(param_desc) - retstr = retstr + param_type + ' ' + param_desc.name - if i <> params_num - 1: retstr = retstr + ", " - retstr = retstr + ')' - return retstr - - - def make_qml_signal_signature(self, signal, interface, name, short=False, add_classname=False): - params = signal.findall('param') - if short: - retstr = '' - else: - retstr = 'void ' - if add_classname: - retstr = retstr + interface + 'Adaptor::' - retstr = retstr + name + '(' - params_num = len(params) - for i in range(0, params_num): - param_desc = self.make_param_desc(params[i], interface) - if param_desc.struct or param_desc.array or not param_desc.mandatory: typ = 'QVariant' - elif param_desc.type == 'Integer' or param_desc.enum: typ = 'int' - elif param_desc.type == 'Boolean': typ = 'bool' - elif param_desc.type == 'Float': typ = 'double' - elif param_desc.type == 'String': typ = 'QString' - else: typ = 'QVariant' - retstr = retstr + typ - if not short: retstr = retstr + ' ' + param_desc.name - if i <> params_num - 1: retstr = retstr + ", " - retstr = retstr + ')' - return retstr - - - def write_adaptor_declaration(self, interface_el, notifications, request_responses, out): - global prefix_class_item - def glue_strings(strings): - ret = list() - curstr = '' - for str in strings: - curstr = curstr + str - if(str[-1] == '>'): - ret.append(curstr) - curstr = '' - return ret - ifacename = interface_el.get('name') - out.write("class " + ifacename + "Adaptor : public QDBusAbstractAdaptor {\n"); - out.write(" Q_OBJECT\n"); - out.write(" Q_CLASSINFO(\"D-Bus Interface\", \"" + self.interface_path + '.' + ifacename + "\")\n"); - out.write(" Q_CLASSINFO(\"D-Bus Introspection\",\n"); - introspection_el = self.create_introspection_iface_el(interface_el, 'hmi') - introspection = glue_strings(ElementTree.tostringlist(introspection_el)) - for str in introspection: - str = str.replace('"', '\\"') - out.write('"' + str + '"' + "\n") - out.write(" )\n") - out.write(" public:\n") - out.write(" explicit " + ifacename + "Adaptor(QObject *parent = 0);\n") - out.write(" void SetApi(Q%sItem*);\n" % prefix_class_item) - out.write(" DBusController *dbusController;\n") - out.write(" public slots:\n") - for (request, response) in request_responses: - signature = self.make_method_signature(request, response, ifacename, False) - out.write(" " + signature + ";\n") - out.write(" signals:\n") - for n in notifications: - signature = self.make_signal_signature(n, ifacename, True) - out.write(" " + signature + ";\n") - out.write(" private slots:\n") - for n in notifications: - signature = self.make_qml_signal_signature(n, ifacename, n.get('name') + '_qml', False) - out.write(" " + signature + ";\n") - out.write(" private:\n") - out.write(" Q%sItem* api_;\n" % prefix_class_item) - out.write("};\n\n"); - - def write_adaptor_definition(self, interface_el, notifications, request_responses, out): - global prefix_class_item - iface_name = interface_el.get('name') - classname = iface_name + 'Adaptor' - out.write("{0}::{0}(QObject* parent) : QDBusAbstractAdaptor(parent) {{}}\n".format(classname)) - - out.write("void {0}::SetApi(Q{1}Item* api) {{\n".format(classname, prefix_class_item)) - with CodeBlock(out) as out: - out.write("api_ = api;\n") - for n in notifications: - signame = n.get('name') - signame = signame[:1].lower() + signame[1:] - slotname = n.get('name') + '_qml' - sig_signature = self.make_qml_signal_signature(n, iface_name, signame, True) - slot_signature = self.make_qml_signal_signature(n, iface_name, slotname, True) - out.write("connect(api_, SIGNAL(" + sig_signature + "), this, SLOT(" + slot_signature + "));\n") - out.write("LOG4CXX_TRACE(logger_, \"CONNECT SIGNALS: \" << __PRETTY_FUNCTION__ );\n") - out.write("}\n\n") - - for (request,response) in request_responses: - in_params = [ self.make_param_desc(x, iface_name) for x in request.findall('param') ] - out_params = [ self.make_param_desc(x, iface_name) for x in response.findall('param') ] - - out.write("bool fill{0}{1}Reply(QDBusMessage& message, const QVariantMap& map) {{\n".format(classname, request.get('name'))) - with CodeBlock(out) as out: - out.write("int retCode_out = 0;\n") - out.write("GetArgFromMap(map, \"__retCode\", retCode_out);\n") - out.write("QVariant retCode_arg = QVariant::fromValue(retCode_out);\n") - out.write("message << retCode_arg;\n") - out.write("QString userMessage_out;\n") - out.write("GetArgFromMap(map, \"__message\", userMessage_out);\n") - out.write("QVariant userMessage_arg = QVariant::fromValue(userMessage_out);\n") - out.write("message << userMessage_arg;\n") - for p in out_params: - param_name = p.name - param_type = self.qt_param_type(p) - out.write("%s %s_out;\n" % (param_type, p.name)) - out.write("if (!GetArgFromMap(map, \"{0}\", {0}_out)) {{ return false; }}\n".format(p.name)) - self.write_param_validation(p, p.name + "_out", "return false", out) - out.write("QVariant {0}_arg;\n".format(p.name)) - out.write("{0}_arg.setValue({0}_out);\n".format(p.name)) - out.write("message << {0}_arg;\n".format(p.name)) - out.write("LOG4CXX_DEBUG(logger_, \"Output arguments:\\n\" << QVariant(map));\n") - out.write("LOG4CXX_TRACE(logger_, \"REPLY ASYNC: \" << __PRETTY_FUNCTION__ );\n") - out.write("return true;\n") - out.write("}\n\n") - - out.write("{0} {{\n".format(self.make_method_signature(request, response, iface_name, True))) - with CodeBlock(out) as out: - out.write("LOG4CXX_TRACE(logger_, \"ENTER: \" << __PRETTY_FUNCTION__ );\n") - out.write("int ret = 0;\n") - return_statement = "return ret;\n" - out.write("QVariantMap in_arg;\n"); - out.write("QVariant out_arg_v;\n"); - for param in in_params: - self.write_param_validation(param, param.name + "_in", "RaiseDbusError(this, InvalidData); return ret", out) - out.write("PutArgToMap(in_arg, \"" + param.name + "\", " + param.name + "_in);\n") - out.write("LOG4CXX_DEBUG(logger_, \"Input arguments:\\n\" << in_arg);\n") - method_name = request.get('name')[:1].lower() + request.get('name')[1:] - - out.write("dbusController->message = &message;\n") - out.write("dbusController->fill = &fill{0}{1}Reply;\n".format(classname, request.get("name"))) - - out.write("""if (!QMetaObject::invokeMethod(api_, "{0}", Qt::{1}Connection, Q_RETURN_ARG(QVariant, out_arg_v), Q_ARG(QVariant, QVariant(in_arg)))) {{\n""".format(method_name, invoke_type_connection)) - with CodeBlock(out) as out: - out.write("RaiseDbusError(this, InvalidData);\n") - out.write("LOG4CXX_ERROR(logger_, \"Can't invoke method " + method_name +"\");\n ") - out.write("return ret;\n") - out.write("}\n") - - out.write("dbusController->message = NULL;\n") - out.write("dbusController->fill = NULL;\n") - out.write("if (message.isDelayedReply()) {\n") - with CodeBlock(out) as out: - out.write("return ret;\n") - out.write("}\n") - - out.write("QVariantMap out_arg;\n") - out.write("if (out_arg_v.type() == QVariant::Map) {\n") - with CodeBlock(out) as out: - out.write("out_arg = out_arg_v.toMap();\n") - out.write("};\n") - - out.write("int err;\n") - out.write("""if (GetArgFromMap(out_arg, "__errno", err)) { RaiseDbusError(this, err); return ret; }\n""") - - out.write("int async_uid;\n") - out.write("if (GetArgFromMap(out_arg, \"__async_uid\", async_uid)) {\n") - with CodeBlock(out) as out: - out.write("message.setDelayedReply(true);\n") - out.write("dbusController->addMessage(message, &fill%s%sReply, async_uid);\n" % (classname, request.get('name'))) - out.write("LOG4CXX_TRACE(logger_, \"EXIT ASYNC: \" << __PRETTY_FUNCTION__ );\n") - out.write("return ret;\n"); - out.write("}\n\n") - - for param in out_params: - out.write("if (!GetArgFromMap(out_arg, \"{0}\", {0}_out)) {{ RaiseDbusError(this, InvalidData); return ret; }}\n".format(param.name)) - self.write_param_validation(param, param.name + "_out", "RaiseDbusError(this, InvalidData); return ret", out) - - out.write("GetArgFromMap(out_arg, \"__retCode\", ret);\n") - out.write("GetArgFromMap(out_arg, \"__message\", userMessage_out);\n") - out.write("LOG4CXX_DEBUG(logger_, \"Output arguments:\\n\" << QVariant(out_arg));\n") - out.write("LOG4CXX_TRACE(logger_, \"EXIT: \" << __PRETTY_FUNCTION__ );\n") - out.write("return ret;\n") - out.write("}\n\n") - - for n in notifications: - slotname = n.get('name') + '_qml' - slot_signature = self.make_qml_signal_signature(n, iface_name, slotname, False, True) - out.write(slot_signature + " {\n") - params = n.findall('param') - out.write(" LOG4CXX_TRACE(logger_, \"EMIT SIGNAL: \" << __PRETTY_FUNCTION__ );\n") - out.write(" LOG4CXX_DEBUG(logger_, \"Arguments:\\n{\"") - for p in params[0:-1]: - param = self.make_param_desc(p, iface_name) - out.write(" << \" " + param.name + ":\" << " + param.name + " << \",\"") - for p in params[-1:]: # last param without comma in end line - p = params[-1] - param = self.make_param_desc(p, iface_name) - out.write(" << \" " + param.name + ":\" << " + param.name) - out.write(" << \" }\");\n") - for p in params: - param = self.make_param_desc(p, iface_name) - param_type = self.qt_param_type(param) - param_name = 'p_' + param.name - if param.mandatory: - if param.array or (param.type not in ['Integer', 'String', 'Float', 'Boolean'] and not param.enum): - out.write(' ' + param_type + ' ' + param_name + ";\n") - out.write(' if (!VariantToValue(' + param.name + ', ' + param_name + ")) {\n") - out.write(" LOG4CXX_ERROR(logger_, \"Can't convert variant to value\");\n") - out.write(" return;}\n") - else: - out.write(' ' + param_type + ' ' + param_name + ";\n") - out.write(' ' + param_name + '.presence = !' + param.name + ".isNull();\n") - out.write(' if (' + param_name + ".presence) {\n") - out.write(' if (!VariantToValue(' + param.name + ', ' + param_name + ".val)) {\n") - out.write(" LOG4CXX_ERROR(logger_, \"Can't convert variant to value\");\n") - out.write(" return;\n }\n") - out.write(" }\n") - out.write(' emit ' + n.get('name') + '(') - for i in range(len(params)): - param = self.make_param_desc(params[i], iface_name) - basic_type = (param.type in ['Integer', 'String', 'Float', 'Boolean']) or param.enum - if param.array or (not param.mandatory) or (not basic_type): - param_name = 'p_' + param.name - else: - param_name = param.name - out.write(param_name) - if i != len(params) - 1: out.write(', ') - out.write(");\n") - out.write("}\n\n") - - - def make_dbus_adaptor_declarations(self, out): - for interface_el in self.el_tree.findall('interface'): - notifications = self.find_notifications_by_provider(interface_el, "hmi") - request_responses = self.find_request_response_pairs_by_provider(interface_el, "hmi") - if len(notifications) > 0 or len(request_responses) > 0: - self.write_adaptor_declaration(interface_el, notifications, request_responses, out) - - - def make_dbus_adaptor_definitions(self, out): - for interface_el in self.el_tree.findall('interface'): - notifications = self.find_notifications_by_provider(interface_el, "hmi") - request_responses = self.find_request_response_pairs_by_provider(interface_el, "hmi") - if len(notifications) > 0 or len(request_responses) > 0: - self.write_adaptor_definition(interface_el, notifications, request_responses, out) - - - def make_dbus_register_metatypes_declaraion(self, out): - out.write("void RegisterDbusMetatypes();\n") - - - def make_dbus_register_metatypes_definition(self, out): - out.write("void RegisterDbusMetatypes() {\n") - for (iface, name) in self.structs: - struct_name = iface + '_' + name - out.write('qDBusRegisterMetaType<' + struct_name + ">();\n") - out.write('qDBusRegisterMetaType<OptionalArgument<' + struct_name + "> >();\n") - out.write('qDBusRegisterMetaType<QList<' + struct_name + "> >();\n") - out.write('qDBusRegisterMetaType<OptionalArgument<QList<' + struct_name + "> > >();\n") - out.write("}\n") - - - def make_api_adaptors_class(self, out): - global prefix_class_item - out.write("struct ApiAdaptors {\n") - interfaces = self.el_tree.findall('interface') - def filt(iface): - return self.find_notifications_by_provider(iface, "hmi") or self.find_request_response_pairs_by_provider(iface, "hmi") - interfaces = filter(filt, interfaces) - for interface_el in interfaces: - name = interface_el.get('name') + 'Adaptor' - out.write(" " + name + "* " + name + "_;\n") - out.write(" ApiAdaptors() :\n") - for i in range(len(interfaces)): - name = interfaces[i].get('name') + 'Adaptor' - out.write(" " + name + "_(NULL)") - if i <> len(interfaces) - 1: out.write(',') - out.write("\n") - out.write(" {}\n") - out.write(" void Init(QObject* p) {\n") - for interface_el in interfaces: - name = interface_el.get('name') + 'Adaptor' - out.write(" " + name + "_ = new " + name + "(p);\n") - out.write(" }\n") - out.write(" void SetApi(QObject* p) {\n") - for interface_el in interfaces: - name = interface_el.get('name') + 'Adaptor' - chname = interface_el.get('name') - out.write(" " + name + ("_->SetApi(p->findChild<Q%sItem*>(\"" % prefix_class_item) + chname + "\"));\n") - out.write(" }\n") - out.write(" void SetDBusController(DBusController* dc) {\n") - for interface_el in interfaces: - name = interface_el.get('name') + 'Adaptor' - chname = interface_el.get('name') - out.write(" " + name + "_->dbusController = dc;\n") - out.write(" }\n") - out.write("};\n\n") - - - -arg_parser = ArgumentParser(description="Generator of Qt to QDbus C++ part") -arg_parser.add_argument('--infile', required=True, help="full name of input file, e.g. applink/src/components/interfaces/QT_HMI_API.xml") -arg_parser.add_argument('--version', required=False, help="Qt version 4.8.5 (default) or 5.1.0") -arg_parser.add_argument('--outdir', required=True, help="path to directory where output files qml_dbus.cc, qml_dbus.h will be saved") -args = arg_parser.parse_args() - -if args.version == "4.8.5": - prefix_class_item = 'Declarative' - invoke_type_connection = 'Direct' -elif args.version == "5.1.0": - prefix_class_item = 'Quick' - invoke_type_connection = 'BlockingQueued' - -header_name = 'qml_dbus.h' -source_name = 'qml_dbus.cc' - -in_tree = ElementTree.parse(args.infile) -in_tree_root = in_tree.getroot() - -impl = Impl(in_tree_root, 'com.ford.sdl.hmi') - -header_out = open(args.outdir + '/' + header_name, "w") -source_out = open(args.outdir + '/' + source_name, "w") - -header_out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0]) -header_out.write("""/** - * @file qml_dbus.h - * @brief Generated QDbus adaptors header file - * - * This file is a part of HMI D-Bus layer. - */ -// Copyright (c) 2013, Ford Motor Company -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following -// disclaimer in the documentation and/or other materials provided with the -// distribution. -// -// Neither the name of the Ford Motor Company nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. - -""") -header_out.write("#ifndef SRC_COMPONENTS_DBUS_QML_DBUS_H_\n"); -header_out.write("#define SRC_COMPONENTS_DBUS_QML_DBUS_H_\n\n"); -header_out.write("#include <QtDBus/QDBusArgument>\n"); -header_out.write("#include <QtDBus/QDBusMessage>\n"); -header_out.write("#include <QtDBus/QDBusConnection>\n"); -header_out.write("#include <QtDBus/QDBusAbstractAdaptor>\n"); -header_out.write("#include <QtDBus/QDBusMetaType>\n"); -header_out.write("#include <Qt%s/Q%sItem>\n" % (prefix_class_item, prefix_class_item)); -header_out.write("#include \"qml_dbus_common.h\"\n\n"); -header_out.write("#include \"dbus_controller.h\"\n\n"); -impl.make_dbus_type_declarations(header_out) -impl.make_dbus_adaptor_declarations(header_out) -impl.make_dbus_register_metatypes_declaraion(header_out) -impl.make_api_adaptors_class(header_out) -impl.make_dbus_metatype_declarations(header_out) -header_out.write("#endif // #ifndef SRC_COMPONENTS_DBUS_QML_DBUS_H_\n"); - -source_out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0]) -source_out.write("""/** - * @file qml_dbus.cc - * @brief Generated QDbus adaptors source file - * - * This file is a part of HMI D-Bus layer. - */ -// Copyright (c) 2013, Ford Motor Company -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following -// disclaimer in the documentation and/or other materials provided with the -// distribution. -// -// Neither the name of the Ford Motor Company nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. - -""") -source_out.write("#include \"" + header_name + "\"\n\n"); -source_out.write("#include \"utils/logger.h\"\n") -source_out.write("#ifdef ENABLE_LOG\n") -source_out.write("extern log4cxx::LoggerPtr logger_;\n") -source_out.write("#endif // ENABLE_LOG\n\n") -impl.make_dbus_type_definitions(source_out) -impl.make_dbus_adaptor_definitions(source_out) -impl.make_dbus_register_metatypes_definition(source_out) diff --git a/src/components/dbus/codegen/make_qml_dbus_qml.py b/src/components/dbus/codegen/make_qml_dbus_qml.py deleted file mode 100755 index 8d057dcda1..0000000000 --- a/src/components/dbus/codegen/make_qml_dbus_qml.py +++ /dev/null @@ -1,217 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# -# @file make_qml_dbus_qml.py -# @brief Generator of QML to QDbus QML part -# -# This file is a part of HMI D-Bus layer. -# -# Copyright (c) 2013, Ford Motor Company -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# -# Redistributions of source code must retain the above copyright notice, this -# list of conditions and the following disclaimer. -# -# Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following -# disclaimer in the documentation and/or other materials provided with the -# distribution. -# -# Neither the name of the Ford Motor Company nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. - -from os import path -from os import makedirs -from sys import argv -from argparse import ArgumentParser -from xml.etree import ElementTree -from copy import copy -from ford_xml_parser import FordXmlParser - -namespace = 'dbus_qml' -qt_quick_version = '1.1' -type_variant_name = 'variant' - -class Impl(FordXmlParser): - def write_function(self, ifacename, request, response, out): - name = request.get('name') - name = name[:1].lower() + name[1:] - out.write(" function " + name + "(params) {\n") - out.write(""" console.debug("{0}Proxy::{1}")\n""".format(ifacename, name)) - out.write(" try {\n") - out.write(" if(\"{0}\" in sdl{1})\n".format(name, ifacename)) - out.write(" return sdl{0}.{1}(" .format(ifacename, name)) - params = request.findall('param') - for i in range(len(params)): - out.write('params.' + params[i].get('name')) - if i <> len(params) - 1: - out.write(', ') - out.write(")\n") - out.write(" else\n") - out.write(""" return { "__errno": Common.Result.UNSUPPORTED_REQUEST }\n""") - out.write(" } catch(err) {\n") - out.write(""" return { "__errno": err }\n""") - out.write(" }\n") - out.write(" }\n\n") - - - def write_signal_param(self, param, out): - if param.array or param.struct or not param.mandatory: typ = type_variant_name - elif param.type == 'Integer' or param.enum: typ = 'int' - elif param.type == 'String': typ = 'string' - elif param.type == 'Boolean': typ = 'bool' - elif param.type == 'Float': typ = 'double' - else: typ = type_variant_name - out.write(typ + ' ' + param.name) - - - def write_signal(self, ifacename, notification, out): - name = notification.get('name') - name = name[:1].lower() + name[1:] - out.write(" signal " + name + "(") - params = notification.findall('param') - for i in range(len(params)): - self.write_signal_param(self.make_param_desc(params[i], ifacename), out) - if i <> len(params) - 1: - out.write(', ') - out.write(")\n") - name = notification.get('name') - out.write(""" on{1}: console.debug("emitted {0}:{1}")\n""".format(ifacename, name)) - - - def write_qml(self, iface, out): - global qt_quick_version - name = iface.get('name') - out.write("import QtQuick %s\n" % qt_quick_version) - out.write("""import "Common.js" as Common\n""") - out.write("import \"..\"\n\n") - out.write("Item {\n") - out.write(" " + name + " {\n") - out.write(" id: sdl" + name + "\n") - out.write(" }\n") - - notifications = impl.find_notifications_by_provider(interface_el, "hmi") - request_responses = impl.find_request_response_pairs_by_provider(interface_el, "hmi") - for request, response in request_responses: - self.write_function(name, request, response, out) - for n in notifications: - self.write_signal(name, n, out) - out.write("}\n") - - - def write_js_enum(self, enum, out): - out.write("var " + enum.get('name') + " = {\n") - lastval = -1 - elements = enum.findall('element') - for i in range(len(elements)): - element = elements[i] - value = element.get('value') - if value is None: - value = lastval + 1 - else: - value = int(value) - lastval = value - name = element.get('internal_name') - if name is None: - name = element.get('name') - out.write(" " + name + ': ' + str(value)) - if len(elements) - 1 != i: out.write(',') - out.write("\n") - out.write("}\n\n") - - -def write_header(out): - out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0]) - out.write("""/** - * Copyright (c) 2013, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -""") - -arg_parser = ArgumentParser(description="Generator of Qt to QDbus QML part") -arg_parser.add_argument('--infile', required=True, help="full name of input file, e.g. applink/src/components/interfaces/QT_HMI_API.xml") -arg_parser.add_argument('--version', required=False, help="Qt version 4.8.5 (default) or 5.1.0") -arg_parser.add_argument('--outdir', required=True, help="path to directory where output files with pattern name <intarface name>Proxy.qml will be saved, e.g. BasicCommunicationProxy.qml, ButtonsProxy.qml VRProxy.qml") -args = arg_parser.parse_args() - -if args.version == "4.8.5": - qt_quick_version = "1.1" - type_variant_name = "variant" -elif args.version == "5.1.0": - qt_quick_version = "2.0" - type_variant_name = "var" - -if not path.isdir(args.outdir): - makedirs(args.outdir) - -in_tree = ElementTree.parse(args.infile) -in_tree_root = in_tree.getroot() - -impl = Impl(in_tree_root) - -for interface_el in in_tree_root.findall('interface'): - notifications = impl.find_notifications_by_provider(interface_el, "hmi") - request_responses = impl.find_request_response_pairs_by_provider(interface_el, "hmi") - if notifications or request_responses: - filename = interface_el.get('name')+'Proxy.qml' - outfile = open(args.outdir + '/' + filename, 'w') - write_header(outfile) - impl.write_qml(interface_el, outfile) - -enum_files = dict() -for (iface, name), enum in impl.enums.items(): - if iface in enum_files: - outfile = enum_files[iface] - else: - filename = iface+'.js' - outfile = open(args.outdir + '/' + filename, 'w') - write_header(outfile) - outfile.write(".pragma library\n") - enum_files[iface] = outfile - impl.write_js_enum(enum, outfile) - - diff --git a/src/components/dbus/codegen/make_qml_requests_cpp.py b/src/components/dbus/codegen/make_qml_requests_cpp.py deleted file mode 100644 index 6674b8f5e2..0000000000 --- a/src/components/dbus/codegen/make_qml_requests_cpp.py +++ /dev/null @@ -1,253 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# -# @file make_qml_dbus_cpp.py -# @brief Generator of QML to QDbus C++ part -# -# This file is a part of HMI D-Bus layer. -# -# Copyright (c) 2014, Ford Motor Company -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# -# Redistributions of source code must retain the above copyright notice, this -# list of conditions and the following disclaimer. -# -# Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following -# disclaimer in the documentation and/or other materials provided with the -# distribution. -# -# Neither the name of the Ford Motor Company nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. - -from argparse import ArgumentParser -import os.path -from sys import argv -from xml.etree import ElementTree -from copy import copy -from ford_xml_parser import FordXmlParser, ParamDesc -from code_formatter import CodeBlock - -prefix_class_item = 'Declarative' -invoke_type_connection = 'Direct' - -def defaultValue(param): - if param.type == "Integer": - return "0" - elif param.type == "Float": - return "0.0" - elif param.type == "Boolean": - return "false" - elif param.enum: - return "0" - -class Impl(FordXmlParser): - - - def args_for_function_definition(self, params, out): - if len(params) == 0: - out.write('QJSValue hmi_callback') - return - for param in params: - out.write('QVariant ' + param.get('name') + ', ') - out.write('QJSValue hmi_callback') - - - def make_requests_for_header(self, out): - for interface_el in self.el_tree.findall('interface'): - request_responses = self.find_request_response_pairs_by_provider(interface_el, "sdl") - for (request, response) in request_responses: - all_params = list() - for param_el in request.findall('param'): - all_params.append(param_el) - with CodeBlock(out) as output: - output.write("Q_INVOLABKE void " + interface_el.get('name') + "_" +request.get('name') + "(") - impl.args_for_function_definition(all_params, out) - output.write(");\n") - - - def make_header_file(self, out): - out.write("class RequestToSDL : public QObject\n") - out.write("{\n") - out.write(" public:\n") - with CodeBlock(out) as output: - output.write("explicit RequestToSDL(QObject *parent = 0);\n") - output.write("~RequestToSDL();\n") - impl.make_requests_for_header(out) - out.write(" private:\n") - with CodeBlock(out) as output: - for interface_el in self.el_tree.findall('interface'): - output.write('QDBusInterface *' + interface_el.get('name') + ';\n') - out.write("};\n") - - - def make_requests_for_source(self, out): - for interface_el in self.el_tree.findall('interface'): - request_responses = self.find_request_response_pairs_by_provider(interface_el, "sdl") - for (request, response) in request_responses: - out.write('void RequestToSDL::' + request.get('name') + '(QString name, ') - for param_el in request.findall('param'): - out.write('QVariant ' + param_el.get('name') + ', ') - out.write('QJSValue hmi_callback) {\n') - with CodeBlock(out) as output: - output.write('QList<QVariant> args;\n') - for param_el in request.findall('param'): - output.write('args << ' + param_el.get('name') + ';\n') - output.write('new ' + interface_el.get('name') + '_' + request.get('name') + '(' + interface_el.get('name') + ', name, args, hmi_callback);\n}\n') - - - - def make_source_file(self, out): - out.write('#include "request_to_sdl.h"\n') - out.write('\n') - out.write('RequestToSDL::RequestToSDL(QObject *parent) {\n') - with CodeBlock(out) as output: - output.write('QDBusConnection bus = QDBusConnection::sessionBus();\n') - for interface_el in self.el_tree.findall('interface'): - iface_name = interface_el.get('name') - output.write(iface_name + ' = new QDBusInterface("com.ford.sdl.core", "/", "com.ford.sdl.core.' + iface_name + '", bus, this);\n') - out.write('}\n\n') - out.write('RequestToSDL::~RequestToSDL() {\n') - with CodeBlock(out) as output: - for interface_el in self.el_tree.findall('interface'): - iface_name = interface_el.get('name') - output.write(iface_name + '->deleteLater();\n') - output.write('this->deleteLater();\n') - out.write('}\n\n') - impl.make_requests_for_source(out) - - - - - -arg_parser = ArgumentParser(description="Generator of Qt to QDbus C++ part") -arg_parser.add_argument('--infile', required=True, help="full name of input file, e.g. applink/src/components/interfaces/QT_HMI_API.xml") -arg_parser.add_argument('--version', required=False, help="Qt version 4.8.5 (default) or 5.1.0") -arg_parser.add_argument('--outdir', required=True, help="path to directory where output files request_to_sdl.h, request_to_sdl.cc will be saved") -args = arg_parser.parse_args() - -if args.version == "4.8.5": - prefix_class_item = 'Declarative' - invoke_type_connection = 'Direct' -elif args.version == "5.1.0": - prefix_class_item = 'Quick' - invoke_type_connection = 'BlockingQueued' - -header_name = 'request_to_sdl.h' -source_name = 'request_to_sdl.cc' - -in_tree = ElementTree.parse(args.infile) -in_tree_root = in_tree.getroot() - -impl = Impl(in_tree_root, 'com.ford.sdl.hmi') - -header_out = open(args.outdir + '/' + header_name, "w") -source_out = open(args.outdir + '/' + source_name, "w") - -header_out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0]) -header_out.write("""/** - * @file request_to_sdl.h - * @brief Generated class that process requests from qtHMI - * - * This file is a part of HMI D-Bus layer. - */ -// Copyright (c) 2013, Ford Motor Company -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following -// disclaimer in the documentation and/or other materials provided with the -// distribution. -// -// Neither the name of the Ford Motor Company nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. - -""") -header_out.write("#ifndef SRC_COMPONENTS_QTHMI_QMLMODELQT5_REQUESTTOSDL_\n"); -header_out.write("#define SRC_COMPONENTS_QTHMI_QMLMODELQT5_REQUESTTOSDL_\n\n"); -header_out.write("#include <QDBusConnection>\n"); -header_out.write("#include <QJSValue>\n"); -header_out.write("#include <QObject>\n"); -header_out.write("#include <QDBusInterface>\n"); -header_out.write('#include "hmi_requests.h"\n'); - -impl.make_header_file(header_out) - -header_out.write("#endif SRC_COMPONENTS_QTHMI_QMLMODELQT5_REQUESTTOSDL_\n"); - - -source_out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0]) -source_out.write("""/** - * @file request_to_sdl.cc - * @brief Generated class that process requests from qtHMI - * - * This file is a part of HMI D-Bus layer. - */ -// Copyright (c) 2014, Ford Motor Company -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following -// disclaimer in the documentation and/or other materials provided with the -// distribution. -// -// Neither the name of the Ford Motor Company nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. - -""") - -impl.make_source_file(source_out) diff --git a/src/components/dbus/codegen/make_request_to_sdl.py b/src/components/dbus/codegen/make_request_to_sdl.py deleted file mode 100755 index c8940f3eb7..0000000000 --- a/src/components/dbus/codegen/make_request_to_sdl.py +++ /dev/null @@ -1,335 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# -# @file make_qml_dbus_cpp.py -# @brief Generator of QML to QDbus C++ part -# -# This file is a part of HMI D-Bus layer. -# -# Copyright (c) 2014, Ford Motor Company -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# -# Redistributions of source code must retain the above copyright notice, this -# list of conditions and the following disclaimer. -# -# Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following -# disclaimer in the documentation and/or other materials provided with the -# distribution. -# -# Neither the name of the Ford Motor Company nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. - -from argparse import ArgumentParser -import os.path -from sys import argv -from xml.etree import ElementTree -from copy import copy -from ford_xml_parser import FordXmlParser, ParamDesc -from code_formatter import CodeBlock - -class Impl(FordXmlParser): - - def args_for_function_definition(self, params, iface_name, out): - for param_el in params: - param = self.make_param_desc(param_el, iface_name) - out.write('QVariant %s,' % (param.name)) - out.write('Q%sValue hmi_callback' % prefix_class_item) - - def make_requests_for_header(self, out): - for interface_el in self.el_tree.findall('interface'): - request_responses = self.find_request_response_pairs_by_provider(interface_el, "sdl") - for (request, response) in request_responses: - all_params = list() - for param_el in request.findall('param'): - all_params.append(param_el) - with CodeBlock(out) as output: - output.write("Q_INVOKABLE bool %s_%s(" % (interface_el.get('name'), request.get('name'))) - impl.args_for_function_definition(all_params, interface_el.get('name'), out) - output.write(");\n") - - - def make_header_file(self, out): - out.write("class QDBusInterface;\n") - out.write("class RequestToSDL : public QObject\n") - out.write("{\n") - out.write(' Q_OBJECT\n') - out.write(" public:\n") - with CodeBlock(out) as output: - output.write("explicit RequestToSDL(QObject *parent = 0);\n") - output.write("~RequestToSDL();\n") - impl.make_requests_for_header(out) - out.write(" private:\n") - with CodeBlock(out) as output: - for interface_el in self.el_tree.findall('interface'): - output.write('QDBusInterface *%s;\n' % interface_el.get('name')) - out.write("};\n") - - - def qt_param_type(self, param): - if not param.mandatory: - param_copy = copy(param) - param_copy.mandatory = True - return "OptionalArgument< " + self.qt_param_type(param_copy) + " >" - if param.array: - param_copy = copy(param) - param_copy.array = False - if param.type == 'String': - return "QStringList" - return "QList< " + self.qt_param_type(param_copy) + " >" - if param.type == 'Integer' or param.enum: - return 'int' - elif param.type == 'String': - return 'QString' - elif param.type == 'Boolean': - return 'bool' - elif param.type == 'Float': - return 'double' - elif param.struct: - return "_".join(param.fulltype) - else: - raise RuntimeError('Unknown type: ' + param.type) - - - def make_requests_for_source(self, out): - for interface_el in self.el_tree.findall('interface'): - request_responses = self.find_request_response_pairs_by_provider(interface_el, "sdl") - for (request, response) in request_responses: - request_name = request.get('name') - iface_name = interface_el.get('name') - request_full_name = iface_name + '_' + request_name - out.write('bool RequestToSDL::' + request_full_name + '(') - for param_el in request.findall('param'): - out.write('QVariant %s, ' % (param_el.get('name'))) - out.write('Q%sValue hmi_callback) {\n' % prefix_class_item) - with CodeBlock(out) as output: - output.write('LOG4CXX_TRACE(logger_, "ENTER");\n') - output.write('QList<QVariant> args;\n') - for param_el in request.findall('param'): - param = self.make_param_desc(param_el, iface_name) - output.write('%s %s;\n' % (impl.qt_param_type(param), param.name + "_tmp")) - output.write('if (VariantToValue(%s, %s)) {\n' % (param.name, param.name + '_tmp')) - with CodeBlock(output) as out: - self.write_param_validation(param, param.name + "_tmp", - "\nLOG4CXX_ERROR(logger_, \"%s in %s out of bounds\");\nreturn false" % (param.name, request_full_name), - out) - out.write('args << QVariant::fromValue(%s);\n' % (param.name + '_tmp')) - output.write('} else {\n') - with CodeBlock(output) as out: - out.write('LOG4CXX_ERROR(logger_, "%s in %s is NOT valid");\n' % (param.name, request_full_name)) - out.write('return false;\n') - out.write('}\n') - output.write('new requests::' + request_full_name + '(hmi_callback, ' + interface_el.get('name') + ' , args, ' - + '"' + request_name + '");\n') - output.write('LOG4CXX_TRACE(logger_, "EXIT");\n') - output.write('return true;\n') - out.write('}\n\n') - - - def write_param_validation(self, param, param_name, fail_statement, out, level=0): - if not param.mandatory and (param.restricted or param.restrictedArray or (param.struct and any(map(lambda x: x.restricted, self.structs[param.fulltype])))): - out.write("if (%s.presence) {\n" % param_name) - param_copy = copy(param) - param_copy.mandatory = True - with CodeBlock(out) as out: - self.write_param_validation(param_copy, param_name + ".val", fail_statement, out, level+1) - out.write("}\n") - elif param.array: - if param.minSize > 0: - out.write("if ({0}.count() < {1}) {{".format(param_name, param.minSize)) - with CodeBlock(out) as out: - out.write("{0};\n".format(fail_statement)) - out.write("}\n") - if param.maxSize != None: - out.write("if ({0}.count() > {1}) {{".format(param_name, param.maxSize)) - with CodeBlock(out) as out: - out.write("{0};\n".format(fail_statement)) - out.write("}\n") - if param.restricted: - out.write('for ({0}::const_iterator it_{2} = {1}.begin(); it_{2} != {1}.end(); ++it_{2}) {{\n'.format(self.qt_param_type(param), param_name, level)) - with CodeBlock(out) as out: - param_copy = copy(param) - param_copy.array = False - self.write_param_validation(param_copy, "(*it_{0})".format(level), fail_statement, out, level+1) - out.write("}\n") - elif param.struct: - for p in self.structs[param.fulltype]: - self.write_param_validation(p, "{0}.{1}".format(param_name, p.name), fail_statement, out, level+1) - elif param.type == "Integer" or param.type == "Float": - conditions = [] - if (param.minValue != None): - conditions.append("(%s < %s)" % (param_name, param.minValue)) - if (param.maxValue != None): - conditions.append("(%s > %s)" % (param_name, param.maxValue)) - if conditions: - out.write('if (%s) {' % ' || '.join(conditions)) - with CodeBlock(out) as out: - out.write('%s;\n' % fail_statement) - out.write("}\n") - elif param.type == "String": - conditions = [] - if (param.minLength > 0): - conditions.append("(%s.size() < %s)" % (param_name, param.minLength)) - if (param.maxLength > 0): - conditions.append("(%s.size() > %s)" % (param_name, param.maxLength)) - if conditions: - out.write('if (%s) {' % ' || '.join(conditions)) - with CodeBlock(out) as out: - out.write('%s;\n' % (fail_statement)) - out.write("}\n") - - def make_source_file(self, out): - out.write('RequestToSDL::RequestToSDL(QObject *parent) {\n') - with CodeBlock(out) as output: - output.write('QDBusConnection bus = QDBusConnection::sessionBus();\n') - for interface_el in self.el_tree.findall('interface'): - iface_name = interface_el.get('name') - output.write(iface_name + ' = new QDBusInterface("com.ford.sdl.core", "/", "com.ford.sdl.core.' + iface_name + '", bus, this);\n') - out.write('}\n\n') - out.write('RequestToSDL::~RequestToSDL() {\n') - with CodeBlock(out) as output: - for interface_el in self.el_tree.findall('interface'): - iface_name = interface_el.get('name') - output.write(iface_name + '->deleteLater();\n') - output.write('this->deleteLater();\n') - out.write('}\n\n') - impl.make_requests_for_source(out) - -arg_parser = ArgumentParser(description="Generator of Qt to QDbus C++ part") -arg_parser.add_argument('--infile', required=True, help="full name of input file, e.g. applink/src/components/interfaces/QT_HMI_API.xml") -arg_parser.add_argument('--version', required=False, help="Qt version 4.8.5 (default) or 5.1.0") -arg_parser.add_argument('--outdir', required=True, help="path to directory where output files request_to_sdl.h, request_to_sdl.cc will be saved") -args = arg_parser.parse_args() - - -if args.version == "4.8.5": - prefix_class_item = 'Script' - invoke_type_connection = 'Direct' -elif args.version == "5.1.0": - prefix_class_item = 'JS' - invoke_type_connection = 'BlockingQueued' -else: - prefix_class_item = 'JS' - invoke_type_connection = 'BlockingQueued' - -header_name = 'request_to_sdl.h' -source_name = 'request_to_sdl.cc' - -in_tree = ElementTree.parse(args.infile) -in_tree_root = in_tree.getroot() - -impl = Impl(in_tree_root, 'com.ford.sdl.hmi') - -header_out = open(args.outdir + '/' + header_name, "w") -source_out = open(args.outdir + '/' + source_name, "w") - -header_out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0]) -header_out.write(""" -/* - Copyright (c) 2014, Ford Motor Company - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following - disclaimer in the documentation and/or other materials provided with the - distribution. - - Neither the name of the Ford Motor Company nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ -""") -header_out.write("#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_REQUEST_TO_SDL_H_\n") -header_out.write("#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_REQUEST_TO_SDL_H_\n\n") - -header_out.write("#include <QtCore/QObject>\n") -header_out.write("#include <QtCore/QVariant>\n") -header_out.write("#include <QtCore/QStringList>\n\n") -header_out.write('#include "qml_dbus.h"\n\n') -if args.version == "4.8.5": - header_out.write("#include <QtScript/QScriptValue>\n") -elif args.version == "5.1.0": - header_out.write("#include <QtQml/QJSValue>\n") - -impl.make_header_file(header_out) -header_out.write("#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_REQUEST_TO_SDL_H_") - - -source_out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0]) -source_out.write(""" -/* - Copyright (c) 2014, Ford Motor Company - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following - disclaimer in the documentation and/or other materials provided with the - distribution. - - Neither the name of the Ford Motor Company nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ - -""") - -source_out.write('#include "request_to_sdl.h"\n') -source_out.write("#include <QtDBus/QDBusConnection>\n") -source_out.write("#include <QtDBus/QDBusInterface>\n") -source_out.write('#include "hmi_requests.h"\n') -source_out.write('#include "utils/logger.h"\n\n') -source_out.write('CREATE_LOGGERPTR_GLOBAL(logger_, "DBusPlugin")\n\n') - -impl.make_source_file(source_out) diff --git a/src/components/interfaces/CMakeLists.txt b/src/components/interfaces/CMakeLists.txt index 1ea481f11a..660cbd661d 100644 --- a/src/components/interfaces/CMakeLists.txt +++ b/src/components/interfaces/CMakeLists.txt @@ -44,31 +44,8 @@ add_library(v4_protocol_v1_2_no_extra ${CMAKE_CURRENT_BINARY_DIR}/v4_protocol_v1 generate_interface("MOBILE_API.xml" "mobile_apis" "sdlrpcv2") add_library(MOBILE_API ${CMAKE_CURRENT_BINARY_DIR}/MOBILE_API_schema.cc) -if(HMI_JSON_API) - generate_interface("HMI_API.xml" "hmi_apis" "jsonrpc") - add_library(HMI_API ${CMAKE_CURRENT_BINARY_DIR}/HMI_API_schema.cc) -endif() - -if(HMI_DBUS_API) - generate_interface("QT_HMI_API.xml" "hmi_apis" "jsonrpc") - - add_custom_command( - OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/HMI_API.h" - COMMAND sed "-e" "s/QT_HMI_API/HMI_API/g" "${CMAKE_CURRENT_BINARY_DIR}/QT_HMI_API.h" > "${CMAKE_CURRENT_BINARY_DIR}/HMI_API.h" - DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/QT_HMI_API.h" - ) - add_custom_command( - OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/HMI_API_schema.h" - COMMAND sed "-e" "s/QT_HMI_API/HMI_API/g" "${CMAKE_CURRENT_BINARY_DIR}/QT_HMI_API_schema.h" > "${CMAKE_CURRENT_BINARY_DIR}/HMI_API_schema.h" - DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/QT_HMI_API_schema.h" - ) - add_custom_command( - OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/HMI_API_schema.cc" - COMMAND sed "-e" "s/QT_HMI_API/HMI_API/g" "${CMAKE_CURRENT_BINARY_DIR}/QT_HMI_API_schema.cc" > "${CMAKE_CURRENT_BINARY_DIR}/HMI_API_schema.cc" - DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/QT_HMI_API_schema.cc" "${CMAKE_CURRENT_BINARY_DIR}/HMI_API_schema.h" "${CMAKE_CURRENT_BINARY_DIR}/HMI_API.h") - - add_library(HMI_API ${CMAKE_CURRENT_BINARY_DIR}/HMI_API_schema.cc) -endif() +generate_interface("HMI_API.xml" "hmi_apis" "jsonrpc") +add_library(HMI_API ${CMAKE_CURRENT_BINARY_DIR}/HMI_API_schema.cc) target_link_libraries(v4_protocol_v1_2_no_extra Utils) target_link_libraries(MOBILE_API Utils) |