mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-07-04 05:06:58 -04:00
BlueKitchen requests from data, which doesn't mean it knows amount need - need to provide handling to buffer in Uart handler - than copy form handler on request, then sent notification when ready
56 lines
1.4 KiB
C++
56 lines
1.4 KiB
C++
#include "ServiceBluetooth.hpp"
|
|
#include "Service/Service.hpp"
|
|
#include "Service/Message.hpp"
|
|
#include "MessageType.hpp"
|
|
#include <log/log.hpp>
|
|
|
|
const char *ServiceBluetooth::serviceName = "ServiceBluetooth";
|
|
|
|
ServiceBluetooth::ServiceBluetooth() : sys::Service(serviceName) {
|
|
LOG_INFO("[ServiceBluetooth] Initializing");
|
|
testTimerID = CreateTimer(3000,true);
|
|
ReloadTimer(testTimerID);
|
|
//// TODO TESTING - creating dangling pointer right now
|
|
LOG_INFO("create!\n");
|
|
worker=std::make_unique<BluetoothWorker>(this);
|
|
// LOG_INFO("BluetoothWorker -> scan!\n");
|
|
// worker->scan();
|
|
}
|
|
|
|
ServiceBluetooth::~ServiceBluetooth() {
|
|
LOG_INFO("[ServiceBluetooth] Cleaning resources");
|
|
}
|
|
|
|
// Invoked when timer ticked
|
|
void ServiceBluetooth::TickHandler(uint32_t id) {
|
|
}
|
|
|
|
// Invoked during initialization
|
|
sys::ReturnCodes ServiceBluetooth::InitHandler() {
|
|
|
|
return sys::ReturnCodes::Success;
|
|
}
|
|
|
|
sys::ReturnCodes ServiceBluetooth::DeinitHandler() {
|
|
|
|
return sys::ReturnCodes::Success;
|
|
}
|
|
|
|
sys::ReturnCodes ServiceBluetooth::WakeUpHandler() {
|
|
return sys::ReturnCodes::Success;
|
|
}
|
|
|
|
|
|
sys::ReturnCodes ServiceBluetooth::SleepHandler() {
|
|
return sys::ReturnCodes::Success;
|
|
}
|
|
|
|
sys::Message_t ServiceBluetooth::DataReceivedHandler(sys::DataMessage *msgl) {
|
|
std::shared_ptr<sys::ResponseMessage> responseMsg;
|
|
switch (static_cast<MessageType >(msgl->messageType)) {
|
|
default:
|
|
break;
|
|
}
|
|
return responseMsg;
|
|
}
|