Clean up temporary code
This commit is contained in:
		@@ -14,8 +14,6 @@ using namespace logid::backend;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
void DeviceManager::addDevice(std::string path)
 | 
					void DeviceManager::addDevice(std::string path)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    log_printf(DEBUG, "Scanning %s for devices.", path.c_str());
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    bool defaultExists = true;
 | 
					    bool defaultExists = true;
 | 
				
			||||||
    bool isReceiver = false;
 | 
					    bool isReceiver = false;
 | 
				
			||||||
    try {
 | 
					    try {
 | 
				
			||||||
@@ -36,7 +34,6 @@ void DeviceManager::addDevice(std::string path)
 | 
				
			|||||||
        log_printf(INFO, "Detected receiver at %s", path.c_str());
 | 
					        log_printf(INFO, "Detected receiver at %s", path.c_str());
 | 
				
			||||||
        auto receiver = std::make_shared<Receiver>(path);
 | 
					        auto receiver = std::make_shared<Receiver>(path);
 | 
				
			||||||
        _receivers.emplace(path, receiver);
 | 
					        _receivers.emplace(path, receiver);
 | 
				
			||||||
        // receiver->listen();
 | 
					 | 
				
			||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
        /* TODO: Error check?
 | 
					        /* TODO: Error check?
 | 
				
			||||||
         * TODO: Can non-receivers only contain 1 device?
 | 
					         * TODO: Can non-receivers only contain 1 device?
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -84,9 +84,6 @@ void Device::_init()
 | 
				
			|||||||
Device::~Device()
 | 
					Device::~Device()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    raw_device->removeEventHandler("DEV_" + std::to_string(_index));
 | 
					    raw_device->removeEventHandler("DEV_" + std::to_string(_index));
 | 
				
			||||||
    ///TODO: tmp
 | 
					 | 
				
			||||||
    raw_device->stopListener();
 | 
					 | 
				
			||||||
    raw_device.reset();
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void Device::addEventHandler(const std::string& nickname, const std::shared_ptr<EventHandler>& handler)
 | 
					void Device::addEventHandler(const std::string& nickname, const std::shared_ptr<EventHandler>& handler)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -270,6 +270,14 @@ void RawDevice::listen()
 | 
				
			|||||||
        this->handleEvent(report);
 | 
					        this->handleEvent(report);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // Listener is stopped, handle I/O queue
 | 
				
			||||||
 | 
					    while(!write_queue.empty())
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        auto task = write_queue.front();
 | 
				
			||||||
 | 
					        (*task)();
 | 
				
			||||||
 | 
					        write_queue.pop();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    continue_listen = false;
 | 
					    continue_listen = false;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user