Ignore:
Timestamp:
01/24/17 13:31:31 (8 years ago)
Author:
(none)
Message:
add 1ms asnyc wait between read
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/FACT++_lidctrl_usb/src/lidctrl.cc

    r18729 r18736  
    3838    DimDescribedService fDim;
    3939    message_t fLastMessage;
     40    boost::asio::deadline_timer fReadTimer;
    4041
    4142    void PrintMessage(const message_t msg)
     
    126127            }
    127128        }
     129        ConnectionEstablished();
     130    }
     131
     132    void DoAsyncRead(const bs::error_code &error){
    128133        AsyncRead(ba::buffer(fRecievedBytes, 2 * sizeof(complete_message_t)), 0, 0);
    129134    }
     
    131136    void ConnectionEstablished()
    132137    {
    133         AsyncRead(ba::buffer(fRecievedBytes, 2 * sizeof(complete_message_t)), 0, 0);
     138        fReadTimer.expires_from_now(boost::posix_time::milliseconds(1));
     139        fReadTimer.async_wait(boost::bind(&ConnectionLid::DoAsyncRead, this, dummy::error));
    134140    }
    135141
     
    147153            "|inner_speed[LSB]: "
    148154            "|outer_speed[LSB]: "),
    149         fLastMessage()
     155        fLastMessage(),
     156        fReadTimer(ioservice)
    150157    {
    151158        SetLogStream(&imp);
Note: See TracChangeset for help on using the changeset viewer.