SDC C-Project CF Review 프로그램
LYW
2021-08-17 572aebd50409d2f11183d6ebbb9d12fe9041e7a5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
//----------------------------------------------------------------------------
//  Project PMAC ETHERNET 
//  Delta Tau Data Systems, Inc.
//  Copyright ?2001. All Rights Reserved.
//
//  SUBSYSTEM:    Ethernet I/O Interface Example
//  FILE:         PMACSOCK.CPP
//  AUTHOR:       Delta Tau Data Systems, Inc.
//
//  OVERVIEW
//  ~~~~~~~~
//  Communication routine to talk to PMAC on ethernet
//
//----------------------------------------------------------------------------
#ifndef _PMAC_SOCK
#define _PMAC_SOCK
 
#include "winsock2.h"
 
 
#define MAX_PMAC_LINE        255
#define FLUSH_TIMEOUT         10 
#define PMACPORT            1025             // Port used for our TCP comm
 
 
   // Open a socket for 
HANDLE CALLBACK PmacSockOpen(DWORD dwDevice,DWORD IPAddress) ;
int CALLBACK PmacSockClose(DWORD dwDevice);
int CALLBACK PmacSockIPAddress( DWORD dwDevice,BOOL bSetIP ,BYTE *ip);
SOCKET CALLBACK ConvertInitialProcSocket(SOCKET initialSocket,DWORD initialPID);
 
   // Ascii comm routines
int  CALLBACK PmacSockFlush(DWORD dwDevice);
int  CALLBACK PmacSockSendLine(DWORD dwDevice, LPCSTR outstr );
int  CALLBACK PmacSockSendLineW(DWORD dwDevice,  PWCHAR outstr );
void CALLBACK PmacSockSendCommand( DWORD dwDevice, PCHAR outstr );
void CALLBACK PmacSockSendCommandW( DWORD dwDevice, PWCHAR outstr );
int  CALLBACK PmacSockGetLine( DWORD dwDevice, LPCSTR outstr, int maxChar, UINT *inChars );
int  CALLBACK PmacSockGetLineW(DWORD dwDevice,PWCHAR s, int maxchar, UINT *nc );
int  CALLBACK PmacSockGetBuffer( DWORD dwDevice, LPCSTR outstr, int size, UINT *nc );
int  CALLBACK PmacSockGetBufferW( DWORD dwDevice, PWCHAR outstr, int size, UINT *nc );
BOOL CALLBACK PmacSockSendCharA(  DWORD dwDevice, CHAR outch );
BOOL CALLBACK PmacSockSendCharW(DWORD dwDevice,  WCHAR outch );
int  CALLBACK PmacSockGetResponse( DWORD dwDevice, PCHAR s, UINT maxchar, PCHAR outstr );
int  CALLBACK PmacSockGetResponseW( DWORD dwDevice, PWCHAR s, UINT maxchar, PWCHAR outstr );
int  CALLBACK PmacSockGetLineError(DWORD dwDevice);
 
int  CALLBACK PmacSockGetLastError(DWORD dwDevice);
int  CALLBACK PmacSockOutport(DWORD dwDevice, BYTE offset, BYTE outch);
int  CALLBACK PmacSockInport(DWORD dwDevice, BYTE offset,BYTE *data);
BYTE CALLBACK PmacSockReadReady(DWORD dwDevice);
int  CALLBACK PmacSockGetControlResponse(DWORD dwDevice, CHAR *outstr, WORD len ,BYTE outchar );
int  CALLBACK PmacSockGetControlResponseW( DWORD dwDevice, PWCHAR s, UINT maxchar,WCHAR outchar );
int  CALLBACK PmacSockWriteBuffer(DWORD dwDevice, CHAR *data, WORD len );
int  CALLBACK PmacSockWriteBufferError( DWORD dwDevice, WORD *erroroffset, WORD *errorcode );
int  CALLBACK PmacSockWriteFWBuffer(DWORD dwDevice,BOOL bRestart, CHAR *data, DWORD len );
 
 
   // DPRAM routines
int CALLBACK PmacSockGetMem( DWORD dwDevice, BYTE *data, WORD offset,WORD length);
int CALLBACK PmacSockSetMem( DWORD dwDevice, BYTE *data, WORD offset,WORD length);
int CALLBACK PmacSockSetMemBit(DWORD dwDevice,DWORD offset,UINT bitno,BOOL on);
int CALLBACK PmacSockSetMemBits(DWORD dwDevice,DWORD offset,UINT startbit,UINT width,DWORD val);
BOOL CALLBACK PmacSockGetMemBit(DWORD dwDevice,DWORD offset,UINT bit,PBOOL val);
BOOL CALLBACK PmacSockGetMemBits(DWORD dwDevice,DWORD offset,UINT startbit,UINT width,PDWORD val);
 
 
  // DPRAM rotary buffer routines
int CALLBACK PmacSockRotBufInit(DWORD dwDevice, BYTE coord);
int CALLBACK PmacSockRotBufPut(DWORD dwDevice, BYTE coord,BYTE *data,
                               WORD len,WORD *erroroffset,WORD *errcode);
 
  
 
char * UnsolicitedPresent(char * data);
 
#endif