<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Mark,<br>
<br>
I'm not familiar with DBC. I only found partial community infos and
examples and an 11 year old PDF that seems to be available in two
versions -- is that the current specification?<br>
<br>
<a class="moz-txt-link-freetext" href="https://kupdf.net/download/dbc-format-2007_59c7d97e08bbc5f7236872bc_pdf">https://kupdf.net/download/dbc-format-2007_59c7d97e08bbc5f7236872bc_pdf</a><br>
<a class="moz-txt-link-freetext" href="https://wenku.baidu.com/view/41c36d25ed630b1c59eeb534">https://wenku.baidu.com/view/41c36d25ed630b1c59eeb534</a><br>
<br>
Is it possible to define a command/query scheme in DBC?<br>
<br>
Thanks,<br>
Michael<br>
<br>
<br>
<div class="moz-cite-prefix">Am 26.07.2018 um 11:13 schrieb Mark
Webb-Johnson:<br>
</div>
<blockquote type="cite"
cite="mid:3577B572-E6D8-405C-BAB7-5227BE6CF73E@webb-johnson.net">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
I’ve spent quite some time looking at the alternatives, with the
result that no matter how much I hate the specification, how
horrible I think the format is, how terribly designed is the
syntax, DBC is the standard that everyone seems to want to follow.<br>
<br>
</blockquote>
<blockquote type="cite"
cite="mid:3577B572-E6D8-405C-BAB7-5227BE6CF73E@webb-johnson.net">
<div class="">For our holy grain of DBC signals -> OVMS
metrics, we can use ‘attributes’ to define OVMS specific stuff
(like signal name to OVMS metric names).</div>
<div class=""><br class="">
</div>
<div class="">So, I’ve created a DBC component, and put in the
basic structures to define the objects in a DBC file. I’ve also
started the work to parse DBC files and load them in. The basic
idea is:</div>
<div class=""><br class="">
</div>
<div class="">
<ul class="MailOutline">
<li class="">There is a core MyDBC object.<br class="">
<br class="">
</li>
<li class="">DBC files can be loaded into that object (either
from VFS, or as static strings), unloaded, etc.<br class="">
<br class="">
</li>
<li class="">The MyDBC object will contain functions to access
DBC files, and maintain them.<br class="">
<br class="">
</li>
<li class="">Functions will also be provided to export DBC
files.<br class="">
<br class="">
</li>
<li class="">Statically loaded (via strings) DBC objects can
be overwritten and modified (especially during development).<br
class="">
<br class="">
</li>
<li class="">The vehicle base class will be extended to allow
a DBC file to be associated with a particular CAN bus - that
will then automatically handle metrics from DBC signals.<br
class="">
<br class="">
</li>
<li class="">RE TOOLS will be changed to use DBC files
directly (in particular to use DBC modifiers, rather than
the current unique ID approach, but also for things like DBC
signal extraction and display).</li>
</ul>
</div>
<div class=""><br class="">
</div>
<div class="">The overall goal is:</div>
<div class=""><br class="">
</div>
<div class="">
<ul class="MailOutline">
<li class="">The ‘old’ (current) way of doing things is to
write C++ code in a vehicle module to match CAN bus #1, ID
0x102, and treat byte #3 an unsigned integer to set it as
the SOC metric.<br class="">
<br class="">
</li>
<li class="">The DBC way is to instead create a DBC file
describe CAN bus #2, message ID 0x102, and a signal at byte
#3 (16 bits in, length 8 bits) mapped to the SOC metric.
Then, just tell the vehicle base module where that DBC file
is and let it handle the mapping automatically. No code.
Just DBC description files.<br class="">
<br class="">
</li>
<li class="">We can still have custom C++ code, for custom
metrics.<br class="">
<br class="">
</li>
<li class="">When reverse engineering, we can dynamically
modify a loaded DBC and instantly see the metrics change. We
can then export that DBC out, and include it in the firmware
for others to use.</li>
</ul>
</div>
<div class=""><br class="">
</div>
<div class="">The biggest amount of work is the DBC file handling
itself. The changes to the vehicle base class are pretty simple.</div>
<div class=""><br class="">
</div>
<div class="">Regards, Mark.<br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 19 Apr 2018, at 11:06 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="caret-color: rgb(0, 0, 0);
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;
text-decoration: none; float: none; display: inline
!important;" class="">The whole decoding/encoding thing
(where we use DBC or whatever to say key X byte Y is
converted to v.bat.soc using this formula) is of course
the holy grain of this; and is built upon all the
foundation I’m laying now. The end goal remains for
vehicle modules with just a DBC (or whatever) and no
actual code.</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.openvehicles.com">OvmsDev@lists.openvehicles.com</a>
<a class="moz-txt-link-freetext" href="http://lists.openvehicles.com/mailman/listinfo/ovmsdev">http://lists.openvehicles.com/mailman/listinfo/ovmsdev</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="160">--
Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
Fon 02333 / 833 5735 * Handy 0176 / 206 989 26
</pre>
</body>
</html>