1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2025-12-15 06:53:07 +01:00

#12: multiple capabilities in user task, user init function, cleanup message handling in main, clearer api

This commit is contained in:
wellenvogel
2021-12-01 20:03:33 +01:00
parent 16cf7655f0
commit c105eef969
9 changed files with 215 additions and 126 deletions

View File

@@ -4,6 +4,12 @@
#include "GwExampleTask.h"
#include "GwApi.h"
/**
* an init function that ist being called before other initializations from the core
*/
void exampleInit(GwApi *api){
api->getLogger()->logDebug(GwLog::LOG,"example init running");
}
#define INVALID_COORD -99999
class GetBoatDataRequest: public GwMessage{
private:
@@ -32,8 +38,7 @@ class GetBoatDataRequest: public GwMessage{
longitude=api->getBoatData()->Longitude->getDataWithDefault(INVALID_COORD);
};
};
void exampleTask(void *param){
GwApi *api=(GwApi*)param;
void exampleTask(GwApi *api){
GwLog *logger=api->getLogger();
//get some configuration data
bool exampleSwitch=api->getConfig()->getConfigItem(