Loading...
Searching...
No Matches
LCM.LCM.LCM Class Reference

Lightweight Communications and Marshalling C#.NET implementation. More...

## Public Member Functions

| LCM (params string[] urls)
| Create a new LCM object, connecting to one or more URLs. If no URL is specified, the environment variable LCM_DEFAULT_URL is used. If that environment variable is not defined, then the default URL is used.
void | Publish (string channel, string s)
| Publish a string on a channel. This method does not use the LCM type definitions and thus is not type safe. This method is primarily provided for testing purposes and may be removed in the future.
void | Publish (string channel, LCMEncodable e)
| Publish an LCM-defined type on a channel. If more than one URL was specified, the message will be sent on each.
void | Publish (string channel, byte[] data, int offset, int length)
| Publish raw data on a channel, bypassing the LCM type specification. If more than one URL was specified when the LCM object was created, the message will be sent on each.
void | Subscribe (string regex, LCMSubscriber sub)
| Subscribe to all channels whose name matches the regular expression. Note that to subscribe to all channels, you must specify ".*", not "*".
void | SubscribeAll (LCMSubscriber sub)
| A convenience function that subscribes to all LCM channels.
void | Unsubscribe (string regex, LCMSubscriber sub)
| Remove this particular regex/subscriber pair (UNTESTED AND API MAY CHANGE). If regex is null, all subscriptions for 'sub' are cancelled. If subscriber is null, any previous subscriptions matching the regular expression will be cancelled. If both 'sub' and 'regex' are null, all subscriptions will be cancelled.
void | Close ()
| Call this function to release all resources used by the LCM instance. After calling this function, the LCM instance should consume no resources, and cannot be used to receive or transmit messages.

## Properties

static LCM | Singleton`[get]`
| Retrieve a default instance of LCM using either the environment variable LCM_DEFAULT_URL or the default. If an exception occurs, exit(-1) is called.
int | NumSubscriptions`[get]`
| The number of subscriptions.

## Detailed Description

Lightweight Communications and Marshalling C#.NET implementation.

## Constructor & Destructor Documentation

## LCM()

LCM.LCM.LCM.LCM | ( | params string[] | urls | ) |

inline

Create a new LCM object, connecting to one or more URLs. If no URL is specified, the environment variable LCM_DEFAULT_URL is used. If that environment variable is not defined, then the default URL is used.

Parameters

  urls | URL array

## Member Function Documentation

## Publish() [1/3]

void LCM.LCM.LCM.Publish | ( | string | channel,
|  | byte[] | data,
|  | int | offset,
|  | int | length )

inline

Publish raw data on a channel, bypassing the LCM type specification. If more than one URL was specified when the LCM object was created, the message will be sent on each.

Parameters

  channel | channel name
  data | data byte array
  offset | offset of the data to write
  length | length of the data to write

## Publish() [2/3]

void LCM.LCM.LCM.Publish | ( | string | channel,
|  | LCMEncodable | e )

inline

Publish an LCM-defined type on a channel. If more than one URL was specified, the message will be sent on each.

Parameters

  channel | channel name
  e | encodable object to send

## Publish() [3/3]

void LCM.LCM.LCM.Publish | ( | string | channel,
|  | string | s )

inline

Publish a string on a channel. This method does not use the LCM type definitions and thus is not type safe. This method is primarily provided for testing purposes and may be removed in the future.

Parameters

  channel | channel name
  s | string to publich

## Subscribe()

void LCM.LCM.LCM.Subscribe | ( | string | regex,
|  | LCMSubscriber | sub )

inline

Subscribe to all channels whose name matches the regular expression. Note that to subscribe to all channels, you must specify ".*", not "*".

Parameters

  regex | regular expression determining the channels to subscribe
  sub | subscribing object providing callback

## SubscribeAll()

void LCM.LCM.LCM.SubscribeAll | ( | LCMSubscriber | sub | ) |

inline

A convenience function that subscribes to all LCM channels.

Parameters

  sub | subscribing object providing callback

## Unsubscribe()

void LCM.LCM.LCM.Unsubscribe | ( | string | regex,
|  | LCMSubscriber | sub )

inline

Remove this particular regex/subscriber pair (UNTESTED AND API MAY CHANGE). If regex is null, all subscriptions for 'sub' are cancelled. If subscriber is null, any previous subscriptions matching the regular expression will be cancelled. If both 'sub' and 'regex' are null, all subscriptions will be cancelled.

Parameters

  regex | regular expression determining the channels to unsubscribe
  sub | unsubscribing object

The documentation for this class was generated from the following file:

- lcm/lcm/LCM.cs