
Software KeTop
T50VGA
84
User's Manual, Version: 1.3
© KEBA 2007
eKVCGetLed,
eKVCGetContrast,
eKVCGetBrightness,
eKVCGetVolume,
eKVCGetScreensaverTime,
eKVCGetJostickValue,
eKVCGetSpaceMouseValue,
eKVCGetOverrideValue,
eKVCGetWheelValue,
eKVCSwtichBacklight,
eKVCGetBacklightState,
eKVCPlaySound,
eKVCWriteFlash
eKVCDisconnect
} TKVCCommand;
typedef struct {
TKVCCommand
command;
SINT16
param;
} TKVCServerData;
7.9.3
Example: Interface on Server
On the server side, the KVC protocol is represented by two classes:
CKVCServer
and
CKVCConnection
. An object of the
CKVCServer
class
represents the actual server (the "listener") and an object of the
CKVCConnection
class represents a connection to a client.
"Server class"
class CKVCServer {
public:
virtual int
Init
();
virtual int
Exit
();
virtual CKVCConnection*
OnClientConnect
(SOCKET socket,
sockaddr_in
&sockAdr);
virtual int
OnClientDisconnect
(CKVCConnection *pConnection,
TDisconInfo info);
POSITION
ConnectionListHeadPos
();
CKVCConnection*
ConnectionListGetNext
(POSITION pos);
int
ConnectionListGetCount
();
};
int
Init
();
Initalizes the server and opens the port 0xCEBA for
incoming connections.
int
Exit
();
Finishes all connections and closes the port 0xCEBA.