Change so re-subscribing to a pid, removes it from the blacklist if it has been tagge... 18/2518/1
authorMichael Carpenter <malcom2073@gmail.com>
Fri, 23 Nov 2012 21:53:56 +0000 (16:53 -0500)
committerMichael Carpenter <malcom2073@gmail.com>
Fri, 23 Nov 2012 21:53:56 +0000 (16:53 -0500)
plugins/obd2plugin/obd2source.cpp

index 0cfc014..cb8f364 100644 (file)
@@ -709,6 +709,15 @@ void OBD2Source::subscribeToPropertyChanges(VehicleProperty::Property property)
 
 
                ObdPid *pid = obd2AmbInstance->createPidforProperty(property);
+               
+               //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.
+               if (m_blacklistPidCountMap.find(pid->pid) != m_blacklistPidCountMap.end())
+               {
+                       m_blacklistPidCountMap.erase(m_blacklistPidCountMap.find(pid->pid));
+               }
+                                       
+                                       
                g_async_queue_push(subscriptionAddQueue,pid);
                CommandRequest *req = new CommandRequest();
                req->req = "connectifnot";