Changes between Initial Version and Version 1 of Docs/Prog/Manual/ApplicationLibraries/lib825ev/ccomm


Ignore:
Timestamp:
04/09/18 08:53:23 (7 years ago)
Author:
Don Wilson
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Docs/Prog/Manual/ApplicationLibraries/lib825ev/ccomm

    v1 v1  
     1[[TOC]]
     2
     3= CComm =
     4
     5CComm is a C++ class that is provided to simplify 825 serial and ethernet operations. CComm is a base class for the inherited classes CCommSerial (serial ports), CCommClient (TCP/IP client), and CCommServer (TCP/IP Server).
     6
     7==== Examples ====
     8
     9
     10== Member Functions ==
     11
     12=== Open ===
     13Opens a specified file, or using the filename already stored in the object.
     14
     15
     16==== Remarks ====
     17
     18==== Example ====
     19
     20{{{
     21CComm *pComm;
     22// pComm is a pointer that can point to a CCommSerial, CCommClient, or CCommServer instance
     23
     24if(commTypeSelection == SERIAL)
     25{
     26    int comport = 2;
     27    CCommSerial *pSerial = new CCommSerial(commPort);
     28    pComm = pSerial;
     29}
     30else if(commTypeSelection == CLIENT)
     31{
     32    string svrIP = "192.168.1.25";
     33    int svrPort = 8001;
     34    CCommClient *pClient = new CCommClient(svrIP, svrPort);
     35    pComm = pClient;
     36}
     37
     38pComm->Open();
     39
     40// Now the app can call pComm->Send to send data without regard for whether it is serial or TCP/IP.
     41
     42}}}
     43