1.libreference-ril-gosuncn.so
2.netcfg
预制到系统内部
device/rockchip/common/device.mk
PRODUCT_COPY_FILES += \
+ device/rockchip/common/libreference-ril-gosuncn.so:system/lib/libreference-ril-gosuncn.so \
+ device/rockchip/common/netcfg:system/bin/netcfg
3.系统变量设置
device/rockchip/rk3128_box/system.prop
+ril.dial.mode=1
+ril.use.csq=true
+persist.sys.lte=1
4.开机运行脚本添加
device/rockchip/common/daemon.sh //私人设置开机运行脚本
+necfg_reset=0
while true
do
echo "=====get_resource_path============"
boot_ok=`getprop sys.boot_completed`
echo bootok= $boot_ok
+ if [ $boot_ok == 1 ]; then
+ if [ $necfg_reset == 0 ]; then
+ necfg_reset=1
+ netcfg usb0 dhcp
fi
get_resource_path
5.内核添加USB识别
kernel/drivers/usb/serial/option.c
static const struct usb_device_id option_ids[] = {
{ USB_DEVICE( 0x2c7c, 0x6005)} ,
{ USB_DEVICE(0x2C7C, 0x6026) }, /* Quectel EC200T */
{ USB_DEVICE(0x2C7C, 0x6000) }, /* Quectel EC200T */
{ USB_DEVICE( 0x2c7c, 0x0125) },
+ { USB_DEVICE( 0x305a, 0x1415) },
......
}
6.hardware添加库加载
hardware/ril/rild/rild.c
lte_mode =12;
switch(lte_mode)
{
case 1: property_set("persist.sys.lte","1");break;
......
+ case 12:property_set("persist.sys.lte","12");break;
}
if (rilLibPath == NULL) {
if(lte_mode==1) strcpy(libPath,"/system/lib/libreference-ril-ec20.so");
......
+ else if(lte_mode==12) strcpy(libPath,"/system/lib/libreference-ril-gosuncn.so");
rilLibPath = libPath;
}
if (hasLibArgs) {
static char * newArgv[MAX_LIB_ARGS];
static char args[PROPERTY_VALUE_MAX];
rilArgv = newArgv;
property_get(LIB_ARGS_PROPERTY, args, "");
if(lte_mode==1) strcpy(args,"-d /dev/ttyUSB0");
......
+ else if(lte_mode==12) strcpy(args,"-d /dev/ttyUSB0");
argc = make_argv(args, rilArgv);
}
7.添加节点权限
device/rockchip/common/ueventd.rockchip.rc
# for radio
+/dev/ttyUSB0 0666 radio radio
+/dev/ttyUSB1 0666 radio radio
+/dev/ttyUSB2 0666 radio radio
8.调试方法
lsusb //查看设备
ls dev/ttyUSB* //查看是否识别到设备
logcat -b radio //查看状态
logcat | grep rild //查看注册