• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ sendFrame函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: NcpBase

NcpSpi::NcpSpi(Instance *aInstance)
    : NcpBase(aInstance)
    , mTxState(kTxStateIdle)
    , mHandlingRxFrame(false)
    , mResetFlag(true)
    , mPrepareTxFrameTask(*aInstance, &NcpSpi::PrepareTxFrame, this)
    , mSendFrameLength(0)
{
    SpiFrame sendFrame(mSendFrame);
    SpiFrame emptyFullAccept(mEmptySendFrameFullAccept);
    SpiFrame emptyZeroAccept(mEmptySendFrameZeroAccept);

    sendFrame.SetHeaderFlagByte(/* aResetFlag */ true);
    sendFrame.SetHeaderAcceptLen(0);
    sendFrame.SetHeaderDataLen(0);

    emptyFullAccept.SetHeaderFlagByte(/* aResetFlag */ true);
    emptyFullAccept.SetHeaderAcceptLen(kSpiBufferSize - kSpiHeaderSize);
    emptyFullAccept.SetHeaderDataLen(0);

    emptyZeroAccept.SetHeaderFlagByte(/* aResetFlag */ true);
    emptyZeroAccept.SetHeaderAcceptLen(0);
    emptyZeroAccept.SetHeaderDataLen(0);

    mTxFrameBuffer.SetFrameAddedCallback(HandleFrameAddedToTxBuffer, this);

    otPlatSpiSlaveEnable(&NcpSpi::SpiTransactionComplete, &NcpSpi::SpiTransactionProcess, this);

    // We signal an interrupt on this first transaction to
    // make sure that the host processor knows that our
    // reset flag was set.

    otPlatSpiSlavePrepareTransaction(mEmptySendFrameZeroAccept, kSpiHeaderSize, mEmptyReceiveFrame, kSpiHeaderSize,
                                     /* aRequestTras */ true);
}
开发者ID:nodish,项目名称:openthread,代码行数:35,代码来源:ncp_spi.cpp


示例17: RTArduLinkConvertUC2ToUInt

void RTArduLink::processReceivedMessage(RTARDULINK_PORT *portInfo)
{
    RTARDULINK_MESSAGE *message;                            // a pointer to the message part of the frame
    unsigned int address;

    message = &(portInfo->RXFrameBuffer.message);           // get the message pointer
    address = RTArduLinkConvertUC2ToUInt(message->messageAddress);

    switch (portInfo->index) {
        case  RTARDULINK_HOST_PORT:
            processHostMessage();                           // came from this upstream link
            return;

        case RTARDULINK_DAISY_PORT:                         // came from dasiy chain port
            if (address != RTARDULINK_HOST_PORT)            // true if it came from a daisy chained subsystem, not a directly connected subsystem
                RTArduLinkConvertIntToUC2(address + RTARDULINKHAL_MAX_PORTS, message->messageAddress);
             else
                RTArduLinkConvertIntToUC2(RTARDULINK_DAISY_PORT, message->messageAddress);
            break;

        default:
            RTArduLinkConvertIntToUC2(address + portInfo->index, message->messageAddress);
            break;
    }

    // if get here, need to forward to host port

    sendFrame(m_hostPort, &(portInfo->RXFrameBuffer), portInfo->RXFrameBuffer.messageLength);
}
开发者ID:silverhawk184,项目名称:RTIMULib-Arduino,代码行数:29,代码来源:RTArduLink.cpp


示例18: initializeTransportAdapters

        virtual void initializeTransportAdapters()
        {
            // Preparing custom device adapter
            mpTransportAdapter = new MockTransportAdapter(*this, *this);

            EXPECT_CALL(*mpTransportAdapter, run()).Times(1);
            EXPECT_CALL(*mpTransportAdapter, scanForNewDevices())
                .Times(1)
                .WillOnce(Invoke(mpTransportAdapter, &MockTransportAdapter::doScanForNewDevices))
            ;

            EXPECT_CALL(*mpTransportAdapter, connectDevice(Data::DeviceHandle))
                .Times(1)
                .WillOnce(Invoke(mpTransportAdapter, &MockTransportAdapter::doConnectDevice))
            ;

            EXPECT_CALL(*mpTransportAdapter, sendFrame(Data::ConnectionHandle, _, 512, Data::UserData))
                .Times(1)
                .WillOnce(Invoke(mpTransportAdapter, &MockTransportAdapter::doSendFrame))
            ;

            EXPECT_CALL(*mpTransportAdapter, disconnectDevice(Data::DeviceHandle))
                .Times(1)
                .WillOnce(Invoke(mpTransportAdapter, &MockTransportAdapter::doDisconnectDevice))
            ;

            addTransportAdapter(mpTransportAdapter);
            LOG4CPLUS_INFO_EXT(mLogger, "Transport adapters initialized");
        }
开发者ID:AByzhynar,项目名称:sdl_core_winport,代码行数:29,代码来源:TransportManagerTestWithCorrectDeviceAdapter.cpp


示例19: switch

    ssize_t WsConnection::handleMessage(const ConnectionPtr_t& conn, uint8_t opcode, const string& data)
    {
        switch(opcode)
        {
            case 0x1:
                //utf-8 data
                m_callback(shared_from_this(), Ws_MessageEvent, (void*)&data);
                break;    
            case 0x2:
                //binary data
                m_callback(shared_from_this(), Ws_MessageEvent, (void*)&data);
                break;
            case 0x8:
                //clsoe
                m_callback(shared_from_this(), Ws_CloseEvent, 0);
                
                conn->shutDown(500);
                break;
            case 0x9:
                //ping
                sendFrame(true, 0xA, data);
                break;
            case 0xA:
                //pong
                m_callback(shared_from_this(), Ws_PongEvent, (void*)&data);
                break;
            default:
                //error
                LOG_ERROR("invalid opcode %d", opcode);
                return -1;
        }    

        return 0;
    } 
开发者ID:ForrestSu,项目名称:libtnet,代码行数:34,代码来源:wsconnection.cpp


示例20: sendFrame

// TODO: Keep-Alive timer for connectivity monitoring.
//       Monitor latency/frequency for signal quality.
void ARControlConnection::onPing(const ARControlFrame &frame)
{
    sendFrame(frame.type,
              (quint8)ARNET_C2D_PONG_ID,
              frame.seq,
              frame.payload.data(),
              frame.payload.size());
}
开发者ID:RadialBlue,项目名称:qt-arsdk,代码行数:10,代码来源:arcontrolconnection.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ sendHeader函数代码示例发布时间:2022-05-30
下一篇:
C++ sendFile函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap