Refactor source IsConnected() and connected notification.

This commit is contained in:
Peter Johnson
2016-12-04 09:50:01 -08:00
parent 81fd0eefac
commit 7c2f994a66
6 changed files with 16 additions and 20 deletions

View File

@@ -595,7 +595,7 @@ void UsbCameraImpl::DeviceDisconnect() {
close(fd);
// Notify
Notifier::GetInstance().NotifySource(*this, CS_SOURCE_DISCONNECTED);
SetConnected(false);
}
void UsbCameraImpl::DeviceConnect() {
@@ -691,7 +691,7 @@ void UsbCameraImpl::DeviceConnect() {
SetDescription(GetDescriptionImpl(m_path.c_str()));
// Notify
Notifier::GetInstance().NotifySource(*this, CS_SOURCE_CONNECTED);
SetConnected(true);
}
bool UsbCameraImpl::DeviceStreamOn() {
@@ -1297,8 +1297,6 @@ bool UsbCameraImpl::CacheProperties(CS_Status* status) const {
return true;
}
bool UsbCameraImpl::IsConnected() const { return m_fd >= 0; }
void UsbCameraImpl::SetProperty(int property, int value, CS_Status* status) {
auto msg = CreateMessage(Message::kCmdSetProperty);
msg->data[0] = property;