This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] CC2652R:CC2652是否可以在 CC2652响应数据之前使用信标类型来筛选数据。

Guru**** 2331930 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/1466287/cc2652r-could-cc2652-use-beacon-type-to-filter-data-before-cc2652-response-the-data

器件型号:CC2652R

工具与软件:

SDK 版本: 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>&-

下面随附的代码介绍了我们如何在每个扫描周期向 CC2652发送命令。

#!/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<&-

下面 随附代码介绍了我们向 TTY 发送命令的方式。

在当前情况下、我们将其称为命令  "\x01\x51\xFE\x06\x00\x00\x04\x00\x02"  我们从 UART 接收的数据每次都 有限制。

客户提出的要求只有 iBeacon 和 Eddystone 数据。

因此、我们想知道 CC2652是否可以通过任何方式使用信标类型在数据 响应数据之前对数据进行筛选。