<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">@Michael,<div class=""><br class=""></div><div class="">I’ve tried merging this (along with all the other recent changes in master) into the for-v3.3 branch, but am now getting compilation errors. The two files with issues are:</div><div class=""><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class="">components/retools_testerpresent/src/retools_testerpresent.cpp</div><div class="">components/vehicle_mgev/src/vehicle_mgev.cpp</div></blockquote><div class=""><div><br class=""></div><div>Both in the RegisterCommand function call with the static class member function as a parameter. Not sure if that new way is used elsewhere?</div><div><br class=""></div><div>Example compiler output is:</div><div><br class=""></div></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div><div><font face="Andale Mono" class=""><span style="font-style: normal; font-size: 12px;" class="">CXX build/retools_testerpresent/src/retools_testerpresent.o</span></font></div><div><font face="Andale Mono" class=""><span style="font-style: normal; font-size: 12px;" class="">.../components/retools_testerpresent/src/retools_testerpresent.cpp: In constructor 'OvmsReToolsTesterPresentInit::OvmsReToolsTesterPresentInit()':</span></font></div><div><font face="Andale Mono" class=""><span style="font-style: normal; font-size: 12px;" class="">.../components/retools_testerpresent/src/retools_testerpresent.cpp:140:5: error: no matching function for call to 'OvmsCommand::RegisterCommand(const char [6], const char [48], <unresolved overloaded function type>, const char [23], int, int)'</span></font></div><div><font face="Andale Mono" class=""><span style="font-style: normal; font-size: 12px;" class="">     );</span></font></div><div><font face="Andale Mono" class=""><span style="font-style: normal; font-size: 12px;" class="">     ^</span></font></div><div><font face="Andale Mono" class=""><span style="font-style: normal; font-size: 12px;" class=""><br class=""></span></font></div><div><font face="Andale Mono" class=""><div><span style="font-size: 12px;" class="">CXX build/vehicle_mgev/src/vehicle_mgev.o</span></div><div><span style="font-size: 12px;" class="">.../components/vehicle_mgev/src/vehicle_mgev.cpp: In constructor 'OvmsVehicleMgEv::OvmsVehicleMgEv()':</span></div><div><span style="font-size: 12px;" class="">.../components/vehicle_mgev/src/vehicle_mgev.cpp:143:5: error: no matching function for call to 'OvmsCommandApp::RegisterCommand(const char [8], const char [15], <unresolved overloaded function type>)'</span></div><div><span style="font-size: 12px;" class="">     );</span></div><div><span style="font-size: 12px;" class="">     ^mand(const char* name, const char* title,</span></div><div style="font-size: 12px;">                  ^</div></font></div></div></blockquote><div class=""><div><br class=""></div><div>I tried for a while, but can’t see what is wrong. Perhaps some missing header file? Anyway, I’ve committed the merge of master into for-v3.3 (even though it doesn’t compile) and just commented out those registrations in my local copy.</div><div><br class=""></div><div>Can you help?</div><div><br class=""></div><div>Thanks, Mark.</div><div><br class=""></div><div><blockquote type="cite" class=""><div class="">On 12 Sep 2020, at 5:12 AM, Michael Balzer <<a href="mailto:dexter@expeedo.de" class="">dexter@expeedo.de</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Mark,<br class=""><br class="">Am 11.09.20 um 18:11 schrieb Michael Balzer:<br class=""><blockquote type="cite" class=""><blockquote type="cite" class="">I agree it is not necessary; my suggestion is purely to clean it up<br class="">and enhance functionality. The problem at the moment is that<br class="">OvmsCommand execute callbacks can only be to function callbacks (not<br class="">objects). It doesn’t even use the c++ bind function callback<br class="">mechanism (like notification, etc, for example). It is what it is,<br class="">and changing now is very hard.<br class=""></blockquote><br class="">That slipped my attention, but upgrading OvmsCommand to accept any<br class="">function type should be simply changing m_execute and m_validate to<br class="">std::function, or do I miss something?<br class=""></blockquote><br class="">Just did this locally, works perfectly. Shall I push the change or have<br class="">you begun working on ovms_command?<br class=""><br class="">If so, it's really just exchanging the function signatures for these types:<br class=""><br class="">typedef std::function<void(int, OvmsWriter*, OvmsCommand*, int, const<br class="">char* const*)> OvmsCommandExecuteCallback_t;<br class="">typedef std::function<int(OvmsWriter*, OvmsCommand*, int, const char*<br class="">const*, bool)> OvmsCommandValidateCallback_t;<br class=""><br class="">Patch attached.<br class=""><br class="">Regards,<br class="">Michael<br class=""><br class="">-- <br class="">Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal<br class="">Fon 02333 / 833 5735 * Handy 0176 / 206 989 26<br class=""><br class=""><span id="cid:C485C3D9-D7D0-413F-A1D9-F85EA4B87851"><ovmscommand.patch></span>_______________________________________________<br class="">OvmsDev mailing list<br class=""><a href="mailto:OvmsDev@lists.openvehicles.com" class="">OvmsDev@lists.openvehicles.com</a><br class="">http://lists.openvehicles.com/mailman/listinfo/ovmsdev<br class=""></div></div></blockquote></div><br class=""></div></body></html>