/* * @file NotificationMuxChannel.cpp * @author Mateusz Piesta (mateusz.piesta@mudita.com) * @date 28.06.19 * @brief * @copyright Copyright (C) 2019 mudita.com * @details */ #include "NotificationMuxChannel.hpp" #include #include "MuxDaemon.hpp" NotificationMuxChannel::NotificationMuxChannel(MuxDaemon* mux): MuxChannel(mux,1,MuxChannel::MuxChannelType ::Notification,"NotificationChannel") { } NotificationMuxChannel::~NotificationMuxChannel() { } int NotificationMuxChannel::ParseInMessage(MuxChannel::MuxChannelMsg *msg) { // Incoming call if (msg->m_data.find("RING") != std::string::npos) { //TODO:M.P incoming call URC action LOG_DEBUG((name + ": incoming call...").c_str()); char* resp = "AT\r"; mux->WriteMuxFrame(GetChannelNumber(), reinterpret_cast(resp),strlen(resp), static_cast(MuxDefines::GSM0710_TYPE_UIH)); } // Incoming call if (msg->m_data.find("+CRING") != std::string::npos) { //TODO:M.P incoming call URC action LOG_DEBUG((name + ": incoming call...").c_str()); } // Call aborted/failed if (msg->m_data.find("NO CARRIER") != std::string::npos) { //TODO:M.P handle it LOG_DEBUG((name + ": call failed/aborted").c_str()); } // Received new SMS if (msg->m_data.find("+CMTI: ") != std::string::npos) { //TODO:M.P handle new SMS LOG_DEBUG((name + ": received new SMS: " + msg->m_data).c_str()); } }