Commit 391fad52 authored by Arnaud Blanchard's avatar Arnaud Blanchard
Browse files

amend

parent d0017b37
......@@ -14,17 +14,21 @@ Example
For exemple you create a channel in one program to write data:
#Creating shared called '/my_channel_name', this program will write on it, it is char ('INT8') with no specific format ('NDEF') of dimension 1 (vector) of 32 elements.
```C++
//Creating shared called '/my_channel_name', this program will write on it, it is char ('INT8') with no specific format ('NDEF') of dimension 1 (vector) of 32 elements.
blc_channel my_channel.create("/my_channel_name", BLC_CHANNEL_WRITE, 'INT8', 'NDEF', 1, 32);
snprintf(my_channel.chars, 32, "Hello world !\n");
```
and read this data in another program:
#Opening shared memory called '/my_channel_name', this program will only read it.
```C++
//Opening shared memory called '/my_channel_name', this program will only read it.
blc_channel my_receiving_channel.open("/my_channel_name", BLC_CHANNEL_READ);
printf("%s", my_receiving_channel.chars);
```
The second program prints 'Hello world !'.
......@@ -46,3 +50,10 @@ You will see all the existing blc_channels, the process reading or writing and t
On Linux we can see and manipulate a virtual file containing this memory in /run/shm/<name of your shared memory>, on OSX you cannot but anyway it is only used for debug.
C/C++ documentation
===================
To see the documentation for C++, execute : `./doc_api blc_channel` in your blaar directory. Add `-c` option if you want the plain C api.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment