bifrost

package module
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2024 License: MIT Imports: 12 Imported by: 0

README

🌈 bifrost

Go Report Card FOSSA Status

Bifrost is a tiny terminal emulator for serial port communication. Supports USB type-C out of the box (2016+ Macbook friendly).

Note: Only Linux and OSX are currenly supported. Windows will be supported in subsequent releases.

Installation

On linux:

  • Unzip and copy binary to /usr/bin/
unzip bifrost-<version>-linux-amd64.zip
cd bifrost-<version>-linux-amd64
sudo cp bifrost /usr/bin/
sudo chown root:root /usr/bin/bifrost
sudo chmod 755 /usr/bin/bifrost

On OSX/MacOS:

  • Unzip and copy binary to /usr/local/bin/
sudo mkdir -p /usr/local/bin
unzip bifrost-<version>-darwin-amd64.zip
cd bifrost-<version>-darwin-amd64
sudo cp bifrost /usr/local/bin/
  • Run bifrost -help to confirm bifrost was installed correctly.

Usage

Bifrost takes -port-path and -baud as parameters. By default -port-path is set to /dev/tty.usbserial and -baud is set to 115200.

Example usage:

bifrost -port-path="/dev/ttyUSB0" -baud=128000

On Linux the serial port adapter path is /dev/ttyUSB0, /dev/ttyUSB1 and so on. Some USB serial port adapters may appear as /dev/ttyACM0.

On OSX/MacOS the serial port adapter path is /dev/tty.usbserial.

The default baud rate 115200 works for most serial connection but you may want to confirm the optimal baud rate for the device you're connecting to.

License

FOSSA Status

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(portPath string, baud int)

Types

type Connect

type Connect struct {
	// contains filtered or unexported fields
}

func NewConnection

func NewConnection(portPath string, baudRate int) (*Connect, error)

NewConnection returns a pointer to a Connect instance

func (*Connect) Start

func (c *Connect) Start()

Start initializes a read loop that attempts to reconnect when the connection is broken

func (*Connect) Write

func (c *Connect) Write(message []byte)

type Key

type Key struct {
	Value []byte
	Type  KeyType
}

Key holds the input value from terminal stream

type KeyType

type KeyType uint16

KeyType describes a key

const (
	Enter KeyType = iota + 1
	Esc
	Space
	Tab
	CtrlA
	CtrlB
	CtrlC
	Delete
	CtrlBackslash
	Backspace
	UpArrow
	DownArrow
	LeftArrow
	RightArrow
)

Key constants

Jump to

Keyboard shortcuts

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