提交 3a95681a 编写于 作者: W wu

modify request direction for API test

Signed-off-by: Nwu <wuzhimin8@huawei.com>
上级 01f45a01
......@@ -77,7 +77,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () {
if (endpoint.direction == usb.USB_REQUEST_DIR_TO_DEVICE) {
testParam.maxOutSize = endpoint.maxPacketSize;
testParam.outEndpoint = endpoint;
} else if (endpoint.direction == (usb.USB_REQUEST_DIR_FROM_DEVICE << 7)) {
} else if (endpoint.direction == usb.USB_REQUEST_DIR_FROM_DEVICE) {
testParam.maxInSize = endpoint.maxPacketSize;
testParam.inEndpoint = endpoint
}
......@@ -437,7 +437,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () {
}
var timeout = 5000;
var controlParam = getTransferParam(6, usb.USB_REQUEST_TARGET_DEVICE, (usb.USB_REQUEST_DIR_FROM_DEVICE << 7)
var controlParam = getTransferParam(6, usb.USB_REQUEST_TARGET_DEVICE, (usb.USB_REQUEST_DIR_FROM_DEVICE)
| (usb.USB_REQUEST_TYPE_STANDARD << 5) | (usb.USB_REQUEST_TARGET_DEVICE & 0x1f), (2 << 8), 0)
callControlTransfer(testParam.pip, controlParam, timeout, 'SUB_USB_JS_0540 GetDescriptor')
})
......@@ -461,7 +461,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () {
}
var timeout = 5000;
var controlParam = getTransferParam(0, usb.USB_REQUEST_TARGET_DEVICE, (usb.USB_REQUEST_DIR_FROM_DEVICE << 7)
var controlParam = getTransferParam(0, usb.USB_REQUEST_TARGET_DEVICE, (usb.USB_REQUEST_DIR_FROM_DEVICE)
| (usb.USB_REQUEST_TYPE_STANDARD << 5) | (usb.USB_REQUEST_TARGET_DEVICE & 0x1f), 0, 0)
callControlTransfer(testParam.pip, controlParam, timeout, 'SUB_USB_JS_0550 GetStatus')
})
......@@ -485,7 +485,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () {
}
var timeout = 5000;
var controlParam = getTransferParam(8, usb.USB_REQUEST_TARGET_DEVICE, (usb.USB_REQUEST_DIR_FROM_DEVICE << 7)
var controlParam = getTransferParam(8, usb.USB_REQUEST_TARGET_DEVICE, (usb.USB_REQUEST_DIR_FROM_DEVICE)
| (usb.USB_REQUEST_TYPE_STANDARD << 5) | (usb.USB_REQUEST_TARGET_DEVICE & 0x1f), 0, 0)
callControlTransfer(testParam.pip, controlParam, timeout, 'SUB_USB_JS_0560 GetConfiguration')
})
......@@ -509,7 +509,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () {
}
var timeout = 5000;
var controlParam = getTransferParam(10, usb.USB_REQUEST_TARGET_INTERFACE, (usb.USB_REQUEST_DIR_FROM_DEVICE << 7)
var controlParam = getTransferParam(10, usb.USB_REQUEST_TARGET_INTERFACE, (usb.USB_REQUEST_DIR_FROM_DEVICE)
| (usb.USB_REQUEST_TYPE_STANDARD << 5) | (usb.USB_REQUEST_TARGET_INTERFACE & 0x1f), 0, 1)
callControlTransfer(testParam.pip, controlParam, timeout, 'SUB_USB_JS_0570 GetInterface')
})
......@@ -533,7 +533,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () {
}
var timeout = 5000;
var controlParam = getTransferParam(1, usb.USB_REQUEST_TARGET_DEVICE, (usb.USB_REQUEST_DIR_TO_DEVICE << 7)
var controlParam = getTransferParam(1, usb.USB_REQUEST_TARGET_DEVICE, (usb.USB_REQUEST_DIR_TO_DEVICE)
| (usb.USB_REQUEST_TYPE_STANDARD << 5) | (usb.USB_REQUEST_TARGET_DEVICE & 0x1f), 0, 0)
callControlTransfer(testParam.pip, controlParam, timeout, 'SUB_USB_JS_0580 ClearFeature')
})
......@@ -557,7 +557,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () {
}
var timeout = 5000;
var controlParam = getTransferParam(255, usb.USB_REQUEST_TARGET_INTERFACE, (usb.USB_REQUEST_DIR_FROM_DEVICE << 7)
var controlParam = getTransferParam(255, usb.USB_REQUEST_TARGET_INTERFACE, (usb.USB_REQUEST_DIR_FROM_DEVICE)
| (usb.USB_REQUEST_TYPE_STANDARD << 5) | (usb.USB_REQUEST_TARGET_INTERFACE & 0x1f), (2 << 8), 0)
callControlTransfer(testParam.pip, controlParam, timeout, 'SUB_USB_JS_0590 ClearFeature')
})
......@@ -581,7 +581,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () {
}
var timeout = 5000;
var controlParam = getTransferParam(255, usb.USB_REQUEST_TARGET_ENDPOINT, (usb.USB_REQUEST_DIR_TO_DEVICE << 7)
var controlParam = getTransferParam(255, usb.USB_REQUEST_TARGET_ENDPOINT, (usb.USB_REQUEST_DIR_TO_DEVICE)
| (usb.USB_REQUEST_TYPE_CLASS << 5) | (usb.USB_REQUEST_TARGET_ENDPOINT & 0x1f), (2 << 8), 0)
callControlTransfer(testParam.pip, controlParam, timeout, 'SUB_USB_JS_0600 ClearFeature')
})
......@@ -605,7 +605,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () {
}
var timeout = 5000;
var controlParam = getTransferParam(255, usb.USB_REQUEST_TARGET_OTHER, (usb.USB_REQUEST_DIR_TO_DEVICE << 7)
var controlParam = getTransferParam(255, usb.USB_REQUEST_TARGET_OTHER, (usb.USB_REQUEST_DIR_TO_DEVICE)
| (usb.USB_REQUEST_TYPE_VENDOR << 5) | (usb.USB_REQUEST_TARGET_OTHER & 0x1f), (2 << 8), 0)
callControlTransfer(testParam.pip, controlParam, timeout, 'SUB_USB_JS_0610 ClearFeature')
})
......@@ -629,7 +629,7 @@ describe('UsbDevicePipeJsFunctionsTest', function () {
}
var timeout = 5000;
var controlParam = getTransferParam(255, usb.USB_REQUEST_TARGET_OTHER, (usb.USB_REQUEST_DIR_TO_DEVICE << 7)
var controlParam = getTransferParam(255, usb.USB_REQUEST_TARGET_OTHER, (usb.USB_REQUEST_DIR_TO_DEVICE)
| (usb.USB_REQUEST_TYPE_CLASS << 5) | (usb.USB_REQUEST_TARGET_OTHER & 0x1f), 0, 0)
callControlTransfer(testParam.pip, controlParam, timeout, 'SUB_USB_JS_0620 ClearFeature')
})
......
......@@ -77,7 +77,7 @@ describe('UsbDevicePipeJsFunctionsTestEx', function () {
if (endpoint.direction == usb.USB_REQUEST_DIR_TO_DEVICE) {
testParam.outEndpoint = endpoint;
testParam.maxOutSize = endpoint.maxPacketSize;
} else if (endpoint.direction == (usb.USB_REQUEST_DIR_FROM_DEVICE << 7)) {
} else if (endpoint.direction == usb.USB_REQUEST_DIR_FROM_DEVICE) {
testParam.inEndpoint = endpoint
testParam.maxInSize = endpoint.maxPacketSize;
}
......
......@@ -452,7 +452,7 @@ describe('UsbDevicePipeJsFunctionsTestA', function () {
}
var timeout = 5000;
var controlParam = getTransferParam(6, (usb.USB_REQUEST_DIR_FROM_DEVICE << 7)
var controlParam = getTransferParam(6, (usb.USB_REQUEST_DIR_FROM_DEVICE)
| (usb.USB_REQUEST_TYPE_STANDARD << 5) | (usb.USB_REQUEST_TARGET_DEVICE & 0x1f), (2 << 8), 0)
callControlTransfer(testParam.pip, controlParam, timeout, 'SUB_USB_JS_0540 GetDescriptor')
})
......@@ -476,7 +476,7 @@ describe('UsbDevicePipeJsFunctionsTestA', function () {
}
var timeout = 5000;
var controlParam = getTransferParam(0, (usb.USB_REQUEST_DIR_FROM_DEVICE << 7)
var controlParam = getTransferParam(0, (usb.USB_REQUEST_DIR_FROM_DEVICE)
| (usb.USB_REQUEST_TYPE_STANDARD << 5) | (usb.USB_REQUEST_TARGET_DEVICE & 0x1f), 0, 0)
callControlTransfer(testParam.pip, controlParam, timeout, 'SUB_USB_JS_0550 GetStatus')
})
......@@ -500,7 +500,7 @@ describe('UsbDevicePipeJsFunctionsTestA', function () {
}
var timeout = 5000;
var controlParam = getTransferParam(8, (usb.USB_REQUEST_DIR_FROM_DEVICE << 7)
var controlParam = getTransferParam(8, (usb.USB_REQUEST_DIR_FROM_DEVICE)
| (usb.USB_REQUEST_TYPE_STANDARD << 5) | (usb.USB_REQUEST_TARGET_DEVICE & 0x1f), 0, 0)
callControlTransfer(testParam.pip, controlParam, timeout, 'SUB_USB_JS_0560 GetConfiguration')
})
......@@ -524,7 +524,7 @@ describe('UsbDevicePipeJsFunctionsTestA', function () {
}
var timeout = 5000;
var controlParam = getTransferParam(10, (usb.USB_REQUEST_DIR_FROM_DEVICE << 7)
var controlParam = getTransferParam(10, (usb.USB_REQUEST_DIR_FROM_DEVICE)
| (usb.USB_REQUEST_TYPE_STANDARD << 5) | (usb.USB_REQUEST_TARGET_INTERFACE & 0x1f), 0, 1)
callControlTransfer(testParam.pip, controlParam, timeout, 'SUB_USB_JS_0570 GetInterface')
})
......@@ -548,7 +548,7 @@ describe('UsbDevicePipeJsFunctionsTestA', function () {
}
var timeout = 5000;
var controlParam = getTransferParam(1, (usb.USB_REQUEST_DIR_TO_DEVICE << 7)
var controlParam = getTransferParam(1, (usb.USB_REQUEST_DIR_TO_DEVICE)
| (usb.USB_REQUEST_TYPE_STANDARD << 5) | (usb.USB_REQUEST_TARGET_DEVICE & 0x1f), 0, 0)
callControlTransfer(testParam.pip, controlParam, timeout, 'SUB_USB_JS_0580 ClearFeature')
})
......@@ -572,7 +572,7 @@ describe('UsbDevicePipeJsFunctionsTestA', function () {
}
var timeout = 5000;
var controlParam = getTransferParam(255, (usb.USB_REQUEST_DIR_FROM_DEVICE << 7)
var controlParam = getTransferParam(255, (usb.USB_REQUEST_DIR_FROM_DEVICE)
| (usb.USB_REQUEST_TYPE_STANDARD << 5) | (usb.USB_REQUEST_TARGET_INTERFACE & 0x1f), (2 << 8), 0)
callControlTransfer(testParam.pip, controlParam, timeout, 'SUB_USB_JS_0590 ClearFeature')
})
......@@ -596,7 +596,7 @@ describe('UsbDevicePipeJsFunctionsTestA', function () {
}
var timeout = 5000;
var controlParam = getTransferParam(255, (usb.USB_REQUEST_DIR_TO_DEVICE << 7)
var controlParam = getTransferParam(255, (usb.USB_REQUEST_DIR_TO_DEVICE)
| (usb.USB_REQUEST_TYPE_CLASS << 5) | (usb.USB_REQUEST_TARGET_ENDPOINT & 0x1f), (2 << 8), 0)
callControlTransfer(testParam.pip, controlParam, timeout, 'SUB_USB_JS_0600 ClearFeature')
})
......@@ -620,7 +620,7 @@ describe('UsbDevicePipeJsFunctionsTestA', function () {
}
var timeout = 5000;
var controlParam = getTransferParam(255, (usb.USB_REQUEST_DIR_TO_DEVICE << 7)
var controlParam = getTransferParam(255, (usb.USB_REQUEST_DIR_TO_DEVICE)
| (usb.USB_REQUEST_TYPE_VENDOR << 5) | (usb.USB_REQUEST_TARGET_OTHER & 0x1f), (2 << 8), 0)
callControlTransfer(testParam.pip, controlParam, timeout, 'SUB_USB_JS_0610 ClearFeature')
})
......@@ -644,7 +644,7 @@ describe('UsbDevicePipeJsFunctionsTestA', function () {
}
var timeout = 5000;
var controlParam = getTransferParam(255, (usb.USB_REQUEST_DIR_TO_DEVICE << 7)
var controlParam = getTransferParam(255, (usb.USB_REQUEST_DIR_TO_DEVICE)
| (usb.USB_REQUEST_TYPE_CLASS << 5) | (usb.USB_REQUEST_TARGET_OTHER & 0x1f), 0, 0)
callControlTransfer(testParam.pip, controlParam, timeout, 'SUB_USB_JS_0620 ClearFeature')
})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册