# Wakeup Reason Listener This sample application demonstrates how to register a listener to receive wakeup event notifications. The application shows how to handle both QMI transaction wakeups and Wake-on-Wireless (WoW) events. 1. Implement IWakeupListener and IServiceStatusListener interfaces class WakeupReasonListener : public telux::power::IWakeupListener, public telux::common::IServiceStatusListener { public: void onWakeup(const telux::power::WakeupEventInfo &eventInfo) override { // eventInfo.type: Indicates wakeup event type (QMI or WoW) // eventInfo.qmiWakeupInfo: QMI transaction details (serviceId, nodeIds, msgId, pid, processName) // eventInfo.wowWakeupInfo: Wireless event details (timestamp, wakeupReason, macAddress, interfaceName, pbmBuffer) // Avoid long blocking calls when handling notifications } void onServiceStatusChange(telux::common::ServiceStatus status) override { // status: Indicates service availability (SERVICE_AVAILABLE or SERVICE_UNAVAILABLE) // Process service status transitions accordingly } }; Copy to clipboard 2. Get an instance of PowerFactory and obtain a WakeupManager instance auto &powerFactory = telux::power::PowerFactory::getInstance(); std::promise prom = std::promise(); auto wakeupMgr = powerFactory.getWakeupManager( [&](telux::common::ServiceStatus status) { std::cout << " Init Callback called " << std::endl; prom.set_value(status); }); Copy to clipboard 3. Wait for the wakeup management services to be initialized and ready if (wakeupMgr == nullptr) { std::cout << " ERROR - Failed to get manager instance" << std::endl; } std::cout << " Waiting for Wakeup Manager to be ready" << std::endl; telux::common::ServiceStatus serviceStatus = prom.get_future().get(); Copy to clipboard 4. Exit the application, if SDK is unable to initialize wakeup management service if (serviceStatus == telux::common::ServiceStatus::SERVICE_AVAILABLE) { std::cout << " *** Wakeup management service is Ready *** " << std::endl; } else { std::cout << " *** ERROR - Unable to initialize wakeup management service" << std::endl; return 1; } Copy to clipboard 5. Instantiate WakeupReasonListener and register for wakeup event notifications auto listener = std::make_shared(); telux::power::WakeupIndications indications; indications.set(telux::power::WakeupIndicationsType::DEFAULT); indications.set(telux::power::WakeupIndicationsType::QMI_WAKEUP); indications.set(telux::power::WakeupIndicationsType::WOW_WAKEUP); auto ec = wakeupMgr->registerListener(listener, indications); if (ec != telux::common::ErrorCode::SUCCESS) { std::cout << "Can't register listener" << std::endl; return -1; } Copy to clipboard 6. Wait for wakeup event notifications The listener will receive wakeup events through the onWakeup callback. The application waits for events to be processed: std::cout << "Listener registered, waiting for wakeup events..." << std::endl; // The onWakeup callback will be invoked when wakeup events occur // Avoid long blocking calls when handling notifications std::this_thread::sleep_for(std::chrono::seconds(60)); Copy to clipboard 7. Deregister the listener when finished wakeupMgr->deRegisterListener(listener); std::cout << "Listener deregistered" << std::endl; Copy to clipboard Wakeup Event Types The application can receive two types of wakeup events: 1. QMI Wakeup Events - Triggered by QMI transactions - Contains service ID, node IDs, message ID - Includes process information (PID, process name) 2. Wake-on-Wireless (WoW) Events - Triggered by wireless events - Contains timestamp and wakeup reason code - Includes MAC address and interface name - Includes pattern buffer (pbmBuffer) information - Supports various WoW reasons Last Published: Aug 05, 2026 [Previous Topic Set TCU activity state](https://docs.qualcomm.com/bundle/publicresource/80-PF458-9/topics/set_tcu_activity_state.md) [Next Topic Thermal](https://docs.qualcomm.com/bundle/publicresource/80-PF458-9/topics/thermal.md)