A few years ago I wrote a script that prints all currently connected serial ports - their device names and product descriptions (to distinguish between FTDI and Prolific devices, for example):
Code: Select all
#!/bin/bash
list_all_ports() {
for ((i = 0; i < dev_count; i++ ))
do
dev_description=`hal-get-property --udi ${dev_list[$i]} --key info.product`
dev_name=`hal-get-property --udi ${dev_list[$i]} --key serial.device`
echo -e $dev_name'\t'$dev_description
done
}
declare -a dev_list
dev_list=(`hal-find-by-property --key info.subsystem --string tty`)
dev_count=${#dev_list[*]}
echo List of comports in the system:
list_all_ports | sort
What could I possibly use to replace these calls?