Chinaunix首页 | 论坛 | 博客
  • 博客访问: 98663
  • 博文数量: 21
  • 博客积分: 1192
  • 博客等级: 少尉
  • 技术积分: 227
  • 用 户 组: 普通用户
  • 注册时间: 2008-02-22 11:00
文章分类

全部博文(21)

文章存档

2014年(1)

2012年(16)

2011年(4)

分类: LINUX

2012-02-10 17:50:31

#!/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) |
给主人留下些什么吧!~~