<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Thanks Michael,</p>
    <p>With my current knowledge of the behavior of  the eUp I don't
      think this will help. Reason: When the polls are too frequent the
      car will never shut down. So the only possibility is to use the
      12V voltage level to see if the 12V battery is charging or not.</p>
    <p>I will go forward now and put some usable features into the
      source. I will go and have a VCDS session tomorrow (hopefully) to
      see what it is doing and to sniff the ExtendedDiagSession messages
      which it hopefully uses.</p>
    <p> Soko</p>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 09.08.2020 13:04, Michael Balzer
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:9fa612f7-f94b-52f9-fec0-44fe7ec60058@expeedo.de">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      UpMiiGo guys,<br>
      <br>
      Am 30.07.20 um 14:43 schrieb Soko:<br>
      <blockquote type="cite">Can I somehow get called (in my
        vehicle-class) if an can-error is thrown?</blockquote>
      Am 30.07.20 um 16:17 schrieb Michael Balzer:<br>
      <blockquote type="cite"
        cite="mid:429f9711-74bd-828c-0c9c-3872f9b0bfac@expeedo.de"> CAN
        tx errors can be caused by other issues as well, so should
        generally not be interpreted that way.</blockquote>
      <br>
      According to Chris on the GE forum, you're also seeing CAN tx
      errors on the Komfort CAN bus, so maybe it actually makes sense
      for you to check for CAN errors.<br>
      <br>
      There are two options:<br>
      <ol>
        <li>Register a TX callback for a specific TX frame</li>
        <li>Register a general TX callback<br>
        </li>
      </ol>
      <u><br>
        Option 1</u> is currently not supported by the poller framework
      (but could be added). For a manual frame transmission, simply set
      the frame callback pointer to your handler:<br>
      <br>
      <tt>static void CAN_tx_callback(const CAN_frame_t* frame, bool
        success)</tt><tt> </tt><tt>{</tt><tt><br>
      </tt><tt>  if (!success) {</tt><tt><br>
      </tt><tt>    // tx failure</tt><tt><br>
      </tt><tt>  }</tt><tt><br>
      </tt><tt>}</tt><tt><br>
      </tt><tt><br>
      </tt><tt>…</tt><tt><br>
      </tt><tt><br>
      </tt><tt>  CAN_frame_t txframe;</tt><tt><br>
      </tt><tt>  txframe = {};</tt><tt><br>
      </tt><tt>  txframe.MsgID = 0x705;</tt><tt><br>
      </tt><tt>  txframe.FIR.B.DLC = 8;</tt><tt><br>
      </tt><tt>  txframe.data = { 0x…, 0x…, … };</tt><tt><br>
      </tt><tt>  txfrane.callback = CAN_tx_callback;</tt><tt><br>
      </tt><tt>  txframe.Write(m_can3);</tt><br>
      <br>
      <br>
      <u>Option 2</u> uses the same handler signature. A handlers is
      registered as a general callback like this, e.g. on vehicle init:<br>
      <br>
      <tt>    MyCAN.RegisterCallback(TAG, </tt><tt>CAN_tx_callback,
        true);</tt><br>
      <br>
      You can also register an RX callback by passing "false" or
      omitting the third argument. On unloading the vehicle module,
      simply do:<br>
      <br>
      <tt>    MyCAN.DeregisterCallback(TAG)</tt><tt>;</tt><br>
      <br>
      <br>
      CAN callbacks are called directly within the CAN driver context
      prior to all standard queues, so can be used for very fast CAN
      responses -- and thus need to be very fast too, to not affect CAN
      driver throughput. Don't do any complex processing in the handler,
      avoid anything that could block the task.<br>
      <br>
      Regards,<br>
      Michael<br>
      <br>
      <pre class="moz-signature" cols="72">-- 
Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
Fon 02333 / 833 5735 * Handy 0176 / 206 989 26
</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-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>
  </body>
</html>