Documentation ¶
Index ¶
- Constants
- Variables
- type Config
- func (m *Config) CloneMessageVT() proto.Message
- func (m *Config) CloneVT() *Config
- func (*Config) Descriptor() ([]byte, []int)deprecated
- func (this *Config) EqualMessageVT(thatMsg proto.Message) bool
- func (this *Config) EqualVT(that *Config) bool
- func (c *Config) EqualsConfig(c2 config.Config) bool
- func (c *Config) GetConfigID() string
- func (c *Config) GetDebugVals() config.DebugValues
- func (x *Config) GetDeviceBaud() int32
- func (x *Config) GetDevicePath() string
- func (x *Config) GetDialers() map[string]*dialer.DialerOpts
- func (x *Config) GetPacketOpts() *kcp.Opts
- func (x *Config) GetTransportPeerId() string
- func (m *Config) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *Config) MarshalToVT(dAtA []byte) (int, error)
- func (m *Config) MarshalVT() (dAtA []byte, err error)
- func (c *Config) ParseTransportPeerID() (peer.ID, error)
- func (*Config) ProtoMessage()
- func (x *Config) ProtoReflect() protoreflect.Message
- func (x *Config) Reset()
- func (c *Config) SetTransportPeerId(peerID string)
- func (m *Config) SizeVT() (n int)
- func (x *Config) String() string
- func (m *Config) UnmarshalVT(dAtA []byte) error
- func (c *Config) Validate() error
- type Factory
- type Link
- type XBee
Constants ¶
const ConfigID = ControllerID
ConfigID is the string used to identify this config object.
const ControllerID = "bifrost/xbee"
ControllerID is the xbee controller ID.
const TransportType = "xbee"
TransportType is the transport type identifier for this transport.
Variables ¶
var File_github_com_aperturerobotics_bifrost_transport_xbee_xbee_proto protoreflect.FileDescriptor
var Version = semver.MustParse("0.0.1")
Version is the version of the xbee implementation.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // TransportPeerID sets the peer ID to attach the transport to. // If unset, attaches to any running peer with a private key. TransportPeerId string `protobuf:"bytes,1,opt,name=transport_peer_id,json=transportPeerId,proto3" json:"transport_peer_id,omitempty"` // DevicePath is the device path to open the serial stream. DevicePath string `protobuf:"bytes,2,opt,name=device_path,json=devicePath,proto3" json:"device_path,omitempty"` // DeviceBaud is the device baudrate. DeviceBaud int32 `protobuf:"varint,3,opt,name=device_baud,json=deviceBaud,proto3" json:"device_baud,omitempty"` // PacketOpts are options to set on the packet connection. // In lossy environments, set the data shards for error correction. PacketOpts *kcp.Opts `protobuf:"bytes,4,opt,name=packet_opts,json=packetOpts,proto3" json:"packet_opts,omitempty"` // Dialers maps peer IDs to dialers. Dialers map[string]*dialer.DialerOpts `` /* 155-byte string literal not displayed */ // contains filtered or unexported fields }
Config is the configuration for the xbee transport.
func (*Config) CloneMessageVT ¶ added in v0.15.6
func (*Config) Descriptor
deprecated
func (*Config) EqualMessageVT ¶ added in v0.15.6
func (*Config) EqualsConfig ¶
EqualsConfig checks if the other config is equal.
func (*Config) GetConfigID ¶
GetConfigID returns the unique string for this configuration type. This string is stored with the encoded config.
func (*Config) GetDebugVals ¶
func (c *Config) GetDebugVals() config.DebugValues
GetDebugVals returns the directive arguments as key/value pairs. This should be something like param1="test", param2="test". This is not necessarily unique, and is primarily intended for display.
func (*Config) GetDeviceBaud ¶
func (*Config) GetDevicePath ¶
func (*Config) GetDialers ¶
func (x *Config) GetDialers() map[string]*dialer.DialerOpts
func (*Config) GetPacketOpts ¶
func (*Config) GetTransportPeerId ¶
func (*Config) MarshalToSizedBufferVT ¶ added in v0.2.0
func (*Config) ParseTransportPeerID ¶ added in v0.20.0
ParseTransportPeerID parses the node peer ID if it is not empty.
func (*Config) ProtoMessage ¶
func (*Config) ProtoMessage()
func (*Config) ProtoReflect ¶ added in v0.2.0
func (x *Config) ProtoReflect() protoreflect.Message
func (*Config) SetTransportPeerId ¶
SetTransportPeerId sets the node peer ID field.
func (*Config) UnmarshalVT ¶ added in v0.2.0
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
Factory constructs a XBee transport.
func (*Factory) Construct ¶
func (t *Factory) Construct( conf config.Config, opts controller.ConstructOpts, ) (controller.Controller, error)
Construct constructs the associated controller given configuration.
func (*Factory) ConstructConfig ¶
ConstructConfig constructs an instance of the controller configuration.
func (*Factory) GetConfigID ¶
GetConfigID returns the configuration ID for the controller.
func (*Factory) GetControllerID ¶
GetControllerID returns the unique ID for the controller.
func (*Factory) GetVersion ¶
GetVersion returns the version of this controller.
type XBee ¶
XBee implements a XBee transport.
func NewXBee ¶
func NewXBee( ctx context.Context, le *logrus.Entry, opts *Config, pKey crypto.PrivKey, c transport.TransportHandler, ) (*XBee, error)
NewXBee builds a new XBee transport, opening the serial device.
func (*XBee) GetPeerDialer ¶ added in v0.21.0
GetPeerDialer returns the dialing information for a peer. Called when resolving EstablishLink. Return nil, nil to indicate not found or unavailable.
func (*XBee) MatchTransportType ¶ added in v0.14.1
MatchTransportType checks if the given transport type ID matches this transport. If returns true, the transport controller will call DialPeer with that tptaddr. E.x.: "udp-quic" or "ws"