Changeset 18909 for trunk/FACT++/src


Ignore:
Timestamp:
09/18/17 16:43:32 (7 years ago)
Author:
tbretz
Message:
Moved setting connection parameters from a global variable (without setter) to the connection call.
Location:
trunk/FACT++/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/ConnectionUSB.cc

    r18615 r18909  
    270270}
    271271
    272 void ConnectionUSB::Connect()
     272void ConnectionUSB::Connect(int _baud_rate, int _character_size,
     273                            parity::type _parity, stop_bits::type _stop_bits,
     274                            flow_control::type _flow_control)
    273275{
    274276    fConnectionStatus = kConnecting;
     
    292294    try
    293295    {
     296        set_option(baud_rate(_baud_rate));
     297        set_option(character_size(_character_size));
     298        set_option(parity(_parity));
     299        set_option(stop_bits(_stop_bits));
     300        set_option(flow_control(_flow_control));
     301/*
    294302        Info("Setting Baud Rate");
    295303        set_option(fBaudRate);
     
    302310        Info("Setting Flow control");
    303311        set_option(fFlowControl);
     312        */
    304313    }
    305314    catch (const bs::system_error &erc)
     
    327336ConnectionUSB::ConnectionUSB(ba::io_service& ioservice, ostream &out) :
    328337MessageImp(out), ba::serial_port(ioservice), fLog(0),
    329 fBaudRate(115200),
     338/*
     339 fBaudRate(115200),
    330340fCharacterSize(8), fParity(parity::none), fStopBits(stop_bits::one),
    331341fFlowControl(flow_control::none),
     342*/
    332343fInTimeout(ioservice), fOutTimeout(ioservice), fConnectTimeout(ioservice),
    333344fQueueSize(0), fConnectionStatus(kDisconnected)
  • trunk/FACT++/src/ConnectionUSB.h

    r16768 r18909  
    1818
    1919    std::string fAddress;
    20 
    21     boost::asio::serial_port_base::baud_rate      fBaudRate;      // unisgned int
    22     boost::asio::serial_port_base::character_size fCharacterSize; // unisgned int
    23     boost::asio::serial_port_base::parity         fParity;        // unisgned int
    24     boost::asio::serial_port_base::stop_bits      fStopBits;      // unisgned int
    25     boost::asio::serial_port_base::flow_control   fFlowControl;   // unisgned int
    2620
    2721    enum ConnectionStatus_t
     
    7670    void SetEndpoint(const std::string &addr);
    7771
    78     void Connect();
     72    void Connect(int baud_rate=115200,
     73                 int character_size=8,
     74                 boost::asio::serial_port_base::parity::type parity=boost::asio::serial_port_base::parity::none,
     75                 boost::asio::serial_port_base::stop_bits::type stop_bits=boost::asio::serial_port_base::stop_bits::one,
     76                 boost::asio::serial_port_base::flow_control::type flow_control=boost::asio::serial_port_base::flow_control::hardware);
     77
     78    void ConfigureConnection();
    7979
    8080    // ------------------------ close --------------------------
Note: See TracChangeset for help on using the changeset viewer.