Skip to content

Commit 7f3cdfc

Browse files
committed
Add UVC camera function profile
1 parent db0ead5 commit 7f3cdfc

File tree

6 files changed

+38
-3
lines changed

6 files changed

+38
-3
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Following USB gadgets are integrated:
1010
* Keyboard & Mouse (/dev/hidg0, /dev/hidg1)
1111
* FIDO CTAP (/dev/hidg0; for WebAuthn)
1212
* CCID (/dev/ccid_ctrl, /dev/ccid_bulk)
13+
* UVC camera (/dev/video?)
1314

1415
USB Gadget Tool requires root permissions and a Kernel with ConfigFS support.
1516
Currently the app only enables the USB Gadget. For the usage of these device endpoints (e.g. /dev/hidg0) further apps are required (see Use-Cases).

app/src/main/assets/usbFunctionProfiles/CCID

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22

3-
GADGET="keyboard"
3+
GADGET="ccid"
44
GADGET_PATH="____gadgetPath____"
55

66
cd $GADGET_PATH/configs/

app/src/main/assets/usbFunctionProfiles/CTAP

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22

3-
GADGET="keyboard"
3+
GADGET="ctap"
44
GADGET_PATH="____gadgetPath____"
55

66
cd $GADGET_PATH/configs/

app/src/main/assets/usbFunctionProfiles/Mouse

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22

3-
GADGET="keyboard"
3+
GADGET="mouse"
44
GADGET_PATH="____gadgetPath____"
55

66
cd $GADGET_PATH/configs/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/sh
2+
3+
GADGET="camera"
4+
GADGET_PATH="____gadgetPath____"
5+
6+
cd $GADGET_PATH/configs/
7+
CONFIG_PATH="$GADGET_PATH/configs/`ls -1 | head -1`/"
8+
STRINGS_PATH="$GADGET_PATH/strings/0x409/"
9+
FUNCTION_PATH="$GADGET_PATH/functions/uvc.usb0"
10+
11+
mkdir -p $FUNCTION_PATH/control/header/h
12+
cd $FUNCTION_PATH
13+
14+
ln -s control/header/h control/class/fs
15+
16+
mkdir -p $FUNCTION_PATH/streaming/mjpeg/m/720p
17+
cd $FUNCTION_PATH/streaming/mjpeg/m/720p
18+
echo 5000000 > dwFrameInterval
19+
echo 1280 > wWidth
20+
echo 720 > wHeight
21+
echo 29491200 > dwMinBitRate
22+
echo 29491200 > dwMaxBitRate
23+
echo 1843200 > dwMaxVideoFrameBufferSize
24+
25+
mkdir -p $FUNCTION_PATH/streaming/header/h
26+
cd $FUNCTION_PATH/streaming/header/h
27+
ln -s ../../mjpeg/m
28+
cd ../../class/fs
29+
ln -s ../../header/h
30+
cd ../../class/hs
31+
ln -s ../../header/h
32+
33+
ln -s $FUNCTION_PATH $CONFIG_PATH/uvc.usb0

fastlane/metadata/android/en-US/full_description.txt

+1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ Following USB gadgets are integrated:
55
* Keyboard & Mouse (<code>/dev/hidg0</code>, <code>/dev/hidg1</code>)
66
* FIDO CTAP (<code>/dev/hidg0</code>; for WebAuthn)
77
* CCID (<code>/dev/ccid_ctrl</code>, <code>/dev/ccid_bulk</code>)
8+
* UVC camera (<code>/dev/video?</code>)
89

910
<i>USB Gadget Tool</i> requires root permissions and a Kernel with ConfigFS support. Currently the app only enables the USB Gadget. For the usage of these device endpoints (e.g. <code>/dev/hidg0</code>) further apps are required.

0 commit comments

Comments
 (0)