ObdPid *pid = obd2AmbInstance->createPidforProperty(property);
+
+ if(!pid)
+ {
+ return;
+ }
//If the pid is currently in the blacklist map, erase it. This allows for applications
//to "un-blacklist" a pid by re-subscribing to it.
supportedPidsList.push_back(new EngineCoolantPid());
supportedPidsList.push_back(new AirIntakeTemperaturePid());
}
+
+ ~Obd2Amb()
+ {
+ for(auto itr = supportedPidsList.begin(); itr != supportedPidsList.end(); itr++)
+ {
+ delete *itr;
+ }
+ }
+
ObdPid* createPidFromReply(ByteArray replyVector)
{
for(auto itr = supportedPidsList.begin(); itr != supportedPidsList.end(); itr++)
{
for(auto itr = supportedPidsList.begin(); itr != supportedPidsList.end(); itr++)
{
- if((*itr)->property == property)
+ VehicleProperty::Property p = (*itr)->property;
+ if(p == property)
{
ObdPid* obj = *itr;
return obj->create();
}
}
+ return NULL;
}
std::list<ObdPid*> supportedPidsList;