通过AT 指令查看设备
通过AT指令打电话
echo -e "ATD110;\r\n" >/dev/ttyUSB2
echo -e "ATD10086;\r\n" >/dev/ttyUSB2
echo -e "ATD15112673367;\r\n" >/dev/ttyUSB2
查看模块型号
echo -e "AT+CGMM\r\n" >/dev/ttyUSB2
获得GSM模块的IMEI(国际移动设备标识)序列
echo -e "AT+CGSN\r\n" >/dev/ttyUSB2
这命令用来读取或者识别SIM卡的IMSI(国际移动签署者标识)
echo -e " AT+CCID \r\n" >/dev/ttyUSB2
AT+CCID
+CCID: 89860000191807884521
AT指令:
https://www.cnblogs.com/zym0805/p/3903732.html
echo -e "AT+CSMINS?\r\n" >/dev/ttyUSB2
echo -e "AT+COPS\r\n" >/dev/ttyUSB2
\r\n" >/dev/ttyUSB2
echo -e "AT+CSMINS\r\n" >/dev/ttyUSB2
echo -e "AT+COPS=?\r\n" >/dev/ttyUSB2
二 RIL 层代码移植。
# ls libquectel-ril/armeabi
chat ip-down ip-up libreference-ril.so
修改mk文件将上面拷贝对应目录。
PRODUCT_COPY_FILES += \
device/softwinner/venus-a3/ec20/ip-up:system/etc/ppp/ip-up \
device/softwinner/venus-a3/ec20/ip-down:system/etc/ppp/ip-down \
device/softwinner/venus-a3/ec20/chat:system/bin/chat \
device/softwinner/venus-a3/ec20/libreference-ril.so:$(TARGET_COPY_OUT_VENDOR)/lib/libreference-ril.so \
service ril-daemon /vendor/bin/hw/rild -l /vendor/lib/libreference-ril.so
class main
user radio
group radio cache inet misc audio sdcard_rw log
capabilities BLOCK_SUSPEND NET_ADMIN NET_RAW
3.Android8及以上版本Framework通过HIDL和ril daemon服务通信。
配置HIDL文件
android/device/softwinner/venus-a3/configs/ manifest.xml
5.
/dev/ttyUSB0 0660 radio radio
/dev/ttyUSB1 0660 radio radio
/dev/ttyUSB2 0660 radio radio
/dev/ttyUSB3 0660 radio radio
/dev/cdc-wdm* 0660 radio radio
/dev/qcqmi* 0660 radio radio
/dev/cdc-acm* 0660 radio radio
6.
最后发现开机时候 4G网络不通,插拔一下就可以上网, 发现是selinux的原因
可以修改system/core/init/init.cpp is_enforcing值赋值为false
is_enforcing = false;
if (security_setenforce(is_enforcing)) {
PLOG(ERROR) << "security_setenforce(%s) failed" << (is_enforcing ? "true" : "false");
security_failure();
}
logcat –b radio & //ril log
logcat –s pppd & //ppp 拨号 log
logcat –c –b radio & //清除以前 raido log
06-28 10:04:42.539 2312 2312 D IccCardProxy: update icc_operator_numeric= 06-28 10:04:42.539 2312 2312 D TelephonyManager: setTelephonyProperty: success phoneId=0 property=gsm.sim.operator.numeric value: propVal= 06-28 10:04:42.547 2312 2312 D TelephonyManager: setTelephonyProperty: success phoneId=0 property=gsm.sim.operator.iso-country value: propVal= 06-28 10:04:42.549 2312 2312 D TelephonyManager: setTelephonyProperty: success phoneId=0 property=gsm.sim.operator.alpha value: propVal= 06-28 10:04:42.560 2312 2312 D RILJ : setPhoneType=1 old value=0 [SUB0]
4G可能帮忙解决问题的
https://blog.csdn.net/wufoodjetsendl1001/article/details/75125489
UICC--Android O
https://blog.csdn.net/Dylan_Sen/article/details/78373258
https://blog.csdn.net/yaoming168/article/details/90647996
https://segmentfault.com/a/1190000011154401
Uicontroller
Android 8.0 RIL框架分析
https://blog.csdn.net/qq_27540925/article/details/79356799
https://blog.csdn.net/qq_27540925/article/details/79402549
https://blog.csdn.net/myfriend0/article/details/79461341
相关代码位置
./frameworks/opt/telephony/src/java/com/android/internal/telephony/PhoneFactory.java
./frameworks/opt/telephony/src/java/com/android/internal/telephony/uicc/UiccController.java
./frameworks/opt/telephony/src/java/com/android/internal/telephony/BaseCommands.java
./frameworks/opt/telephony/src/java/com/android/internal/telephony/RadioIndication.java
./frameworks/opt/telephony/src/java/com/android/internal/telephony/RIL.java
、
~/data/work/android/packages/services/Telephony/src/com/android/services
学习记录
一 Framework 层
二 RIL层