-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathtransmit.sh
59 lines (47 loc) · 866 Bytes
/
transmit.sh
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
55
56
57
58
59
#!/bin/bash
# send Standard data frame
json=$(cat << EOS
{
"request": "Transmit",
"id": "0x123",
"type": "stdData",
"data": [1,2]
}
EOS
)
echo "$json"
echo "$json" | socat - udp-datagram:255.255.255.255:8200,broadcast
# send Extended data frame
json=$(cat << EOS
{
"request": "Transmit",
"id": "0x123",
"type": "extData",
"data": [10,11,12,13]
}
EOS
)
echo "$json"
echo "$json" | socat - udp-datagram:255.255.255.255:8200,broadcast
# send Standard remote frame
json=$(cat << EOS
{
"request": "Transmit",
"id": "0xF23",
"type": "stdRemote"
}
EOS
)
echo "$json"
echo "$json" | socat - udp-datagram:255.255.255.255:8200,broadcast
# send Extended remote frame
json=$(cat << EOS
{
"request": "Transmit",
"id": "0xF23",
"type": "extRemote"
}
EOS
)
echo "$json"
echo "$json" | socat - udp-datagram:255.255.255.255:8200,broadcast