Part Number: CC2652R
Tool/software:
SDK version: 7.40.00.77
#!/bin/sh #/usr/bin/blescan.sh tty="$(uci -q get tisbl.tisbl.tty)" [ -z "$tty" ] && tty='/dev/ttyMSM1' exec 100>"/var/lock/ble.lock" flock 100 MAX_COUNT=20 count=1 com-wr.sh "$tty" 3 "\x01\x1D\xFC\x01\x00" > /dev/null # this reset command delay time must >= 3, if small than 3, the following commands will be something wrong com-wr.sh "$tty" 1 "\x01\x00\xFE\x08\x02\x00\x00\x00\x00\x00\x00\x00" > /dev/null com-wr.sh "$tty" 1 "\x01\x60\xFE\x04\x01\x00\x20\x00" > /dev/null com-wr.sh "$tty" 1 "\x01\x60\xFE\x04\x01\x01\x20\x00" > /dev/null com-wr.sh "$tty" 1 "\x01\x61\xFE\x02\x01\x02" > /dev/null com-wr.sh "$tty" 1 "\x01\x61\xFE\x02\x01\x03" > /dev/null com-wr.sh "$tty" 1 "\x01\x61\xFE\x02\x01\x04" > /dev/null com-wr.sh "$tty" 1 "\x01\x61\xFE\x02\x01\x05" > /dev/null while [ $count -le $MAX_COUNT ] do com-wr.sh "$tty" 3 "\x01\x51\xFE\x06\x00\x00\x00\x04\x00\x02" | tee /tmp/blescan.data | ble-scan-rx-parser.sh com-wr.sh "$tty" 1 "\x01\x52\xFE\x00" > /dev/null count=$((count + 1)) done exec 100>&-
This attached code is how we send commands to CC2652 per scan cycle.
#!/bin/sh # com-wr.sh tty time command parser # example com-wr.sh /dev/ttyMSM1 1 "\x01\x1D\xFC\x01\x00" | hexdump.sh --> send "\x01\x1D\xFC\x01\x00" to /dev/ttyMSM1 and then hexdump receive data until 100ms timeout #command example "\x7E\x03\xD0\xAF und normaler Text" usleep 10000 tty=$1 time=$2 command=$3 parser=$4 stty -F $tty time $time exec 99< $tty echo -en $command > $tty cat $tty exec 99<&-
This attached code is how we send commands to tty
In current situation, the data which we receive from UART with command "\x01\x51\xFE\x06\x00\x00\x00\x04\x00\x02" have limit(about 16 records).
As a result, we called the command "\x01\x51\xFE\x06\x00\x00\x00\x04\x00\x02" each time.
We would like to know if there is any way can let CC2652 scan BLE beacon continuously.
Then we can use repeated UART data reading instead of sending scanning-related commands to the CC2652R each time.








