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

GET_INTERFACE を発行

Syntax
C++
uhs_status_t Usbh_Api_GetInterface(struct usb_control_block* ucb, struct usbd_usb_deviceinfo* usbdev, const uhs_ubit16_t wIndex, void * buf);
引数 
説明 
struct usb_control_block* ucb 
[in] USB コントロールブロック 
struct usbd_usb_deviceinfo* usbdev 
[in] USB デバイス構造体 
const uhs_ubit16_t wIndex 
[in] インターフェース番号 
void * buf 
[out] オルタネートインターフェース番号(1byte)を取得するバッファへのポインタ 

GET_INTERFACE の発行結果

返値の詳細 
説明 
正常終了 
状態異常 
パラメータ異常 
リソース不足 
USBリクエストの受付に失敗(キューフル等) 

GET_INTERFACE の発行を行います。

buf は非キャッシュ領域を指定して下さい。 

CALLBACK関数内から本関数を呼び出すと、転送処理は行われますがタイムアウトによるエラーリターンします。 

SUSPEND/RESUME中に呼び出すとエラーリターンします。

1: uhs_status_t Usbh_Api_GetInterface( 2: struct usb_control_block* ucb, 3: struct usbd_usb_deviceinfo* usbdev, 4: const uhs_ubit16_t wIndex, 5: void *buf 6: ) 7: { 8: uhs_status_t retval = UDI_OK; 9: 10: 11: if( Usbh_susres_get_state() != USBH_SUSRES_STS_IDLE ){ 12: uhs_debug_print (DBG_ERR, ("ERROR : Don't Call Current State!!")); 13: CORE_REPORT_ERROR( USBC_ILLEGAL_ERROR ); 14: return UDI_STAT_INVALID_STATE; 15: } 16: 17: if (( ucb == NULL ) || ( usbdev == NULL ) || ( buf == NULL )) { 18: CORE_REPORT_ERROR( USBC_INVALID_PARAMETER ); 19: return UDI_STAT_DATA_ERROR; 20: } 21: 22: 23: Usbh_Api_FixupPipeInfo( 24: &ucb->pipe, 25: ucb->usbdev->usbdev_DevNum, 26: USB_DEFAULT_EP_NUM, 27: USB_PACKETID_IN, 28: USB_TRANS_CONTROL, 29: ucb->usbdev->usbdev_EpMaxpktOut[USB_DEFAULT_EP_NUM] 30: ); 31: 32: retval = Usbh_Api_SyncControlMsg( 33: ucb, 34: USB_DEVICE_REQUEST_TYPE_DEVICE_TO_HOST | 35: USB_DEVICE_REQUEST_TYPE_STANDARD_TYPE | 36: USB_DEVICE_REQUEST_TYPE_INTERFACE_RECIPIENT, 37: USB_DEVICE_REQUEST_GET_INTERFACE, 38: 0, 39: 0, 40: wIndex & 0xffU, 41: wIndex >> 8, 42: buf, 43: 1 ); 44: 45: if( retval != UDI_OK) { 46: CORE_REPORT_WARNING(USBC_ILLEGAL_ERROR); 47: } 48: 49: return retval; 50: }
Copyright (c) 2017-2025 Axell Corporation. All rights reserved.