Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,23 @@ Note: if you have trouble establishing communication between these programs acro
computers especially on Windows, take a look at the NetworkConnectivity page and read the
Network Troubleshooting section.

## [FAQs](https://github.com/labstreaminglayer/liblsl/blob/master/FAQ.md)
## [FAQs](https://labstreaminglayer.readthedocs.io/info/faqs.html)

## C Example Programs: Basic to Advanced

These two example programs illustrate the bread-and-butter use of LSL as it is executing in almost
any device module that comes with the distribution:

- [Sending a multi-channel time series into LSL.](https://github.com/labstreaminglayer/App-Examples/blob/master/SendDataC.c)
- [Receiving a multi-channel time series from LSL.](https://github.com/labstreaminglayer/App-Examples/blob/master/ReceiveDataC.c)
- [Sending a multi-channel time series into LSL.](https://github.com/sccn/liblsl/blob/main/examples/SendDataC.c)
- [Receiving a multi-channel time series from LSL.](https://github.com/sccn/liblsl/blob/main/examples/ReceiveDataC.c)


These two example programs illustrate a more special-purpose use case, namely sending arbitrary
string-formatted data at irregular sampling rate. Such streams are used by programs that produce
event markers, for example:

- [Sending a stream of strings with irregular timing.](https://github.com/labstreaminglayer/App-Examples/blob/master/SendStringMarkersC.c)
- [Receiving a stream of strings with irregular timing.](https://github.com/labstreaminglayer/App-Examples/blob/master/ReceiveStringMarkersC.c)
- [Sending a stream of strings with irregular timing.](https://github.com/sccn/liblsl/blob/main/examples/SendStringMarkersC.c)
- [Receiving a stream of strings with irregular timing.](https://github.com/sccn/liblsl/blob/main/examples/ReceiveStringMarkersC.c)

The last example shows how to attach properly formatted meta-data to a stream, and how to read it
out again at the receiving end.
Expand All @@ -61,22 +61,22 @@ the spec is [here](https://github.com/sccn/xdf/wiki/Meta-Data).
Note that some older example programs (SendData/ReceiveData) predate this convention and name the
channels inconsistently.

- [Handling stream meta-data.](https://github.com/labstreaminglayer/App-Examples/blob/master/HandleMetaDataC.c)
- [Handling stream meta-data.](https://github.com/sccn/liblsl/blob/main/examples/HandleMetaDataC.c)

## C++ Example Programs: Basic to Advanced

These two example programs illustrate the shortest amount of code that is necessary to get a C++
program linked to LSL:

- [Minimal data sending example.](https://github.com/labstreaminglayer/App-Examples/blob/master/SendDataSimple.cpp)
- [Minimal data receiving example.](https://github.com/labstreaminglayer/App-Examples/blob/master/ReceiveDataSimple.cpp)
- [Minimal data sending example.](https://github.com/sccn/liblsl/blob/main/examples/SendDataSimple.cpp)
- [Minimal data receiving example.](https://github.com/sccn/liblsl/blob/main/examples/ReceiveDataSimple.cpp)


These two example programs demonstrate how to write more complete LSL clients in C++ (they are 1:1
equivalents of the corresponding C programs):

- [Sending a multi-channel time series into LSL.](https://github.com/labstreaminglayer/App-Examples/blob/master/SendData.cpp)
- [Receiving a multi-channel time series from LSL.](https://github.com/labstreaminglayer/App-Examples/blob/master/ReceiveData.cpp)
- [Sending a multi-channel time series into LSL.](https://github.com/sccn/liblsl/blob/main/examples/SendData.cpp)
- [Receiving a multi-channel time series from LSL.](https://github.com/sccn/liblsl/blob/main/examples/ReceiveData.cpp)

These two programs transmit their data at the granularity of chunks instead of samples.
This is mostly a convenience matter, since inlets and outlets can be configured to automatically
Expand All @@ -86,17 +86,17 @@ of samples and data that is pushed as samples can be pulled out as chunks or vic
They also show how structs can be used to represent the sample data, instead of numeric arrays
(which is mostly a syntactic difference):

- [Sending a multi-channel time series at chunk granularity.](https://github.com/labstreaminglayer/App-Examples/blob/master/SendDataInChunks.cpp)
- [Receiving a multi-channel time series at chunk granularity.](https://github.com/labstreaminglayer/App-Examples/blob/master/ReceiveDataInChunks.cpp)
- [Sending a multi-channel time series at chunk granularity.](https://github.com/sccn/liblsl/blob/main/examples/SendDataInChunks.cpp)
- [Receiving a multi-channel time series at chunk granularity.](https://github.com/sccn/liblsl/blob/main/examples/ReceiveDataInChunks.cpp)

These two example programs illustrate a more special-purpose use case, namely sending arbitrary
string-formatted data at irregular sampling rate.
Such streams are used by programs that produce event markers, for example.

These are 1:1 equivalents of the corresponding C programs:

- [Sending a stream of strings with irregular timing.](https://github.com/labstreaminglayer/App-Examples/blob/master/SendStringMarkers.cpp)
- [Receiving a stream of strings with irregular timing.](https://github.com/labstreaminglayer/App-Examples/blob/master/ReceiveStringMarkers.cpp)
- [Sending a stream of strings with irregular timing.](https://github.com/sccn/liblsl/blob/main/examples/SendStringMarkers.cpp)
- [Receiving a stream of strings with irregular timing.](https://github.com/sccn/liblsl/blob/main/examples/ReceiveStringMarkers.cpp)

The last example shows how to attach properly formatted meta-data to a stream, and how to read it
out again at the receiving end.
Expand All @@ -105,24 +105,24 @@ LSL has adopted the convention to name meta-data fields according to the XDF fil
specification whenever the content type matches (for example EEG, Gaze, MoCap, VideoRaw, etc);
the spec is [here](https://github.com/sccn/xdf/wiki/Meta-Data).

- [Handling stream meta-data.](https://github.com/labstreaminglayer/App-Examples/blob/master/HandleMetaData.cpp)
- [Handling stream meta-data.](https://github.com/sccn/liblsl/blob/main/examples/HandleMetaData.cpp)

## C/C++ Special-Purpose Example Programs

These programs illustrate some special use cases of LSL that are also relevant for C programmers.
See the lsl\_c.h header for the corresponding C APIs (they are very similar to the C++ code shown here).

This example illustrates in more detail how streams can be resolved on the network:
- [Resolving all streams on the lab network, one-shot and continuous.](https://github.com/labstreaminglayer/App-Examples/blob/master/GetAllStreams.cpp)
- [Resolving all streams on the lab network, one-shot and continuous.](https://github.com/sccn/liblsl/blob/main/examples/GetAllStreams.cpp)

This example shows how to query the full XML meta-data of a stream (which may be several megabytes large):
- [Retrieving the XML meta-data of a stream.](https://github.com/labstreaminglayer/App-Examples/blob/master/GetFullinfo.cpp)
- [Retrieving the XML meta-data of a stream.](https://github.com/sccn/liblsl/blob/main/examples/GetFullinfo.cpp)

This example shows how to obtain time-correction values for a given stream.
These time-correction values are offsets (in seconds) that are used to remap any stream's timestamps
into the own local clock domain (just by adding the offset to the timestamp):

- [Querying the time-correction information for a stream.](https://github.com/labstreaminglayer/App-Examples/blob/master/GetTimeCorrection.cpp)
- [Querying the time-correction information for a stream.](https://github.com/sccn/liblsl/blob/main/examples/GetTimeCorrection.cpp)

## License

Expand Down
Loading