[Ovmsdev] access to writer?
Michael Balzer
dexter at expeedo.de
Fri Sep 13 20:39:54 HKT 2024
The short answer is: you can't.
There is no "current" writer. If a function may need to output text to a
writer, you need to pass the writer pointer to that function.
In case of functions that may be called within a user command execution
and shall then provide output, add the writer to the signature, and only
use it when it's not null. If the output is important, send it to the
log if the writer is null.
If you need to reduce the output for certain output channels, you'll
also want to pass the "verbosity" parameter along with the writer pointer.
Regards,
Michael
Am 13.09.24 um 08:55 schrieb sharkcow via OvmsDev:
> Hi all,
>
> I have a dumb question: how do I get access to the current "writer"
> object in a "regular" function in my vehicle code (not defined by
> RegisterCommand)?
>
> Thanks!
>
> sharkcow
> _______________________________________________
> OvmsDev mailing list
> OvmsDev at lists.openvehicles.com
> http://lists.openvehicles.com/mailman/listinfo/ovmsdev
--
Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
Fon 02333 / 833 5735 * Handy 0176 / 206 989 26
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 203 bytes
Desc: OpenPGP digital signature
URL: <http://lists.openvehicles.com/pipermail/ovmsdev/attachments/20240913/3291eb26/attachment.sig>
More information about the OvmsDev
mailing list