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


C++ ResetDevice函数代码示例

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


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

示例1: lock

// used to notify object to release of create the sensor
void KinectSensor::NuiStatusNotification( _In_z_ const WCHAR* wcPortID, HRESULT hrStatus )
{
    AutoLock lock( m_nuiLock );

    if( E_NUI_NOTCONNECTED == hrStatus )
    {
        ResetDevice();

        // release the instance of the sensor
        m_pNuiSensor.Release();
    }
    else
    {
        if( 0 != m_wsPortID.compare(wcPortID) )
        {
            ResetDevice();
            m_wsPortID = wcPortID;
        }

        // notifaction callback, check the state
        // if there is a non-recovery error, reset
        HRESULT hr = GetNUISensorStatus();
        if( FAILED(hr) && KinectSensorStatusError == m_eStatus )
        {
            ResetDevice();

            // release the instance of the sensor
            m_pNuiSensor.Release();
            
            return;
        }
    }

}
开发者ID:IsaacGonzalez,项目名称:KinectCommonBridge,代码行数:35,代码来源:KinectSensor.cpp

示例2: ResetDevice

bool Device::Init()
{
	ResetDevice();
	
	if (!Device_Inserted())
		return false;
	
	SearchConfig();
	
	if(device.ConfigDevice == 0)
	{
		SearchBootDevice();
		
		if(GetDeviceCount() >= 2)
		{
			if(SearchDolDevice() != 0)
				device.BootDevice = device.DolDevice;
		}
		device.ConfigDevice = device.BootDevice;
	}
	device.BootDevice = device.ConfigDevice;
	device.BrowsedDevice = device.ConfigDevice;
	device.DeviceCount = GetDeviceCount();	
	
	return true;
}
开发者ID:djskual,项目名称:savegame-manager-gx,代码行数:26,代码来源:device.cpp

示例3: EnableSkeletonStream

// start the skeleton stream
HRESULT KinectSensor::StartSkeletonStream()
{
    // since this can be call publically
    // we will ensure the stream is configured and ready
    if( nullptr == m_pSkeletonStream )
    {
        // enable a stream
        EnableSkeletonStream();
    }

    // previous call failed, must be memory issue
    if( nullptr == m_pSkeletonStream )
    {
        return E_OUTOFMEMORY; 
    }

    // be sure the sensor is initialized before starting stream
    HRESULT hr = UpdateSensor();
    if( FAILED(hr) )
    {
        ResetDevice();
        return hr;
    }

    return m_pSkeletonStream->StartStream();
}
开发者ID:IsaacGonzalez,项目名称:KinectCommonBridge,代码行数:27,代码来源:KinectSensor.cpp

示例4: switch

HRESULT DrawDevice::TestCooperativeLevel()
{
    if (m_pDevice == NULL)
    {
        return E_FAIL;
    }

    HRESULT hr = S_OK;

    // Check the current status of D3D9 device.
    hr = m_pDevice->TestCooperativeLevel();

    switch (hr)
    {
    case D3D_OK: break;
    case D3DERR_DEVICELOST:
        hr = S_OK;
    case D3DERR_DEVICENOTRESET:
        hr = ResetDevice();
        break;
    default:
        // Some other failure.
        break;
    }

    return hr;
}
开发者ID:n-n-n,项目名称:ImageVideo,代码行数:27,代码来源:DrawDevice.cpp

示例5: UsbSamp_EvtReadWriteWorkItem

VOID
UsbSamp_EvtReadWriteWorkItem(
    _In_ WDFWORKITEM  WorkItem
    )
{
    PWORKITEM_CONTEXT pItemContext;
    NTSTATUS status;

    UsbSamp_DbgPrint(3, ("ReadWriteWorkItem called\n"));

    pItemContext = GetWorkItemContext(WorkItem);

    status = ResetPipe(pItemContext->Pipe);
    if (!NT_SUCCESS(status)) {

        UsbSamp_DbgPrint(1, ("ResetPipe failed 0x%x\n", status));

        status = ResetDevice(pItemContext->Device);
        if (!NT_SUCCESS(status)){

            UsbSamp_DbgPrint(1, ("ResetDevice failed 0x%x\n", status));
        }
    }

    WdfObjectDelete(WorkItem);

    return;
}
开发者ID:340211173,项目名称:Driver,代码行数:28,代码来源:bulkrwr.c

示例6: GetChar

/********************************************************************
* Function:        void GetChar(BYTE * ptrChar)
*
* PreCondition:    UART Setup
*
* Input:		ptrChar - pointer to character received
*
* Output:		
*
* Side Effects:	Puts character into destination pointed to by ptrChar.
*				Clear WDT
*
* Overview:		Receives a character from UART2.  
*
* Note:			None
********************************************************************/
void GetChar(BYTE * ptrChar)
{
	BYTE dummy;
	while(1)
	{	
		asm("clrwdt");					//looping code, so clear WDT
	
		//check for receive errors
		if((UxSTA & 0x000E) != 0x0000)
		{
			dummy = UxRXREG; 			//dummy read to clear FERR/PERR
			UxSTAbits.OERR = 0;			//clear OERR to keep receiving
		}

		//get the data
		if(UxSTAbits.URXDA == 1)
		{
			* ptrChar = UxRXREG;		//get data from UART RX FIFO
			break;
		}

        #ifndef USE_AUTOBAUD
		//if timer expired, jump to user code
		if(IFS0bits.T3IF == 1){
			ResetDevice(userReset.Val);
		}
        #endif
	}//end while(1)
}//end GetChar(BYTE *ptrChar)
开发者ID:garyStofer,项目名称:wifi_wx_station,代码行数:45,代码来源:boot.c

示例7: manager

void manager (struct plc * plc, signed count, signed pause)

{
	while (count--)
	{
		if (_anyset (plc->flags, PLC_VERSION))
		{
			VersionInfo1 (plc);
		}
		if (_anyset (plc->flags, PLC_LOCAL_TRAFFIC))
		{
			Traffic1 (plc);
		}
		if (_anyset (plc->flags, PLC_NETWORK_TRAFFIC))
		{
			NetworkTraffic1 (plc);
		}
		if (_anyset (plc->flags, PLC_NETWORK))
		{
			PhyRates1 (plc);
		}
		if (_anyset (plc->flags, PLC_RESET_DEVICE))
		{
			ResetDevice (plc);
		}
		sleep (pause);
	}
	return;
}
开发者ID:I2SE,项目名称:open-plc-utils,代码行数:29,代码来源:int6krate.c

示例8: TRACE

status_t
AHCIPort::ResetPort(bool forceDeviceReset)
{
    if (!fTestUnitReadyActive)
        TRACE("AHCIPort::ResetPort port %d\n", fIndex);

    // stop DMA engine
    fRegs->cmd &= ~PORT_CMD_ST;
    FlushPostedWrites();

    if (wait_until_clear(&fRegs->cmd, PORT_CMD_CR, 500000) < B_OK) {
        TRACE("AHCIPort::ResetPort port %d error DMA engine doesn't stop\n",
              fIndex);
    }

    bool deviceBusy = fRegs->tfd & (ATA_BSY | ATA_DRQ);

    if (!fTestUnitReadyActive) {
        TRACE("AHCIPort::ResetPort port %d, deviceBusy %d, "
              "forceDeviceReset %d\n", fIndex, deviceBusy, forceDeviceReset);
    }

    if (deviceBusy || forceDeviceReset)
        ResetDevice();

    // start DMA engine
    fRegs->cmd |= PORT_CMD_ST;
    FlushPostedWrites();

    return PostReset();
}
开发者ID:ErfanBagheri,项目名称:haiku,代码行数:31,代码来源:ahci_port.cpp

示例9: assert

// create the instance of the nui sensor
HRESULT KinectSensor::CreateNuiDevice()
{
    assert( m_wsPortID.size() != 0 );

    // check if we can use it
    CComPtr<INuiSensor> pNuiSensor;
    HRESULT hr = NuiCreateSensorById( m_wsPortID.c_str(), &pNuiSensor );
    if( FAILED(hr) )
    {
        return hr;
    }

    // is this one we already have
    if( m_pNuiSensor == pNuiSensor )
    {
        return S_OK;
    }

    assert( nullptr == m_pNuiSensor );

    // if the device is not in use by another process
    if( !IsSensorConflict(pNuiSensor) )
    {
        // start clean
        ResetDevice();

        m_pNuiSensor = pNuiSensor; // auto refcount with CComPtr
    }
    
    // update internal state and return
    return GetNUISensorStatus(true);
}
开发者ID:IsaacGonzalez,项目名称:KinectCommonBridge,代码行数:33,代码来源:KinectSensor.cpp

示例10: OMX_INIT_STRUCT

OMX_ERRORTYPE IpulibRender::PortFormatChanged(OMX_U32 nPortIndex)
{
	OMX_ERRORTYPE ret = OMX_ErrorNone;
	OMX_PARAM_PORTDEFINITIONTYPE sPortDef;
	OMX_BOOL bFmtChanged = OMX_FALSE;

	if(nPortIndex != IN_PORT)
		return OMX_ErrorBadPortIndex;

	OMX_INIT_STRUCT(&sPortDef, OMX_PARAM_PORTDEFINITIONTYPE);
	ports[IN_PORT]->GetPortDefinition(&sPortDef);

	if(sVideoFmt.nFrameWidth != sPortDef.format.video.nFrameWidth)
	{
		sVideoFmt.nFrameWidth = sPortDef.format.video.nFrameWidth;
		bFmtChanged = OMX_TRUE;
	}
	if(sVideoFmt.nFrameHeight != sPortDef.format.video.nFrameHeight)
	{
		sVideoFmt.nFrameHeight = sPortDef.format.video.nFrameHeight;
		bFmtChanged = OMX_TRUE;
	}
	if(sVideoFmt.eColorFormat != sPortDef.format.video.eColorFormat)
	{
		sVideoFmt.eColorFormat = sPortDef.format.video.eColorFormat;
		bFmtChanged = OMX_TRUE;
	}

	if(bFmtChanged == OMX_TRUE)
		ResetDevice();

	return ret;
}
开发者ID:hicks0074,项目名称:freescale_omx_framework,代码行数:33,代码来源:IpulibRender_mx6x.cpp

示例11: Reset

/** @brief Reset service
 *
 * @param instance
 * @param message_router_request
 * @param message_router_response
 * @returns Currently always kEipOkSend is returned
 */
static EipStatus Reset(CipInstance *instance, /* pointer to instance*/
                       CipMessageRouterRequest *message_router_request, /* pointer to message router request*/
                       CipMessageRouterResponse *message_router_response) /* pointer to message router response*/
{
  (void) instance;

  EipStatus eip_status = kEipStatusOkSend;

  message_router_response->reply_service = (0x80
      | message_router_request->service);
  message_router_response->size_of_additional_status = 0;
  message_router_response->general_status = kCipErrorSuccess;

  if (message_router_request->data_length == 1) {
    switch (message_router_request->data[0]) {
      case 0: /* Reset type 0 -> emulate device reset / Power cycle */
        if (kEipStatusError == ResetDevice()) {
          message_router_response->general_status = kCipErrorInvalidParameter;
        }
        break;

      case 1: /* Reset type 1 -> reset to device settings */
        if (kEipStatusError == ResetDeviceToInitialConfiguration()) {
          message_router_response->general_status = kCipErrorInvalidParameter;
        }
        break;

        /* case 2: Not supported Reset type 2 -> Return to factory defaults except communications parameters */

      default:
        message_router_response->general_status = kCipErrorInvalidParameter;
        break;
    }
  } else  /*TODO: Should be if (pa_stMRRequest->DataLength == 0)*/
  {
    /* The same behavior as if the data value given would be 0
     emulate device reset */

    if (kEipStatusError == ResetDevice()) {
      message_router_response->general_status = kCipErrorInvalidParameter;
    } else {
      /* eip_status = EIP_OK; */
    }
  }
  message_router_response->data_length = 0;
  return eip_status;
}
开发者ID:pogojotz,项目名称:OpENer,代码行数:54,代码来源:cipidentity.c

示例12: main

/*
  Checks for commandline args, intializes globals, then  begins code download.
*/
int main(int argc, char **argv) {

   nf2.device_name = DEFAULT_IFACE;

   processArgs(argc, argv);

   if (check_iface(&nf2))
   {
	   exit(1);
   }
   if (openDescriptor(&nf2))
   {
      exit(1);
   }

   if (strncmp(log_file_name, "stdout",6)) {

      if ((log_file = fopen(log_file_name, "w")) == NULL) {
	 printf("Error: unable to open logfile %s for writing.\n",
		log_file_name);
	 exit(1);
      }
   }
   else
      log_file = stdout;

   InitGlobals();

   BeginCodeDownload(bin_file_name);

   if (!cpci_reprog)
      ResetDevice();

   /* reset the PHYs */
   NF2_WR32(MDIO_0_CONTROL_REG, 0x8000);
   NF2_WR32(MDIO_1_CONTROL_REG, 0x8000);
   NF2_WR32(MDIO_2_CONTROL_REG, 0x8000);
   NF2_WR32(MDIO_3_CONTROL_REG, 0x8000);

   /* wait until the resets have been completed */
   usleep(100);

   if (intr_enable)
   {
      /* PHY interrupt mask off for link status change */
      NF2_WR32(MDIO_0_INTERRUPT_MASK_REG, 0xfffd);
      NF2_WR32(MDIO_1_INTERRUPT_MASK_REG, 0xfffd);
      NF2_WR32(MDIO_2_INTERRUPT_MASK_REG, 0xfffd);
      NF2_WR32(MDIO_3_INTERRUPT_MASK_REG, 0xfffd);
   }

   VerifyDevInfo();

   fclose(log_file);

   closeDescriptor(&nf2);

   return SUCCESS;
}
开发者ID:1573472562,项目名称:netfpga,代码行数:62,代码来源:nf_download.c

示例13: OnInitDialog

BOOL CROIDlg::OnInitDialog()
{
	CDialog::OnInitDialog();
	if(ResetDevice(m_pDevice, TRUE)){
		UpdateControls();
		return TRUE;
	}
	return FALSE;
}
开发者ID:yiwuzhi,项目名称:ControlSystem,代码行数:9,代码来源:ROIDlg.cpp

示例14: OnInitDialog

BOOL CExposeDlg::OnInitDialog()
{
	__super::OnInitDialog();
	if(ResetDevice(m_pDevice, TRUE)){
		UpdateControls();
		return TRUE;
	}
	return FALSE;
}
开发者ID:githubcjl,项目名称:uVision_cjl,代码行数:9,代码来源:ExposeDlg.cpp

示例15: ResetAccount

void NOnlineInfo::ResetAll()
{
	ResetAccount();
	ResetDevice();
	ResetChannels();
	ResetChannelMigration();
	ResetOnline();
	ResetSceneMode();
	ResetMatch();
	ResetURLs();
}
开发者ID:icywind,项目名称:TCCommTest,代码行数:11,代码来源:OnlineInfo.cpp


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