AG903ライブラリリファレンス
内容インデックスホーム
前へ上へ次へ
Usbh_Cdc_StopIntIN 関数

Interrupt IN 転送を停止する

Syntax
C++
uhs_status_t Usbh_Cdc_StopIntIN(void* pContext);
引数 
説明 
void* pContext 
[in] コミュニケーションデバイス識別へのポインタ 

Interrupt IN 転送の停止結果

返値の詳細 
説明 
成功 
パラメータエラー 
初期化済みでない、デバイス情報不一致 
デバイスが接続されていない 
リソース獲得失敗 
使用準備が出来ていない 
非サポートデバイス 
オープンしていない 
要求が既に停止済み 
データ転送失敗 

Interrupt Interface での Interrupt IN 転送を停止します。 

pContext は、接続コールバックにてコミュニケーションデバイスクラスドライバから ユーザアプリケーションへ渡される識別子情報です。 

ユーザアプリケーションは、この識別子で複数台のコミュニケーションデバイスを管理 して下さい。識別子情報に対してアクセスする事は禁止です。 

 

通知用コールバックからの呼出しは禁止です。 

本関数の呼び出しにより、インタラプトINの通信エラーが発生する場合があります。 (停止による発生なので特に処理は不要です。) 

Usbh_Cdc_Open APIを実施後に使用して下さい。 実施前に呼び出した場合は、エラーを返却します。 

1: uhs_status_t Usbh_Cdc_StopIntIN(void* pContext) 2: { 3: PCDC_DEVICE pCdcDevice; 4: uhs_status_t nRetvalResorce; 5: CDC_FUNC_STATUS nRetval; 6: uhs_ubit8_t u8CntDeviceId; 7: uhs_status_t nRetStatus; 8: 9: 10: 11: 12: if( pContext == NULL ) { 13: DIAPI_CDC_REPORT_SUMMARY( USBCDC_LOG_SYS_PARAM_ERROR ); 14: return( USBCDC_API_PARAM_ERROR ); 15: } 16: 17: 18: 19: 20: if( g_pCdcDriver == NULL ) { 21: DIAPI_CDC_REPORT_SUMMARY( USBCDC_LOG_NOT_INIT ); 22: return( USBCDC_API_SYS_SYSTEM_ERROR ); 23: } 24: 25: 26: 27: 28: 29: 30: nRetStatus = Usbh_Cdc_CheckDeviceStatus(pContext, &pCdcDevice, &u8CntDeviceId, ID_API_DET); 31: if(nRetStatus != USBCDC_API_SUCCESS){ 32: DIAPI_CDC_REPORT_SUMMARY( USBCDC_LOG_SYS_SYSTEM_ERROR ); 33: return(nRetStatus); 34: } 35: 36: 37: 38: 39: nRetvalResorce = CdcUtils_AcquisitionSemaphore(pCdcDevice->pIntInExecuteLock, WAITFOREVER); 40: if( nRetvalResorce != TRUE ){ 41: 42: 43: 44: (void)CdcUtils_ReleaseSemaphore( g_pCdcDriver->pApiDetAccessLock[u8CntDeviceId] ); 45: return( USBCDC_API_SYS_OUT_OF_RESOURCE ); 46: } 47: 48: 49: 50: 51: if( (pCdcDevice->nDeviceStat == CDC_DEVICE_STAT_CONNECTING) || 52: (pCdcDevice->nDeviceStat == CDC_DEVICE_STAT_REGIST) ) { 53: 54: 55: 56: (void)CdcUtils_ReleaseSemaphore( pCdcDevice->pIntInExecuteLock ); 57: (void)CdcUtils_ReleaseSemaphore( g_pCdcDriver->pApiDetAccessLock[u8CntDeviceId] ); 58: DIAPI_CDC_REPORT_SUMMARY( USBCDC_LOG_NOT_USE ); 59: return( USBCDC_API_NOT_READY ); 60: } 61: else if( pCdcDevice->nDeviceStat == CDC_DEVICE_STAT_NO_SUPPORT ) { 62: 63: 64: 65: (void)CdcUtils_ReleaseSemaphore( pCdcDevice->pIntInExecuteLock ); 66: (void)CdcUtils_ReleaseSemaphore( g_pCdcDriver->pApiDetAccessLock[u8CntDeviceId] ); 67: 68: DIAPI_CDC_REPORT_SUMMARY( USBCDC_LOG_NO_SUPPORT ); 69: return( USBCDC_API_NO_SUPPORT ); 70: } 71: else { 72: ; 73: } 74: 75: 76: if( pCdcDevice->pIntInBuff->isIntINUserFlag == FALSE ) { 77: 78: 79: (void)CdcUtils_ReleaseSemaphore( pCdcDevice->pIntInExecuteLock ); 80: 81: 82: 83: (void)CdcUtils_ReleaseSemaphore( g_pCdcDriver->pApiDetAccessLock[u8CntDeviceId] ); 84: 85: 86: DIAPI_CDC_REPORT_SUMMARY( USBCDC_LOG_ALREADY_STOP_INTIN ); 87: return( USBCDC_API_ALREADY_STOP_INTIN ); 88: } 89: 90: 91: 92: 93: nRetval = Usbh_Cdc_StopIntINMsg(pCdcDevice); 94: if(nRetval != CDC_FUNC_STATUS_SUCCESS ) { 95: 96: 97: (void)CdcUtils_ReleaseSemaphore( pCdcDevice->pIntInExecuteLock ); 98: 99: 100: 101: (void)CdcUtils_ReleaseSemaphore( g_pCdcDriver->pApiDetAccessLock[u8CntDeviceId] ); 102: 103: 104: DIAPI_CDC_REPORT_SUMMARY( USBCDC_LOG_FAILED_INTERRUPT ); 105: return( USBCDC_API_TRANS_INT_FAILED ); 106: } 107: 108: 109: 110: 111: pCdcDevice->pIntInBuff->isIntINUserFlag = FALSE; 112: 113: 114: 115: 116: nRetvalResorce = CdcUtils_ReleaseSemaphore( pCdcDevice->pIntInExecuteLock ); 117: if(nRetvalResorce != TRUE){ 118: 119: 120: (void)CdcUtils_ReleaseSemaphore( g_pCdcDriver->pApiDetAccessLock[u8CntDeviceId] ); 121: 122: 123: DIAPI_CDC_REPORT_SUMMARY( USBCDC_LOG_SYS_OUT_OF_RESOURCE ); 124: return( USBCDC_API_SYS_OUT_OF_RESOURCE ); 125: } 126: 127: 128: 129: 130: nRetvalResorce = CdcUtils_ReleaseSemaphore( g_pCdcDriver->pApiDetAccessLock[u8CntDeviceId] ); 131: if(nRetvalResorce != TRUE){ 132: 133: DIAPI_CDC_REPORT_SUMMARY( USBCDC_LOG_SYS_OUT_OF_RESOURCE ); 134: return( USBCDC_API_SYS_OUT_OF_RESOURCE ); 135: } 136: 137: return( USBCDC_API_SUCCESS ); 138: }
Copyright (c) 2017-2025 Axell Corporation. All rights reserved.