<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="">Derek,<div class=""><br class=""></div><div class="">I think perhaps best to use the implementation of ’tpms’ as a model for this:</div><div class=""><br class=""></div><div class=""><ol class="MailOutline"><li class="">A kconfig to enable/disable the component (CONFIG_OVMS_COMP_V2G), default on is ok.<br class=""><br class=""></li><li class="">A component ovms_v2g in components, conditionally included via the kconfig. This component provides the command framework.<br class=""><br class=""></li><li class="">Extensions to vehicle.{h,cpp} to provide virtual functions for vehicles to implement.<br class=""><br class=""></li><li class="">Implementation in your Leaf vehicle support module.</li></ol></div><div class=""><br class=""></div><div class="">That approach seems quite clean in the TPMS implementation, and has worked out well for two vehicle types so far.</div><div class=""><br class=""></div><div class="">Regards, Mark.<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 13 Aug 2020, at 5:28 PM, Derek Caudwell <<a href="mailto:d.caudwell@gmail.com" class="">d.caudwell@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hi all,<br class=""><div class=""><br class=""></div><div class="">How about the following framework:</div><div class=""><br class=""></div><div class="">V2G framework - used to set mode, set current/charge limits and query status  with commands such as,</div><div class="">V2G mode - used to set mode either V2G, G2V, REM (default - mode remotely set by charger/V2G/V2H unit) </div><div class="">V2G limit - used to set limits such as charge/discharge current limit and SOC min/max limits</div><div class="">V2G status - used to report mode, limits set and power/current flow</div><div class="">V2G start - used to start powerflow in a given mode </div><div class="">V2G stop - used to stop powerflow </div><div class=""><br class=""></div><div class="">The basic wrappers could be defined in vehicle.h/cpp and the feature confirmed as supported in the specific vehicle and coded to implement the specific command features.</div><div class=""><br class=""></div><div class="">Views?</div><div class=""><br class=""></div><div class="">Cheers Derek</div><div class=""><br class=""></div></div>
_______________________________________________<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></blockquote></div><br class=""></div></body></html>