<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Thanks for checking.<br>
    <br>
    But... I checked before & again: STAT was privileged in V2, in
    fact there were no unprivileged standard commands.<br>
    <br>
    Also the command should still be privileged because I don't want any
    person knowing my SIM number to be able to read my charge status
    & odometer. That info can be used to precisely track a vehicle
    when combined with other data.<br>
    <br>
    Or did I get the security concept wrong?<br>
    <br>
    Regards,<br>
    Michael<br>
    <br>
    <br>
    <div class="moz-cite-prefix">Am 04.11.2017 um 14:02 schrieb Mark
      Webb-Johnson:<br>
    </div>
    <blockquote type="cite"
      cite="mid:63803BFB-BD40-44F5-A611-755B11ACC148@webb-johnson.net">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      Looks good.
      <div class=""><br class="">
      </div>
      <div class="">Only change I made was to make it ‘non privileged’
        (to match ovms v2).</div>
      <div class=""><br class="">
      </div>
      <div class="">The way these are going to be implemented is using
        the BufferedShell() class. This implements an OvmsWriter that
        simply buffers the output for later collection. The SMS system
        will receive a command, then pass it to the OvmsCommandApp
        system using this BufferedShell() as the writer. Once the
        command completes execution, the output in BufferedShell() will
        be collected, and sent back out in an SMS reply. Privileged
        commands will be slightly different than OVMS v2. To run a
        privileged command, you either send it from the registered phone
        number, or prefix the command with the module password. Either
        will cause the IsSecure() to be set true on the BufferedShell(),
        before the command is executed.</div>
      <div class=""><br class="">
      </div>
      <div class="">Regards, Mark.</div>
      <div class=""><br class="">
        <div>
          <blockquote type="cite" class="">
            <div class="">On 4 Nov 2017, at 5:51 PM, Michael Balzer <<a
                href="mailto:dexter@expeedo.de" class=""
                moz-do-not-send="true">dexter@expeedo.de</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=""> I've added
                a default implementation for the "stat" command.<br
                  class="">
                <br class="">
                <tt class="">    virtual vehicle_command_t
                  CommandStat(int verbosity, OvmsWriter* writer);</tt><br
                  class="">
                <br class="">
                I thought about letting the vehicle module generate a
                std::string, but it would still need the verbosity and
                would always need another memory buffer, so I think
                passing the writer to vehicle methods generating output
                is better -- please correct me if there is a system
                design decision I'm breaking with this.<br class="">
                <br class="">
                Regards,<br class="">
                Michael<br class="">
                <br class="">
                <br class="">
                <div class="moz-cite-prefix">Am 30.10.2017 um 07:06
                  schrieb Mark Webb-Johnson:<br class="">
                </div>
                <blockquote type="cite"
                  cite="mid:95054693-82AD-44D4-A22C-34798F9BDB53@webb-johnson.net"
                  class="">
                  <meta http-equiv="Content-Type" content="text/html;
                    charset=utf-8" class="">
                  I’ve implemented these standard commands in vehicle
                  framework:
                  <div class=""><br class="">
                  </div>
                  <blockquote style="margin: 0 0 0 40px; border: none;
                    padding: 0px;" class="">
                    <div class="">
                      <div class=""><font class="" face="Andale Mono"><span
                            style="font-size: 18px;" class="">virtual
                            vehicle_command_t
                            CommandSetChargeMode(vehicle_mode_t mode);</span></font></div>
                      <div class=""><font class="" face="Andale Mono"><span
                            style="font-size: 18px;" class="">virtual
                            vehicle_command_t
                            CommandSetChargeCurrent(uint16_t limit);</span></font></div>
                      <div class=""><font class="" face="Andale Mono"><span
                            style="font-size: 18px;" class="">virtual
                            vehicle_command_t CommandStartCharge();</span></font></div>
                      <div class=""><font class="" face="Andale Mono"><span
                            style="font-size: 18px;" class="">virtual
                            vehicle_command_t CommandStopCharge();</span></font></div>
                      <div class=""><font class="" face="Andale Mono"><span
                            style="font-size: 18px;" class="">virtual
                            vehicle_command_t CommandSetChargeTimer(bool
                            timeron, uint16_t timerstart);</span></font></div>
                      <div class=""><font class="" face="Andale Mono"><span
                            style="font-size: 18px;" class="">virtual
                            vehicle_command_t CommandCooldown(bool
                            cooldownon);</span></font></div>
                      <div class=""><font class="" face="Andale Mono"><span
                            style="font-size: 18px;" class="">virtual
                            vehicle_command_t CommandWakeup();</span></font></div>
                      <div class=""><font class="" face="Andale Mono"><span
                            style="font-size: 18px;" class="">virtual
                            vehicle_command_t CommandLock(const char*
                            pin);</span></font></div>
                      <div class=""><font class="" face="Andale Mono"><span
                            style="font-size: 18px;" class="">virtual
                            vehicle_command_t CommandUnlock(const char*
                            pin);</span></font></div>
                      <div class=""><font class="" face="Andale Mono"><span
                            style="font-size: 18px;" class="">virtual
                            vehicle_command_t CommandActivateValet(const
                            char* pin);</span></font></div>
                      <div class=""><font class="" face="Andale Mono"><span
                            style="font-size: 18px;" class="">virtual
                            vehicle_command_t
                            CommandDeactivateValet(const char* pin);</span></font></div>
                      <div class=""><font class="" face="Andale Mono"><span
                            style="font-size: 18px;" class="">virtual
                            vehicle_command_t CommandHomelink(uint8_t
                            button);</span></font></div>
                    </div>
                  </blockquote>
                  <div class=""><br class="">
                  </div>
                  <div class="">Also implemented most of these for the
                    Tesla Roadster, as an example implementation.</div>
                  <div class=""><br class="">
                  </div>
                  <div class="">I haven’t changed ovms_server_v2 yet, to
                    implement the standard command processor for these,
                    but that should be trivial.</div>
                  <div class=""><br class="">
                  </div>
                  <div class="">Vehicle modules are able to implement
                    handlers for these standardised commands, as well as
                    their own custom commands (if required).</div>
                  <div class=""><br class="">
                  </div>
                  <div class="">Regards, Mark.</div>
                </blockquote>
                <br class="">
                <pre class="moz-signature" cols="72">-- 
Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
Fon 02333 / 833 5735 * Handy 0176 / 206 989 26
</pre>
              </div>
              _______________________________________________<br
                class="">
              OvmsDev mailing list<br class="">
              <a href="mailto:OvmsDev@lists.teslaclub.hk" class=""
                moz-do-not-send="true">OvmsDev@lists.teslaclub.hk</a><br
                class="">
              <a class="moz-txt-link-freetext" href="http://lists.teslaclub.hk/mailman/listinfo/ovmsdev">http://lists.teslaclub.hk/mailman/listinfo/ovmsdev</a><br
                class="">
            </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>
    <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>