brlapi_par...Management(3)
โจ NAME โจ
brlapi_parameterManagement โ Parameter management ๐
Okay so hi bestie, welcome to brlapi_par...Management(3) ๐ this whole page is literally just how to manage BrlAPI parameters. That's it. That's the vibe. Let's get into it ๐ฆ
๐ธ SYNOPSIS ๐ธ
๐ง Macros
#define BRLAPI_PARAMF_LOCAL 0X00
#define BRLAPI_PARAMF_GLOBAL 0X01
#define BRLAPI_PARAMF_SELF 0X02
๐ฆ Typedefs
typedef uint32_t brlapi_param_flags_t
typedef void(* brlapi_paramCallback_t) (brlapi_param_t parameter,
brlapi_param_subparam_t subparam, brlapi_param_flags_t flags, void
*priv, const void *data, size_t len)
typedef void * brlapi_paramCallbackDescriptor_t
๐ Functions
ssize_t BRLAPI_STDCALL brlapi_getParameter (brlapi_param_t parameter,
brlapi_param_subparam_t subparam, brlapi_param_flags_t flags, void
*data, size_t len)
ssize_t BRLAPI_STDCALL brlapi__getParameter (brlapi_handle_t *handle,
brlapi_param_t parameter, brlapi_param_subparam_t subparam,
brlapi_param_flags_t flags, void *data, size_t len)
void *BRLAPI_STDCALL brlapi_getParameterAlloc (brlapi_param_t parameter,
brlapi_param_subparam_t subparam, brlapi_param_flags_t flags, size_t
*len)
void *BRLAPI_STDCALL brlapi__getParameterAlloc (brlapi_handle_t *handle,
brlapi_param_t parameter, brlapi_param_subparam_t subparam,
brlapi_param_flags_t flags, size_t *len)
int BRLAPI_STDCALL brlapi_setParameter (brlapi_param_t parameter,
brlapi_param_subparam_t subparam, brlapi_param_flags_t flags, const
void *data, size_t len)
int BRLAPI_STDCALL brlapi__setParameter (brlapi_handle_t *handle,
brlapi_param_t parameter, brlapi_param_subparam_t subparam,
brlapi_param_flags_t flags, const void *data, size_t len)
brlapi_paramCallbackDescriptor_t BRLAPI_STDCALL brlapi_watchParameter
(brlapi_param_t parameter, brlapi_param_subparam_t subparam,
brlapi_param_flags_t flags, brlapi_paramCallback_t func, void *priv,
void *data, size_t len)
brlapi_paramCallbackDescriptor_t BRLAPI_STDCALL brlapi__watchParameter
(brlapi_handle_t *handle, brlapi_param_t parameter,
brlapi_param_subparam_t subparam, brlapi_param_flags_t flags,
brlapi_paramCallback_t func, void *priv, void *data, size_t len)
int BRLAPI_STDCALL brlapi_unwatchParameter
(brlapi_paramCallbackDescriptor_t descriptor)
int BRLAPI_STDCALL brlapi__unwatchParameter (brlapi_handle_t *handle,
brlapi_paramCallbackDescriptor_t descriptor)
enum brlapi_param_t { BRLAPI_PARAM_SERVER_VERSION = 0,
BRLAPI_PARAM_CLIENT_PRIORITY = 1, BRLAPI_PARAM_DRIVER_NAME = 2,
BRLAPI_PARAM_DRIVER_CODE = 3, BRLAPI_PARAM_DRIVER_VERSION = 4,
BRLAPI_PARAM_DEVICE_MODEL = 5, BRLAPI_PARAM_DEVICE_CELL_SIZE = 31,
BRLAPI_PARAM_DISPLAY_SIZE = 6, BRLAPI_PARAM_DEVICE_IDENTIFIER = 7,
BRLAPI_PARAM_DEVICE_SPEED = 8, BRLAPI_PARAM_DEVICE_ONLINE = 9,
BRLAPI_PARAM_RETAIN_DOTS = 10,
BRLAPI_PARAM_COMPUTER_BRAILLE_CELL_SIZE = 11,
BRLAPI_PARAM_LITERARY_BRAILLE = 12, BRLAPI_PARAM_CURSOR_DOTS = 13,
BRLAPI_PARAM_CURSOR_BLINK_PERIOD = 14,
BRLAPI_PARAM_CURSOR_BLINK_PERCENTAGE = 15,
BRLAPI_PARAM_RENDERED_CELLS = 16, BRLAPI_PARAM_SKIP_IDENTICAL_LINES
= 17, BRLAPI_PARAM_AUDIBLE_ALERTS = 18,
BRLAPI_PARAM_CLIPBOARD_CONTENT = 19,
BRLAPI_PARAM_BOUND_COMMAND_KEYCODES = 20,
BRLAPI_PARAM_COMMAND_KEYCODE_NAME = 21,
BRLAPI_PARAM_COMMAND_KEYCODE_SUMMARY = 22,
BRLAPI_PARAM_DEFINED_DRIVER_KEYCODES = 23,
BRLAPI_PARAM_DRIVER_KEYCODE_NAME = 24,
BRLAPI_PARAM_DRIVER_KEYCODE_SUMMARY = 25,
BRLAPI_PARAM_COMPUTER_BRAILLE_ROWS_MASK = 26,
BRLAPI_PARAM_COMPUTER_BRAILLE_ROW_CELLS = 27,
BRLAPI_PARAM_COMPUTER_BRAILLE_TABLE = 28,
BRLAPI_PARAM_LITERARY_BRAILLE_TABLE = 29,
BRLAPI_PARAM_MESSAGE_LOCALE = 30, BRLAPI_PARAM_DRIVER_PROPERTY_VALUE
= 32, BRLAPI_PARAM_COUNT = 33 }
๐ซถ Detailed Description ๐ซถ
So like, there are several kinds of parameters, and you need to know which kind you're dealing with, iykyk:
- states that are tied to the braille device itself โ its size, parameters of the device port, all of that ๐ซ
- states of the BrlAPI connection itself, like the displaying level or key passing preferences โจ
- general states, for example the cut buffer ๐
- braille parameters: braille table, contraction, cursor shape, etc ๐ธ
- browse parameters: line skip, beep, etc ๐
Some of them are subdivided in subparameters, bestie. Others have only subparameter 0. Yep, just the one. Not me living my single-subparam truth ๐
Some of them are read-only, others are read/write.
A client can either:
- request the immediate content of a parameter by using
brlapi_getParameter()๐ - set the content of a parameter by using
brlapi_setParameter()โ๏ธ - or register a callback that may be called immediately and on each change of a given parameter, by using
brlapi_watchParameter()๐
๐ Macro Definition Documentation ๐
๐ #define BRLAPI_PARAMF_GLOBAL 0X01
Refer to the global value instead of the value local to the connection ๐
๐ #define BRLAPI_PARAMF_LOCAL 0X00
Refer to the value local to the connection instead of the global value ๐
๐ #define BRLAPI_PARAMF_SELF 0X02
Specify whether to receive notifications of value self-changes ๐
๐ฆ Typedef Documentation ๐ฆ
โจ typedef uint32_t brlapi_param_flags_t
Flags for parameter requests ๐ฉ
โจ typedef void(* brlapi_paramCallback_t) (brlapi_param_t parameter, brlapi_param_subparam_t subparam, brlapi_param_flags_t flags, void *priv, const void *data, size_t len)
Callback for parameter changes ๐ซ
When a parameter gets changed, application-defined callbacks set by the brlapi_watchParameter() function are called. Like, that's the whole point. ๐ซถ
Parameters
parameteris the parameter that changed;subparamis a specific instance of the parameter;flagsspecify which value and how it was changed;privis thevoidpointer that was passed to thebrlapi_watchParametercall which registered the callback;datais a buffer containing the new value of the parameter;lenis the size of thedata.
Okay ngl this part is important bestie: this callback only gets called when the application calls some brlapi_ function (i.e. BrlAPI gets direct control of the execution). BrlAPI itself does not start a separate thread or such. ๐ญ
If an application wants to see such event trigger a callback getting called e.g. in another thread, it can use brlapi_pause() to give BrlAPI an opportunity to receive messages and call the callbacks. Slay โจ
โจ typedef void* brlapi_paramCallbackDescriptor_t
Type for callback descriptors ๐๏ธ This is returned by brlapi_watchParameter, to be passed to brlapi_unwatchParameter. Keep it safe, it's your receipt ๐งพ
๐ Enumeration Type Documentation ๐
๐ enum brlapi_param_t
Enumerator
BRLAPI_PARAM_SERVER_VERSIONโ Version of the server:uint32_tโญBRLAPI_PARAM_CLIENT_PRIORITYโ Priority of the client:uint32_t(from 0 through 100, default is 50) ๐BRLAPI_PARAM_DRIVER_NAMEโ Full name of the driver:string๐BRLAPI_PARAM_DRIVER_CODEโ Code (short name) of the driver:string๐คBRLAPI_PARAM_DRIVER_VERSIONโ Version of the driver:string๐ท๏ธBRLAPI_PARAM_DEVICE_MODELโ Model of the device:string๐ฑBRLAPI_PARAM_DEVICE_CELL_SIZEโ Number of dots in a cell:uint8_tโซBRLAPI_PARAM_DISPLAY_SIZEโ Dimensions of the braille display:{ uint32_t columns; uint32_t rows; }๐BRLAPI_PARAM_DEVICE_IDENTIFIERโ Identifier of the device:string๐BRLAPI_PARAM_DEVICE_SPEEDโ Speed of the device:uint32_t๐๏ธBRLAPI_PARAM_DEVICE_ONLINEโ Device is online:boolean๐ขBRLAPI_PARAM_RETAIN_DOTSโ Pass dot combinations (rather than characters):booleanโชBRLAPI_PARAM_COMPUTER_BRAILLE_CELL_SIZEโ Number of dots used to render a computer braille character:uint8_t(8 or 6) ๐งฎBRLAPI_PARAM_LITERARY_BRAILLEโ Whether braille is literary (rather than computer):boolean๐BRLAPI_PARAM_CURSOR_DOTSโ Representation of the cursor:uint8_t(ISO 11548-1) ๐ฑ๏ธBRLAPI_PARAM_CURSOR_BLINK_PERIODโ Blinking period of the cursor:uint32_t(milliseconds) โฑ๏ธBRLAPI_PARAM_CURSOR_BLINK_PERCENTAGEโ Portion of the blinking period that the cursor is visible:uint8_t(from 0 through 100) ๐๏ธBRLAPI_PARAM_RENDERED_CELLSโ Cells rendered by the client:uint8_t[](ISO 11548-1), one cell per element ๐กBRLAPI_PARAM_SKIP_IDENTICAL_LINESโ Whether to skip identical screen lines:boolean๐BRLAPI_PARAM_AUDIBLE_ALERTSโ Whether to use audible alerts:boolean๐BRLAPI_PARAM_CLIPBOARD_CONTENTโ Content of the clipboard: UTF-8string๐BRLAPI_PARAM_BOUND_COMMAND_KEYCODESโ Commands bound by the driver:uint64_t[], one command keycode per element โจ๏ธBRLAPI_PARAM_COMMAND_KEYCODE_NAMEโ Name for a command keycode (specified via thesubparamargument):string(usually a few characters) ๐ท๏ธBRLAPI_PARAM_COMMAND_KEYCODE_SUMMARYโ Description for a command keycode (specified via thesubparamargument):string(usually a few words) ๐ฌBRLAPI_PARAM_DEFINED_DRIVER_KEYCODESโ Keycodes defined by the driver:uint64_t[], one keycode per element ๐ขBRLAPI_PARAM_DRIVER_KEYCODE_NAMEโ Name for a driver keycode (specified via thesubparamargument):string(usually a few characters) ๐ซBRLAPI_PARAM_DRIVER_KEYCODE_SUMMARYโ Description for a driver keycode (specified via thesubparamargument):string(usually a few words) ๐๏ธBRLAPI_PARAM_COMPUTER_BRAILLE_ROWS_MASKโ Set of Unicode rows that are defined for computer braille (fromU+0000throughU+10FFFF):uint8_t[544], one bit per row, eight rows per element ๐งฉBRLAPI_PARAM_COMPUTER_BRAILLE_ROW_CELLSโ Computer braille cells for a Unicode row (specified via thesubparamargument):uint8_t[256](ISO 11548-1), one cell per element ๐BRLAPI_PARAM_COMPUTER_BRAILLE_TABLEโ Name of the computer braille table:string๐๏ธBRLAPI_PARAM_LITERARY_BRAILLE_TABLEโ Name of the literary braille table:string๐BRLAPI_PARAM_MESSAGE_LOCALEโ Locale to use for messages:string๐BRLAPI_PARAM_DRIVER_PROPERTY_VALUEโ Value of a driver-specific property:uint32_t๐งBRLAPI_PARAM_COUNTโ (no description, she's just the counter, periodt โ)
and that's where this half of the page ends, bestie ๐ keep scrolling for the rest ๐
๐ซ Function Documentation ๐ซ
Okay bestie, this is the part where we actually call the functions. Grab a snack, we're going through them one by one. ๐
๐ซถ brlapi__getParameter ๐ซถ
ssize_t BRLAPI_STDCALL brlapi__getParameter (brlapi_handle_t * handle,
brlapi_param_t parameter, brlapi_param_subparam_t subparam,
brlapi_param_flags_t flags, void * data, size_t len)
References BRLAPI_STDCALL.
๐ซถ brlapi__getParameterAlloc ๐ซถ
void *BRLAPI_STDCALL brlapi__getParameterAlloc (brlapi_handle_t * handle,
brlapi_param_t parameter, brlapi_param_subparam_t subparam,
brlapi_param_flags_t flags, size_t * len)
References BRLAPI_STDCALL.
๐ซถ brlapi__setParameter ๐ซถ
int BRLAPI_STDCALL brlapi__setParameter (brlapi_handle_t * handle,
brlapi_param_t parameter, brlapi_param_subparam_t subparam,
brlapi_param_flags_t flags, const void * data, size_t len)
References BRLAPI_STDCALL.
๐ซถ brlapi__unwatchParameter ๐ซถ
int BRLAPI_STDCALL brlapi__unwatchParameter (brlapi_handle_t * handle,
brlapi_paramCallbackDescriptor_t descriptor)
References BRLAPI_STDCALL.
๐ซถ brlapi__watchParameter ๐ซถ
brlapi_paramCallbackDescriptor_t BRLAPI_STDCALL brlapi__watchParameter
(brlapi_handle_t * handle, brlapi_param_t parameter,
brlapi_param_subparam_t subparam, brlapi_param_flags_t flags,
brlapi_paramCallback_t func, void * priv, void * data, size_t len)
References BRLAPI_STDCALL.
โจ brlapi_getParameter โจ
Get the content of a parameter
ssize_t BRLAPI_STDCALL brlapi_getParameter (brlapi_param_t parameter,
brlapi_param_subparam_t subparam, brlapi_param_flags_t flags, void *
data, size_t len)
No cap, brlapi_getParameter gets the current content of a parameter. Like, right now, the actual vibe of it. ๐ฆ
Parameters
parameteris the parameter whose content shall be gotten;subparamis a specific instance of the parameter;flagsspecify which value and how it should be returned;datais a buffer where content of the parameter shall be stored;lenis the size of the buffer.
Returns
the real size of the parameter's content. Now listen โ if the parameter does not fit in the provided buffer, it is truncated to len bytes (but the real size of the parameter is still returned). So yes bestie, you get the truth even when the buffer lied. ๐ญ In that case, the client must call brlapi_getParameter again with a big enough buffer.
References BRLAPI_STDCALL.
โจ brlapi_getParameterAlloc โจ
Return the content of a parameter
void *BRLAPI_STDCALL brlapi_getParameterAlloc (brlapi_param_t parameter,
brlapi_param_subparam_t subparam, brlapi_param_flags_t flags, size_t *
len)
brlapi_getParameterAlloc gets the current content of a parameter, by returning it as a newly-allocated buffer. The buffer is allocated to one byte more than the parameter value. This byte is set to zero. This allows, for string parameters, to be able to immediately use it as a C string. Honestly? Iconic behaviour. ๐
Parameters
parameteris the parameter whose content shall be gotten;subparamis a specific instance of the parameter;flagsspecify which value and how it should be returned;lenis the address where to store the size of the parameter value.
Returns
a newly-allocated buffer that contains the value of the parameter. The caller must call free() on it after use. NULL is returned on errors.
References BRLAPI_STDCALL.
โจ brlapi_setParameter โจ
Set the content of a parameter
int BRLAPI_STDCALL brlapi_setParameter (brlapi_param_t parameter,
brlapi_param_subparam_t subparam, brlapi_param_flags_t flags, const void
* data, size_t len)
brlapi_setParameter sets the content of a parameter. You're the main character here, you decide what goes in. ๐
Parameters
parameteris the parameter to set;subparamis a specific instance of the parameter;flagsspecify which value and how it should be set;datais a buffer containing the data to store in the parameter;lenis the size of the data.
Returns
0 on success, -1 on error (read-only parameter for instance). Yeah, if it's read-only it's giving no and you just have to accept that. ๐
References BRLAPI_STDCALL.
โจ brlapi_unwatchParameter โจ
Clear a parameter change callback
int BRLAPI_STDCALL brlapi_unwatchParameter (brlapi_paramCallbackDescriptor_t
descriptor)
brlapi_unwatchParameter unregisters a parameter change callback: the callback function previously registered with brlapi_watchParameter will not be called any longer. It's the โจ we're-so-done โจ of function calls.
Parameters
descriptorrefers to the callback to be removed.
Returns
0 on success, -1 on error.
References BRLAPI_STDCALL.
โจ brlapi_watchParameter โจ
Set a parameter change callback
brlapi_paramCallbackDescriptor_t BRLAPI_STDCALL brlapi_watchParameter
(brlapi_param_t parameter, brlapi_param_subparam_t subparam,
brlapi_param_flags_t flags, brlapi_paramCallback_t func, void * priv,
void * data, size_t len)
brlapi_watchParameter registers a parameter change callback: whenever the given parameter changes, the given function is called. It's literally the "notify me bestie ๐" of the API.
Parameters
parameteris the parameter to watch;subparamis a specific instance of the parameter;flagsspecify which value and how it should be monitored;funcis the function to call on parameter change;privis a void pointer which will be passed as such to the function;datais a buffer where the current content of the parameter shall be stored;lenis the size of the buffer.
Returns
the callback descriptor (to be passed to brlapi_unwatchParameter to unregister the callback), or NULL on error.
Note Default parameter callbacks don't do anything, except the ones for display size which just raiseSIGWINCH. So like, lowkey quiet, except the display size one who is so dramatic. ๐ IfdataisNULL, the callback will be called immediately bybrlapi_watchParameter, for providing the initial value.
References BRLAPI_STDCALL.
๐ Author ๐
Generated automatically by Doxygen for BrlAPI from the source code.
And that's a wrap, bestie! ๐ This page came from BrlAPI, Version 0.8, and the footer's date stamp is its own little timestamp of destiny โ same source, same version, same energy. Go forth and parameter-manage, you absolute legend. ๐๐ฆโจ
๐ฆ where this page comes from
- fedora 43: brlapi-devel 0.8.7-4.fc43 ยท LGPL-2.0-or-later AND LGPL-2.1-or-later AND GPL-2.0-or-later
- fedora 43: brlapi-devel 0.8.7-4.fc43 ยท LGPL-2.0-or-later AND LGPL-2.1-or-later AND GPL-2.0-or-later
- fedora 44: brlapi-devel 0.8.7-8.fc44 ยท LGPL-2.0-or-later AND LGPL-2.1-or-later AND GPL-2.0-or-later
- fedora 44: brlapi-devel 0.8.7-8.fc44 ยท LGPL-2.0-or-later AND LGPL-2.1-or-later AND GPL-2.0-or-later
- opensuse-leap 16.0: brlapi-devel 6.8-160000.2.2 ยท LGPL-2.1-or-later
- opensuse-leap 16.0: brlapi-devel 6.8-160000.2.2 ยท LGPL-2.1-or-later
- opensuse-leap 16.0: brlapi-devel 6.8-160000.2.2 ยท LGPL-2.1-or-later
- opensuse-leap 16.0: brlapi-devel 6.8-160000.2.2 ยท LGPL-2.1-or-later
- ubuntu stonking: libbrlapi-dev 6.9.1+repack-1ubuntu1
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms