hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#/bin/bash
#load/unload driver
 
count=0
 
S=1
while [ "$S" == "1" ]
do
     count=$[ count + 1 ]
    sleep 3
    dmesg -c
    ./unload.sh
    ./load.sh
    sleep 3
    ./cli mib reset
    ./cli mib ampdurx
    ./cli hci rxq show
    sleep 60    
    gotIp=$(ifconfig | grep "inet addr:192.168.2.22")
    if [ "$gotIp" == "" ]; then
          echo -n "[$count]timeout..."
          addr=$(dmesg | grep "30 49 3b 01 3f c0")
        if [ "$addr" == "" ]; then    
              echo "no rx beacon..."
           ./cli mib ampdurx
           ./cli hci rxq show
               ./unload.sh
              break
          else
              echo "got rx beacon..."
              ./cli mib ampdurx
              ./cli hci rxq show
              sleep 2
          fi
       else
       
           addr=$(dmesg | grep "30 49 3b 01 3f c0")
        if [ "$addr" == "" ]; then    
              echo "[$count] connet to ap... no rx beacon..."
                 ./cli mib ampdurx
                 ./cli hci rxq show
             ./unload.sh
                        
              break
          else
              echo "[$count]connet to ap... got rx beacon..." 
              ./cli mib ampdurx
              ./cli hci rxq show
              sleep 2         
          fi
            
    fi
    
done