当前位置: 首页>>代码示例>>C++>>正文


C++ setTimeout函数代码示例

本文整理汇总了C++中setTimeout函数的典型用法代码示例。如果您正苦于以下问题:C++ setTimeout函数的具体用法?C++ setTimeout怎么用?C++ setTimeout使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了setTimeout函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: setPortName

/*!
\fn Win_QextSerialPort::Win_QextSerialPort(const QString & name, const PortSettings& settings)
Constructs a port with specified name and settings.
*/
Win_QextSerialPort::Win_QextSerialPort(const QString & name, const PortSettings& settings, QextSerialBase::QueryMode mode) 
{
    m_WinHandle=INVALID_HANDLE_VALUE;
    setPortName(name);
    setBaudRate(settings.BaudRate);
    setDataBits(settings.DataBits);
    setStopBits(settings.StopBits);
    setParity(settings.Parity);
    setFlowControl(settings.FlowControl);
    setTimeout(settings.Timeout_Millisec);
    setQueryMode(mode);
    init();
}
开发者ID:dulton,项目名称:53_hero,代码行数:17,代码来源:win_qextserialport.cpp

示例2: handleRead

	/// Handle completion of a read operation.
	void handleRead( const boost::system::error_code& e, std::size_t bytesTransferred )
	{
		setTimeout( 0 );
		if ( !e )	{
			LOG_TRACE << "Read " << bytesTransferred << " bytes from " << identifier();
			m_connHandler->networkInput( m_readBuffer, bytesTransferred );
		}
		else	{
			LOG_TRACE << "Read error: " << e.message();
			signalError( e );
		}
		nextOperation();
	}
开发者ID:Wolframe,项目名称:Wolframe,代码行数:14,代码来源:connectionBase.hpp

示例3: handleShutdown

	/// Handle connection shutdown
	void handleShutdown()
	{
		setTimeout( 0 );
		if ( socket().lowest_layer().is_open() )	{
			boost::system::error_code ignored_ec;
			socket().lowest_layer().shutdown( boost::asio::ip::tcp::socket::shutdown_both, ignored_ec );
			socket().lowest_layer().close();
			LOG_DEBUG << "Connection to " << identifier() << " closed";
		}
		else	{
			LOG_DEBUG << "Connection to " << identifier() << " already closed";
		}
	}
开发者ID:Wolframe,项目名称:Wolframe,代码行数:14,代码来源:connectionBase.hpp

示例4: QextSerialBase

/*!
\fn Posix_QextSerialPort::Posix_QextSerialPort(const PortSettings& settings)
Constructs a port with default name and specified settings.
*/
Posix_QextSerialPort::Posix_QextSerialPort(const PortSettings& settings, QextSerialBase::QueryMode mode)
    : QextSerialBase()
{
    setBaudRate(settings.BaudRate);
    setDataBits(settings.DataBits);
    setParity(settings.Parity);
    setStopBits(settings.StopBits);
    setFlowControl(settings.FlowControl);

    setTimeout(settings.Timeout_Millisec);
    setQueryMode(mode);
    init();
}
开发者ID:MatthiasEgli,项目名称:qgroundcontrol,代码行数:17,代码来源:posix_qextserialport.cpp

示例5: QextSerialBase

/*!
\fn Posix_QextSerialPort::Posix_QextSerialPort(const PortSettings& settings)
Constructs a port with default name and specified settings.
*/
Posix_QextSerialPort::Posix_QextSerialPort(const PortSettings& settings)
 : QextSerialBase()
{
    setBaudRate(settings.BaudRate);
    setDataBits(settings.DataBits);
    setParity(settings.Parity);
    setStopBits(settings.StopBits);
    setFlowControl(settings.FlowControl);

    Posix_File=new QFile();
    setTimeout(settings.Timeout_Millisec);
    init();
}
开发者ID:bcabebe,项目名称:Serial-Bootloader-AN1310-v1.05,代码行数:17,代码来源:posix_qextserialport.cpp

示例6: QIODevice

/*!
   Constructs a port with default name and specified settings.
 */
QextSerialPort::QextSerialPort(const PortSettings & settings, QextSerialPort::QueryMode mode)
    : QIODevice()
{
    construct();
    setBaudRate(settings.BaudRate);
    setDataBits(settings.DataBits);
    setParity(settings.Parity);
    setStopBits(settings.StopBits);
    setFlowControl(settings.FlowControl);
    setTimeout(settings.Timeout_Millisec);
    setQueryMode(mode);
    platformSpecificInit();
}
开发者ID:MorS25,项目名称:OpenPilot,代码行数:16,代码来源:qextserialport.cpp

示例7: port

/*!
 * initPort() - initialization of com port.
 */
void TEDisplayEpson::initPort()
{
    TSerialPort *p = port();
	if ( !p ) return;
	if (!isOpen())
		open();
	p->setFlowControl(FLOW_OFF);
	setPortBaudRate(m_baudRate);
	p->setDataBits(DATA_8);
	p->setParity(PAR_NONE);
	p->setStopBits(STOP_1);
	setTimeout(100);
};
开发者ID:app,项目名称:tradeequip-drv,代码行数:16,代码来源:epson.cpp

示例8: rfid_set

void ICACHE_FLASH_ATTR rfid_set(uint8 freq, uint8 led) {
	char command[10];
	
	if (freq < 10) {
		os_sprintf(command, "mc%d0\r", freq);
		uart_write_str(command);
#if RFID_DEBUG
		debug("RFID: %s\n", command);
#endif
	}
	
	setTimeout(rfid_set_led, led, 10);
}
开发者ID:timmyhadwen,项目名称:ESP8266,代码行数:13,代码来源:mod_rfid.c

示例9: finger_start_read

LOCAL void ICACHE_FLASH_ATTR finger_start_read() {
LOCAL uint32 finger_read_timer = 0;
	if (device_get_uart() != UART_FINGER) {
#if FINGER_DEBUG
		debug("FINGER: %s\n", DEVICE_NOT_FOUND);
#endif
		return;
	}

	finger_current_buff = 0;
	clearTimeout(finger_read_timer);
	finger_read_timer = setTimeout(finger_gen_img, finger_read, FINGER_TIMEOUT);
}
开发者ID:habashynn,项目名称:ESP8266,代码行数:13,代码来源:user_mod_finger.c

示例10: PPositionOurGoalKick

    inline PPositionOurGoalKick(const BeliefState& state) 
      : Play(state)
    {
      name = "PositionOurGoalKick";

      assert(HomeTeam::SIZE == 5);
      setTimeout(100, 1);
      PositionPlay = PLAYTYPE_YES;
      AttackPlay   = PLAYTYPE_NO;
      
      Tactic::Param param;
      
	  Vector2D<int> finalPoint ;
	  /* for goalie */
	  roleList[0].push_back(std::make_pair(Tactic::GoalieOur, param));
      /*Vector2D<int> dpointg(ForwardX(-HALF_FIELD_MAXX + GOAL_DEPTH + BOT_RADIUS*1.2),state.ballPos.y);
	  param.PositionP.x  = ForwardX(-HALF_FIELD_MAXX + GOAL_DEPTH + BOT_RADIUS*1.2) ;
	  param.PositionP.y  = state.ballPos.y;
	  param.PositionP.finalSlope = 0;
	  param.PositionP.align = false ;
	  roleList[0].push_back(std::make_pair(Tactic::Position,param));
      *//* Role 1 - Defender 1*/
	  Vector2D<int> dpoint0(ForwardX(-HALF_FIELD_MAXX + GOAL_DEPTH + BOT_RADIUS*9),-1*(OUR_GOAL_MAXY + 2*BOT_RADIUS));
	  finalPoint = position_our_bot(&state,dpoint0,0);
	  param.PositionP.x = finalPoint.x ; param.PositionP.y = finalPoint.y ;
	  param.PositionP.finalSlope = 0 ;
	  roleList[1].push_back(std::make_pair(Tactic::Position,param));
      
	  // Role 2
	  Vector2D<int> dpoint(ForwardX(-HALF_FIELD_MAXX/2),HALF_FIELD_MAXY/2);
	  finalPoint = position_our_bot(&state,dpoint,0);
	  param.PositionP.x = finalPoint.x ; param.PositionP.y = finalPoint.y ;
      param.PositionP.finalSlope  = 0;
      roleList[2].push_back(std::make_pair(Tactic::Position, param));
      
	  //Role 3
	  Vector2D<int> dpoint1(ForwardX(-CENTER_CIRCLE_DIAMETER/2),HALF_FIELD_MAXY/4);
	  finalPoint = position_our_bot(&state,dpoint1,0);
	  param.PositionP.x = finalPoint.x ; param.PositionP.y = finalPoint.y ;
      param.PositionP.finalSlope  = 0;
      roleList[3].push_back(std::make_pair(Tactic::Position, param));
      
	  //Role 4
	  Vector2D<int> dpoint2(ForwardX(HALF_FIELD_MAXX/6),-HALF_FIELD_MAXY/2);
	  finalPoint = position_our_bot(&state,dpoint2,0);
	  param.PositionP.x = finalPoint.x ; param.PositionP.y = finalPoint.y ;
      param.PositionP.finalSlope  = 0;
      roleList[4].push_back(std::make_pair(Tactic::Position, param));
      
      computeMaxTacticTransits();
    }
开发者ID:KRSSG,项目名称:kgpkubs-mirosot,代码行数:51,代码来源:pPositionOurGoalKick.hpp

示例11: Packet

VotePacket::VotePacket( uint32 ip, uint16 port, int32 rank,
                        bool direct)
   : Packet(  MAX_VOTE_LENGTH,
              VOTE_PRIO,
              PACKETTYPE_VOTE,
              ip, port, 0, 0)
{   
   int packetPosition = HEADER_SIZE;
   incWriteLong( packetPosition, rank );
   incWriteLong( packetPosition, direct );
   // 5 seconds timeout.
   setTimeout( 5 );
   setLength(packetPosition);
}
开发者ID:FlavioFalcao,项目名称:Wayfinder-Server,代码行数:14,代码来源:ModulePacket.cpp

示例12: File

Socket::Socket(int sockfd, int type, const char *address /* = NULL */,
               int port /* = 0 */)
  : File(true), m_port(port), m_type(type), m_error(0), m_eof(false),
    m_timeout(0), m_timedOut(false), m_bytesSent(0) {
  if (address) m_address = address;
  m_fd = sockfd;

  struct timeval tv;
  tv.tv_sec = RuntimeOption::SocketDefaultTimeout;
  tv.tv_usec = 0;
  setsockopt(m_fd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv));
  setsockopt(m_fd, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(tv));
  setTimeout(tv);
}
开发者ID:edv4rd0,项目名称:hiphop-php,代码行数:14,代码来源:socket.cpp

示例13: cancel

void Timer::start(TimeMs timeout, Qt::TimerType type, Repeat repeat) {
	cancel();

	_type = type;
	setRepeat(repeat);
	_adjusted = false;
	setTimeout(timeout);
	_timerId = startTimer(_timeout, _type);
	if (_timerId) {
		_next = getms(true) + _timeout;
	} else {
		_next = 0;
	}
}
开发者ID:absalan,项目名称:tdesktop,代码行数:14,代码来源:timer.cpp

示例14: setTimeout

            void
            StopAndWaitRC::doWakeup(Port<Data>)
            {
                if (sendNowData &&
                    getPortConnector< Port<Data> >()->hasAcceptor(activeCompound))
                {
                    setTimeout(resendTimeout);
                    getPortConnector< Port<Data> >()->getAcceptor(activeCompound)->sendData(activeCompound->copy());

                    sendNowData = false;
                }

                getReceptor()->wakeup();
            }
开发者ID:freiheitsnetz,项目名称:openwns-library,代码行数:14,代码来源:StopAndWaitRC.cpp

示例15: settings

/*!
\fn Posix_QextSerialPort::construct(void)
Common constructor function, called by all versions of 
Posix_QextSerialPort::Posix_QextSerialPort().  Sets up default port settings (115200 8N1 
Hardware flow control where supported, otherwise no flow control, and 500 ms timeout).
*/
void Posix_QextSerialPort::construct(void) {
    QextSerialBase::construct();
#ifdef NOQFILE
    m_fdFile=-1;
#else
    Posix_File=new QFile();
#endif
    setBaudRate(BAUD115200);
    setDataBits(DATA_8);
    setStopBits(STOP_1);
    setParity(PAR_NONE);
    setFlowControl(FLOW_HARDWARE);
    setTimeout(0, 500);
}
开发者ID:app,项目名称:tradeequip,代码行数:20,代码来源:posix_qextserialport.cpp


注:本文中的setTimeout函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。