Skip to content

lightbug-io/toit-pluggable-printing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Toit Pluggable Printing

A printing package, that produces toit printed output in various different locations but overriding the PrintService.

This package was mostly used during some initial hardware development phases while standard toit print would get in the way of other things such as UART communication.

Can target:

  • default: Calls print_ which is what toit normally does
  • http: Sends the output over HTTP POST request
  • httpsrv: Hosts a web server displaying prints on a page (See also watchHttp.sh)
  • multi: Can be used to combine multiple targets
  • nulled: A service that does nothing
  • uart: Sends the output over UART
  • udp: Sends the output over UDP

Example usage

Checkout the example directory for runnable examples.

And example running only the udp service.

import pluggable-printing
import log

main:
  pluggable-printing.install-udp --port=18018
  log.info "Starting"

An example running the udp and httpsrv services on ports 18018 port with a buffer size of 10 for the web server would look like this:

import pluggable-printing
import log

main:
  pluggable-printing.install-multi --services=[
    UdpProvider --port=18018,
    HttpServerProvider --port=18018 --buffer-size=10,
  ]
  log.info "Starting"

About

A pluggable printing package for toit

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published