#!/bin/bash
#Firstly,generate special configuration for different ports,different users
#and copy configuration file to /etc/minicom (minicom default configuration file directory)
#reference man minicom
#configuration
# The configuration argument is more interesting. Normally, minicom gets its defaults from a file called "minirc.dfl". If you
# however give an argument to minicom, it will try to get its defaults from a file called "minirc.configuration". So it is
# possible to create multiple configuration files, for different ports, different users etc. Most sensible is to use device
# names, such as tty1, tty64, sio2 etc. If a user creates his own configuration file, it will show up in his home directory as
# ".minirc.dfl" or ".minirc.configuration".
#dslr board default port on /dev/ttyUSB0
dslr_config="minirc.dslr"
cat >$dslr_config << EOF
pu port /dev/ttyUSB0
pu baudrate 115200
pu bits 8
pu parity N
pu stopbits 1
pu rtscts No
pu xonxoff No
EOF
sudo mv $dslr_config /etc/minicom/
sudo chmod a+r /etc/minicom/$dslr_config
minicom_config="dslr"
minicom_script="switch_android_console_runscript"
minicom_command="minicom $minicom_config -S $minicom_script"
pkill_command="\"^${minicom_command}$\""
echo $pkill_command
cat >$minicom_script << EOF
verbose on
#send "\n", For testing only
send "\n"
send "\n"
send "\n"
send "\n"
send "ls"
print "will close minicom"
send " *********************** "
sleep 5
! pkill -f $pkill_command
exit 0
EOF
$minicom_command
#*************参考内容***************
#注意事项
#1.minicom配置文件的写法使用 minirc.XXXX
#2.minicom -S参数中间不能有空格
#4.runscript中!后面必需有空格
#* 一定要把没minirc的内容写全,否在可能无法成功的send命令
#******存在的问题******
#提示bigger 50 bigger100的问题,
阅读(1960) | 评论(0) | 转发(0) |