00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00026 #ifndef _BRLAPI_PROTOCOL_H
00027 #define _BRLAPI_PROTOCOL_H
00028
00029 #ifdef __cplusplus
00030 extern "C" {
00031 #endif
00032
00033
00034 #include <inttypes.h>
00035 #ifndef UINT32_MAX
00036 #define UINT32_MAX (4294967295U)
00037 #endif
00038
00039
00040 #include <unistd.h>
00041
00052 #define BRLAPI_PROTOCOL_VERSION ((uint32_t) 6)
00054 #define BRLPACKET_AUTHKEY 'K'
00055 #define BRLPACKET_GETDRIVERID 'd'
00056 #define BRLPACKET_GETDRIVERNAME 'n'
00057 #define BRLPACKET_GETDISPLAYSIZE 's'
00058 #define BRLPACKET_GETTTY 't'
00059 #define BRLPACKET_SETFOCUS 'F'
00060 #define BRLPACKET_LEAVETTY 'L'
00061 #define BRLPACKET_KEY 'k'
00062 #define BRLPACKET_IGNOREKEYRANGE 'm'
00063 #define BRLPACKET_IGNOREKEYSET 'M'
00064 #define BRLPACKET_UNIGNOREKEYRANGE 'u'
00065 #define BRLPACKET_UNIGNOREKEYSET 'U'
00066 #define BRLPACKET_WRITE 'w'
00067 #define BRLPACKET_GETRAW '*'
00068 #define BRLPACKET_LEAVERAW '#'
00069 #define BRLPACKET_PACKET 'p'
00070 #define BRLPACKET_ACK 'A'
00071 #define BRLPACKET_ERROR 'e'
00072 #define BRLPACKET_EXCEPTION 'E'
00075 #define BRLRAW_MAGIC (0xdeadbeefL)
00076
00078 typedef struct {
00079 uint32_t protocolVersion;
00080 unsigned char key;
00081 } authStruct;
00082
00084 typedef struct {
00085 uint32_t code;
00086 brl_type_t type;
00087 unsigned char packet;
00088 } errorPacket_t;
00089
00091 #define BRLAPI_WF_DISPLAYNUMBER 0X01
00092 #define BRLAPI_WF_REGION 0X02
00093 #define BRLAPI_WF_TEXT 0X04
00094 #define BRLAPI_WF_ATTR_AND 0X08
00095 #define BRLAPI_WF_ATTR_OR 0X10
00096 #define BRLAPI_WF_CURSOR 0X20
00099 typedef struct {
00100 uint32_t flags;
00101 unsigned char data;
00102 } writeStruct;
00103
00104
00118 ssize_t brlapi_writePacket(int fd, brl_type_t type, const void *buf, size_t size);
00119
00120
00136 ssize_t brlapi_readPacket(int fd, brl_type_t *type, void *buf, size_t size);
00137
00138 #ifdef __cplusplus
00139 }
00140 #endif
00141
00142 #endif