Main Page   Modules   Data Structures   File List   Data Fields   Globals  

api_protocol.h

Go to the documentation of this file.
00001 /*
00002  * BRLTTY - A background process providing access to the Linux console (when in
00003  *          text mode) for a blind person using a refreshable braille display.
00004  *
00005  * Copyright (C) 1995-2004 by The BRLTTY Team. All rights reserved.
00006  *
00007  * BRLTTY comes with ABSOLUTELY NO WARRANTY.
00008  *
00009  * This is free software, placed under the terms of the
00010  * GNU General Public License, as published by the Free Software
00011  * Foundation.  Please see the file COPYING for details.
00012  *
00013  * Web Page: http://mielke.cc/brltty/
00014  *
00015  * This software is maintained by Dave Mielke <dave@mielke.cc>.
00016  */
00017 
00022 #ifndef _BRLAPI_PROTOCOL_H
00023 #define _BRLAPI_PROTOCOL_H
00024 
00025 #ifdef __cplusplus
00026 extern "C" {
00027 #endif /* __cplusplus */
00028 
00029 /* this is for UINT32_MAX */
00030 #include <inttypes.h>
00031 #ifndef UINT32_MAX
00032 #define UINT32_MAX (4294967295U)
00033 #endif /* UINT32_MAX */
00034 
00035 /* The type size_t is defined there! */
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 /* brlapi_writePacket */
00097 ssize_t brlapi_writePacket(int fd, brl_type_t type, const void *buf, size_t size);
00098 
00099 /* brlapi_readPacket */
00115 ssize_t brlapi_readPacket(int fd, brl_type_t *type, void *buf, size_t size);
00116 
00117 #ifdef __cplusplus
00118 }
00119 #endif /* __cplusplus */
00120 
00121 #endif /* _BRLAPI_PROTOCOL_H */

Generated on Tue Jul 13 07:08:02 2004 for BrlAPI by doxygen1.2.18