Data Structures | |
| struct | brlapi_connectionSettings_t |
| Settings structure for BrlAPI connection. More... | |
Defines | |
| #define | BRLAPI_SOCKETPORTNUM 4101 |
| #define | BRLAPI_SOCKETPORT "4101" |
| #define | BRLAPI_SOCKETPATH "/var/lib/BrlAPI/" |
| #define | BRLAPI_ETCDIR "/etc" |
| #define | BRLAPI_AUTHKEYFILE "brlapi.key" |
| #define | BRLAPI_DEFAUTH BRLAPI_ETCDIR "/" BRLAPI_AUTHKEYFILE |
| #define | BRLAPI_SETTINGS_INITIALIZER { NULL, NULL } |
Typedefs | |
| typedef int | brlapi_fileDescriptor |
Functions | |
| brlapi_fileDescriptor BRLAPI_STDCALL | brlapi_openConnection (const brlapi_connectionSettings_t *desiredSettings, brlapi_connectionSettings_t *actualSettings) |
| brlapi_fileDescriptor BRLAPI_STDCALL | brlapi__openConnection (brlapi_handle_t *handle, const brlapi_connectionSettings_t *desiredSettings, brlapi_connectionSettings_t *actualSettings) |
| void BRLAPI_STDCALL | brlapi_closeConnection (void) |
| void BRLAPI_STDCALL | brlapi__closeConnection (brlapi_handle_t *handle) |
| #define BRLAPI_AUTHKEYFILE "brlapi.key" |
Default name of the file containing BrlAPI 's authorization key
This name is relative to BRLAPI_ETCDIR
| #define BRLAPI_DEFAUTH BRLAPI_ETCDIR "/" BRLAPI_AUTHKEYFILE |
Default authorization setting
| #define BRLAPI_ETCDIR "/etc" |
brltty 's settings directory
This is where authorization key and driver-dependent key names are found for instance.
| #define BRLAPI_SETTINGS_INITIALIZER { NULL, NULL } |
Allows to initialize a structure of type brlapi_connectionSettings_t * with default values.
| #define BRLAPI_SOCKETPATH "/var/lib/BrlAPI/" |
Default unix path on which connections to BrlAPI can be established
| #define BRLAPI_SOCKETPORT "4101" |
| #define BRLAPI_SOCKETPORTNUM 4101 |
Default port number on which connections to BrlAPI can be established
| typedef int brlapi_fileDescriptor |
| void BRLAPI_STDCALL brlapi__closeConnection | ( | brlapi_handle_t * | handle | ) |
| brlapi_fileDescriptor BRLAPI_STDCALL brlapi__openConnection | ( | brlapi_handle_t * | handle, | |
| const brlapi_connectionSettings_t * | desiredSettings, | |||
| brlapi_connectionSettings_t * | actualSettings | |||
| ) |
| void BRLAPI_STDCALL brlapi_closeConnection | ( | void | ) |
Cleanly close the socket
This function locks until a closing acknowledgement is received from the server. The socket is then freed, so the file descriptor brlapi_openConnection() gave has no meaning any more
| brlapi_fileDescriptor BRLAPI_STDCALL brlapi_openConnection | ( | const brlapi_connectionSettings_t * | desiredSettings, | |
| brlapi_connectionSettings_t * | actualSettings | |||
| ) |
Open a socket and connect it to BrlAPI 's server
This function first loads an authorization key as specified in settings. It then creates a TCP socket and connects it to the specified machine, on the specified port. It writes the authorization key on the socket and waits for acknowledgement.
if (brlapi_openConnection(&settings,&settings)<0) { fprintf(stderr,"couldn't connect to BrlAPI at %s: %s\n", settings.host, brlapi_strerror(&brlapi_error)); exit(1); }
| desiredSettings | this gives the desired connection parameters, as described in brlapi_connectionSettings_t. If NULL, defaults values are used, so that it is generally a good idea to give NULL as default, and only fill a brlapi_connectionSettings_t structure when the user gave parameters to the program for instance; | |
| actualSettings | if not NULL, parameters which were actually used are stored here, if the application ever needs them. |
1.5.1