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.
#define BRLAPI_WF_DISPLAYNUMBER 0X01Flags for writing Display number
#define BRLAPI_WF_REGION 0X02Region parameter
#define BRLAPI_WF_TEXT 0X04Contains some text
Function Documentation
ssize_t brlapi_readPacket (brlapi_fileDescriptorfd, brlapi_packetType_t *type, void *buf, size_tsize)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_fileDescriptorfd, size_tpacketSize, void *buf, size_tbufSize)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.
ssize_t brlapi_readPacketHeader (brlapi_fileDescriptorfd, 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.
pthread_mutex_t brlapi_fd_mutexMutex 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_getDriverId()
•
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.