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

C++ PrintStatus函数代码示例

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

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



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

示例1: DB

    void Socket::setBlockingMode(bool isBlocking) {
#ifndef _WIN32
        DB(PrintStatus(fd));
        if (!_myIsConnected) {
            AC_WARNING << "Socket::setBlockingMode setting blocking mode of a not connected socket, the mode will be lost after you connect";
        }
        int status = fcntl(fd, F_GETFL, 0);
        if (!isBlocking) {
            status |= O_NONBLOCK;
        } else {
            status &= ~O_NONBLOCK;
        }
        if (fcntl(fd, F_SETFL, status)== -1) {
            throw SocketError(getLastSocketError(), "Socket::setBlockingMode failed");
        }
#else
        u_long theFlag = 1;
        if (isBlocking) {
            theFlag = 0;
        }
        int theRC = ioctlsocket(fd, FIONBIO, &theFlag);
        if (theRC == SOCKET_ERROR) {
            int err = getLastSocketError();
            throw SocketError(err, "Socket::setBlockingMode failed");
        }
#endif
    }
开发者ID:artcom,项目名称:asl,代码行数:27,代码来源:Socket.cpp


示例2: VS_ParseCommand

uint8_t VS_ParseCommand(const unsigned char *cmd, bool *handled, const CLS1_StdIOType *io)
{
  const uint8_t *p;
  uint32_t val32u;

  if (UTIL1_strcmp((char*)cmd, CLS1_CMD_HELP)==0 || UTIL1_strcmp((char*)cmd, "VS1053 help")==0) {
    *handled = TRUE;
    return PrintHelp(io);
  } else if ((UTIL1_strcmp((char*)cmd, CLS1_CMD_STATUS)==0) || (UTIL1_strcmp((char*)cmd, "VS1053 status")==0)) {
    *handled = TRUE;
    return PrintStatus(io);
  } else if (UTIL1_strncmp((char*)cmd, "VS1053 volume ", sizeof("VS1053 volume ")-1)==0) {
    *handled = TRUE;
    p = cmd+sizeof("VS1053 volume ")-1;
    if (UTIL1_xatoi(&p, &val32u)==ERR_OK) {
      return VS_SetVolume((uint16_t)val32u);
    } else {
      CLS1_SendStr("Failed reading volume", io->stdErr);
      return ERR_FAILED;
    }
  } else if (UTIL1_strncmp((char*)cmd, "VS1053 play ", sizeof("VS1053 play ")-1)==0) {
    *handled = TRUE;
    p = cmd+sizeof("VS1053 play ")-1;
    return VS_PlaySong(p, io);
  }
  return ERR_OK;
}
开发者ID:ADeadCat,项目名称:mcuoneclipse,代码行数:27,代码来源:VS1053.c


示例3: REF_ParseCommand

byte REF_ParseCommand(const unsigned char *cmd, bool *handled, const CLS1_StdIOType *io) {
  if (UTIL1_strcmp((char*)cmd, CLS1_CMD_HELP)==0 || UTIL1_strcmp((char*)cmd, "ref help")==0) {
    *handled = TRUE;
    return PrintHelp(io);
  } else if ((UTIL1_strcmp((char*)cmd, CLS1_CMD_STATUS)==0) || (UTIL1_strcmp((char*)cmd, "ref status")==0)) {
    *handled = TRUE;
    return PrintStatus(io);
#if REF_START_STOP_CALIB
  } else if (UTIL1_strcmp((char*)cmd, "ref calib start")==0) {
    if (refState==REF_STATE_NOT_CALIBRATED || refState==REF_STATE_READY) {
      REF_CalibrateStartStop();
    } else {
      CLS1_SendStr((unsigned char*)"ERROR: cannot start calibration, must not be calibrating or be ready.\r\n", io->stdErr);
      return ERR_FAILED;
    }
    *handled = TRUE;
    return ERR_OK;
  } else if (UTIL1_strcmp((char*)cmd, "ref calib stop")==0) {
    if (refState==REF_STATE_CALIBRATING) {
      REF_CalibrateStartStop();
    } else {
      CLS1_SendStr((unsigned char*)"ERROR: can only stop if calibrating.\r\n", io->stdErr);
      return ERR_FAILED;
    }
    *handled = TRUE;
    return ERR_OK;
#endif
  }
  return ERR_OK;
}
开发者ID:emmeneggerc,项目名称:INTRO_EF,代码行数:30,代码来源:Reflectance.c


示例4: PrintStatus

std::ostream& AztecOO_StatusTestResNorm::Print(std::ostream& stream, int indent) const
{
  for (int j = 0; j < indent; j ++)
    stream << ' ';
  PrintStatus(stream, status_);
  stream << "(";
  if (resweights_!=0) stream << "Weighted ";
  stream << ((resnormtype_==OneNorm) ? "1-Norm" : (resnormtype_==TwoNorm) ? "2-Norm" : "Inf-Norm");
  stream << ((curresvecexplicit_) ? " Exp" : " Imp");
  stream << " Res Vec) ";
  if (scaletype_!=None)
    stream << "/";
  if (scaletype_==UserProvided)
    stream << " (User Scale)";
  else {
    stream << "(";
    if (scaleweights_!=0) stream << "Weighted ";
    stream << ((scalenormtype_==OneNorm) ? "1-Norm" : (resnormtype_==TwoNorm) ? "2-Norm" : "Inf-Norm");
    if (scaletype_==NormOfInitRes)
      stream << " Res0";
    else
      stream << " RHS ";
    stream << ")";
  }
  if (status_==Unchecked)
    stream << " Unchecked << ";
  else {
    stream << " = " << testvalue_;
    stream << ((testvalue_<tolerance_) ? " < " : (testvalue_==tolerance_) ? " = " : (testvalue_>tolerance_) ? " > " : " <> ");
  }
  stream << tolerance_;
  stream << std::endl;
    
  return stream;
}
开发者ID:00liujj,项目名称:trilinos,代码行数:35,代码来源:AztecOO_StatusTestResNorm.cpp


示例5: LP_ParseCommand

uint8_t LP_ParseCommand(const unsigned char *cmd, bool *handled, const CLS1_StdIOType *io) {
  if (UTIL1_strcmp((char*)cmd, (char*)CLS1_CMD_HELP)==0 || UTIL1_strcmp((char*)cmd, (char*)"LowPower help")==0) {
    PrintHelp(io);
    *handled = TRUE;
  } else if (UTIL1_strcmp((char*)cmd, (char*)CLS1_CMD_STATUS)==0 || UTIL1_strcmp((char*)cmd, (char*)"LowPower status")==0) {
    PrintStatus(io);
    *handled = TRUE;
  } else if (UTIL1_strcmp((char*)cmd, (char*)"LowPower mode run")==0) {
    *handled = TRUE;
    LP_mode = LP_RUN;
  } else if (UTIL1_strcmp((char*)cmd, (char*)"LowPower mode wait")==0) {
    *handled = TRUE;
    LP_mode = LP_WAIT;
  } else if (UTIL1_strcmp((char*)cmd, (char*)"LowPower mode sleep")==0) {
    *handled = TRUE;
    LP_mode = LP_SLEEP;
  } else if (UTIL1_strcmp((char*)cmd, (char*)"LowPower mode stop")==0) {
    *handled = TRUE;
    LP_mode = LP_STOP;
#if LP_CAN_CHANGE_CLOCK
  } else if (UTIL1_strcmp((char*)cmd, (char*)"LowPower clock fast")==0) {
    *handled = TRUE;
    LP_ChangeClock(LP_SPEED_FAST);
  } else if (UTIL1_strcmp((char*)cmd, (char*)"LowPower clock medium")==0) {
    *handled = TRUE;
    LP_ChangeClock(LP_SPEED_MEDIUM);
  } else if (UTIL1_strcmp((char*)cmd, (char*)"LowPower clock slow")==0) {
    *handled = TRUE;
    LP_ChangeClock(LP_SPEED_SLOW);
#endif
  }
  return ERR_OK;
}
开发者ID:AlexanderWiniger,项目名称:mcuoneclipse,代码行数:33,代码来源:LowPower.c


示例6: DeletePartitions

/* Delete the disk partition table */
BOOL DeletePartitions(HANDLE hDrive)
{
	BOOL r;
	DWORD size;
	CREATE_DISK CreateDisk = {PARTITION_STYLE_RAW, {{0}}};

	PrintStatus(0, TRUE, "Deleting partitions...");

	size = sizeof(CreateDisk);
	r = DeviceIoControl(hDrive, IOCTL_DISK_CREATE_DISK,
			(BYTE*)&CreateDisk, size, NULL, 0, &size, NULL );
	if (!r) {
		uprintf("Could not delete drive layout: %s\n", WindowsErrorString());
		safe_closehandle(hDrive);
		return FALSE;
	}

	r = DeviceIoControl(hDrive, IOCTL_DISK_UPDATE_PROPERTIES, NULL, 0, NULL, 0, &size, NULL );
	if (!r) {
		uprintf("Could not refresh drive layout: %s\n", WindowsErrorString());
		safe_closehandle(hDrive);
		return FALSE;
}

return TRUE;
}
开发者ID:Kronimo,项目名称:rufus,代码行数:27,代码来源:drive.c


示例7: Init

	void Init( void ) {
		RegisterCommands();
		RegisterCvars();

		isServer = Common::com_dedicated->GetBool();
		peer = RakNet::RakPeerInterface::GetInstance();
		uint16_t port = static_cast<uint16_t>( net_port->GetInt32() );

		RakNet::SocketDescriptor socketDescriptors[] = {
			RakNet::SocketDescriptor( port, nullptr ) // primary network card
		};

		if ( isServer ) {
			maxConnections = Server::sv_maxConnections->GetUInt32();
		}
		else {
			maxConnections = 1u;
		}
		peer->Startup( maxConnections, socketDescriptors, ARRAY_LEN( socketDescriptors ) );
		peer->SetMaximumIncomingConnections( maxConnections );
	//	peer->SetOccasionalPing( true );
		peer->SetUnreliableTimeout( 1000 );
		peer->AllowConnectionResponseIPMigration( false );

		myGUID = peer->GetGuidFromSystemAddress( RakNet::UNASSIGNED_SYSTEM_ADDRESS ).g;
		PrintStatus();
	}
开发者ID:Razish,项目名称:xsngine,代码行数:27,代码来源:Network.cpp


示例8: MPC4728_ParseCommand

byte MPC4728_ParseCommand(const unsigned char *cmd, bool *handled, const CLS1_StdIOType *io) {
  const unsigned char *p;

  if (UTIL1_strcmp((char*)cmd, CLS1_CMD_HELP)==0 || UTIL1_strcmp((char*)cmd, "MPC4728 help")==0) {
    *handled = TRUE;
    return PrintHelp(io);
  } else if ((UTIL1_strcmp((char*)cmd, CLS1_CMD_STATUS)==0) || (UTIL1_strcmp((char*)cmd, "MPC4728 status")==0)) {
    *handled = TRUE;
    return PrintStatus(io);
  } else if (UTIL1_strcmp((char*)cmd, "MPC4728 reset")==0) {
    *handled = TRUE;
    if (MPC4728_Reset()!=ERR_OK) {
      return ERR_FAILED;
    } else {
      return ERR_OK;
    }
  } else if (UTIL1_strcmp((char*)cmd, "MPC4728 wakeup")==0) {
    *handled = TRUE;
    if (MPC4728_Wakeup()!=ERR_OK) {
      return ERR_FAILED;
    } else {
      return ERR_OK;
    }
  } else if (UTIL1_strcmp((char*)cmd, "MPC4728 update")==0) {
    *handled = TRUE;
    if (MPC4728_Update()!=ERR_OK) {
      return ERR_FAILED;
    } else {
      return ERR_OK;
    }
  } else if (UTIL1_strncmp((char*)cmd, "MPC4728 fastwrite ", sizeof("MPC4728 fastwrite ")-1)==0) {
    uint16_t dac[4];
    uint8_t pd[4];
    int i;
    
    *handled = TRUE;
    p = cmd+sizeof("I2CSPY1 fastwrite ")-1;
    for(i=0;i<4;i++) { /* init */
      dac[i] = 0;
      pd[i] = 0;
    }
    for(i=0;i<4;i++) {
      if (UTIL1_ScanHex16uNumber(&p, &dac[i])!=ERR_OK) {
        break;
      }
      dac[i] &= 0xFFF; /* ensure it is 12 bits */
    }
    if (i!=4) {
      CLS1_SendStr((unsigned char*)"**** Not enough values, 4 expected.\r\n", io->stdErr);
      return ERR_FAILED;
    }
    if (MPC4728_FastWrite(dac, sizeof(dac), pd, sizeof(pd))!=ERR_OK) {
      CLS1_SendStr((unsigned char*)"**** FastWrite failed.\r\n", io->stdErr);
      return ERR_FAILED;
    } else {
      return ERR_OK;
    }
  }
  return ERR_OK;
}
开发者ID:mahaaaa,项目名称:mcuoneclipse,代码行数:60,代码来源:MPC4728.c


示例9: FreeData

void LoggableFrontend::Update()
{
	if (!PrepareData())
	{
		FreeData();
		return;
	}

	BeforePrint();

	MessageList* pMessages = LockMessages();
	if (!pMessages->empty())
	{
		Message* pFirstMessage = pMessages->front();
		int iStart = m_iNeededLogFirstID - pFirstMessage->GetID() + 1;
		if (iStart < 0)
		{
			PrintSkip();
			iStart = 0;
		}
		for (unsigned int i = (unsigned int)iStart; i < pMessages->size(); i++)
		{
			PrintMessage((*pMessages)[i]);
			m_iNeededLogFirstID = (*pMessages)[i]->GetID();
		}
	}
	UnlockMessages();

	PrintStatus();

	FreeData();

	fflush(stdout);
}
开发者ID:0BruceWayne0,项目名称:nzbget,代码行数:34,代码来源:LoggableFrontend.cpp


示例10: MPI_Comm_free

//=============================================================================
void Amesos_Mumps::Destroy()
{
  if (!NoDestroy_) 
  { 
    // destroy instance of the package
    MDS.job = -2;

    if (Comm().MyPID() < MaxProcs_) dmumps_c(&(MDS));
    
#if 0
    if (IsComputeSchurComplementOK_ && (Comm().MyPID() == 0)
	&& MDS.schur) {
      delete [] MDS.schur;
      MDS.schur = 0;
    }
#endif
    
#ifdef HAVE_MPI
    if (MUMPSComm_) 
    {
      MPI_Comm_free( &MUMPSComm_ );
      MUMPSComm_ = 0;
    }
#endif
    
    if( (verbose_ && PrintTiming_) || verbose_ == 2) PrintTiming();
    if( (verbose_ && PrintStatus_) || verbose_ == 2) PrintStatus();
  }
}
开发者ID:00liujj,项目名称:trilinos,代码行数:30,代码来源:Amesos_Mumps.cpp


示例11: main

int main(int argc, const char * argv[]) {
    if (argc != 2)
    {
        puts("Usage: toy FILE.brick\n");
        return 0;
    }
    
    FILE* file = fopen(argv[1], "r");
    
    if (!file)
    {
        printf("ERROR: cannot read file \"%s\".", argv[1]);
        return (EXIT_FAILURE);
    }
    
    size_t file_size = getFileSize(file);
    
    TOYVM vm;
    InitializeVM(&vm, 2 * file_size, file_size);
    
    fread(vm.memory, 1, file_size, file);
    fclose(file);

    RunVM(&vm);
    
    if (vm.cpu.status.BAD_ACCESS
        || vm.cpu.status.BAD_INSTRUCTION
        || vm.cpu.status.INVALID_REGISTER_INDEX
        || vm.cpu.status.STACK_OVERFLOW
        || vm.cpu.status.STACK_UNDERFLOW)
    {
        PrintStatus(&vm);
    }
}
开发者ID:coderodde,项目名称:ToyVM,代码行数:34,代码来源:main.c


示例12: QUADCALIB_ParseCommand

byte QUADCALIB_ParseCommand(const unsigned char *cmd, bool *handled, const CLS1_StdIOType *io) {
  if (UTIL1_strcmp((char*)cmd, CLS1_CMD_HELP)==0 || UTIL1_strcmp((char*)cmd, "quadcalib help")==0) {
    *handled = TRUE;
    return PrintHelp(io);

  } else if ((UTIL1_strcmp((char*)cmd, CLS1_CMD_STATUS)==0) || (UTIL1_strcmp((char*)cmd, "quadcalib status")==0)) {
    *handled = TRUE;
    return PrintStatus(io);
  } else if ((UTIL1_strcmp((char*)cmd, "quadcalib tune 0")==0)) {
    *handled = TRUE;
    return Tune(io, 0, MOT_GetMotorHandle(MOT_MOTOR_RIGHT));

  } else if ((UTIL1_strcmp((char*)cmd, "quadcalib tune 1")==0)) {
    *handled = TRUE;
    return Tune(io, 1, MOT_GetMotorHandle(MOT_MOTOR_RIGHT));

  } else if ((UTIL1_strcmp((char*)cmd, "quadcalib tune 2")==0)) {
    *handled = TRUE;
    return Tune(io, 2, MOT_GetMotorHandle(MOT_MOTOR_LEFT));

  } else if ((UTIL1_strcmp((char*)cmd, "quadcalib tune 3")==0)) {
    *handled = TRUE;
    return Tune(io, 3, MOT_GetMotorHandle(MOT_MOTOR_LEFT));
  }
  return ERR_OK;
}
开发者ID:tbsimmen,项目名称:INTRO_Robotfiles,代码行数:26,代码来源:QuadCalib.c


示例13: OnAlert

 virtual void PXCAPI OnAlert(const PXCSpeechRecognition::AlertData *data) {
     if(data->label == PXCSpeechRecognition::AlertType::ALERT_SPEECH_UNRECOGNIZABLE)
     {
         ClearScores(m_hWnd);
     }
     PrintStatus(m_hWnd,AlertToString(data->label));
 }
开发者ID:rberman,项目名称:BlindSight,代码行数:7,代码来源:speech_recognition.cpp


示例14: EvaluateStatus

void EvaluateStatus(unsigned char force)
{
	unsigned char T=0;

	//calculating the state value 

	// input pins	
	if (!(PINA & 0b00000100))	T = T + 128;
	if (!(PINA & 0b00000010))	T = T + 64;
	if (!(PINA & 0b00000001))	T = T + 32;
	if (!(PIND & 0b00000100))	T = T + 16;

	// output relays
	if ((PINB & 0b00000001))	T = T + 8;
	if ((PINB & 0b00000010))	T = T + 4;
	if ((PINB & 0b00000100))	T = T + 2;
	if ((PINB & 0b00001000))	T = T + 1;
	
	// if the force flag is set or the value has 
	// changed from the last known state, then
	// update the last known state tracking 
	// variable and print the updated state
	// to the serial connection
	if(force || lastKnownInputState != T)
	{
		lastKnownInputState = T;
		PrintStatus(T);
	}	

	lastKnownInputState = T;
}
开发者ID:afkham,项目名称:pi4j,代码行数:31,代码来源:OlimexAvrIoM16-Pi4JGpioExtension.c


示例15: BLEUART_CMDMODE_ParseCommand

uint8_t BLEUART_CMDMODE_ParseCommand(const unsigned char *cmd, bool *handled, const CLS1_StdIOType *io) {
  uint8_t res = ERR_OK;

  if (UTIL1_strcmp((char*)cmd, CLS1_CMD_HELP)==0 || UTIL1_strcmp((char*)cmd, "uart help")==0) {
    CLS1_SendHelpStr((unsigned char*)"uart", (const unsigned char*)"Group of Adafruit BLE commands\r\n", io->stdOut);
    CLS1_SendHelpStr((unsigned char*)"  help|status", (const unsigned char*)"Print help or status information\r\n", io->stdOut);
    CLS1_SendHelpStr((unsigned char*)"  enable", (unsigned char*)"Enable BLE UART\r\n", io->stdOut);
    CLS1_SendHelpStr((unsigned char*)"  disable", (unsigned char*)"Disable BLE UART\r\n", io->stdOut);
    CLS1_SendHelpStr((unsigned char*)"  tx <string>", (unsigned char*)"Send string\r\n", io->stdOut);
    *handled = TRUE;
    return ERR_OK;
  } else if ((UTIL1_strcmp((char*)cmd, CLS1_CMD_STATUS)==0) || (UTIL1_strcmp((char*)cmd, "uart status")==0)) {
    *handled = TRUE;
    return PrintStatus(io);
  } else if (UTIL1_strcmp((char*)cmd, "uart enable")==0) {
    isEnabled = TRUE;
    *handled = TRUE;
  } else if (UTIL1_strcmp((char*)cmd, "uart disable")==0) {
    isEnabled = FALSE;
    *handled = TRUE;
  } else if (UTIL1_strncmp((char*)cmd, "uart tx ", sizeof("uart tx ") - 1) == 0) {
    *handled = TRUE;
    taskENTER_CRITICAL();
    UTIL1_strcpy(txBuffer, sizeof(txBuffer), cmd+sizeof("uart tx ")-1);
    UTIL1_strcat(txBuffer, sizeof(txBuffer), "\\n\n"); /* add newline */
    taskEXIT_CRITICAL();
  }
  return res; /* no error */
}
开发者ID:mbangtri,项目名称:mcuoneclipse,代码行数:29,代码来源:bleuart_cmdmode.c


示例16: Stop

bool Stop(HWND hwndDlg) {

    if (g_vrec) g_vrec->StopRec();
    g_stopped=true;
    CleanUp();
    PrintStatus(hwndDlg,L"Recognition Finished");
    return g_stopped;
}
开发者ID:rberman,项目名称:BlindSight,代码行数:8,代码来源:speech_recognition.cpp


示例17: switch

//
// OnReceiveMessage
//
// Virtual method called by base class with Window messages
//
BOOL CCalibFilterProperties::OnReceiveMessage(HWND hwnd,
                                              UINT uMsg,
                                              WPARAM wParam,
                                              LPARAM lParam)
{
    switch (uMsg)
    {        
        case WM_INITDIALOG:
        {
        m_hwnd = hwnd;
        SetControls( hwnd );
        SetTimer( hwnd, 0, 50, 0 );
        return 1L;
        }

        case WM_VSCROLL:
        {
        return 1L;
        }

        case WM_COMMAND:
        if( HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_START_CALIB )
        {
            StartCalibration();
        }
        if( HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_SAVECALIBRATION )
        {
            SaveCameraParams();
        }
        if( HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_LOADCALIBRATION )
        {
            LoadCameraParams();
        }
        else if( HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_STOP )
        {
            //StopCalibration();
        }
        else if( HIWORD(wParam) == EN_CHANGE || HIWORD(wParam) == BN_CLICKED )
        {
            SetDirty();
        }
        return 1L;

        case WM_TIMER:
        {
            PrintStatus();
        }
        return 1L;

        case WM_DESTROY:
        {
            KillTimer( hwnd, 0 );
        }
        return 1L;
    }
    return CBasePropertyPage::OnReceiveMessage(hwnd,uMsg,wParam,lParam);

} // OnReceiveMessage
开发者ID:JackJone,项目名称:opencv,代码行数:63,代码来源:CalibFilterProp.cpp


示例18: FinishUpdate

void FinishUpdate() {
  if(nShowPhase != 2) {
    PrintStatus(" ");
  } // if nShowPhase
  sprintf(strImage+nScreenWidth-10, "[  OK  ]\n");

  if(! ::nProcessRank) fprintf(stderr, strImage);
  nShowPhase = 0;
} // FinishUpdate
开发者ID:vhaasteren,项目名称:bang-legacy,代码行数:9,代码来源:banfunc.cpp


示例19: RNETA_ParseCommand

uint8_t RNETA_ParseCommand(const unsigned char *cmd, bool *handled, const CLS1_StdIOType *io) {
    uint8_t res = ERR_OK;
    const uint8_t *p;
    uint16_t val16;

    if (UTIL1_strcmp((char*)cmd, (char*)CLS1_CMD_HELP)==0 || UTIL1_strcmp((char*)cmd, (char*)"app help")==0) {
        PrintHelp(io);
        *handled = TRUE;
    } else if (UTIL1_strcmp((char*)cmd, (char*)CLS1_CMD_STATUS)==0 || UTIL1_strcmp((char*)cmd, (char*)"app status")==0) {
        *handled = TRUE;
        return PrintStatus(io);
    } else if (UTIL1_strncmp((char*)cmd, (char*)"app saddr", sizeof("app saddr")-1)==0) {
        p = cmd + sizeof("app saddr")-1;
        *handled = TRUE;
        if (UTIL1_ScanHex16uNumber(&p, &val16)==ERR_OK) {
            (void)RNWK_SetThisNodeAddr((RNWK_ShortAddrType)val16);
        } else {
            CLS1_SendStr((unsigned char*)"ERR: wrong address\r\n", io->stdErr);
            return ERR_FAILED;
        }
    } else if (UTIL1_strncmp((char*)cmd, (char*)"app daddr", sizeof("app daddr")-1)==0) {
        p = cmd + sizeof("app daddr")-1;
        *handled = TRUE;
        if (UTIL1_ScanHex16uNumber(&p, &val16)==ERR_OK) {
            APP_dstAddr = val16;
        } else {
            CLS1_SendStr((unsigned char*)"ERR: wrong address\r\n", io->stdErr);
            return ERR_FAILED;
        }
#if PL_HAS_RSTDIO
    } else if (UTIL1_strncmp((char*)cmd, (char*)"app send", sizeof("app send")-1)==0) {
        unsigned char buf[32];
        RSTDIO_QueueType queue;

        if (UTIL1_strncmp((char*)cmd, (char*)"app send in", sizeof("app send in")-1)==0) {
            queue = RSTDIO_QUEUE_TX_IN;
            cmd += sizeof("app send in");
        } else if (UTIL1_strncmp((char*)cmd, (char*)"app send out", sizeof("app send out")-1)==0) {
            queue = RSTDIO_QUEUE_TX_OUT;
            cmd += sizeof("app send out");
        } else if (UTIL1_strncmp((char*)cmd, (char*)"app send err", sizeof("app send err")-1)==0) {
            queue = RSTDIO_QUEUE_TX_ERR;
            cmd += sizeof("app send err");
        } else {
            return ERR_OK; /* not handled */
        }
        UTIL1_strcpy(buf, sizeof(buf), cmd);
        UTIL1_chcat(buf, sizeof(buf), '\n');
        buf[sizeof(buf)-2] = '\n'; /* have a '\n' in any case */
        if (RSTDIO_SendToTxStdio(queue, buf, UTIL1_strlen((char*)buf))!=ERR_OK) {
            CLS1_SendStr((unsigned char*)"failed!\r\n", io->stdErr);
        }
        *handled = TRUE;
#endif
    }
    return res;
}
开发者ID:Joteyo,项目名称:mcuoneclipse,代码行数:57,代码来源:RNet_App.c


示例20: PrintFailed

void PrintFailed() {
  if(nShowPhase != 2) {
    PrintStatus(" ");
  } // if nShowPhase
  sprintf(strImage+nScreenWidth-10, "[FAILED]\n");

  if(! ::nProcessRank) fprintf(stderr, strImage);
  nShowPhase = 0;
} // PrintFailed
开发者ID:vhaasteren,项目名称:bang-legacy,代码行数:9,代码来源:banfunc.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ PrintString函数代码示例发布时间:2022-05-30
下一篇:
C++ PrintStats函数代码示例发布时间: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