libgpiod  2.0.1
Functions
Request configuration objects

Functions for manipulating request configuration objects. More...

Functions

struct gpiod_request_configgpiod_request_config_new (void)
 Create a new request config object. More...
 
void gpiod_request_config_free (struct gpiod_request_config *config)
 Free the request config object and release all associated resources. More...
 
void gpiod_request_config_set_consumer (struct gpiod_request_config *config, const char *consumer)
 Set the consumer name for the request. More...
 
const char * gpiod_request_config_get_consumer (struct gpiod_request_config *config)
 Get the consumer name configured in the request config. More...
 
void gpiod_request_config_set_event_buffer_size (struct gpiod_request_config *config, size_t event_buffer_size)
 Set the size of the kernel event buffer for the request. More...
 
size_t gpiod_request_config_get_event_buffer_size (struct gpiod_request_config *config)
 Get the edge event buffer size for the request config. More...
 

Detailed Description

Functions for manipulating request configuration objects.

Request config objects are used to pass a set of options to the kernel at the time of the line request. The mutators don't return error values. If the values are invalid, in general they are silently adjusted to acceptable ranges.

Function Documentation

◆ gpiod_request_config_free()

void gpiod_request_config_free ( struct gpiod_request_config config)

Free the request config object and release all associated resources.

Parameters
configLine config object.

◆ gpiod_request_config_get_consumer()

const char* gpiod_request_config_get_consumer ( struct gpiod_request_config config)

Get the consumer name configured in the request config.

Parameters
configRequest config object.
Returns
Consumer name stored in the request config.

◆ gpiod_request_config_get_event_buffer_size()

size_t gpiod_request_config_get_event_buffer_size ( struct gpiod_request_config config)

Get the edge event buffer size for the request config.

Parameters
configRequest config object.
Returns
Edge event buffer size setting from the request config.

◆ gpiod_request_config_new()

struct gpiod_request_config* gpiod_request_config_new ( void  )

Create a new request config object.

Returns
New request config object or NULL on error. The returned object must be freed by the caller using gpiod_request_config_free.

◆ gpiod_request_config_set_consumer()

void gpiod_request_config_set_consumer ( struct gpiod_request_config config,
const char *  consumer 
)

Set the consumer name for the request.

Parameters
configRequest config object.
consumerConsumer name.
Note
If the consumer string is too long, it will be truncated to the max accepted length.

◆ gpiod_request_config_set_event_buffer_size()

void gpiod_request_config_set_event_buffer_size ( struct gpiod_request_config config,
size_t  event_buffer_size 
)

Set the size of the kernel event buffer for the request.

Parameters
configRequest config object.
event_buffer_sizeNew event buffer size.
Note
The kernel may adjust the value if it's too high. If set to 0, the default value will be used.
The kernel buffer is distinct from and independent of the user space buffer (gpiod_edge_event_buffer_new).