api

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2026 License: Apache-2.0 Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package api provides the gRPC server implementation for SerialLink agent.

Index

Constants

This section is empty.

Variables

View Source
var (
	Version   = "dev"
	Commit    = "none"
	BuildDate = "unknown"
)

Version information (set at build time)

Functions

func StreamLoggingInterceptor added in v0.0.2

func StreamLoggingInterceptor(logger *log.Logger) grpc.StreamServerInterceptor

StreamLoggingInterceptor returns a gRPC stream interceptor for logging

func UnaryLoggingInterceptor added in v0.0.2

func UnaryLoggingInterceptor(logger *log.Logger) grpc.UnaryServerInterceptor

UnaryLoggingInterceptor returns a gRPC unary interceptor for logging requests

Types

type SerialServer

type SerialServer struct {
	pb.UnimplementedSerialServiceServer
	// contains filtered or unexported fields
}

SerialServer implements the gRPC SerialService

func NewSerialServer

func NewSerialServer(manager *serial.Manager, scanner *serial.Scanner, cfg *config.Config, logger *log.Logger) *SerialServer

NewSerialServer creates a new SerialServer

func (*SerialServer) BiDirectionalStream

func (s *SerialServer) BiDirectionalStream(stream pb.SerialService_BiDirectionalStreamServer) error

BiDirectionalStream handles bidirectional streaming

func (*SerialServer) ClosePort

ClosePort closes a serial port

func (*SerialServer) ConfigurePort

ConfigurePort configures a port

func (*SerialServer) GetAgentInfo

GetAgentInfo returns information about the agent

func (*SerialServer) GetPortConfig

GetPortConfig returns the current configuration of a port

func (*SerialServer) GetPortInfo

GetPortInfo returns information about a specific port

func (*SerialServer) GetPortStatus

GetPortStatus returns the status of a port

func (*SerialServer) ListPorts

ListPorts returns all available serial ports

func (*SerialServer) OpenPort

OpenPort opens a serial port

func (*SerialServer) Ping

func (s *SerialServer) Ping(ctx context.Context, req *pb.PingRequest) (*pb.PingResponse, error)

Ping checks if the server is alive

func (*SerialServer) Read

func (s *SerialServer) Read(ctx context.Context, req *pb.ReadRequest) (*pb.ReadResponse, error)

Read reads data from a port

func (*SerialServer) StreamRead

StreamRead streams data from a port

func (*SerialServer) StreamWrite

func (s *SerialServer) StreamWrite(stream pb.SerialService_StreamWriteServer) error

StreamWrite writes streaming data to a port

func (*SerialServer) Write

func (s *SerialServer) Write(ctx context.Context, req *pb.WriteRequest) (*pb.WriteResponse, error)

============================================================================ Data Transfer ============================================================================ Write writes data to a port

Directories

Path Synopsis
gen

Jump to

Keyboard shortcuts

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