File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -16,15 +16,17 @@ function load() {
16
16
progress_bar 0
17
17
while read line; do
18
18
line=$( printf ' %s\r' " $line " | xxd -p | tr -d ' \n' )
19
- result=$( gatttool -i hci0 \
20
- -n $line \
19
+ for (( index= 0 ; index< ${# string} ; index+= 180 )) ; do
20
+ result=$( gatttool -i hci0 \
21
+ -n ${string: index: 180} \
21
22
-a 0x0031 \
22
23
-b " $mac_address " \
23
24
--char-write-req 2>&1 )
24
- if [[ " $result " != " Characteristic value was written successfully" ]]; then
25
- printf " \n%s\n" " $result "
26
- exit 1
27
- fi
25
+ if [[ " $result " != " Characteristic value was written successfully" ]]; then
26
+ printf " \n%s\n" " $result "
27
+ exit 1
28
+ fi
29
+ done
28
30
(( counter++ ))
29
31
percentage=" $( bc <<< " scale=2; (${counter}/${lines})*100" ) "
30
32
progress_bar " ${percentage% .* } "
You can’t perform that action at this time.
0 commit comments