disp

package
v0.9.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 12, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package disp is for dispatching and displaying trice log lines. This file contains the client code.

Package disp is for dispatching and displaying trice log lines. This file contains the server code.

Index

Constants

This section is empty.

Variables

View Source
var (
	// IPAddr is the display server ip addr
	IPAddr = "localhost" // default value for testing

	// IPPort is the display server ip addr
	IPPort = "61497" // default value for testing

	// ColorPalette is the used PC color set. It is initialized with its default value inside the appropriate subcommand.
	ColorPalette = "off" // default value for testing

)
View Source
var (
	// Out is an exported function pointer, which can be redirected for example to a client call
	Out = out
)
View Source
var (
	// PtrRPC is a pointer for remote calls valid after a succesful rpc.Dial()
	PtrRPC *rpc.Client
)

Functions

func Connect

func Connect() error

Connect is called by the client and tries to dial. On success PtrRpc is valid afterwards and zhe output is re-directed

func RemoteOut

func RemoteOut(s []string) error

RemoteOut does send the logstring s to the displayServer It is replacing emit.Out when trice acts as remote

func ScDisplayServer

func ScDisplayServer() error

ScDisplayServer is the endless function called when trice tool acts as remote display. All in Server struct registered RPC functions are reachable, when displayServer runs.

func ScShutdownRemoteDisplayServer

func ScShutdownRemoteDisplayServer(ts int64) error

ScShutdownRemoteDisplayServer starts a client to send shutdown message to display server

func StartServer

func StartServer(exe string)

StartServer starts a display server with the filename exe (if not already running)

func StopServer

func StopServer(ts int64) error

StopServer sends signal to display server to quit

Types

type Server

type Server struct{}

Server is the RPC struct for registered server dunctions

func (*Server) ColorPalette

func (p *Server) ColorPalette(s []string, reply *int64) error

ColorPalette is the exported server function for color palette, if trice tool acts as display server. By declaring it as a Server struct method it is registered as RPC destination.

func (*Server) LogSetFlags

func (p *Server) LogSetFlags(f []int64, r *int64) error

LogSetFlags is called remotely to shutdown display server

func (*Server) Out

func (p *Server) Out(s []string, reply *int64) error

Out is the exported server function for string display, if trice tool acts as display server. By declaring it as a Server struct method it is registered as RPC destination.

func (*Server) Shutdown

func (p *Server) Shutdown(ts []int64, y *int64) error

Shutdown is called remotely to shutdown display server

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL