Changes between Version 2 and Version 3 of Docs/Prog/Manual/ApplicationLibraries/lib825ev/ccomm
- Timestamp:
- 04/09/18 09:08:29 (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Docs/Prog/Manual/ApplicationLibraries/lib825ev/ccomm
v2 v3 13 13 #define SERIAL 1 14 14 #define CLIENT 2 15 #define SERVER 3 15 16 16 17 int commTypeSelection = CLIENT; … … 30 31 CCommClient *pClient = new CCommClient(svrIP, svrPort); 31 32 pComm = pClient; 33 } 34 else if(commTypeSelection == SERVER) 35 { 36 int svrPort = 8001; 37 CCommServer *pServer = new CCommServer(svrPort); 38 pComm = pServer; 32 39 } 33 40 … … 57 64 printf("rcvd [%s]\r\n", buf); 58 65 66 if(buf[1] == 'T') // Received <STX>T<ETX> return timeval 67 { 68 time_t tmval; 69 time(&tmval); // Get timeval 70 71 char response[12]; 72 sprintf(response, "%d\n", tmval); 73 pComm->Send(pConnection, response, strlen(response); 74 } 75 76 59 77 return 0; 60 78 }