00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00022 #ifndef _BRLAPI_PROTOCOL_H
00023 #define _BRLAPI_PROTOCOL_H
00024
00025 #ifdef __cplusplus
00026 extern "C" {
00027 #endif
00028
00029
00030 #include <inttypes.h>
00031 #ifndef UINT32_MAX
00032 #define UINT32_MAX (4294967295U)
00033 #endif
00034
00035
00036 #include <unistd.h>
00037
00049 typedef uint32_t brl_type_t;
00050
00051 #define BRLAPI_PROTOCOL_VERSION ((uint32_t) 3)
00053 #define BRLPACKET_AUTHKEY 'K'
00054 #define BRLPACKET_BYE 'B'
00055 #define BRLPACKET_GETDRIVERID 'd'
00056 #define BRLPACKET_GETDRIVERNAME 'n'
00057 #define BRLPACKET_GETDISPLAYSIZE 's'
00058 #define BRLPACKET_GETTTY 't'
00059 #define BRLPACKET_LEAVETTY 'L'
00060 #define BRLPACKET_KEY 'k'
00061 #define BRLPACKET_COMMAND 'c'
00062 #define BRLPACKET_IGNOREKEYRANGE 'm'
00063 #define BRLPACKET_IGNOREKEYSET 'M'
00064 #define BRLPACKET_UNIGNOREKEYRANGE 'u'
00065 #define BRLPACKET_UNIGNOREKEYSET 'U'
00066 #define BRLPACKET_WRITEDOTS 'D'
00067 #define BRLPACKET_STATWRITE 'S'
00068 #define BRLPACKET_EXTWRITE 'e'
00069 #define BRLPACKET_GETRAW '*'
00070 #define BRLPACKET_LEAVERAW '#'
00071 #define BRLPACKET_PACKET 'p'
00072 #define BRLPACKET_ACK 'A'
00073 #define BRLPACKET_ERROR 'E'
00076 #define BRLRAW_MAGIC (0xdeadbeefL)
00077
00078 typedef struct {
00079 uint32_t protocolVersion;
00080 unsigned char key;
00081 } authStruct;
00082
00083
00097 ssize_t brlapi_writePacket(int fd, brl_type_t type, const void *buf, size_t size);
00098
00099
00115 ssize_t brlapi_readPacket(int fd, brl_type_t *type, void *buf, size_t size);
00116
00117 #ifdef __cplusplus
00118 }
00119 #endif
00120
00121 #endif