Removed test code, small update in ServiceDB's destructor. Ready to merge

This commit is contained in:
Mati
2019-06-11 13:32:53 +02:00
parent 61ac4f477a
commit 6e1f9ebda1
3 changed files with 7 additions and 20 deletions

View File

@@ -84,7 +84,7 @@ sys::ReturnCodes ApplicationManager::InitHandler() {
//search for application with specified name and run it
//TODO name of the app should be Homescreen but for tests is is "ApplicationClock"
std::string runAppName = "ApplicationViewer";
std::string runAppName = "ApplicationClock";
auto it = applications.find(runAppName);
if( it!= applications.end()){

View File

@@ -35,6 +35,10 @@ ServiceDB::ServiceDB()
ServiceDB::~ServiceDB() {
settingsDB.reset();
contactsDB.reset();
smsDB.reset();
Database::Deinitialize();
LOG_INFO("[ServiceDB] Cleaning resources");
}

View File

@@ -124,30 +124,13 @@ public:
// Invoked upon receiving data message
sys::Message_t DataReceivedHandler(sys::DataMessage* msgl) override{
auto ret = DBServiceAPI::SettingsGet(this);
ret.language = SettingsLanguage ::GERMAN;
ret.networkOperator = "MuditaConnectingPeople";
DBServiceAPI::SettingsUpdate(this,ret);
auto records = DBServiceAPI::SMSGetLimitOffset(this,0,4);
auto threads = DBServiceAPI::ThreadGetLimitOffset(this,0,4);
auto contacts = DBServiceAPI::ContactGetLimitOffset(this,0,4);
auto smsthread = DBServiceAPI::SMSGetLimitOffsetByThreadID(this,0,4,1);
LOG_ERROR("Available heap: %lu",usermemGetFreeHeapSize());
return std::make_shared<sys::ResponseMessage>( );
}
// Invoked when timer ticked
void TickHandler(uint32_t id) override{
auto msg = std::make_shared<sys::DataMessage>(500);
sys::Bus::SendUnicast(msg,"Blinky",this);
//auto msg = std::make_shared<sys::DataMessage>(500);
//sys::Bus::SendUnicast(msg,"Blinky",this);
LOG_DEBUG("Blinky service tick!");
}