return l;
}
+struct UserData{
+ AbstractSink* sink;
+ PropertyList list;
+};
+
void Core::registerSink(AbstractSink *self)
{
if(!ListPlusPlus<AbstractSink*>(&mSinks).contains(self))
{
mSinks.push_back(self);
}
+
+ auto cb = [](gpointer userdata) {
+ UserData* foo = (UserData*)userdata;
+ foo->sink->supportedChanged(foo->list);
+
+ delete foo;
+ return (int)0;
+ };
+
+ UserData* foo = new UserData;
+ foo->sink = self;
+ foo->list = mMasterPropertyList;
+
+ g_timeout_add(0, (GSourceFunc) cb, foo);
}
void Core::unregisterSink(AbstractSink *self)
return *this;
}
+ virtual ~AsyncPropertyRequest() { }
+
VehicleProperty::Property property;
std::string sourceUuidFilter;
Zone::Type zoneFilter;
}
}
- ~AsyncPropertyReply()
+ virtual ~AsyncPropertyReply()
{
if(timeoutSource)
{
}
+ virtual ~AsyncSetPropertyRequest() { }
+
AbstractPropertyType* value;
};
this->sourceUuid = request.sourceUuid;
}
+ virtual ~AsyncRangePropertyRequest() {}
+
VehicleProperty::Property property;
std::string sourceUuid;
GetRangedPropertyCompletedSignal completed;
out.precision(15);
- if(mDebugLevel <= debugThreshhold)
+ if(mDebugLevel <= debugThreshhold || mDebugLevel == Error || mDebugLevel == Warning)
out<<message<<" ";
return *this;
}
out.precision(15);
- if(mDebugLevel <= debugThreshhold)
+ if(mDebugLevel <= debugThreshhold || mDebugLevel == Error || mDebugLevel == Warning)
out<<endl;
return *this;
}
out.precision(15);
- if(mDebugLevel <= debugThreshhold)
+ if(mDebugLevel <= debugThreshhold || mDebugLevel == Error || mDebugLevel == Warning)
out<<val<<" ";
return *this;
}
routingEngine->subscribeToProperty(VehicleProperty::EngineSpeed, this);
routingEngine->subscribeToProperty(VehicleProperty::VehicleSpeed, this);
- supportedChanged(routingEngine->supported());
+// supportedChanged(routingEngine->supported());
}
velocityRequest.completed = [](AsyncPropertyReply* reply)
{
if(!reply->success)
- DebugOut(0)<<"Velocity Async request failed";
+ DebugOut(DebugOut::Error)<<"Velocity Async request failed ("<<reply->error<<")"<<endl;
else
DebugOut(0)<<"Velocity Async request completed: "<<reply->value->toString()<<endl;
delete reply;
vinRequest.completed = [](AsyncPropertyReply* reply)
{
if(!reply->success)
- DebugOut(0)<<"VIN Async request failed";
+ DebugOut(DebugOut::Error)<<"VIN Async request failed ("<<reply->error<<")"<<endl;
else
DebugOut(0)<<"VIN Async request completed: "<<reply->value->toString()<<endl;
delete reply;
wmiRequest.completed = [](AsyncPropertyReply* reply)
{
if(!reply->success)
- DebugOut(0)<<"WMI Async request failed";
+ DebugOut(DebugOut::Error)<<"WMI Async request failed ("<<reply->error<<")"<<endl;
else
DebugOut(1)<<"WMI Async request completed: "<<reply->value->toString()<<endl;
delete reply;
batteryVoltageRequest.completed = [](AsyncPropertyReply* reply)
{
if(!reply->success)
- DebugOut(0)<<"BatteryVoltage Async request failed";
+ DebugOut(DebugOut::Error)<<"BatteryVoltage Async request failed ("<<reply->error<<")"<<endl;
else
DebugOut(1)<<"BatteryVoltage Async request completed: "<<reply->value->toString()<<endl;
delete reply;
doorsPerRowRequest.completed = [](AsyncPropertyReply* reply)
{
if(!reply->success)
- DebugOut(0)<<"Doors per row Async request failed";
+ DebugOut(DebugOut::Error)<<"Doors per row Async request failed ("<<reply->error<<")"<<endl;
else
DebugOut(1)<<"Doors per row: "<<reply->value->toString()<<endl;
delete reply;
airbagStatus.completed = [](AsyncPropertyReply* reply)
{
if(!reply->success)
- DebugOut(0)<<"Airbag Async request failed";
+ DebugOut(DebugOut::Error)<<"Airbag Async request failed ("<<reply->error<<")"<<endl;
else
DebugOut(1)<<"Airbag Status: "<<reply->value->toString()<<endl;
delete reply;
exteriorBrightness.completed = [](AsyncPropertyReply* reply)
{
if(!reply->success)
- DebugOut(0)<<"Exterior Brightness Async request failed";
+ DebugOut(DebugOut::Error)<<"Exterior Brightness Async request failed ("<<reply->error<<")"<<endl;
else
DebugOut(1)<<"Exterior Brightness: "<<reply->value->toString()<<endl;
delete reply;