Commit 1afb527 1 parent 926432c commit 1afb527 Copy full SHA for 1afb527
File tree 4 files changed +24
-3
lines changed
recipes-devtools/android-tools/android-tools
recipes-support/arduino-ootb
4 files changed +24
-3
lines changed Original file line number Diff line number Diff line change 1
1
[Unit]
2
- Description =Android Debug Bridge & Usb ACM
2
+ Description =Android Debug Bridge & Usb NCM
3
3
ConditionPathExists =/sys/class/typec/port0/data_role
4
4
After =network-pre.target dbus.service
5
5
Before =android-system.service
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ start()
35
35
36
36
# populate config, optional
37
37
mkdir configs/c.1/strings/0x409
38
- echo \" adb+acm\" > configs/c.1/strings/0x409/configuration
38
+ echo \" adb+acm+ncm \" > configs/c.1/strings/0x409/configuration
39
39
echo 900 > configs/c.1/MaxPower
40
40
41
41
# create a generic ffs for adb
@@ -44,6 +44,12 @@ start()
44
44
# create the acm (serial) function
45
45
mkdir functions/acm.GS0
46
46
47
+ # create the ncm function
48
+ mkdir functions/ncm.usb0
49
+
50
+ # assign ncm function to configuration
51
+ ln -s functions/ncm.usb0/ configs/c.1
52
+
47
53
# assign acm function to configuration
48
54
ln -s functions/acm.GS0 configs/c.1
49
55
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ RDEPENDS:${PN} += "systemd"
7
7
SRC_URI = " \
8
8
file://connection-status-led.timer \
9
9
file://connection-status-led.service \
10
+ file://ncm-network.service \
10
11
file://secure-device.service \
11
12
file://create-docker-envfile.service \
12
13
file://offline-update.service \
@@ -15,12 +16,13 @@ SRC_URI = " \
15
16
16
17
inherit systemd
17
18
18
- SYSTEMD_SERVICE :${PN} = "connection-status-led.timer connection-status-led.service secure-device.service create-docker-envfile.service offline-update.service"
19
+ SYSTEMD_SERVICE :${PN} = "connection-status-led.timer connection-status-led.service ncm-network.service secure-device.service create-docker-envfile.service offline-update.service"
19
20
20
21
do_install () {
21
22
install -d ${D}${systemd_system_unitdir}
22
23
install -m 0644 ${WORKDIR} /connection -status -led . timer ${D}${systemd_system_unitdir} /
23
24
install -m 0644 ${WORKDIR} /connection -status -led . service ${D}${systemd_system_unitdir} /
25
+ install -m 0644 ${WORKDIR} /ncm -network . service ${D}${systemd_system_unitdir} /
24
26
install -m 0644 ${WORKDIR} /secure -device . service ${D}${systemd_system_unitdir} /
25
27
install -m 0644 ${WORKDIR} /create -docker -envfile . service ${D}${systemd_system_unitdir} /
26
28
install -m 0644 ${WORKDIR} /offline -update . service ${D}${systemd_system_unitdir} /
Original file line number Diff line number Diff line change
1
+ [Unit]
2
+ Description =Configure link-local connection on usb ncm interface
3
+ BindsTo =sys-subsystem-net-devices-usb0.device
4
+ After =android-tools-adbd.service sys-subsystem-net-devices-usb0.device
5
+
6
+ [Service]
7
+ Type =simple
8
+ RemainAfterExit =yes
9
+ ExecStart =/bin/sh -c '/usr/bin/nmcli c delete usbncm; /usr/bin/nmcli c add type ethernet ifname usb0 ipv4.method shared ipv4.addresses 192.168.224.1/24 ipv6.method disabled con-name usbncm && /usr/bin/nmcli c up usbncm'
10
+ ExecStop =/bin/sh -c '/usr/bin/nmcli c down usbncm && /usr/bin/nmcli c delete usbncm'
11
+
12
+ [Install]
13
+ WantedBy =usb-gadget.target
You can’t perform that action at this time.
0 commit comments