浏览代码

Add files via upload

MoeClub 1 年之前
父节点
当前提交
009ce2b0a8
共有 3 个文件被更改,包括 33 次插入8 次删除
  1. 33 8
      C8-660/network.sh
  2. 二进制
      C8-660/sms_tool
  3. 二进制
      C8-660/sms_tool.zip

+ 33 - 8
C8-660/network.sh

@@ -3,11 +3,13 @@
 # Lock PCI, If PCILock is empty, will lock first PCI.
 PCIStatic=1
 # PCILock="<PCI>,<RFCN>,<BAND>,<SCS>"
-PCILock=""
+PCILock="530,627264,78,1"
 # BAND="", BAND="78", BAND="1:78"
 BAND=""
 # Use SIM Card Index
 SIMCardIndex=1
+# Empty NVRAM
+EmptyNVRAM=0
 
 
 [ -e /bin/sendat ] || exit 1
@@ -43,31 +45,49 @@ function WaitSIM(){
 
 function Driver(){
   echo "$(Now) Set Driver ..." |tee -a "$LOG"
-  /bin/sendat "$PORT" 'AT&F0'
-  /bin/sendat "$PORT" 'AT+QCFG="pcie_mbim",0'
+  [ $1 -gt 0 ] && /bin/sendat "$PORT" 'AT+QPRTPARA=3'
   /bin/sendat "$PORT" 'AT+QCFG="pcie/mode",1'
   /bin/sendat "$PORT" 'AT+QCFG="data_interface",1,0'
   /bin/sendat "$PORT" 'AT+QETH="eth_driver","r8168",0'
   /bin/sendat "$PORT" 'AT+QETH="eth_driver","r8125",1'
+  /bin/sendat "$PORT" 'AT+QCFG="volte_disable",0'
+  /bin/sendat "$PORT" 'AT+QCFG="sms_control",1,1'
+  /bin/sendat "$PORT" 'AT+QCFG="call_control",0,0'
+  /bin/sendat "$PORT" 'AT+CPMS="ME","ME","ME"'
+  /bin/sendat "$PORT" 'AT+CMGF=0'
 }
 
 function NR5G(){
   rfBand=`/bin/sendat "$PORT" 'AT+QNWPREFCFG="rf_band"' |grep '+QNWPREFCFG:\s*"nr5g_band"' |cut -d',' -f2 |grep -o '[0-9A-Za-z:]*'`
   band="${1:-$rfBand}"
   echo "$(Now) Set NR5G ${band} ..." |tee -a "$LOG"
-  /bin/sendat "$PORT" 'AT+QNWCFG="data_roaming",1'
   /bin/sendat "$PORT" 'AT+QNWPREFCFG="roam_pref",255'
+  /bin/sendat "$PORT" 'AT+QNWPREFCFG="rat_acq_order",NR5G:LTE:WCDMA'
   /bin/sendat "$PORT" 'AT+QNWPREFCFG="mode_pref",NR5G'
   /bin/sendat "$PORT" 'AT+QNWPREFCFG="nr5g_disable_mode",2'
   /bin/sendat "$PORT" "AT+QNWPREFCFG=\"nr5g_band\",${band}"
 }
 
+function COPS(){
+  echo "$(Now) Search COPS ..." |tee -a "$LOG"
+  /bin/sendat "$PORT" 'AT+COPS=2'
+  /bin/sendat "$PORT" 'AT+COPS=0'
+  for i in $(seq 1 $MaxNum); do
+    cops=`/bin/sendat "$PORT" 'AT+COPS?' |grep '+COPS: 0,'  |cut -d'"' -f2 |sed 's/[[:space:]]//g'`
+    [ -n "$cops" ] && echo "$(Now) COPS: $cops" |tee -a "$LOG" && break || sleep 1
+  done
+}
+
 function Modem(){
   echo "$(Now) Reset Modem ..." |tee -a "$LOG"
+  SIMCard="${1:-1}"
+  ResetModem="${2:-0}"
+  /bin/sendat "$PORT" 'AT+QNWCFG="data_roaming",1'
+  /bin/sendat "$PORT" 'AT+QCFG="ims",1'
   /bin/sendat "$PORT" 'AT+QSCLK=0,0'
   /bin/sendat "$PORT" 'AT+QMAPWAC=1'
-  /bin/sendat "$PORT" "AT+QUIMSLOT=${SIMCardIndex:-1}"
-  [ $1 -gt 0 ] && /bin/sendat "$PORT" 'AT+CFUN=1,1'
+  /bin/sendat "$PORT" "AT+QUIMSLOT=${SIMCard}"
+  [ "$ResetModem" -gt 0 ] && /bin/sendat "$PORT" 'AT+CFUN=1,1'
   sleep 5
 }
 
@@ -173,10 +193,11 @@ for i in $(seq 1 $MaxNum); do
   
   [ $m -eq 1 ] && {
     [ $n -eq 0 ] && {
-      Driver
+      Driver "$EmptyNVRAM"
       NR5G "$BAND"
+      COPS
     }
-    Modem "$n"
+    Modem "$SIMCardIndex" "$n"
     WaitSIM
   }
   
@@ -189,3 +210,7 @@ done
 
 echo "$(Now) FINISH" |tee -a "$LOG"
 
+# /bin/sendat "$PORT" 'AT+CMGL=4'
+# sms_tool -s "ME" -f "%Y/%d/%m %H:%M:%S" -d /dev/ttyUSB2 -j recv
+
+

二进制
C8-660/sms_tool


二进制
C8-660/sms_tool.zip