lcm: github.com/lcm-proj/lcm/lcm-go/lcm Index | Files

package lcm

import "github.com/lcm-proj/lcm/lcm-go/lcm"

Index

Package Files

lcm.go

type LCM Uses

type LCM struct {
    Errors chan error // Errors when handling incoming LCM messages
    // contains filtered or unexported fields
}

LCM is a wrapper type for all things LCM.

func New Uses

func New() (LCM, error)

New returns a new LCM instance using the default provider as defined in the C interface. In case of a failure, an error is returned.

func NewProvider Uses

func NewProvider(provider string) (LCM, error)

NewProvider returns a new LCM instance using the specified provider. In case of a failure, an error is returned.

func (*LCM) Destroy Uses

func (lcm *LCM) Destroy() error

Destroy destroys an LCM object, so that it can be picked up by the garbage collector. This method also unsubscribes to all channels that lcm previously subscribed to.

func (LCM) Publisher Uses

func (lcm LCM) Publisher(channel string) (chan<- []byte, <-chan error)

Publisher returns a channel that the caller can send data to, which is sent out to the channel passed as the argument. Furthermoe, an error channel is returned that allows the caller to listen for and handle any errors.

func (LCM) Subscribe Uses

func (lcm LCM) Subscribe(channel string, size int) (Subscription, error)

Subscribe subscribes to an LCM channel with the given buffer size. Whenever an incoming message is handled by LCM the encoded data is sent in the form of a []byte down the ReceiveChan member of the returned Subscription.

func (LCM) Unsubscribe Uses

func (lcm LCM) Unsubscribe(subscription Subscription) error

Unsubscribe removes an Subscription from an LCM object.

func (LCM) UnsubscribeAll Uses

func (lcm LCM) UnsubscribeAll() error

UnsubscribeAll removes all Subscriptions from an LCM object.

type Subscription Uses

type Subscription struct {
    ReceiveChan chan []byte // Channel on which messages to the subscribed channel are forwarded
    Drops       int         // The number of dropped packages so far
    // contains filtered or unexported fields
}

Subscription is a wrapper type for a subscription to an LCM channel.

func (Subscription) Channel Uses

func (subscription Subscription) Channel() string

Channel returns the LCM channel name of the subscription.

Package lcm imports 3 packages (graph). Updated 2019-04-28. Refresh now. Tools for package owners.