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

add error example, improve debug messages

This commit is contained in:
andreas
2023-10-24 15:10:13 +02:00
parent 0db0dd4322
commit 155c7a8d1c
2 changed files with 20 additions and 3 deletions

View File

@@ -7,6 +7,20 @@
#include "GWConfig.h"
#include <vector>
/**
* INVALID!!! - the next interface declaration will not work
* as it is not in the correct header file
* it is just included here to show you how errors
* could be created.
* if you call the apiSetExampleNotWorkingIf method
* it will always return false
*/
class ExampleNotWorkingIf: public GwApi::TaskInterfaces::Base{
public:
int someValue=99;
};
DECLARE_TASKIF(exampleTask,ExampleNotWorkingIf);
/**
* an init function that ist being called before other initializations from the core
*/
@@ -103,6 +117,9 @@ void exampleTask(GwApi *api){
int apiResult=0;
ExampleTaskIf e1=apiGetExampleTaskIf(api,apiResult);
LOG_DEBUG(GwLog::LOG,"exampleIf before rs=%d,v=%d,s=%s",apiResult,e1.count,e1.someValue.c_str());
ExampleNotWorkingIf nw1;
bool nwrs=apiSetExampleNotWorkingIf(api,nw1);
LOG_DEBUG(GwLog::LOG,"exampleNotWorking update returned %d",(int)nwrs);
while(true){
delay(1000);
/*