@@ -100,15 +100,6 @@ get_vendor_info() {
100100 platform=$( uci get qmodem.$section .platform 2> /dev/null)
101101}
102102
103- check_is_disabled (){
104- is_disabled=$( uci -q get qmodem.${config_section} .state 2> /dev/null)
105- if [ " $is_disabled " = " disabled" ]; then
106- json_add_string status " disabled"
107- json_dump
108- exit 0
109- fi
110- }
111-
112103# Helper function for AT configuration
113104get_at_cfg () {
114105 json_add_object at_cfg
@@ -323,14 +314,11 @@ EOF
323314 case " $2 " in
324315 base_info)
325316 json_init
326- check_is_disabled
327317 cache_file=" /tmp/cache_base_info_$config_section "
328-
329318 try_cache 10 " $cache_file " base_info
330319 ;;
331320 cell_info)
332321 json_init
333- check_is_disabled
334322 cache_file=" /tmp/cache_cell_info_$config_section "
335323 try_cache 10 " $cache_file " cell_info
336324 ;;
350338 dial_status)
351339 status_output=$( /etc/init.d/qmodem_network modem_status " $config_section " 2> /dev/null)
352340 json_init
353- check_is_disabled
354341 if [[ " $status_output " != * " Not Running" * ]]; then
355342 json_add_string running true
356343 else
380367 ;;
381368 get_disabled_features)
382369 json_init
383- check_is_disabled
384370 json_add_array disabled_features
385371 vendor_get_disabled_features
386372 get_modem_disabled_features
@@ -390,37 +376,31 @@ EOF
390376 ;;
391377 get_dns)
392378 json_init
393- check_is_disabled
394379 get_dns
395380 json_dump
396381 ;;
397382 get_imei)
398383 json_init
399- check_is_disabled
400384 get_imei
401385 json_dump
402386 ;;
403387 get_lockband)
404388 json_init
405- check_is_disabled
406389 get_lockband
407390 json_dump
408391 ;;
409392 get_mode)
410393 json_init
411- check_is_disabled
412394 get_mode
413395 json_dump
414396 ;;
415397 get_neighborcell)
416398 json_init
417- check_is_disabled
418399 get_neighborcell
419400 json_dump
420401 ;;
421402 get_network_prefer)
422403 json_init
423- check_is_disabled
424404 get_network_prefer
425405 json_dump
426406 ;;
@@ -434,25 +414,21 @@ EOF
434414 ;;
435415 info)
436416 json_init
437- check_is_disabled
438417 cache_file=" /tmp/cache_info_$config_section "
439418 try_cache 10 " $cache_file " get_info
440419 ;;
441420 network_info)
442421 json_init
443- check_is_disabled
444422 cache_file=" /tmp/cache_network_info_$config_section "
445423 try_cache 10 " $cache_file " network_info
446424 ;;
447425 sim_info)
448426 json_init
449- check_is_disabled
450427 cache_file=" /tmp/cache_sim_info_$config_section "
451428 try_cache 10 " $cache_file " sim_info
452429 ;;
453430 get_connect_status)
454431 json_init
455- check_is_disabled
456432 get_connect_status
457433 json_add_string connection_status " $connect_status "
458434 json_dump
475451 get_at_port_config " $config_section " 1
476452
477453 json_init
478- check_is_disabled
479454 json_add_object result
480455 for i in $index ; do
481456 tom_modem $use_ubus_flag -d " $at_port " -o d -i " $i "
513488 ;;
514489
515490 send_at)
491+
516492 params=$( echo " $input " | jsonfilter -e ' @.params' )
517493 cmd=$( echo " $params " | jq -r ' .at' )
518494 port=$( echo " $params " | jq -r ' .port' )
591567 set_imei)
592568 imei=$( echo " $input " | jsonfilter -e ' @.imei' )
593569 json_init
594- check_is_disabled
595570 json_add_string imei " $imei "
596571 set_imei " $imei "
597572 json_dump
609584 load_vendor_script " $vendor "
610585
611586 json_init
612- check_is_disabled
613587 case " $2 " in
614588 set_lockband)
615589 set_lockband " $params "
627601 set_mode)
628602 mode=$( echo " $input " | jsonfilter -e ' @.mode' )
629603 json_init
630- check_is_disabled
631604 set_mode " $mode "
632605 json_add_string result " $mode "
633606 json_dump
636609 set_sms_storage)
637610 storage=$( echo " $input " | jsonfilter -e ' @.storage' )
638611 json_init
639- check_is_disabled
640612 set_sms_storage " $storage "
641613 json_dump
642614 ;;
0 commit comments