From 3d13f10839e218b65dc247f03a15fb5dfa87bc8b Mon Sep 17 00:00:00 2001 From: Bartosz Date: Thu, 18 Aug 2022 12:36:38 +0200 Subject: [PATCH] [MOS-668] Modify USB notifications logging Modified USB notificaitons logging so no logs are being created when USB data is received, thus logs are not overloaded and are smaller --- module-services/service-desktop/WorkerDesktop.cpp | 7 +++++-- pure_changelog.md | 3 +++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/module-services/service-desktop/WorkerDesktop.cpp b/module-services/service-desktop/WorkerDesktop.cpp index 1cfd99daa75d05eb0e158da4967f9b8e0f038a99..42e4f26e801cf61b744860b41c2b1ed560a00828 100644 --- a/module-services/service-desktop/WorkerDesktop.cpp +++ b/module-services/service-desktop/WorkerDesktop.cpp @@ -202,20 +202,21 @@ bool WorkerDesktop::handleIrqQueueMessage(std::shared_ptr &que return false; } - LOG_DEBUG("USB status: %s", magic_enum::enum_name(notification).data()); - if (notification == bsp::USBDeviceStatus::Connected) { + LOG_DEBUG("USB status: Connected"); ownerService->bus.sendMulticast(std::make_shared(), sys::BusChannel::USBNotifications); usbStatus = bsp::USBDeviceStatus::Connected; } else if (notification == bsp::USBDeviceStatus::Configured) { if (usbStatus == bsp::USBDeviceStatus::Connected) { + LOG_DEBUG("USB status: First configuration"); ownerService->bus.sendUnicast( std::make_shared(sdesktop::usb::USBConfigurationType::firstConfiguration), service::name::service_desktop); } else { + LOG_DEBUG("USB status: Reconfiguration"); ownerService->bus.sendUnicast( std::make_shared(sdesktop::usb::USBConfigurationType::reconfiguration), service::name::service_desktop); @@ -223,6 +224,7 @@ bool WorkerDesktop::handleIrqQueueMessage(std::shared_ptr &que usbStatus = bsp::USBDeviceStatus::Configured; } else if (notification == bsp::USBDeviceStatus::Disconnected) { + LOG_DEBUG("USB status: Disconnected"); ownerService->bus.sendMulticast(std::make_shared(), sys::BusChannel::USBNotifications); usbStatus = bsp::USBDeviceStatus::Disconnected; @@ -231,6 +233,7 @@ bool WorkerDesktop::handleIrqQueueMessage(std::shared_ptr &que bsp::usbHandleDataReceived(); } else if (notification == bsp::USBDeviceStatus::Reset) { + LOG_DEBUG("USB status: Reset"); if (usbStatus == bsp::USBDeviceStatus::Configured) { reset(); } diff --git a/pure_changelog.md b/pure_changelog.md index b52c6236b534cc8b81772e4911a570522e9c6198..576f003101c8db05b4ba3534cdf329a6ba9087b2 100644 --- a/pure_changelog.md +++ b/pure_changelog.md @@ -2,6 +2,9 @@ ## Unreleased +### Changed / Improved +* Changed USB logging + ### Fixed * Fixed improper duration of the rejected outgoing call shown in calls log * Fixed turning on loudspeaker before outgoing call is answered