~aleteoryx/muditaos

3d13f10839e218b65dc247f03a15fb5dfa87bc8b — Bartosz 3 years ago 946e34d
[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
2 files changed, 8 insertions(+), 2 deletions(-)

M module-services/service-desktop/WorkerDesktop.cpp
M pure_changelog.md
M module-services/service-desktop/WorkerDesktop.cpp => module-services/service-desktop/WorkerDesktop.cpp +5 -2
@@ 202,20 202,21 @@ bool WorkerDesktop::handleIrqQueueMessage(std::shared_ptr<sys::WorkerQueue> &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<sdesktop::usb::USBConnected>(),
                                        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::USBConfigured>(sdesktop::usb::USBConfigurationType::firstConfiguration),
                service::name::service_desktop);
        }
        else {
            LOG_DEBUG("USB status: Reconfiguration");
            ownerService->bus.sendUnicast(
                std::make_shared<sdesktop::usb::USBConfigured>(sdesktop::usb::USBConfigurationType::reconfiguration),
                service::name::service_desktop);


@@ 223,6 224,7 @@ bool WorkerDesktop::handleIrqQueueMessage(std::shared_ptr<sys::WorkerQueue> &que
        usbStatus = bsp::USBDeviceStatus::Configured;
    }
    else if (notification == bsp::USBDeviceStatus::Disconnected) {
        LOG_DEBUG("USB status: Disconnected");
        ownerService->bus.sendMulticast(std::make_shared<sdesktop::usb::USBDisconnected>(),
                                        sys::BusChannel::USBNotifications);
        usbStatus = bsp::USBDeviceStatus::Disconnected;


@@ 231,6 233,7 @@ bool WorkerDesktop::handleIrqQueueMessage(std::shared_ptr<sys::WorkerQueue> &que
        bsp::usbHandleDataReceived();
    }
    else if (notification == bsp::USBDeviceStatus::Reset) {
        LOG_DEBUG("USB status: Reset");
        if (usbStatus == bsp::USBDeviceStatus::Configured) {
            reset();
        }

M pure_changelog.md => pure_changelog.md +3 -0
@@ 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