Go to the source code of this file.
Enumerations | |
enum | eDmCmdPriority { dmCmdPriorLow = 0, dmCmdPriorNormal, dmCmdPriorHigh, dmCmdPriorUrgent } |
enum | eDmQuality { dmQFull = 0, dmQBW, dmQTyping, dmQUndefined } |
enum | eDmCommandCode { dmCcDisplay = 0, dmCcDisplayPartial, dmCcDump, dmCcEraseToWhite, dmCcUndefined } |
Functions | |
int | dmDisplay (eDmCmdPriority prior, eDmQuality qual) |
int | dmDisplayEraseToWhite (eDmCmdPriority prior) |
int | dmMessageInit (char *szDestination) |
int | dmDisplayPartial (eDmCmdPriority prior, eDmQuality qual, int xUp, int yUp, int xDown, int yDown) |
int | dmDump (eDmCmdPriority prior) |
enum eDmCmdPriority |
Copyright (C) 2005-2008 iRex Technologies B.V. All rights reserved.
Definition at line 37 of file erdm.h.
00038 { 00039 dmCmdPriorLow = 0, // wait 1500 ms 00040 dmCmdPriorNormal, // wait 500 ms 00041 dmCmdPriorHigh, // wait 100 ms 00042 dmCmdPriorUrgent // no wait, immediate display update 00043 } eDmCmdPriority;
enum eDmCommandCode |
Definition at line 60 of file erdm.h.
00061 { 00062 dmCcDisplay = 0, // do a full display update 00063 dmCcDisplayPartial, // not implemented 00064 dmCcDump, // not implemented 00065 dmCcEraseToWhite, // blank display 00066 dmCcUndefined 00067 } eDmCommandCode;
enum eDmQuality |
Definition at line 48 of file erdm.h.
00049 { 00050 dmQFull = 0, // fullscreen waveform - makes display flicker once, sixteen gray levels 00051 dmQBW, // black-and-white waveform - fastest one but horrible for grey pixels 00052 dmQTyping, // typing waveform - looks nice, no display flicker, only four gray levels (0, 5, 10, 15) 00053 dmQUndefined 00054 } eDmQuality;
int dmDisplay | ( | eDmCmdPriority | prior, | |
eDmQuality | qual | |||
) |
Definition at line 107 of file erdm.c.
00108 { 00109 char szMsg[DM_MAXCHARONLINE]; 00110 uDmCommand dmCmd; 00111 00112 dmCmd.dmCmdDisplay.cmd = dmCcDisplay; 00113 dmCmd.dmCmdDisplay.priority = prior; 00114 dmCmd.dmCmdDisplay.qual = qual; 00115 00116 dmMessageFramer(szMsg, &dmCmd); 00117 00118 if (!fInit) 00119 { 00120 dmMessageInit("127.0.0.1"); 00121 } 00122 00123 sendto(sockfd, szMsg, strlen(szMsg), 0, (struct sockaddr *) &serverAdr, sizeof(serverAdr)); 00124 return 0; 00125 }
int dmDisplayEraseToWhite | ( | eDmCmdPriority | prior | ) |
Definition at line 151 of file erdm.c.
00152 { 00153 char szMsg[DM_MAXCHARONLINE]; 00154 uDmCommand dmCmd; 00155 00156 dmCmd.dmCmdDisplay.cmd = dmCcEraseToWhite; 00157 dmCmd.dmCmdDisplay.priority = prior; 00158 00159 dmMessageFramer(szMsg, &dmCmd); 00160 00161 if (!fInit) 00162 { 00163 dmMessageInit("127.0.0.1"); 00164 } 00165 00166 sendto(sockfd, szMsg, strlen(szMsg), 0, (struct sockaddr *) &serverAdr, sizeof(serverAdr)); 00167 return 0; 00168 }
int dmDisplayPartial | ( | eDmCmdPriority | prior, | |
eDmQuality | qual, | |||
int | xUp, | |||
int | yUp, | |||
int | xDown, | |||
int | yDown | |||
) |
Definition at line 127 of file erdm.c.
00128 { 00129 char szMsg[DM_MAXCHARONLINE]; 00130 uDmCommand dmCmd; 00131 00132 dmCmd.dmCmdDisplayPartial.cmd = dmCcDisplayPartial; 00133 dmCmd.dmCmdDisplayPartial.priority = prior; 00134 dmCmd.dmCmdDisplayPartial.qual = qual; 00135 dmCmd.dmCmdDisplayPartial.xUp = xUp; 00136 dmCmd.dmCmdDisplayPartial.yUp = yUp; 00137 dmCmd.dmCmdDisplayPartial.xDown = xDown; 00138 dmCmd.dmCmdDisplayPartial.yDown = yDown; 00139 00140 dmMessageFramer(szMsg, &dmCmd); 00141 00142 if (!fInit) 00143 { 00144 dmMessageInit("127.0.0.1"); 00145 } 00146 00147 sendto(sockfd, szMsg, strlen(szMsg), 0, (struct sockaddr *) &serverAdr, sizeof(serverAdr)); 00148 return 0; 00149 }
int dmDump | ( | eDmCmdPriority | prior | ) |
Definition at line 170 of file erdm.c.
00171 { 00172 ERDM_ERRORPRINTF("dmDump is not implemented.\n"); 00173 return -1; 00174 }
int dmMessageInit | ( | char * | szDestination | ) |
Definition at line 44 of file erdm.c.
00045 { 00046 int port; 00047 int ret; 00048 struct in_addr destinationAdr; 00049 00050 // Note: 00051 // INADDR_LOOPBACK : "127.0.0.1" 00052 // INADDR_ANY : "0.0.0.0" 00053 00054 if ((ret = inet_pton(AF_INET, szDestination, &destinationAdr)) == 1) 00055 { 00056 ERDM_LOGPRINTF("Sending messages to %s.\n", szDestination); 00057 } 00058 else if (ret == 0) 00059 { 00060 ERDM_ERRORPRINTF("%s not a presentation IP address (not in dotted decimal format).\n", szDestination); 00061 return -1; 00062 } 00063 else 00064 { 00065 ERDM_ERRORPRINTF("Failed to convert to a numeric IP address.\n"); 00066 return -2; 00067 } 00068 00069 dmGetServerPort(&port); 00070 00071 sockfd = socket(AF_INET, SOCK_DGRAM, 0); 00072 bzero(&serverAdr, sizeof(serverAdr)); 00073 serverAdr.sin_family = AF_INET; 00074 serverAdr.sin_addr.s_addr = destinationAdr.s_addr; 00075 serverAdr.sin_port = htons(port); 00076 00077 fInit = 1; 00078 return 0; 00079 }