导航

运行quectel EC20 module example data

Posted on 2018-08-01 16:00  ricks  阅读(2121)  评论(1编辑  收藏  举报

environment setting are as below:

1. ubuntu 14.04, linux kernel 4.4,OpenLinux(QuecLinux)

2. module: EC20-CE-TE-A

3. sim: Unicom

编译ql-ol-sdk/ql-ol-extsdk/example/data 例程

ricks@ubuntu:/home/share/project/ql-ol-sdk/ql-ol-extsdk/example/data$ ls
example_data_call_v2.c  example_dual_apn.c  example_single_apn.c  Makefile
ricks@ubuntu:/home/share/project/ql-ol-sdk/ql-ol-extsdk/example/data$ make 
arm-oe-linux-gnueabi-gcc  -march=armv7-a -mfloat-abi=softfp -
......
 -I../../include -I/home/share/project/ql-ol-sdk/ql-ol-a-vfp-neon-oe-linux-gnueabi/usr/lib/libql_mgmt_client.so  -o example_data_call_v2
ricks@ubuntu:/home/share/project/ql-ol-sdk/ql-ol-extsdk/example/data$ ls
example_data_call_v2    example_data_call_v2.o  example_dual_apn.c  example_single_apn    example_single_apn.o
example_data_call_v2.c  example_dual_apn        example_dual_apn.o  example_single_apn.c  Makefile
ricks@ubuntu:/home/share/project/ql-ol-sdk/ql-ol-extsdk/example/data$ 

copy例程到QuecLinux,即EC20 module 的/usrdata目录下

ricks@ubuntu:/home/share/project/ql-ol-sdk$ adb push ./ql-ol-extsdk/example/data  /usrdata 
push: ./ql-ol-extsdk/example/data/example_single_apn.c -> /usrdata/example_single_apn.c
push: ./ql-ol-extsdk/example/data/example_data_call_v2.o -> /usrdata/example_data_call_v2.o
push: ./ql-ol-extsdk/example/data/example_dual_apn.o -> /usrdata/example_dual_apn.o
push: ./ql-ol-extsdk/example/data/example_dual_apn -> /usrdata/example_dual_apn
push: ./ql-ol-extsdk/example/data/example_dual_apn.c -> /usrdata/example_dual_apn.c
push: ./ql-ol-extsdk/example/data/example_data_call_v2 -> /usrdata/example_data_call_v2
push: ./ql-ol-extsdk/example/data/example_single_apn -> /usrdata/example_single_apn
push: ./ql-ol-extsdk/example/data/Makefile -> /usrdata/Makefile
push: ./ql-ol-extsdk/example/data/example_single_apn.o -> /usrdata/example_single_apn.o
push: ./ql-ol-extsdk/example/data/example_data_call_v2.c -> /usrdata/example_data_call_v2.c
10 files pushed. 0 files skipped.
208 KB/s (178468 bytes in 0.835s)

运行 example_dual_apn

/usrdata # ./example_dual_apn

log如下:

/usrdata # [QL_CLI][130]:QL_WWAN_Initialize ret=0!
[QL_CLI][16]:nw_init_cb!
[QL_CLI][138]:QL_WWAN_GetDataSrvHandle g_h_handle=337896!
[QL_CLI][142]:QL_WWAN_SetProfileId ret = 0
[QL_CLI][144]:QL_WWAN_SetIPVersion ret = 0
[QL_CLI][64]:QL_WWAN_StartDataCall ret=0!
[QL_CLI][67]:Wait for network ready!
[QL_CLI][27]:APN[0] dsi_net_evt_cb, evt=18!
[QL_CLI][44]:Network Ready!!
[QL_CLI][27]:APN[0] dsi_net_evt_cb, evt=1!
[QL_CLI][31]:Call is connected!!
[QL_CLI][85]:QL_WWAN_GetIPAddr ret = 0, valid_ip_cnt=1; Interface IP address =10.74.177.45
[QL_CLI][88]:QL_WWAN_GetDeviceName ret = 0, name=rmnet_data0
[QL_CLI][27]:APN[0] dsi_net_evt_cb, evt=8!
[QL_CLI][41]:Old address deleted !!
[QL_CLI][27]:APN[0] dsi_net_evt_cb, evt=7!
[QL_CLI][38]:New address is generated!!
[QL_CLI][104]:Gateway IP address   =10.74.177.46
[QL_CLI][109]:Primary DNS address  =120.80.80.80
[QL_CLI][114]:Secondary DNS address=221.5.88.88
[QL_CLI][151]:[APN0]: OK

[QL_CLI][138]:QL_WWAN_GetDataSrvHandle g_h_handle=312280!
[QL_CLI][142]:QL_WWAN_SetProfileId ret = 0
[QL_CLI][144]:QL_WWAN_SetIPVersion ret = 0
[QL_CLI][64]:QL_WWAN_StartDataCall ret=0!
[QL_CLI][67]:Wait for network ready!
[QL_CLI][27]:APN[1] dsi_net_evt_cb, evt=18!
[QL_CLI][44]:Network Ready!!
[QL_CLI][27]:APN[1] dsi_net_evt_cb, evt=1!
[QL_CLI][31]:Call is connected!!
[QL_CLI][85]:QL_WWAN_GetIPAddr ret = 0, valid_ip_cnt=1; Interface IP address =10.107.130.219
[QL_CLI][88]:QL_WWAN_GetDeviceName ret = 0, name=rmnet_data1
[QL_CLI][27]:APN[1] dsi_net_evt_cb, evt=8!
[QL_CLI][41]:Old address deleted !!
[QL_CLI][27]:APN[1] dsi_net_evt_cb, evt=7!
[QL_CLI][38]:New address is generated!!
[QL_CLI][104]:Gateway IP address   =10.107.130.220
[QL_CLI][109]:Primary DNS address  =221.4.8.1
[QL_CLI][114]:Secondary DNS address=0.0.0.0
[QL_CLI][151]:[APN1]: OK

执行ifconfig命令:

/ # ifconfig
bridge0   Link encap:Ethernet  HWaddr 66:93:17:48:78:15  
          inet addr:192.168.225.1  Bcast:192.168.225.255  Mask:255.255.255.0
          inet6 addr: fe80::6493:17ff:fe45:7512/64 Scope:Link
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:76 (76.0 B)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:7 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:400 (400.0 B)  TX bytes:400 (400.0 B)

rmnet0    Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          UP RUNNING  MTU:2000  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:776 (776.0 B)

rmnet_data0 Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          inet addr:10.74.177.45  Mask:255.0.0.0
          inet6 addr: fe80::3d7f:a371:ef50:21c8/64 Scope:Link
          UP RUNNING  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:388 (388.0 B)

rmnet_data1 Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          inet addr:10.107.130.219  Mask:255.0.0.0
          inet6 addr: fe80::21b2:c928:28dc:eafc/64 Scope:Link
          UP RUNNING  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:388 (388.0 B)

其中rmnet_data0/1 Link encap都会分到一个ip地址。