Files
MuditaOS/module-bluetooth/Bluetooth/command/Command.cpp
Bartosz Cichocki 31db992c5c [MOS-264] Add handling of signal strength and operator name in HFP
To be able to display signal strength, operator name and
rest of status indicators in Bluetooth's HFP profile, some
refactor has been done.
2022-04-11 11:46:30 +02:00

27 lines
634 B
C++

// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#include "Command.hpp"
#include <log/log.hpp>
namespace bluetooth
{
Command::Command(CommandPack &&pack) : pack(std::move(pack))
{}
auto Command::getType() const noexcept -> Command::Type
{
return pack.commandType;
}
auto Command::getData() -> DataVariant
{
if (pack.data == nullptr) {
LOG_ERROR("Terrible,terrible damage!");
return DataVariant{};
}
return pack.data->getData();
}
} // namespace bluetooth