diff options
author | Justin Dickow <jjdickow@gmail.com> | 2015-05-05 11:50:30 -0400 |
---|---|---|
committer | Justin Dickow <jjdickow@gmail.com> | 2015-05-05 11:50:30 -0400 |
commit | 269d17a5e8b4554b90babb719545e3486feabbbf (patch) | |
tree | dc27931fd0a09b6d27c621c3c05501bc0b6153ad | |
parent | e11dc3a2289200fb443186593a900e5d960ef37e (diff) | |
download | smartdevicelink-269d17a5e8b4554b90babb719545e3486feabbbf.tar.gz |
Added implementations for notification RPCs
Signed-off-by: Justin Dickow <jjdickow@gmail.com>
4 files changed, 278 insertions, 0 deletions
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_interior_vehicle_data_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_interior_vehicle_data_notification.h new file mode 100644 index 000000000..4fc3c15d1 --- /dev/null +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_interior_vehicle_data_notification.h @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2015, 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_INTERIOR_VEHICLE_DATA_NOTIFICATION_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_INTERIOR_VEHICLE_DATA_NOTIFICATION_H_ + +#include "application_manager/commands/hmi/notification_from_hmi.h" +#include "application_manager/application_manager_impl.h" + + +namespace application_manager { + +namespace commands { + +namespace hmi { + +/** + * @brief OnInteriorVehicleDataNotification command class + **/ +class OnInteriorVehicleDataNotification : public NotificationFromHMI { + public: + /** + * @brief OnInteriorVehicleDataNotification class constructor + * + * @param message Incoming SmartObject message + **/ + explicit OnInteriorVehicleDataNotification(const MessageSharedPtr& message); + + /** + * @brief OnInteriorVehicleDataNotification class destructor + **/ + virtual ~OnInteriorVehicleDataNotification(); + + /** + * @brief Execute command + **/ + virtual void Run(); + + private: + DISALLOW_COPY_AND_ASSIGN(OnInteriorVehicleDataNotification); +}; + +} // namespace hmi + +} // namespace commands + +} // namespace application_manager + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_INTERIOR_VEHICLE_DATA_NOTIFICATION_H_ diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_interior_vehicle_data_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_interior_vehicle_data_notification.h new file mode 100644 index 000000000..ad3e4b87b --- /dev/null +++ b/src/components/application_manager/include/application_manager/commands/mobile/on_interior_vehicle_data_notification.h @@ -0,0 +1,76 @@ +/* + +Copyright (c) 2015, 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_MOBILE_ON_INTERIOR_VEHICLE_DATA_NOTIFICATION_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_INTERIOR_VEHICLE_DATA_NOTIFICATION_H_ + +#include "application_manager/commands/command_notification_impl.h" +#include "utils/macro.h" + +namespace application_manager { + +namespace commands { + +namespace mobile { + +/** + * @brief OnInteriorVehicleDataNotification class + **/ +class OnInteriorVehicleDataNotification : public CommandNotificationImpl { + public: + /** + * @brief OnInteriorVehicleDataNotification class constructor + * + * @param message Incoming SmartObject message + **/ + explicit OnInteriorVehicleDataNotification(const MessageSharedPtr& message); + + /** + * @brief OnInteriorVehicleDataNotification class destructor + **/ + virtual ~OnInteriorVehicleDataNotification(); + + /** + * @brief Execute command + **/ + virtual void Run(); + + private: + DISALLOW_COPY_AND_ASSIGN(OnInteriorVehicleDataNotification); +}; + +} // namespace mobile +} // namespace commands +} // namespace application_manager + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_INTERIOR_VEHICLE_DATA_NOTIFICATION_H_ diff --git a/src/components/application_manager/src/commands/hmi/on_interior_vehicle_data_notification.cc b/src/components/application_manager/src/commands/hmi/on_interior_vehicle_data_notification.cc new file mode 100644 index 000000000..5da364df6 --- /dev/null +++ b/src/components/application_manager/src/commands/hmi/on_interior_vehicle_data_notification.cc @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2015, 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_interior_vehicle_data_notification.h" +#include "interfaces/MOBILE_API.h" + +namespace application_manager { + +namespace commands { + +namespace hmi { + +OnInteriorVehicleDataNotification::OnInteriorVehicleDataNotification( + const MessageSharedPtr& message) : NotificationFromHMI(message) { +} + +OnInteriorVehicleDataNotification::~OnInteriorVehicleDataNotification() { +} + +void OnInteriorVehicleDataNotification::Run() { + LOG4CXX_AUTO_TRACE(logger_); + + //prepare SmartObject for mobile factory + (*message_)[strings::params][strings::function_id] = + mobile_apis::FunctionID::OnInteriorVehicleDataId; + SendNotificationToMobile(message_); + +} + +} // namespace hmi + +} // namespace commands + +} // namespace application_manager diff --git a/src/components/application_manager/src/commands/mobile/on_interior_vehicle_data_notification.cc b/src/components/application_manager/src/commands/mobile/on_interior_vehicle_data_notification.cc new file mode 100644 index 000000000..552c25b26 --- /dev/null +++ b/src/components/application_manager/src/commands/mobile/on_interior_vehicle_data_notification.cc @@ -0,0 +1,61 @@ +/* + + Copyright (c) 2015, 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/mobile/on_interior_vehicle_data_notification.h" +#include "application_manager/application_manager_impl.h" +#include "application_manager/application_impl.h" + +namespace application_manager { + +namespace commands { + +namespace mobile { + +OnInteriorVehicleDataNotification::OnInteriorVehicleDataNotification( + const MessageSharedPtr& message) + : CommandNotificationImpl(message) { +} + +OnInteriorVehicleDataNotification::~OnInteriorVehicleDataNotification() { +} + +void OnInteriorVehicleDataNotification::Run() { + LOG4CXX_AUTO_TRACE(logger_); + SendNotification(); +} + +} // namespace mobile + +} // namespace commands + +} // namespace application_manager |