Skip to content

Commit 355742b

Browse files
zhhyu7Alan Carvalho de Assis
authored andcommitted
Documentation/sim: add cdcmbim examples
We can send and receive data through device files nuttx: /dev/cdc-wdm2 linux: /dev/cdc-wdm1 The number suffix depends on the actual situation. And send and receive messages through network cards. Signed-off-by: zhanghongyu <[email protected]>
1 parent f55270f commit 355742b

File tree

1 file changed

+41
-0
lines changed
  • Documentation/platforms/sim/sim/boards/sim

1 file changed

+41
-0
lines changed

Documentation/platforms/sim/sim/boards/sim/index.rst

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1669,6 +1669,7 @@ This is a configuration with sim usbdev support.
16691669
conn0: adb & rndis
16701670
conn1: cdcacm & cdcecm
16711671
conn2: cdcncm
1672+
conn3: cdcmbim
16721673

16731674
You can use the sim:usbdev configuration::
16741675

@@ -1801,6 +1802,46 @@ This is a configuration with sim usbdev support.
18011802

18021803
Then you can test the network connection using the ping command or telnet.
18031804

1805+
6> Run CDCMBIM:
1806+
1807+
NuttX enter command::
1808+
1809+
$ conn 3
1810+
$ ifconfig
1811+
eth0 Link encap:Ethernet HWaddr 42:67:c6:69:73:51 at RUNNING mtu 1500
1812+
inet addr:10.0.1.2 DRaddr:10.0.1.1 Mask:255.255.255.0
1813+
wwan0 Link encap:UNSPEC at RUNNING mtu 1200
1814+
inet addr:0.0.0.0 DRaddr:0.0.0.0 Mask:0.0.0.0
1815+
$ ifconfig wwan0 10.0.0.1 netmask 255.255.255.0
1816+
$ ifconfig
1817+
eth0 Link encap:Ethernet HWaddr 42:67:c6:69:73:51 at RUNNING mtu 1500
1818+
inet addr:10.0.1.2 DRaddr:10.0.1.1 Mask:255.255.255.0
1819+
wwan0 Link encap:UNSPEC at RUNNING mtu 1200
1820+
inet addr:10.0.0.1 DRaddr:10.0.0.1 Mask:255.255.255.0
1821+
1822+
$ echo -n "hello from nuttx" > /dev/cdc-wdm2
1823+
$ cat /dev/cdc-wdm2
1824+
hello from linux
1825+
1826+
Host PC, you can see the network device named wwx020000112233::
1827+
1828+
$ sudo ifconfig wwx020000112233
1829+
$ sudo ifconfig wwx020000112233 10.0.0.2 netmask 255.255.255.0
1830+
$ ifconfig
1831+
wwx020000112233: flags=4226<BROADCAST,NOARP,MULTICAST> mtu 1500
1832+
inet 10.0.0.2 netmask 255.255.255.0 broadcast 10.0.0.255
1833+
ether 02:00:00:11:22:33 txqueuelen 1000 (以太网)
1834+
RX packets 0 bytes 0 (0.0 B)
1835+
RX errors 0 dropped 0 overruns 0 frame 0
1836+
TX packets 58 bytes 9143 (9.1 KB)
1837+
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
1838+
1839+
$ sudo cat /dev/cdc-wdm1
1840+
hello from nuttx
1841+
$ sudo bash -c "echo -n hello from linux > /dev/cdc-wdm1"
1842+
1843+
Then you can test the network connection using the ping command or telnet.
1844+
18041845
usbhost
18051846
-------
18061847

0 commit comments

Comments
 (0)