Argon RTOS  1.3.0
Tiny embedded real-time kernel
Channels
+ Collaboration diagram for Channels:

Description

Channel API.

Classes

struct  ar_channel_t
 Channel. More...
 
class  Ar::Channel
 Channel. More...
 
class  Ar::TypedChannel< T >
 Typed channel. More...
 

Channels

ar_status_t ar_channel_create (ar_channel_t *channel, const char *name, uint32_t width)
 Create a new channel. More...
 
ar_status_t ar_channel_delete (ar_channel_t *channel)
 Delete an existing channel. More...
 
ar_status_t ar_channel_send (ar_channel_t *channel, const void *value, uint32_t timeout)
 Send to a channel. More...
 
ar_status_t ar_channel_receive (ar_channel_t *channel, void *value, uint32_t timeout)
 Receive from a channel. More...
 
const char * ar_channel_get_name (ar_channel_t *channel)
 Get a channel's name. More...
 

Function Documentation

◆ ar_channel_create()

ar_status_t ar_channel_create ( ar_channel_t *  channel,
const char *  name,
uint32_t  width 
)

Create a new channel.

Parameters
channelPointer to storage for the new channel.
nameOptional name for the new channel.
widthThe size in bytes of the data passed through the channel. Set this parameter to 0 to use the default pointer-sized width.

◆ ar_channel_delete()

ar_status_t ar_channel_delete ( ar_channel_t *  channel)

Delete an existing channel.

Parameters
channelPointer to the channel.

◆ ar_channel_get_name()

const char* ar_channel_get_name ( ar_channel_t *  channel)

Get a channel's name.

Parameters
channelPointer to the channel.

◆ ar_channel_receive()

ar_status_t ar_channel_receive ( ar_channel_t *  channel,
void *  value,
uint32_t  timeout 
)

Receive from a channel.

Parameters
channelPointer to the channel.
valuePointer to a location where the received data is written.
timeoutThe maximum number of milliseconds the caller is willing to wait before the receive is completed.

◆ ar_channel_send()

ar_status_t ar_channel_send ( ar_channel_t *  channel,
const void *  value,
uint32_t  timeout 
)

Send to a channel.

This function synchronously sends a value across the specified channel. If there is not a thread waiting to receive on the other side, then this function will block.

Parameters
channelPointer to the channel.
valuePointer to value to send through the channel.
timeoutThe maximum number of milliseconds the caller is willing to wait before the send is completed.