diff --git a/usb/usb_standard/src/main/js/test/UsbDevicePipeJsunit.test.js b/usb/usb_standard/src/main/js/test/UsbDevicePipeJsunit.test.js index aecb261972be8eec46e264bb51918b2b82f0f32d..f56e023419dbb295de68dd0b2e4a72f590b718da 100644 --- a/usb/usb_standard/src/main/js/test/UsbDevicePipeJsunit.test.js +++ b/usb/usb_standard/src/main/js/test/UsbDevicePipeJsunit.test.js @@ -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') }) diff --git a/usb/usb_standard/src/main/js/test/UsbDevicePipeJsunitEx.test.js b/usb/usb_standard/src/main/js/test/UsbDevicePipeJsunitEx.test.js index 344e96d5864487080d4b4736131c391f7ff1ec8a..cb5c3fb42ae383e89998d5c5352fcb4b30e462f9 100644 --- a/usb/usb_standard/src/main/js/test/UsbDevicePipeJsunitEx.test.js +++ b/usb/usb_standard/src/main/js/test/UsbDevicePipeJsunitEx.test.js @@ -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; } diff --git a/usb/usb_standard/src/main/js/test/UsbDevicePipeJsunit_A.test.js b/usb/usb_standard/src/main/js/test/UsbDevicePipeJsunit_A.test.js index ca03d2c486d0cc530b9e00bdd442933fb5ba7342..77b4dc02681537d02e9bd824ce24efcc4412298b 100644 --- a/usb/usb_standard/src/main/js/test/UsbDevicePipeJsunit_A.test.js +++ b/usb/usb_standard/src/main/js/test/UsbDevicePipeJsunit_A.test.js @@ -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') })