2 Copyright (C) 2012 Intel Corporation
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with this library; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 #include "dbusplugin.h".h"
21 #include "abstractroutingengine.h"
24 extern "C" AbstractSinkManager * create(AbstractRoutingEngine* routingengine)
26 return new DBusSinkManager(routingengine);
29 DBusSink::DBusSink(AbstractRoutingEngine* engine): AbstractSink(engine)
31 routingEngine->subscribeToProperty(VehicleProperty::EngineSpeed, this);
32 routingEngine->subscribeToProperty(VehicleProperty::VehicleSpeed, this);
34 AsyncPropertyRequest velocityRequest;
35 velocityRequest.property = VehicleProperty::VehicleSpeed;
36 velocityRequest.completed = [](AsyncPropertyReply* reply) { DebugOut()<<"Velocity Async request completed: "<<boost::any_cast<uint16_t>(reply->value)<<endl; };
38 AsyncPropertyReply* reply = routingEngine->getPropertyAsync(velocityRequest);
42 PropertyList DBusSink::subscriptions()
47 void DBusSink::supportedChanged(PropertyList supportedProperties)
52 void DBusSink::propertyChanged(VehicleProperty::Property property, boost::any value, std::string uuid)
54 DebugOut()<<VehicleProperty::name(property)<<" value: "<<boost::any_cast<uint16_t>(value)<<endl;
57 std::string DBusSink::uuid()
59 return "c2e6cafa-eef5-4b8a-99a0-0f2c9be1057d";