<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Mark,<br>
<br>
I'll add the logging support along with the TX queue.<br>
<br>
Regards,<br>
Michael<br>
<br>
<br>
Am 10.01.2018 um 01:27 schrieb Mark Webb-Johnson:<br>
</div>
<blockquote type="cite"
cite="mid:D4A07E68-FD57-4A6E-AEDC-FD4FBE97E547@webb-johnson.net">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
Probably best to split this off as a separate eMail thread.
<div class=""><br class="">
</div>
<div class="">I think the implementation would be relatively
simple.</div>
<div class=""><br class="">
</div>
<div class="">
<ul class="MailOutline">
<li class="">Create a canlog class with a FILE* m_log member
variable, and a virtual function Log() that is called with a
direction (tx/rx) and frame to log.</li>
<ul class="">
<li class="">The constructor should be passed the vfs file
path to log to. It should fopen the m_log file to that.</li>
<li class="">The destructor should fclose the m_log file.</li>
</ul>
<li class="">Create a canlog_crtd class, derived from canlog,
that supports Log() to log to m_log in CRTD format.</li>
<li class="">Optionally create other canlog_* classes, for
other logging formats that we want to support.</li>
<li class="">Add a canlog* m_log member variable in canbus.</li>
<ul class="">
<li class="">Initialise m_log to NULL in the constructor.</li>
<li class="">In the destructor, if m_log is not null, delete
it’s object and set it to NULL.</li>
<li class="">Have a command ‘can log’ like ‘can trace’ that
specifies a vfs file path (remember to check it with
OvmsConfig ProtectedPath) and logging format. It will then
’new’ a canlog_* style object (depending on logging
format).</li>
</ul>
<li class="">In can::IncomingFrame, log incoming CAN messages
with m_log->Log(), in the same way as m_trace is handled.</li>
<li class="">In canbus::Write, log outgoing CAN messages with
m_log->Log(), in the same way as m_trace is handled.</li>
</ul>
<div><br class="">
</div>
<div>Volunteer?</div>
<div><br class="">
</div>
<div>Regards, Mark.</div>
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 10 Jan 2018, at 8:07 AM, Mark Webb-Johnson
<<a href="mailto:mark@webb-johnson.net" class=""
moz-do-not-send="true">mark@webb-johnson.net</a>>
wrote:</div>
<br class="Apple-interchange-newline">
<div class=""><span style="font-family: Helvetica;
font-size: 24px; font-style: normal; font-variant-caps:
normal; font-weight: normal; letter-spacing: normal;
text-align: start; text-indent: 0px; text-transform:
none; white-space: normal; word-spacing: 0px;
-webkit-text-stroke-width: 0px; float: none; display:
inline !important;" class="">Now SD CARD support is
coming, anybody want to step forward and extend
components/can to support CAN bus logging to a file (in
crtd format, or perhaps support one or two popular
formats)? Implementation would be in class canbus, very
similar to m_trace; just need to have a FILE* m_log and
appropriate commands / logging of packet write/read in
the same place that trace does it.</span></div>
</blockquote>
</div>
<br class="">
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
OvmsDev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:OvmsDev@lists.teslaclub.hk">OvmsDev@lists.teslaclub.hk</a>
<a class="moz-txt-link-freetext" href="http://lists.teslaclub.hk/mailman/listinfo/ovmsdev">http://lists.teslaclub.hk/mailman/listinfo/ovmsdev</a>
</pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="144">--
Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
Fon 02333 / 833 5735 * Handy 0176 / 206 989 26
</pre>
</body>
</html>