Man page - brlapi_writepacket(3)
Packages contains this manual
- brlapi_suspend(3)
- brlapi_connection(3)
- brlapi_param_bool_t(3)
- brlapi_header_t(3)
- brlapi_strexception(3)
- brlapi_error_t(3)
- brlapi__pause(3)
- brlapi_write(3)
- brlapi_fd_mutex(3)
- brlapi_param_properties_t(3)
- brlapi_errno(3)
- brlapi_tty(3)
- brlapi_range_t(3)
- brlapi_error(3)
- brlapi_param_flags_t(3)
- brlapi__write(3)
- brlapi_pause(3)
- brlapi__sync(3)
- brlapi_sync(3)
- brlapi_driverspecific(3)
- brlapi_nerr(3)
- brlapi_protocol(3)
- brlapi_keycodes.h(3)
- brlapi_libcerrno(3)
- brlapi_info(3)
- brlapi_param_type_t(3)
- brlapi_errlist(3)
- brlapi_handle_t(3)
- brlapi_perror(3)
- brlapi_gaierrno(3)
- brlapi_strerror(3)
- brlapi__strexception(3)
- brlapi_resume(3)
- brlapi_constants.h(3)
- brlapi_protocol.h(3)
- brlapi_packet_t(3)
- brlapi_settings_t(3)
- brlapi_version(3)
- brlapi_keycodes(3)
- brlapi_deprecated(3)
- brlapi_misc(3)
- brlapi_handles(3)
- brlapi_strerror_r(3)
- brlapi_param_subparam_t(3)
- brlapi_errfun(3)
- brlapi_param_t(3)
- brlapi_param.h(3)
- brlapi_keys(3)
- brlapi_error_location(3)
apt-get install libbrlapi-dev
Manual
brlapi_protocol
NAMESYNOPSIS
Data Structures
Macros
Functions
Variables
Detailed Description
Macro Definition Documentation
#define BRLAPI_AUTH_CRED βCβ
#define BRLAPI_AUTH_KEY βKβ
#define BRLAPI_AUTH_NONE βNβ
#define BRLAPI_DEVICE_MAGIC (0xdeadbeefL)
#define BRLAPI_HEADERSIZE sizeof(brlapi_header_t)
#define BRLAPI_MAXPACKETSIZE 4096
#define BRLAPI_MAXPARAMSIZE (BRLAPI_MAXPACKETSIZE - (sizeof(uint32_t) +sizeof(brlapi_param_t) + 2*sizeof(uint32_t)))
#define BRLAPI_PACKET_ACCEPTKEYRANGES βuβ
#define BRLAPI_PACKET_ACK βAβ
#define BRLAPI_PACKET_AUTH βaβ
#define BRLAPI_PACKET_ENTERRAWMODE β*β
#define BRLAPI_PACKET_ENTERTTYMODE βtβ
#define BRLAPI_PACKET_ERROR βeβ
#define BRLAPI_PACKET_EXCEPTION βEβ
#define BRLAPI_PACKET_GETDISPLAYSIZE βsβ
#define BRLAPI_PACKET_GETDRIVERNAME βnβ
#define BRLAPI_PACKET_GETMODELID βdβ
#define BRLAPI_PACKET_IGNOREKEYRANGES βmβ
#define BRLAPI_PACKET_KEY βkβ
#define BRLAPI_PACKET_LEAVERAWMODE β#β
#define BRLAPI_PACKET_LEAVETTYMODE βLβ
#define BRLAPI_PACKET_PACKET βpβ
#define BRLAPI_PACKET_PARAM_REQUEST ((βPβ<<8) + βRβ)
#define BRLAPI_PACKET_PARAM_UPDATE ((βPβ<<8) + βUβ)
#define BRLAPI_PACKET_PARAM_VALUE ((βPβ<<8) + βVβ)
#define BRLAPI_PACKET_RESUMEDRIVER βRβ
#define BRLAPI_PACKET_SETFOCUS βFβ
#define BRLAPI_PACKET_SUSPENDDRIVER βSβ
#define BRLAPI_PACKET_SYNCHRONIZE βZβ
#define BRLAPI_PACKET_VERSION βvβ
#define BRLAPI_PACKET_WRITE βwβ
#define BRLAPI_PARAMF_GET 0X100 /** Get current parameter value */
#define BRLAPI_PARAMF_SUBSCRIBE 0X200 /** Subscribe to parameterupdates */
#define BRLAPI_PARAMF_UNSUBSCRIBE 0X400 /** Unsubscribe from parameterupdates */
#define BRLAPI_PROTOCOL_VERSION ((uint32_t) 8) /** Communication protocolversion */
#define BRLAPI_PVF_GLOBAL 0X01 /** Value is the global value */
#define BRLAPI_WF_ATTR_AND 0X08
#define BRLAPI_WF_ATTR_OR 0X10
#define BRLAPI_WF_CHARSET 0X40
#define BRLAPI_WF_CURSOR 0X20
#define BRLAPI_WF_DISPLAYNUMBER 0X01
#define BRLAPI_WF_REGION 0X02
#define BRLAPI_WF_TEXT 0X04
Function Documentation
ssize_t brlapi_readPacket (brlapi_fileDescriptor fd, brlapi_packetType_t *type, void * buf, size_t size)
ssize_t brlapi_readPacketContent (brlapi_fileDescriptor fd, size_tpacketSize, void * buf, size_t bufSize)
ssize_t brlapi_readPacketHeader (brlapi_fileDescriptor fd,brlapi_packetType_t * packetType)
ssize_t brlapi_writePacket (brlapi_fileDescriptor fd, brlapi_packetType_ttype, const void * buf, size_t size)
Variable Documentation
pthread_mutex_t brlapi_fd_mutex [extern]
Author
NAME
brlapi_protocol - BrlAPIβs protocol
- Instructions and constants for BrlAPI βs protocol.
SYNOPSIS
Data Structures
struct
brlapi_header_t
struct
brlapi_versionPacket_t
struct
brlapi_authClientPacket_t
struct
brlapi_authServerPacket_t
struct
brlapi_errorPacket_t
struct
brlapi_getDriverSpecificModePacket_t
struct
brlapi_writeArgumentsPacket_t
struct
brlapi_paramValuePacket_t
struct
brlapi_paramRequestPacket_t
union
brlapi_packet_t
Macros
#define
BRLAPI_PROTOCOL_VERSION
((uint32_t) 8) /**
Communication protocol version */
#define
BRLAPI_MAXPACKETSIZE
4096
#define
BRLAPI_PACKET_VERSION
βvβ
#define
BRLAPI_PACKET_AUTH
βaβ
#define
BRLAPI_PACKET_GETDRIVERNAME
βnβ
#define
BRLAPI_PACKET_GETMODELID
βdβ
#define
BRLAPI_PACKET_GETDISPLAYSIZE
βsβ
#define
BRLAPI_PACKET_ENTERTTYMODE
βtβ
#define
BRLAPI_PACKET_SETFOCUS
βFβ
#define
BRLAPI_PACKET_LEAVETTYMODE
βLβ
#define
BRLAPI_PACKET_KEY
βkβ
#define
BRLAPI_PACKET_IGNOREKEYRANGES
βmβ
#define
BRLAPI_PACKET_ACCEPTKEYRANGES
βuβ
#define
BRLAPI_PACKET_WRITE
βwβ
#define
BRLAPI_PACKET_ENTERRAWMODE
β*β
#define
BRLAPI_PACKET_LEAVERAWMODE
β#β
#define
BRLAPI_PACKET_PACKET
βpβ
#define
BRLAPI_PACKET_ACK
βAβ
#define
BRLAPI_PACKET_ERROR
βeβ
#define
BRLAPI_PACKET_EXCEPTION
βEβ
#define
BRLAPI_PACKET_SUSPENDDRIVER
βSβ
#define
BRLAPI_PACKET_RESUMEDRIVER
βRβ
#define
BRLAPI_PACKET_SYNCHRONIZE
βZβ
#define
BRLAPI_PACKET_PARAM_VALUE
((βPβ<<8) + βVβ)
#define
BRLAPI_PACKET_PARAM_REQUEST
((βPβ<<8) + βRβ)
#define
BRLAPI_PACKET_PARAM_UPDATE
((βPβ<<8) + βUβ)
#define
BRLAPI_DEVICE_MAGIC
(0xdeadbeefL)
#define
BRLAPI_HEADERSIZE
sizeof(
brlapi_header_t
)
#define
BRLAPI_AUTH_NONE
βNβ
#define
BRLAPI_AUTH_KEY
βKβ
#define
BRLAPI_AUTH_CRED
βCβ
#define
BRLAPI_WF_DISPLAYNUMBER
0X01
#define
BRLAPI_WF_REGION
0X02
#define
BRLAPI_WF_TEXT
0X04
#define
BRLAPI_WF_ATTR_AND
0X08
#define
BRLAPI_WF_ATTR_OR
0X10
#define
BRLAPI_WF_CURSOR
0X20
#define
BRLAPI_WF_CHARSET
0X40
#define
BRLAPI_PVF_GLOBAL
0X01 /** Value is the
global value */
#define
BRLAPI_MAXPARAMSIZE
(
BRLAPI_MAXPACKETSIZE
- (sizeof(uint32_t) +
sizeof(
brlapi_param_t
) + 2*sizeof(uint32_t)))
#define
BRLAPI_PARAMF_GET
0X100 /** Get current
parameter value */
#define
BRLAPI_PARAMF_SUBSCRIBE
0X200 /** Subscribe
to parameter updates */
#define
BRLAPI_PARAMF_UNSUBSCRIBE
0X400 /**
Unsubscribe from parameter updates */
Functions
ssize_t
brlapi_writePacket
(
brlapi_fileDescriptor
fd,
brlapi_packetType_t
type, const void *buf, size_t
size)
ssize_t
brlapi_readPacketHeader
(
brlapi_fileDescriptor
fd,
brlapi_packetType_t
*packetType)
ssize_t
brlapi_readPacketContent
(
brlapi_fileDescriptor
fd, size_t packetSize, void
*buf, size_t bufSize)
ssize_t
brlapi_readPacket
(
brlapi_fileDescriptor
fd,
brlapi_packetType_t
*type, void *buf, size_t size)
Variables
pthread_mutex_t brlapi_fd_mutex
Detailed Description
These are defines for the protocol between BrlAPI βs server and clients. Understanding is not needed to use the BrlAPI library, so reading this is not needed unless really wanting to connect to BrlAPI without BrlAPI βs library.
Macro Definition Documentation
#define BRLAPI_AUTH_CRED βCβ
Explicit socket credentials authorization
#define BRLAPI_AUTH_KEY βKβ
Key authorization
#define BRLAPI_AUTH_NONE βNβ
No or implicit authorization
#define BRLAPI_DEVICE_MAGIC (0xdeadbeefL)
Magic number to give when sending a BRLPACKET_ENTERRAWMODE or BRLPACKET_SUSPEND packet
#define BRLAPI_HEADERSIZE sizeof(brlapi_header_t)
Size of packet headers
#define BRLAPI_MAXPACKETSIZE 4096
Maximum packet size for packets exchanged on sockets and with braille terminal
#define BRLAPI_MAXPARAMSIZE (BRLAPI_MAXPACKETSIZE - (sizeof(uint32_t) +sizeof(brlapi_param_t) + 2*sizeof(uint32_t)))
#define BRLAPI_PACKET_ACCEPTKEYRANGES βuβ
Unmask key ranges
#define BRLAPI_PACKET_ACK βAβ
Acknowledgement
#define BRLAPI_PACKET_AUTH βaβ
Authorization
#define BRLAPI_PACKET_ENTERRAWMODE β*β
Enter in raw mode
#define BRLAPI_PACKET_ENTERTTYMODE βtβ
Asks for a specified tty
#define BRLAPI_PACKET_ERROR βeβ
non-fatal error
#define BRLAPI_PACKET_EXCEPTION βEβ
Exception
#define BRLAPI_PACKET_GETDISPLAYSIZE βsβ
Dimensions of brl display
#define BRLAPI_PACKET_GETDRIVERNAME βnβ
Ask which driver is used
#define BRLAPI_PACKET_GETMODELID βdβ
Ask which model is used
#define BRLAPI_PACKET_IGNOREKEYRANGES βmβ
Mask key ranges
#define BRLAPI_PACKET_KEY βkβ
Braille key
#define BRLAPI_PACKET_LEAVERAWMODE β#β
Leave raw mode
#define BRLAPI_PACKET_LEAVETTYMODE βLβ
Release the tty
#define BRLAPI_PACKET_PACKET βpβ
Raw packets
#define BRLAPI_PACKET_PARAM_REQUEST ((βPβ<<8) + βRβ)
Parameter request
#define BRLAPI_PACKET_PARAM_UPDATE ((βPβ<<8) + βUβ)
Parameter update
#define BRLAPI_PACKET_PARAM_VALUE ((βPβ<<8) + βVβ)
Parameter value
#define BRLAPI_PACKET_RESUMEDRIVER βRβ
Resume driver
#define BRLAPI_PACKET_SETFOCUS βFβ
Set current tty focus
#define BRLAPI_PACKET_SUSPENDDRIVER βSβ
Suspend driver
#define BRLAPI_PACKET_SYNCHRONIZE βZβ
Synchronize exceptions
#define BRLAPI_PACKET_VERSION βvβ
Version
#define BRLAPI_PACKET_WRITE βwβ
Write
#define BRLAPI_PARAMF_GET 0X100 /** Get current parameter value */
Flags for parameter requests
#define BRLAPI_PARAMF_SUBSCRIBE 0X200 /** Subscribe to parameterupdates */
#define BRLAPI_PARAMF_UNSUBSCRIBE 0X400 /** Unsubscribe from parameterupdates */
#define BRLAPI_PROTOCOL_VERSION ((uint32_t) 8) /** Communication protocolversion */
#define BRLAPI_PVF_GLOBAL 0X01 /** Value is the global value */
Flags for parameter values
#define BRLAPI_WF_ATTR_AND 0X08
And attributes
#define BRLAPI_WF_ATTR_OR 0X10
Or attributes
#define BRLAPI_WF_CHARSET 0X40
Charset
#define BRLAPI_WF_CURSOR 0X20
Cursor position
#define BRLAPI_WF_DISPLAYNUMBER 0X01
Flags for writing Display number
#define BRLAPI_WF_REGION 0X02
Region parameter
#define BRLAPI_WF_TEXT 0X04
Contains some text
Function Documentation
ssize_t brlapi_readPacket (brlapi_fileDescriptor fd, brlapi_packetType_t *type, void * buf, size_t size)
Read a packet from BrlAPI server
This function is for internal use, but one might use it if one really knows what one is doing...
type is where the function will store the packet type; it should always be one of the above defined BRLPACKET_* (or else something very nasty must have happened :/).
The syntax is the same as read()βs.
Returns
packetβs size, -2 if EOF occurred, -1 on error or signal interruption.
If the packet is larger than the supplied buffer, the buffer will be filled with the beginning of the packet, the rest of the packet being discarded. This follows the semantics of the recv system call when the MSG_TRUNC option is given.
See also
brlapi_writePacket()
ssize_t brlapi_readPacketContent (brlapi_fileDescriptor fd, size_tpacketSize, void * buf, size_t bufSize)
Read the content of a packet from BrlAPI server
This function is for internal use, but one might use it if one really knows what one is doing...
packetSize is the size announced by brlapi_readPacketHeader()
bufSize is the size of buf
Returns
packetSize, -2 if EOF occurred, -1 on error.
If the packet is larger than the supplied buffer, the buffer will be filled with the beginning of the packet, the rest of the packet being discarded. This follows the semantics of the recv system call when the MSG_TRUNC option is given.
See also
brlapi_writePacket() brlapi_readPacketHeader() brlapi_readPacket()
ssize_t brlapi_readPacketHeader (brlapi_fileDescriptor fd,brlapi_packetType_t * packetType)
Read the header (type+size) of a packet from BrlAPI server
This function is for internal use, but one might use it if one really knows what one is doing...
type is where the function will store the packet type; it should always be one of the above defined BRLPACKET_* (or else something very nasty must have happened :/).
Returns
packetβs size, -2 if EOF occurred, -1 on error or signal interruption.
See also
brlapi_writePacket() brlapi_readPacketContent brlapi_readPacket
ssize_t brlapi_writePacket (brlapi_fileDescriptor fd, brlapi_packetType_ttype, const void * buf, size_t size)
Send a packet to BrlAPI server
This function is for internal use, but one might use it if one really knows what one is doing...
type should only be one of the above defined BRLPACKET_*.
The syntax is the same as write()βs.
Returns
0 on success, -1 on failure.
See also
brlapi_readPacketHeader() brlapi_readPacketContent() brlapi_readPacket()
Variable Documentation
pthread_mutex_t brlapi_fd_mutex [extern]
Mutex for protecting concurrent fd access
In order to regulate concurrent access to the libraryβs file descriptor and requests to / answers from BrlAPI server, every function of the library locks this mutex, namely
|
β’ |
brlapi_openConnection() |
|||
|
β’ |
brlapi_closeConnection() |
|||
|
β’ |
brlapi_enterRawMode() |
|||
|
β’ |
brlapi_leaveRawMode() |
|||
|
β’ |
brlapi_sendRaw() |
|||
|
β’ |
brlapi_recvRaw() |
|||
|
β’ |
brlapi_getDriverName() |
|||
|
β’ |
brlapi_getDisplaySize() |
|||
|
β’ |
brlapi_enterTtyMode() |
|||
|
β’ |
brlapi_enterTtyModeWithPath() |
|||
|
β’ |
brlapi_leaveTtyMode() |
|||
|
β’ |
brlapi_*write*() |
|||
|
β’ |
brlapi_(un)?ignorekey(Range|Set)() |
|||
|
β’ |
brlapi_readKey() |
If both these functions and brlapi_writePacket() or brlapi_readPacket() are used in a multithreaded application, this mutex must be locked before calling brlapi_writePacket() or brlapi_readPacket() , and unlocked afterwards.
Author
Generated automatically by Doxygen for BrlAPI from the source code.