home *** CD-ROM | disk | FTP | other *** search
- #define CFILES
- #include "recomsrv.h"
-
- static int rx = 512;
- static int tx = 512;
-
-
- BOOL FAR __cdecl SRV_DEBUG( UINT DebugNr, char huge *szFormat, ...);
-
- setque()
- {
- rx = comData.a.qdb.cbqRx;
- tx = comData.a.qdb.cbqTx;
-
- comData.rc = 0L;
- }
- inicom()
- {
- char tmp[30];
-
- REMOTE_COM = comData.a.dcb.Id;
-
- GetPrivateProfileString("PORT", "COM", "COM2", tmp, sizeof(tmp), APPINI);
-
- // setque kommt immer for inicom !!!
-
- com = OpenComm(tmp, rx, tx);
- // lpevent = (int far *)SetCommEventMask(com, EV_ERR);
- lpevent = &event[0];
- evcnt = 0;
-
- if(com >= 0)
- { comData.rc = 0;
- }else
- { comData.rc = com;
- }
-
- }
- setcom()
- {
- comData.a.dcb.Id = com;
- comData.rc = SetCommState(&comData.a.dcb);
- }
- reccom()
- {
- comData.rc = comData.len = ReadComm(com, &comData.a.x, 1);
- }
- sndcom()
- {
- comData.rc = WriteComm(com, &comData.a.x, 1);
- }
- ctx()
- {
- comData.rc = TransmitCommChar(com, (char)comData.a.x);
- }
- trmcom()
- {
- comData.rc = CloseComm(com);
- }
- stacom()
- {
- comData.rc = GetCommError(com, &comData.a.cs);
- // SRV_DEBUG(1, "stacomm: inQ=%d, outQ=%d", comData.a.cs.cbInQue, comData.a.cs.cbOutQue);
- }
- cflush()
- {
- comData.rc = FlushComm(com, comData.a.x);
- }
- cevt()
- {
- lpevent = (int far *)SetCommEventMask(com, comData.a.x);
- comData.rc = *lpevent;
- }
- cextfcn()
- {
- comData.rc = EscapeCommFunction(com, comData.a.x);
- }
- cevtget()
- {
- comData.rc = GetCommEventMask(com, comData.a.x);
- }
- csetbrk()
- {
- comData.rc = SetCommBreak(com);
- }
- cclrbrk()
- {
- comData.rc = ClearCommBreak(com);
- }
- getdcb()
- {
- comData.rc = GetCommState(com, &comData.a.dcb);
- comData.a.dcb.Id = REMOTE_COM;
- }
- cwstring()
- {
- // SRV_DEBUG(1, "cwstring: len=%d", comData.len);
- comData.rc = WriteComm(com, comData.a.txt, comData.len);
- }
- crstring()
- {
- comData.rc = comData.len = ReadComm(com, comData.a.txt, comData.len);
- // SRV_DEBUG(1, "crstring: len=%d", comData.len);
- }
- enablenoti()
- {
- lpevent = &event[0];
- evcnt = 0;
- EnableCommNotification(REMOTE_COM, HwnD, comData.a.noti.inTrig, comData.a.noti.outTrig);
- comData.rc = TRUE;
- }
-
-
-
-
-
-
-
-
-