Skip to content

Commit

Permalink
Fix on all Diagnostic error (#471)
Browse files Browse the repository at this point in the history
  • Loading branch information
MSECode authored Feb 23, 2024
1 parent 6ad7f5a commit 5c1d78a
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ namespace embot { namespace app { namespace eth {
.property =
{
Process::eApplication,
{1, 13},
{2024, Month::Feb, Day::fifteen, 11, 00}
{1, 14},
{2024, Month::Feb, Day::twentythree, 13, 00}
},
.OStick = 1000*embot::core::time1microsec,
.OSstacksizeinit = 10*1024,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,19 +81,19 @@ extern "C" {
#define EOMTHEEMSAPPLCFG_VERSION_MAJOR (VERSION_MAJOR_OFFSET+3)
// <o> minor <0-255>
// <o> minor <0-255>
#define EOMTHEEMSAPPLCFG_VERSION_MINOR 83
#define EOMTHEEMSAPPLCFG_VERSION_MINOR 84

// </h>version

// <h> build date
// <o> year <2010-2030>
#define EOMTHEEMSAPPLCFG_BUILDDATE_YEAR 2024
// <o> month <1-12>
#define EOMTHEEMSAPPLCFG_BUILDDATE_MONTH 1
#define EOMTHEEMSAPPLCFG_BUILDDATE_MONTH 2
// <o> day <1-31>
#define EOMTHEEMSAPPLCFG_BUILDDATE_DAY 8
#define EOMTHEEMSAPPLCFG_BUILDDATE_DAY 23
// <o> hour <0-23>
#define EOMTHEEMSAPPLCFG_BUILDDATE_HOUR 18
#define EOMTHEEMSAPPLCFG_BUILDDATE_HOUR 13
// <o> minute <0-59>
#define EOMTHEEMSAPPLCFG_BUILDDATE_MIN 00
// </h>build date
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ struct embot::app::eth::CANmonitor::Impl
embot::core::Time timeofdisappearance {0};

MAP boards2touch {0, 0};
MAP boards2report {0, 0};

bool transmissionisactive {false};
bool allboardsarealive {false};
Expand Down Expand Up @@ -109,7 +110,8 @@ bool embot::app::eth::CANmonitor::Impl::start()
return false;
}

boards2touch = _config.target;
boards2touch = boards2report = _config.target;

state = State::OK;
allboardsarealive = true;
active = true;
Expand All @@ -121,6 +123,7 @@ bool embot::app::eth::CANmonitor::Impl::stop()
{
// log("stop()");
boards2touch.clear();
boards2report.clear();
state = State::OK;
allboardsarealive = false;
active = false;
Expand Down Expand Up @@ -149,11 +152,10 @@ bool embot::app::eth::CANmonitor::Impl::tick()
{
regularreportnow = true;
}

MAP boards2report {};

if(true == checknow)
{
boards2report.clear();
timeoflastcheck = timenow;

bool allboardstouched = boards2touch.empty();
Expand Down Expand Up @@ -215,16 +217,16 @@ bool embot::app::eth::CANmonitor::Impl::tick()
case State::OK:
{
// alwayslog("OK");
errdes.par16 = 0;
errdes.par16 = _config.servicecategory;
errdes.par64 = boards2report.getcompact();
errdes.code = eoerror_code_get(eoerror_category_System, eoerror_value_SYS_canservices_monitor_regularcontact);
eo_errman_Error(eo_errman_GetHandle(), eo_errortype_info, NULL, _config.ownername, &errdes);
eo_errman_Error(eo_errman_GetHandle(), eo_errortype_info, NULL, _config.ownername, &errdes);
} break;

case State::justLOST:
{
// alwayslog("jLOST");
errdes.par16 = 0;
errdes.par16 = _config.servicecategory;
errdes.par64 = boards2report.getcompact();
errdes.code = eoerror_code_get(eoerror_category_System, eoerror_value_SYS_canservices_monitor_lostcontact);
eo_errman_Error(eo_errman_GetHandle(), eo_errortype_error, NULL, _config.ownername, &errdes);
Expand All @@ -234,7 +236,7 @@ bool embot::app::eth::CANmonitor::Impl::tick()
{
// alwayslog("JFOUND");
uint64_t mspassed = (timenow-timeofdisappearance)/1000;
errdes.par16 = 0;
errdes.par16 = _config.servicecategory;
errdes.par64 = (mspassed << 32) | boards2report.getcompact();
errdes.code = eoerror_code_get(eoerror_category_System, eoerror_value_SYS_canservices_monitor_retrievedcontact);
eo_errman_Error(eo_errman_GetHandle(), eo_errortype_warning, NULL, _config.ownername, &errdes);
Expand All @@ -244,7 +246,7 @@ bool embot::app::eth::CANmonitor::Impl::tick()
{
// alwayslog("sLOST");
uint64_t mspassed = (timenow-timeofdisappearance)/1000;
errdes.par16 = 0;
errdes.par16 = _config.servicecategory;
errdes.par64 = (mspassed << 32) | boards2report.getcompact();
errdes.code = eoerror_code_get(eoerror_category_System, eoerror_value_SYS_canservices_monitor_stillnocontact);
eo_errman_Error(eo_errman_GetHandle(), eo_errortype_error, NULL, _config.ownername, &errdes);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ and `justLOST` states may happen if some boards keep on disappearing and reappea

constexpr Config(const MAP &map, embot::core::relTime rc, Report rm, embot::core::relTime rr, const char *o, eOmn_serv_category_t s)
{
target = map; periodofcheck = rc; reportmode = rm; ownername = o; servicecategory = s;
target = map; periodofcheck = rc; reportmode = rm; periodofreport = rr; ownername = o; servicecategory = s;
}

Config() = default;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,19 @@ extern "C" {
#define EOMTHEEMSAPPLCFG_VERSION_MAJOR 3
// <o> minor <0-255>
// <o> minor <0-255>
#define EOMTHEEMSAPPLCFG_VERSION_MINOR 65
#define EOMTHEEMSAPPLCFG_VERSION_MINOR 66

// </h>version

// <h> build date
// <o> year <2010-2030>
#define EOMTHEEMSAPPLCFG_BUILDDATE_YEAR 2024
// <o> month <1-12>
#define EOMTHEEMSAPPLCFG_BUILDDATE_MONTH 1
#define EOMTHEEMSAPPLCFG_BUILDDATE_MONTH 2
// <o> day <1-31>
#define EOMTHEEMSAPPLCFG_BUILDDATE_DAY 8
#define EOMTHEEMSAPPLCFG_BUILDDATE_DAY 23
// <o> hour <0-23>
#define EOMTHEEMSAPPLCFG_BUILDDATE_HOUR 18
#define EOMTHEEMSAPPLCFG_BUILDDATE_HOUR 13
// <o> minute <0-59>
#define EOMTHEEMSAPPLCFG_BUILDDATE_MIN 00
// </h>build date
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,19 +84,19 @@ extern "C" {
#define EOMTHEEMSAPPLCFG_VERSION_MAJOR (VERSION_MAJOR_OFFSET+3)
// <o> minor <0-255>

#define EOMTHEEMSAPPLCFG_VERSION_MINOR 86
#define EOMTHEEMSAPPLCFG_VERSION_MINOR 87

// </h>version

// <h> build date
// <o> year <2010-2030>
#define EOMTHEEMSAPPLCFG_BUILDDATE_YEAR 2024
// <o> month <1-12>
#define EOMTHEEMSAPPLCFG_BUILDDATE_MONTH 1
#define EOMTHEEMSAPPLCFG_BUILDDATE_MONTH 2
// <o> day <1-31>
#define EOMTHEEMSAPPLCFG_BUILDDATE_DAY 8
#define EOMTHEEMSAPPLCFG_BUILDDATE_DAY 23
// <o> hour <0-23>
#define EOMTHEEMSAPPLCFG_BUILDDATE_HOUR 18
#define EOMTHEEMSAPPLCFG_BUILDDATE_HOUR 13
// <o> minute <0-59>
#define EOMTHEEMSAPPLCFG_BUILDDATE_MIN 00

Expand Down

0 comments on commit 5c1d78a

Please sign in to comment.