<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="">Tom,<div class=""><br class=""></div><div class="">For your canbus::Write, the approach is reasonable and useful. But, you are missing the message type (standard or extended). You are using uint16_t for the id, so only support standard. Perhaps change the name to canbus::WriteStandard(…), and also have a canbus::WriteExtended(uint32_t id, …)?</div><div class=""><br class=""></div><div class="">Regarding the OvmsVehicleNissanLeaf Ticker functions, you don’t need to register the event for these. Tickers for 1, 10, 60, 300, 600 and 3600 are already implemented in the base class. You just need to make a void TickerXXX(uint32_t ticker) function in your code, and it will get called appropriately. Have a look at vehicle_demo.{h,cpp} for an example.<br class=""><div><br class=""></div><div>Regards, Mark</div><div><br class=""><blockquote type="cite" class=""><div class="">On 26 Nov 2017, at 6:06 AM, Tom Parker <<a href="mailto:tom@carrott.org" class="">tom@carrott.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" class="">
<div text="#000000" bgcolor="#FFFFFF" class="">
On 20/11/17 02:49, Mark Webb-Johnson wrote:<br class="">
<blockquote type="cite" cite="mid:315DAF66-F6EA-4B6F-A8D0-6341DBF7C81D@webb-johnson.net" class="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" class="">
<div class="">In v3, I haven’t bother with listen-only. Looking at
connections to <a href="http://api.openvehicles.com/" class="" moz-do-not-send="true">api.openvehicles.com</a>, all but 2
vehicles have feature 15=1 (and those are probably mistakes by
the end-user).</div>
</blockquote>
<br class="">
OK I won't worry about porting that code.<br class="">
<br class="">
<blockquote type="cite" cite="mid:315DAF66-F6EA-4B6F-A8D0-6341DBF7C81D@webb-johnson.net" class="">
<div class="">
<blockquote type="cite" class="">In v2 I abstracted the hardware
interactions necesary to write to the canbus into a function
void vehicle_nissanleaf_send_can_message(short id, unsigned
char length, unsigned char *data). In v3 we call
canbus::Write(const CAN_frame_t* p_frame). Do we want to add a
similar simpler "send to this buffer with this can id" method
to the canbus object? The Leaf doesn't use any of the extended
can features so a simple interface for the simple case seems
to make sense. For the moment I've implemented it within the
leaf codebase, see void
OvmsVehicleNissanLeaf::SendCanMessage(uint16_t id, uint8_t
length, uint8_t *data) in the pull request.</blockquote>
<br class="">
</div>
<div class="">No harm in adding that, if you think it is useful.
Please go ahead.</div>
</blockquote>
<br class="">
I've updated
<a class="moz-txt-link-freetext" href="https://github.com/openvehicles/Open-Vehicle-Monitoring-System-3/pull/9">https://github.com/openvehicles/Open-Vehicle-Monitoring-System-3/pull/9</a><br class="">
<br class="">
I used method overloading, which I've previously learnt isn't as
straightforward as it is in Java. Please advise if this is an
appropriate way to add two Write methods to the canbus object.<br class="">
<br class="">
</div>
_______________________________________________<br class="">OvmsDev mailing list<br class=""><a href="mailto:OvmsDev@lists.teslaclub.hk" class="">OvmsDev@lists.teslaclub.hk</a><br class="">http://lists.teslaclub.hk/mailman/listinfo/ovmsdev<br class=""></div></blockquote></div><br class=""></div></body></html>