mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
Refactor source IsConnected() and connected notification.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user