70 case eoerror_value_CFG_candiscovery_started:
73 eObrd_type_t brdnum =
static_cast<eObrd_type_t
>((
m_dnginfo.
param64 & 0x0000ff0000000000) >> 40);
74 const char *canboardname = eoboards_type2string(brdnum);
76 eObrd_protocolversion_t prot = {0};
77 eObrd_firmwareversion_t appl = {0};
81 prot.major = reqpr >> 8;
82 prot.minor = reqpr & 0xff;
83 appl.major = (reqfw >> 16) & 0xff;
84 appl.minor = (reqfw >> 8) & 0xff;
85 appl.build = reqfw & 0xff;
86 num = eo_common_hlfword_bitsetcount(maskcan1)+eo_common_hlfword_bitsetcount(maskcan2);
88 snprintf(str,
sizeof(str),
" %s %d %s boards on (can1map, can2map) = (0x%.4x, 0x%.4x) with target can protocol ver %d.%d and application ver %d.%d.%d.",
92 prot.major, prot.minor,
93 appl.major, appl.minor, appl.build
98 case eoerror_value_CFG_candiscovery_ok:
101 eObool_t fakesearch = (0x0000 == (
m_dnginfo.
param16 & 0xf000)) ? (eobool_false) : (eobool_true);
103 const char *canboardname = eoboards_type2string(
static_cast<eObrd_type_t
>(brdnum));
105 eObrd_protocolversion_t prot = {0};
106 eObrd_firmwareversion_t appl = {0};
109 char strOK[80] =
"OK";
111 prot.major = reqpr >> 8;
112 prot.minor = reqpr & 0xff;
113 appl.major = (reqfw >> 16) & 0xff;
114 appl.minor = (reqfw >> 8) & 0xff;
115 appl.build = reqfw & 0xff;
118 if(eobool_true == fakesearch)
120 snprintf(strOK,
sizeof(strOK),
"OK but FAKE (without any control on CAN w/ get-fw-version<> message)");
123 snprintf(str,
sizeof(str),
"%s is %s for %d %s boards with target can protocol ver %d.%d and application ver %d.%d.%d. Search time was %d ms",
127 prot.major, prot.minor,
128 appl.major, appl.minor, appl.build,
134 case eoerror_value_CFG_candiscovery_detectedboard:
137 const char *canboardname = eoboards_type2string(
static_cast<eObrd_type_t
>(brdnum));
139 eObrd_protocolversion_t prot = {0};
140 eObrd_firmwareversion_t appl = {0};
144 prot.major = reqpr >> 8;
145 prot.minor = reqpr & 0xff;
146 appl.major = (reqfw >> 16) & 0xff;
147 appl.minor = (reqfw >> 8) & 0xff;
148 appl.build = reqfw & 0xff;
152 snprintf(str,
sizeof(str),
"%s %s board in %s addr %d with can protocol ver %d.%d and application ver %d.%d.%d Search time was %d ms",
156 prot.major, prot.minor,
157 appl.major, appl.minor, appl.build,
163 case eoerror_value_CFG_candiscovery_boardsmissing:
166 const char *canboardname = eoboards_type2string(
static_cast<eObrd_type_t
>((
m_dnginfo.
param16 >> 8)));
173 snprintf(str,
sizeof(str),
"%s %d missing %s boards for %d ms in %s:",
183 if(eobool_true == eo_common_hlfword_bitcheck(maskofmissing, i))
185 snprintf(str,
sizeof(str),
"%d of %d: missing %s BOARD %s:%s:%d",
186 n, numofmissing, canboardname,
197 case eoerror_value_CFG_candiscovery_boardsinvalid:
200 const char *canboardname = eoboards_type2string(
static_cast<eObrd_type_t
>(
m_dnginfo.
param16 >> 8));
204 const char *empty =
"";
205 const char *wrongtype =
"WRONG BOARD TYPE";
206 const char *wrongprot =
"WRONG PROTOCOL VERSION";
207 const char *wrongappl =
"WRONG APPLICATION VERSION";
209 snprintf(str,
sizeof(str),
"%s %d invalid %s boards in %s:\n",
217 for(
int i=1; i<15; i++)
219 uint64_t val = (invalidmask >> (4*i)) & 0x0f;
222 snprintf(str,
sizeof(str),
"\t %d of %d: wrong %s because it has: %s%s%s \n",
223 n, numofinvalid, canboardname,
224 ((val & 0x1) == 0x1) ? (wrongtype) : (empty),
225 ((val & 0x2) == 0x2) ? (wrongappl) : (empty),
226 ((val & 0x4) == 0x4) ? (wrongprot) : (empty)
237 case eoerror_value_CFG_skin_ok:
241 eObrd_protocolversion_t prot = {0};
242 eObrd_firmwareversion_t appl = {0};
245 prot.major = reqpr >> 8;
246 prot.minor = reqpr & 0xff;
247 appl.major = (reqfw >> 8) & 0xff;
248 appl.minor = reqfw & 0xff;
251 snprintf(str,
sizeof(str),
"%s on %d skin patches for boards on (can1map, can2map) = (0x%.4x, 0x%.4x) with target can protocol ver %d.%d and application ver %d.%d",
255 prot.major, prot.minor,
256 appl.major, appl.minor
261 case eoerror_value_CFG_skin_failed_toomanyboards:
262 case eoerror_value_CFG_inertials3_failed_toomanyboards:
263 case eoerror_value_CFG_temperatures_failed_toomanyboards:
271 snprintf(str,
sizeof(str),
" %s for %d boards. Limit of max number of boards is %d. Boards are on (can1map, can2map) = (0x%.4x, 0x%.4x)",
273 numOfReqBoards, numOfMaxBoards,
279 case eoerror_value_CFG_skin_failed_candiscovery:
280 case eoerror_value_CFG_inertials3_failed_candiscovery:
281 case eoerror_value_CFG_temperatures_failed_candiscovery:
289 if (eoerror_value_CFG_skin_failed_candiscovery == value)
291 snprintf(str,
sizeof(str),
"%s for %d skin patches. ",
m_dnginfo.
baseMessage.c_str(), numOfPatches);
300 snprintf(str,
sizeof(str),
"Missing can boards on (can1map, can2map) = (0x%.4x, 0x%.4x) and found but incompatible can boards on (can1map, can2map) = (0x%.4x, 0x%.4x)",
301 missMaskcan1, missMaskcan2,
302 incompMaskcan1, incompMaskcan2
308 case eoerror_value_CFG_strain_ok:
309 case eoerror_value_CFG_strain_failed_candiscovery:
311 eObrd_protocolversion_t prot = {0};
312 eObrd_firmwareversion_t appl = {0};
315 prot.major = reqpr >> 8;
316 prot.minor = reqpr & 0xff;
317 appl.major = (reqfw >> 8) & 0xff;
318 appl.minor = reqfw & 0xff;
323 snprintf(str,
sizeof(str),
"%s for board at addr:%d and port:%d with can protocol ver %d.%d and application ver %d.%d. Strain number is:%d",
326 prot.major, prot.minor,
327 appl.major, appl.minor,
333 case eoerror_value_CFG_mais_ok:
334 case eoerror_value_CFG_mais_failed_candiscovery:
335 case eoerror_value_CFG_psc_ok:
336 case eoerror_value_CFG_psc_failed_candiscovery:
337 case eoerror_value_CFG_pos_ok:
338 case eoerror_value_CFG_pos_failed_candiscovery:
340 eObrd_protocolversion_t prot = {0};
341 eObrd_firmwareversion_t appl = {0};
344 prot.major = reqpr >> 8;
345 prot.minor = reqpr & 0xff;
346 appl.major = (reqfw >> 8) & 0xff;
347 appl.minor = reqfw & 0xff;
351 snprintf(str,
sizeof(str),
"%s on board at addr: %d and port:%d with can protocol ver %d.%d and application ver %d.%d.",
355 prot.major, prot.minor,
356 appl.major, appl.minor
361 case eoerror_value_CFG_mais_failed_verify_because_active:
362 case eoerror_value_CFG_mc_foc_ok:
363 case eoerror_value_CFG_mc_foc_failed_candiscovery_of_foc:
364 case eoerror_value_CFG_mc_foc_failed_encoders_verify:
365 case eoerror_value_CFG_mc_mc4_ok:
366 case eoerror_value_CFG_mc_mc4_failed_candiscovery_of_mc4:
367 case eoerror_value_CFG_mc_mc4_failed_mais_verify:
368 case eoerror_value_CFG_mc_mc4plus_ok:
369 case eoerror_value_CFG_mc_mc4plus_failed_encoders_verify:
370 case eoerror_value_CFG_comm_cannotloadaregularrop:
371 case eoerror_value_CFG_mc_mc4plusmais_ok:
372 case eoerror_value_CFG_mc_mc4plusmais_failed_encoders_verify:
373 case eoerror_value_CFG_mc_mc4plusmais_failed_candiscovery_of_mais:
374 case eoerror_value_CFG_services_not_verified_yet:
375 case eoerror_value_CFG_mc_not_verified_yet:
376 case eoerror_value_CFG_strain_not_verified_yet:
377 case eoerror_value_CFG_mais_not_verified_yet:
378 case eoerror_value_CFG_skin_not_verified_yet:
379 case eoerror_value_CFG_inertials3_not_verified_yet:
380 case eoerror_value_CFG_encoders_not_verified_yet:
381 case eoerror_value_CFG_mc_using_onboard_config:
382 case eoerror_value_CFG_strain_using_onboard_config:
383 case eoerror_value_CFG_mais_using_onboard_config:
384 case eoerror_value_CFG_inertials3_using_onboard_config:
385 case eoerror_value_CFG_skin_using_onboard_config:
386 case eoerror_value_CFG_inertials3_ok:
387 case eoerror_value_CFG_temperatures_not_verified_yet:
388 case eoerror_value_CFG_temperatures_ok:
389 case eoerror_value_CFG_temperatures_using_onboard_config:
390 case eoerror_value_CFG_psc_failed_verify_because_active:
391 case eoerror_value_CFG_psc_not_verified_yet:
392 case eoerror_value_CFG_psc_using_onboard_config:
393 case eoerror_value_CFG_mc_mc2pluspsc_ok:
394 case eoerror_value_CFG_mc_mc2pluspsc_failed_encoders_verify:
395 case eoerror_value_CFG_mc_mc2pluspsc_failed_candiscovery_of_pscs:
396 case eoerror_value_CFG_inertials3_failed_notsupported:
397 case eoerror_value_CFG_temperatures_failed_notsupported:
398 case eoerror_value_CFG_mais_failed_notsupported:
399 case eoerror_value_CFG_strain_failed_notsupported:
400 case eoerror_value_CFG_skin_failed_notsupported:
401 case eoerror_value_CFG_psc_failed_notsupported:
402 case eoerror_value_CFG_mc_failed_notsupported:
403 case eoerror_value_CFG_encoders_failed_notsupported:
404 case eoerror_value_CFG_pos_not_verified_yet:
405 case eoerror_value_CFG_pos_using_onboard_config:
406 case eoerror_value_CFG_pos_failed_notsupported:
407 case eoerror_value_CFG_mc_mc4plusfaps_ok:
408 case eoerror_value_CFG_mc_mc4plusfaps_failed_encoders_verify:
409 case eoerror_value_CFG_mc_mc4plusfaps_failed_candiscovery:
410 case eoerror_value_CFG_mc_mc4pluspmc_ok:
411 case eoerror_value_CFG_mc_mc4pluspmc_failed_encoders_verify:
412 case eoerror_value_CFG_mc_mc4pluspmc_failed_candiscovery_of_pmc:
413 case eoerror_value_CFG_ft_ok:
414 case eoerror_value_CFG_ft_failed_candiscovery:
415 case eoerror_value_CFG_ft_not_verified_yet:
416 case eoerror_value_CFG_ft_using_onboard_config:
417 case eoerror_value_CFG_ft_failed_notsupported:
418 case eoerror_value_CFG_ft_failed_fullscales:
419 case eoerror_value_CFG_bat_ok:
420 case eoerror_value_CFG_bat_failed_candiscovery:
421 case eoerror_value_CFG_bat_not_verified_yet:
422 case eoerror_value_CFG_bat_using_onboard_config:
423 case eoerror_value_CFG_bat_failed_notsupported:
429 case eoerror_value_CFG_encoders_ok:
430 case eoerror_value_CFG_encoders_failed_verify:
438 int16_t rawerror1 = errorenc1 & failmaskenc1;
439 int16_t rawerror2 = errorenc2 & failmaskenc2;
443 for(
auto i=0; i < numOfJoints; i++)
446 auto primary_enc_with_error = (failmaskenc1 & (1<<i));
447 auto secondary_enc_with_error = (failmaskenc2 & (1<<i));
448 auto primary_error_code = 0;
449 auto secondary_error_code = 0;
450 if(primary_enc_with_error)
452 primary_error_code = ( (errorenc1 & (0xf <<i)) >> 4*i);
454 snprintf(str,
sizeof(str),
" joint %d (%s) has error on primary encoder (code=%d). ",
459 if(secondary_enc_with_error)
461 secondary_error_code = ( (errorenc2 & (0xf <<i)) >> 4*i);
463 snprintf(str,
sizeof(str),
" joint %d (%s) has error on secodary encoder (code=%d)",
473 case eoerror_value_CFG_inertials3_failed_unsupportedsensor:
477 snprintf(str,
sizeof(str),
"%s. Number of unsupported sens is %d",
484 case eoerror_value_CFG_inertials3_changed_requestedrate:
485 case eoerror_value_CFG_temperatures_changed_requestedrate:
486 case eoerror_value_CFG_psc_changed_requestedrate:
487 case eoerror_value_CFG_pos_changed_requestedrate:
492 snprintf(str,
sizeof(str),
"%s. Requested rate %u and Assigned rate %u",
500 case eoerror_value_CFG_inertials3_failed_generic:
501 case eoerror_value_CFG_temperatures_failed_generic:
505 snprintf(str,
sizeof(str),
"%s for %d sensors",
512 case EOERROR_VALUE_DUMMY:
929 case eoerror_value_SYS_runninghappily:
931 std::string appstate =
"unknown";
934 case 0: appstate=
"just restarted";
break;
935 case 1: appstate=
"idle";
break;
936 case 2: appstate=
"running";
break;
938 snprintf(str,
sizeof(str),
" %s Application state is %s.",
m_dnginfo.
baseMessage.c_str(), appstate.c_str());
942 case eoerror_value_SYS_ctrloop_execoverflowRX:
952 snprintf(str,
sizeof(str),
" %s RX execution time %d[usec]. Latest previous execution times[usec] (..., Tx=%d);(RX=%d, DO=%d, TX=%d);",
957 case eoerror_value_SYS_ctrloop_execoverflowDO:
966 snprintf(str,
sizeof(str),
" %s DO execution time %d[usec]. Latest previous execution times[usec] (..., Tx=%s);(RX=%d, DO=%d, TX=%d); (Rx=%d, ...);",
971 case eoerror_value_SYS_ctrloop_execoverflowTX:
981 snprintf(str,
sizeof(str),
" %s TX execution time %d[usec]. Latest previous execution times[usec] (RX=%s, DO=%s, TX=%d); (Rx=%d, DO=%d, ...). Num of CAN frames[CAN1,CAN2]=[%u %u]",
986 case eoerror_value_SYS_ropparsingerror:
992 case eoerror_value_SYS_halerror:
998 case eoerror_value_SYS_osalerror:
1004 case eoerror_value_SYS_ipalerror:
1010 case eoerror_value_SYS_dispatcherfifooverflow:
1016 case eoerror_value_SYS_canservices_txfifooverflow:
1018 snprintf(str,
sizeof(str),
" %s CanPort=%s Frame.ID=%d, Frame.Size=%d Frame.Data=0x%lx",
1023 case eoerror_value_SYS_canservices_txbusfailure:
1029 case eoerror_value_SYS_canservices_formingfailure:
1035 case eoerror_value_SYS_canservices_parsingfailure:
1041 case eoerror_value_SYS_canservices_genericerror:
1048 case eoerror_value_SYS_ctrloop_rxphasemin:
1049 case eoerror_value_SYS_ctrloop_dophasemin:
1050 case eoerror_value_SYS_ctrloop_txphasemin:
1051 case eoerror_value_SYS_ctrloop_rxphaseaverage:
1052 case eoerror_value_SYS_ctrloop_dophaseaverage:
1053 case eoerror_value_SYS_ctrloop_txphaseaverage:
1054 case eoerror_value_SYS_ctrloop_rxphasemax:
1055 case eoerror_value_SYS_ctrloop_dophasemax:
1056 case eoerror_value_SYS_ctrloop_txphasemax:
1058 snprintf(str,
sizeof(str),
" %s, monitored over %f sec is %d microsec",
m_dnginfo.
baseMessage.c_str(),
1065 case eoerror_value_SYS_exec_time_stats:
1067 static constexpr const char *
const names[4] = {
"runner.RX()",
"runner.DO()",
"runner.TX()",
"other.ID = " };
1068 std::string actor = {};
1078 snprintf(str,
sizeof(str),
" %s: %s -> (%d, %d, %d) us over %f sec",
1089 case eoerror_value_SYS_proxy_forward_fails:
1091 snprintf(str,
sizeof(str),
" %s. ROP.sign=%d, ROP.id=%d. Proxy list capacity is %d, size is %d ",
1100 case eoerror_value_SYS_proxy_ropdes_notfound:
1107 case eoerror_value_SYS_canservices_canprint:
1113 case eoerror_value_SYS_canservices_rxmaisbug:
1119 case eoerror_value_SYS_canservices_rxfromwrongboard:
1125 case eoerror_value_SYS_transceiver_rxseqnumber_error:
1132 case eoerror_value_SYS_transceiver_rxseqnumber_restarted:
1138 case eoerror_value_SYS_canservices_board_detected:
1179 snprintf(str,
sizeof(str),
" %s on CAN port=%s with address %d. Fw ver is %d.%d.%d. Proto ver is %d.%d",
1181 fw_build, fw_major, fw_minor, proto_major, proto_minor );
1185 case eoerror_value_SYS_canservices_board_wrongprotversion:
1214 snprintf(str,
sizeof(str),
" %s on CAN port=%s with address %d. Fw ver is %d.%d.%d. Proto ver is %d.%d. Required Version is %d.%d",
1216 fw_build, fw_major, fw_minor, proto_major, proto_minor, req_proto_major, req_proto_minor );
1220 case eoerror_value_SYS_canservices_board_notfound:
1222 eObrd_type_t general_brd_type = eoboards_cantype2type((eObrd_cantype_t)
m_dnginfo.
param16);
1223 snprintf(str,
sizeof(str),
" %s The board is on CAN port=%s with address %d. Board type is %s.",
1230 case eoerror_value_SYS_canservices_boards_lostcontact:
1232 eOmn_serv_category_t serv_category;
1235 getCanMonitorInfo(serv_category, lostCanBoards1, lostCanBoards2);
1237 snprintf(str,
sizeof(str),
"%s Type of service category is %s. Lost can boards on (can1map, can2map) = ([ %s ], [ %s ] ).",
1239 eomn_servicecategory2string(serv_category),
1240 lostCanBoards1, lostCanBoards2
1247 case eoerror_value_SYS_canservices_boards_retrievedcontact:
1249 eOmn_serv_category_t serv_category;
1250 diagstr retrievedCanBoards1 = {0};
1251 diagstr retrievedCanBoards2 = {0};
1252 getCanMonitorInfo(serv_category, retrievedCanBoards1, retrievedCanBoards2);
1254 snprintf(str,
sizeof(str),
"%s Type of service category is %s. Retrieved can boards on (can1map, can2map) = ([ %s ], [ %s ] ).",
1256 eomn_servicecategory2string(serv_category),
1257 retrievedCanBoards1, retrievedCanBoards2
1264 case eoerror_value_SYS_canservices_monitor_regularcontact:
1266 eOmn_serv_category_t serv_category;
1267 diagstr foundCanBoards1 = {0};
1268 diagstr foundCanBoards2 = {0};
1269 getCanMonitorInfo(serv_category, foundCanBoards1, foundCanBoards2);
1271 snprintf(str,
sizeof(str),
"%s Type of service category is %s. CAN boards are on (can1map, can2map) = ([ %s ], [ %s ])",
1273 eomn_servicecategory2string(serv_category),
1280 case eoerror_value_SYS_canservices_monitor_lostcontact:
1282 eOmn_serv_category_t serv_category;
1285 getCanMonitorInfo(serv_category, lostCanBoards1, lostCanBoards2);
1287 snprintf(str,
sizeof(str),
"%s Type of service category is %s. Lost CAN boards are on (can1map, can2map) = ([ %s ], [ %s ]).",
1289 eomn_servicecategory2string(serv_category),
1296 case eoerror_value_SYS_canservices_monitor_retrievedcontact:
1298 eOmn_serv_category_t serv_category;
1299 uint32_t totRetrvTime;
1300 diagstr retrievedCanBoards1 = {0};
1301 diagstr retrievedCanBoards2 = {0};
1302 getCanMonitorInfoWithTime(serv_category, retrievedCanBoards1, retrievedCanBoards2, totRetrvTime);
1305 snprintf(str,
sizeof(str),
"%s Type of service category is %s. CAN boards are on (can1map, can2map) = ([ %s ], [ %s ]). Total retrieving time: %d [ms]",
1307 eomn_servicecategory2string(serv_category),
1308 retrievedCanBoards1,
1309 retrievedCanBoards2,
1316 case eoerror_value_SYS_canservices_monitor_stillnocontact:
1318 eOmn_serv_category_t serv_category;
1319 uint32_t totDisappTime;
1322 getCanMonitorInfoWithTime(serv_category, lostCanBoards1, lostCanBoards2, totDisappTime);
1324 snprintf(str,
sizeof(str),
"%s Type of service category is %s. Lost CAN boards are on (can1map, can2map) = ([ %s ] , [ %s ]). Total disappearance time: %d [ms]",
1326 eomn_servicecategory2string(serv_category),
1335 case eoerror_value_SYS_unspecified:
1336 case eoerror_value_SYS_tobedecided:
1337 case eoerror_value_SYS_memory_zerorequested:
1338 case eoerror_value_SYS_memory_notinitialised:
1339 case eoerror_value_SYS_memory_missing:
1340 case eoerror_value_SYS_mutex_timeout:
1341 case eoerror_value_SYS_wrongparam:
1342 case eoerror_value_SYS_wrongusage:
1343 case eoerror_value_SYS_runtimeerror:
1344 case eoerror_value_SYS_runninginfatalerrorstate:
1345 case eoerror_value_SYS_udptxfailure:
1346 case eoerror_value_SYS_configurator_udptxfailure:
1347 case eoerror_value_SYS_runner_udptxfailure:
1348 case eoerror_value_SYS_runner_transceivererror:
1349 case eoerror_value_SYS_canservices_rxfifooverflow:
1350 case eoerror_value_SYS_proxy_forward_ok:
1351 case eoerror_value_SYS_proxy_forward_callback_fails:
1352 case eoerror_value_SYS_proxy_reply_ok:
1353 case eoerror_value_SYS_proxy_reply_fails:
1354 case eoerror_value_SYS_canservices_boards_missing:
1355 case eoerror_value_SYS_canservices_boards_searched:
1356 case eoerror_value_SYS_canservices_boards_found:
1357 case eoerror_value_SYS_transceiver_rxinvalidframe_error:
1363 case EOERROR_VALUE_DUMMY: