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


C++ sendFrame函数代码示例

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


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

示例1: if

/*快捷键*/
void CAdjustTestWaterTemperatureWindow::keyReleaseEvent(QKeyEvent *event)
{
    if (!event->isAutoRepeat())
    {
        if(event->key() == Qt::Key_Return || event->key() == Qt::Key_Enter)
        {

        }
        else if (event->modifiers() == Qt::NoModifier && event->key() == Qt::Key_A)
        {
            setProperty("testFlag",1);
            if(property("id").toInt() == 0)
            {
                setProperty("id", property("number").toInt() - 1);
            }
            else
                setProperty("id", property("id").toInt() - 1);
            _currentStep[property("id").toInt()]->setFocus();
            sendFrame(0x3,0x1,_currentStep[property("id").toInt()]->value());
            _centerGrid->removeWidget(_currentItem);
            _centerGrid->addWidget(_currentItem, 3, property("id").toInt() + 1);
        }
        else if (event->modifiers() == Qt::NoModifier && event->key() == Qt::Key_D)
        {
            setProperty("testFlag",1);
            if(property("id").toInt() == property("number").toInt() - 1)
            {
                setProperty("id", 0);
            }
            else
                setProperty("id", property("id").toInt() + 1);
            _currentStep[property("id").toInt()]->setFocus();
            sendFrame(0x3,0x1,_currentStep[property("id").toInt()]->value());
            _centerGrid->removeWidget(_currentItem);
            _centerGrid->addWidget(_currentItem, 3, property("id").toInt() + 1);
        }
        else if (event->modifiers() == Qt::NoModifier && event->key() == Qt::Key_W)
        {
            increaseButtonClicked();
        }
        else if (event->modifiers() == Qt::NoModifier && event->key() == Qt::Key_S)
        {
            decreaseButtonClicked();
        }
        else if (event->modifiers() == Qt::ControlModifier && event->key() == Qt::Key_S)
        {
            saveAllAdjustButtonClicked();
        }
        else if (event->modifiers() == Qt::NoModifier && event->key() == Qt::Key_R)
        {
            readButtonClicked();
        }
        else if (event->modifiers() == Qt::NoModifier && event->key() == Qt::Key_Z)
        {
            zeroButtonClicked();
        }
    }
}
开发者ID:jiacheng2012,项目名称:311_tester,代码行数:59,代码来源:cadjusttestwatertemperaturewindow.cpp

示例2: switch

void RTTeensyLink::processReceivedMessage()
{
    RTTEENSYLINK_MESSAGE*
    message;                          // a pointer to the message part of the frame
    int identityLength;
    int suffixLength;

    message = &
              (m_RXFrameBuffer.message);                   // get the message pointer

    switch (message->messageType) {
    case RTTEENSYLINK_MESSAGE_POLL:
    case RTTEENSYLINK_MESSAGE_ECHO:
        RTTeensyLinkConvertIntToUC2(RTTEENSYLINK_MY_ADDRESS, message->messageAddress);
        sendFrame(&(m_RXFrameBuffer),
                  m_RXFrameBuffer.messageLength);   // just send the frame back as received
        break;

    case RTTEENSYLINK_MESSAGE_IDENTITY:
        identityLength = strlen(RTTeensyLinkConfig.identity);
        suffixLength = strlen(m_identitySuffix);

        memcpy(message->data, RTTeensyLinkConfig.identity,
               identityLength + 1);    // copy in identity

        if ((identityLength + suffixLength) < RTTEENSYLINK_DATA_MAX_LEN - 1) {
            memcpy(message->data + identityLength, m_identitySuffix,
                   suffixLength + 1); // copy in suffix
        } else {
            suffixLength = 0;
        }

        RTTeensyLinkConvertIntToUC2(RTTEENSYLINK_MY_ADDRESS, message->messageAddress);
        message->data[RTTEENSYLINK_DATA_MAX_LEN - 1] =
            0;     // make sure zero terminated if it was truncated
        sendFrame(&(m_RXFrameBuffer),
                  RTTEENSYLINK_MESSAGE_HEADER_LEN + identityLength + suffixLength + 1);
        break;

    default:
        if (message->messageType < RTTEENSYLINK_MESSAGE_CUSTOM) {   // illegal code
            message->data[0] = RTTEENSYLINK_RESPONSE_ILLEGAL_COMMAND;
            message->data[1] = message->messageType;        // this is the offending code
            message->messageType = RTTEENSYLINK_MESSAGE_ERROR;
            RTTeensyLinkConvertIntToUC2(RTTEENSYLINK_MY_ADDRESS, message->messageAddress);
            sendFrame(&(m_RXFrameBuffer), RTTEENSYLINK_MESSAGE_HEADER_LEN + 2);
            break;
        }

        processCustomMessage(message->messageType, message->messageParam, message->data,
                             m_RXFrameBuffer.messageLength -
                             RTTEENSYLINK_MESSAGE_HEADER_LEN);   // see if anyone wants to process it
        break;
    }
}
开发者ID:ccccjason,项目名称:IMU,代码行数:55,代码来源:RTTeensyLink.cpp

示例3: m_port

TCPServerProcessor::TCPServerProcessor() : m_port(1337), m_waiting(false)
{
    m_server = new Server(this);
    connect(this, SIGNAL( sendFrame(quint32,QVariantList)),
            m_server, SLOT( sendFrame(quint32,QVariantList)) );

    //m_inputPinCvMatData = createCvMatDataInputPin( "image", this, IInputPin::CONNECTION_OPTIONAL );
    //m_inputPinDouble    = createInputPin<double>(  "double_test", this, IInputPin::CONNECTION_OPTIONAL );
    //m_inputPinCvScalar  = createInputPin<cv::Scalar>( "cv::Scalar", this, IInputPin::CONNECTION_OPTIONAL );


    plv::createDynamicInputPin( "generic pin", this, plv::IInputPin::CONNECTION_OPTIONAL );
}
开发者ID:woutgg,项目名称:parlevision,代码行数:13,代码来源:TCPServerProcessor.cpp

示例4: sendChainedFrame

/**
     * This function is used to send a chained frame.
     *
     * @param data
     *            the data to be send
     */
int sendChainedFrame(struct file *filp,const unsigned char data[],int len)
{

	int count_status=0 ;
	int length = len;
	int offset = 0;
	int ret=0;
	unsigned char *lastDataPackage=NULL;
	unsigned char *dataPackage=NULL;
	NFC_DBG_MSG(KERN_INFO "sendChainedFrame - Enter\n");
	dataPackage = gDataPackage;
	do
	{
		NFC_DBG_MSG(KERN_INFO "sendChainedFrame \n");
		// send a chained frame and receive the acknowledge
		memcpy(&dataPackage[0],&data[offset], ifs);

		count_status = sendFrame(filp,dataPackage, PH_SCAL_T1_CHAINING,ifs);
		if(count_status==0)
		{
			NFC_ERR_MSG(KERN_INFO "ERROR1: Failed to send Frame\n");
			return -1;
		}
		receiveAcknowledge(filp);
		udelay(1000);
		length = length - ifs;
		offset = offset + ifs;
		ret += count_status;
	}while (length > ifs);

#if 1
	// send the last frame
	lastDataPackage = gDataPackage;
	memcpy(&lastDataPackage[0],&data[offset], length);

	count_status = sendFrame(filp,lastDataPackage, PH_SCAL_T1_SINGLE_FRAME,length);

	if(count_status == 0)

	{
		NFC_ERR_MSG(KERN_INFO "ERROR2:Failed to send Frame\n");
		return -1;

	}
#endif
	NFC_DBG_MSG(KERN_INFO "sendChainedFrame - Exit\n");
	ret += count_status;
	return ret;
}
开发者ID:Reachseysear,项目名称:Find7-kernel-source,代码行数:55,代码来源:p61_op.c

示例5: sendFrame

void CanHandler::CANIO(CAN_FRAME& frame) {

    static CAN_FRAME CANioFrame;

    CANioFrame.id = CAN_OUTPUTS;
    CANioFrame.length = 8;
    CANioFrame.extended = 0; //standard frame
    CANioFrame.rtr = 0;

    for(int i=0; i==8; i++)
    {
        if(frame.data.bytes[i]==0x88)setOutput(i,true);
        if(frame.data.bytes[i]==0xFF)setOutput(i,false);
    }

    for(int i=0; i==8; i++)
    {
        if(getOutput(i))CANioFrame.data.bytes[i]=0x88;
        else CANioFrame.data.bytes[i]=0xFF;
    }

    sendFrame(CANioFrame);


    CANioFrame.id = CAN_ANALOG_INPUTS;
    int i=0;
    uint16_t anaVal;

    for(int j=0; j>6; j+=2)
    {
        anaVal=getAnalog(i++);
        CANioFrame.data.bytes[j]=highByte (anaVal);
        CANioFrame.data.bytes[j+1]=lowByte(anaVal);
    }

    sendFrame(CANioFrame);

    CANioFrame.id = CAN_DIGITAL_INPUTS;
    CANioFrame.length = 4;

    for(int i=0; i==4; i++)
    {
        if (getDigital(i))CANioFrame.data.bytes[i]=0x88;
        else CANioFrame.data.bytes[i]=0xff;
    }

    sendFrame(CANioFrame);
}
开发者ID:cgalpin,项目名称:GEVCU,代码行数:48,代码来源:CanHandler.cpp

示例6: Q_Q

void QAmqpChannelPrivate::close(const QAmqpMethodFrame &frame)
{
    Q_Q(QAmqpChannel);
    qAmqpDebug(">> CLOSE");
    QByteArray data = frame.arguments();
    QDataStream stream(&data, QIODevice::ReadOnly);
    qint16 code = 0, classId, methodId;
    stream >> code;
    QString text =
        QAmqpFrame::readAmqpField(stream, QAmqpMetaType::ShortString).toString();

    stream >> classId;
    stream >> methodId;

    QAMQP::Error checkError = static_cast<QAMQP::Error>(code);
    if (checkError != QAMQP::NoError) {
        error = checkError;
        errorString = qPrintable(text);
        Q_EMIT q->error(error);
    }

    qAmqpDebug(">> code: %d", code);
    qAmqpDebug(">> text: %s", qPrintable(text));
    qAmqpDebug(">> class-id: %d", classId);
    qAmqpDebug(">> method-id: %d", methodId);
    Q_EMIT q->closed();

    // complete handshake
    QAmqpMethodFrame closeOkFrame(QAmqpFrame::Channel, miCloseOk);
    closeOkFrame.setChannel(channelNumber);
    sendFrame(closeOkFrame);

    // notify everyone that the channel was closed on us.
    notifyClosed();
}
开发者ID:droidsyer,项目名称:qamqp,代码行数:35,代码来源:qamqpchannel.cpp

示例7: makeFlag

void TclClass::sendColor(byte red, byte green, byte blue) {
  byte flag;

  flag = makeFlag(red,green,blue);

  sendFrame(flag,red,green,blue);
}
开发者ID:CoolNeon,项目名称:arduino-tcl,代码行数:7,代码来源:TCL.cpp

示例8: DEBUG

void AdminConnection::processGetCommandTypes(InputFrame::Ptr frame){
  DEBUG("doing get command types frame");

  OutputFrame::Ptr of = createFrame(frame);
  CommandManager::getCommandManager()->doGetCommandTypes(frame, of);
  sendFrame(of);
}
开发者ID:glew,项目名称:tpserver-cpp,代码行数:7,代码来源:adminconnection.cpp

示例9: FrameException

void AdminConnection::processDescribeCommand(InputFrame::Ptr frame)
{
  Logger::getLogger()->debug("doing describe command frame");

  if(frame->getDataLength() < 4){
    throw FrameException(fec_FrameError);
  }

  int numdesc = frame->unpackInt();

  if(frame->getDataLength() < 4 + 4 * numdesc){
    throw FrameException(fec_FrameError);
  }

  sendSequence(frame,numdesc);

  if(numdesc == 0){
    DEBUG("asked for no commands to describe");
    throw FrameException( fec_NonExistant, "You didn't ask for any command descriptions, try again");
  }

  for(int i = 0; i < numdesc; i++){
    OutputFrame::Ptr of = createFrame(frame);
    int cmdtype = frame->unpackInt();
    CommandManager::getCommandManager()->describeCommand(cmdtype, of);
    sendFrame(of);
  }
}
开发者ID:glew,项目名称:tpserver-cpp,代码行数:28,代码来源:adminconnection.cpp

示例10: select

/**
* @brief 
*
* @return 
*/
int HttpStream::run()
{
    Select select( 60 );
    select.addWriter( mConnection->socket() );

    if ( !waitForProviders() )
        return( 1 );

    while ( !mStop && select.wait() >= 0 )
    {
        if ( mStop )
           break;
        Select::CommsList writeable = select.getWriteable();
        if ( writeable.size() <= 0 )
        {
            Error( "Writer timed out" );
            mStop = true;
            break;
        }
        mQueueMutex.lock();
        if ( !mFrameQueue.empty() )
        {
            for ( FrameQueue::iterator iter = mFrameQueue.begin(); iter != mFrameQueue.end(); iter++ )
            {
                sendFrame( writeable, *iter );
                //delete *iter;
            }
            mFrameQueue.clear();
        }
        mQueueMutex.unlock();
        usleep( INTERFRAME_TIMEOUT );
    }

    return( 0 );
}
开发者ID:jianhongwei,项目名称:ozonebase,代码行数:40,代码来源:ozHttpStream.cpp

示例11: sendFrame

    void WsConnection::send(const string& message, bool binary)
    {
        char opcode = binary ? 0x2 : 0x1;

        //for utf-8, we assume message is already utf-8
        sendFrame(true, opcode, message);
    }
开发者ID:ForrestSu,项目名称:libtnet,代码行数:7,代码来源:wsconnection.cpp

示例12: writeReg

void RFM69::send(uint8_t toAddress, const void* buffer, uint8_t bufferSize, bool requestACK)
{
  writeReg(REG_PACKETCONFIG2, (readReg(REG_PACKETCONFIG2) & 0xFB) | RF_PACKET2_RXRESTART); // avoid RX deadlocks
  uint32_t now = millis();
  while (!canSend() && millis() - now < RF69_CSMA_LIMIT_MS) receiveDone();
  sendFrame(toAddress, buffer, bufferSize, requestACK, false);
}
开发者ID:abouillot,项目名称:HomeAutomation,代码行数:7,代码来源:rfm69.cpp

示例13: comDemo

void comDemo()
{
	//init USB
	if(initUSBCommunicationSync()!=0) {
		return;
	}
	
	//init UDP
	if(initCommunication()!=0) {
		return;
	}
	
	usleep(1000000);
	
	char type;
	uint32_t data0;
	uint32_t data1;
	uint32_t data2;
	uint32_t data3;	
	uint32_t rss0;
	uint32_t rss1;
	uint32_t rss2;
	uint32_t rss3;	
	
	while(1) {	
		//read USB
		if(readUSBFrameSync(&type,&data0,&data1,&data2,&data3,&rss0,&rss1,&rss2,&rss3)==0) {
			//send UDP
			sendFrame(type,data0,data1,data2,STOP_MISSION);
		}
	}
	
	closeUSBCommunicationSync();
}
开发者ID:shalashaskaa,项目名称:drone-linux,代码行数:34,代码来源:com_demo.c

示例14: debugger

void debugger(){
	Serial.write(START_TX);
	switch(serialCommand){
	case PORTS_STATUS:{
		Serial.write(PORTS_STATUS);		//frame id
		byte frame[]={PINA, PINB, PINC, PINE, PINF, PING, PINH, 0};
		sendFrame(frame);
		endTx();
		break;
	}
	case PORT_CONFIG:{
		Serial.write(PORT_CONFIG);
		Serial.println("test");
		Serial.println(DDRA, BIN);
		Serial.println(DDRB, BIN);
		Serial.println(DDRC, BIN);
		Serial.println(DDRE, BIN);
		Serial.println(DDRF, BIN);
		Serial.println(DDRG, BIN);
		Serial.println(DDRH, BIN);
		endTx();
		break;
	}
	default:{
		Serial.println("Don't understand");
	}
	}
}
开发者ID:ravmiecznik,项目名称:myECUeclipse,代码行数:28,代码来源:myECU.cpp

示例15: frame

//------------------------------------------------------------------------------
bool BaseWebSocketSessionManager::sendBinary(AbstractWebSocketConnection* connection,
                                             unsigned char* data,
                                             std::size_t size)
{
    WebSocketFrame frame(data,size,Poco::Net::WebSocket::FRAME_BINARY);
    return sendFrame(connection,frame);
}
开发者ID:mfox2,项目名称:ofxHTTP,代码行数:8,代码来源:BaseWebSocketSessionManager.cpp


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