kpc3plus

package
v1.8.8 Latest Latest
Warning

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

Go to latest
Published: May 18, 2024 License: BSD-3-Clause Imports: 7 Imported by: 3

Documentation

Overview

Package kpc3plus provides a transport layer for communicating with a JNOS BBS over RF, by way of a serial connection to a Kantronics KPC 3 Plus TNC. The Open function, if successful, returns a Transport that can be passed to jnos.Connect.

Index

Constants

This section is empty.

Variables

View Source
var ErrBadEcho = errors.New("sent data not echoed correctly")

ErrBadEcho is returned when the echo of the sent data does not arrive within a reasonable amount of time.

Functions

func Connect

func Connect(serialPort, bbsAddress, mailbox, callsign string, log io.Writer) (c *jnos.Conn, err error)

Connect connects to the JNOS BBS at bbsAddress, by way of a Kantronics KPC-3 Plus TNC attached to serialPort, and returns an open jnos.Conn for interaction with it. (bbsAddress should consist of a call sign, a dash, and a small integer SSID.) It logs into the specified BBS mailbox. If callsign is set and is different from mailbox, it self-identifies periodically using that call sign for FCC compliance. (callsign should be the licensed FCC call sign of the calling user.) If log is set, all traffic except echo-backs is logged to it.

Types

type Transport

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

Transport is the KPC-3 Plus transport to the JNOS BBS.

func Open

func Open(serialPort, bbsAddress, callsign string, log io.Writer) (t *Transport, err error)

Open opens a transport to the JNOS BBS at bbsAddress, by way of a Kantronics KPC-3 Plus TNC attached to serialPort. (bbsAddress should consist of a call sign, a dash, and a small integer SSID.) It logs into the mailbox corresponding to the specified callsign, which must be the licensed FCC call sign of the calling user. (For connecting to other mailboxes, see the Connect function.) If log is set, all traffic except echo-backs is logged to it.

func (*Transport) Close

func (t *Transport) Close() (err error)

Close closes the connection to the BBS and resets the configuration of the TNC.

func (*Transport) ReadUntil

func (t *Transport) ReadUntil(until string) (s string, err error)

ReadUntil reads data from the BBS until the specified string is seen, or a timeout occurs. It returns the data that was read (even if it returns an error).

func (*Transport) ReadUntilT

func (t *Transport) ReadUntilT(until string, timeout time.Duration) (s string, err error)

ReadUntilT reads data from the BBS until the specified string is seen, or the specified timeout occurs. It returns the data that was read (even if it returns an error).

func (*Transport) Send

func (t *Transport) Send(s string) (err error)

Send sends a string to the BBS.

func (*Transport) UseVerboseReads

func (t *Transport) UseVerboseReads() bool

UseVerboseReads returns whether it's appropriate to use verbose reads when communicating over this transport.

Jump to

Keyboard shortcuts

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