Skip to content

Commit 2c91859

Browse files
committed
fix table structure of broadcast package
1 parent 47f8da5 commit 2c91859

File tree

1 file changed

+88
-125
lines changed

1 file changed

+88
-125
lines changed

devicetypes/curtain3.md

Lines changed: 88 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -2,99 +2,94 @@
22

33
## Broadcast Package
44

5-
The following table describes the SCAN RSP AD Structure.
5+
The following table describes the Service Data of SCAN_RSP.
66
<table>
7-
<tr>
8-
<td>Byte 0</td>
9-
<td></td>
10-
<td>0x09</td>
11-
</tr>
12-
<tr>
13-
<td>Byte 1</td>
14-
<td>Service Data</td>
15-
<td>0x16</td>
16-
</tr>
17-
<tr>
18-
<td>Byte 2~3</td>
19-
<td></td>
20-
<td>0xFD3D</td>
21-
</tr>
22-
<tr>
23-
<td rowspan=2>Byte 4</td>
24-
<td>EncLsb</td>
25-
<td>Bit [7] – Encryption method low bit
26-
0: No encryption<br>
27-
1: Encryption method 1 (same as Bot's encryption method) when Byte 1 bit[5]-Enc type = 1<br>
28-
0: Encryption method 2 (specific algorithm to be determined)<br>
29-
1: Encryption method 3 (specific algorithm to be determined)</td>
30-
</tr>
31-
<tr>
32-
<td>Device Type</td>
33-
<td>Bit 6-0 Device Type<br>(0x5B): Add mode<br>(0x7B): Broadcast mode</td>
34-
</tr>
35-
<tr>
36-
<td rowspan=5>Byte 5</td>
37-
<td rowspan=5>Status</td>
38-
<td>Bit [7] – Allow connection: 1 - Allowed (host), 0 - Not allowed (slave)</td>
39-
</tr>
40-
<tr>
41-
<td>Bit [6] - Calibration status: 1 - Calibrated, 0 - Not calibrated, needs calibration</td>
42-
</tr>
43-
<tr>
44-
<td>Bit [5] - Enc type Msb<br>0: Original bot encryption algorithm<br>1: New encryption method 2 or encryption method 3, refer to the explanation of Byte 0 bit[7]</td>
45-
</tr>
46-
<tr>
47-
<td>Bit [4] - Data commit flag<br>0: Service data, no data need to commit<br>1: Service data has data need to commit. This flag needs to be cleared by the hub or APP after the data is updated successfully. The device itself does not clear it actively</td>
48-
</tr>
49-
<tr>
50-
<td>Bit [3] - group D<br>Bit [2] - group C<br>Bit [1] - group B<br>Bit [0] - group A<br>0: Device is not in the current group<br>1: Device is in the current group</td>
51-
</tr>
52-
<tr>
53-
<td rowspan=2>Byte 6</td>
54-
<td>update utc flag</td>
55-
<td>Bit [7] – Sync utc<br>0: No need to synchronize time<br>1: Device has gone through one time synchronization period (default is 10 days), need to perform time synchronization. The running time is in UTC when synchronization is performed. When the hub or APP successfully timestamps the device, the device itself actively clears this flag</td>
56-
</tr>
57-
<tr>
58-
<td>Battery</td>
59-
<td>Bit [6:0] – Battery level 0~100%</td>
60-
</tr>
61-
<tr>
62-
<td rowspan=2>Byte 7</td>
63-
<td>MotionState</td>
64-
<td>Bit [7] - Motion state<br>0: Static<br>1: In motion</td>
65-
</tr>
66-
<tr>
67-
<td>Position</td>
68-
<td>Bit [6:0] - Current position of the device (%)</td>
69-
</tr>
70-
<tr>
71-
<td rowspan=2>Byte 8</td>
72-
<td>LightLevel</td>
73-
<td>Bit [7:4] - Light level (1-10)</td>
74-
</tr>
75-
<tr>
76-
<td>DeviceChain</td>
77-
<td>Bit [3:0] - Device chain length</td>
78-
</tr>
79-
<tr>
80-
<td rowspan=4>Byte 9</td>
81-
<td>CrashType</td>
82-
<td>Bit [7:6] - Saved crash log type</td>
83-
</tr>
84-
<tr>
85-
<td>MotorFault</td>
86-
<td>Bit [5] - Whether the motor clutch is abnormal<br>1: Abnormal<br>0: Normal</td>
87-
</tr>
88-
<tr>
89-
<td>HallFault</td>
90-
<td>Bit [4] - Whether the Hall signal is abnormal<br>1: Abnormal<br>0: Normal</td>
91-
</tr>
92-
<tr>
93-
<td>StopReason</td>
94-
<td>Bit [3:0] - Motor movement stop reason<br>0: None<br>1: Motor movement time exceeded 10 minutes<br>2: No Hall counting in 1 second<br>3: Excessive stalling current<br>4: Movement to target position<br>5: Received stop command<br>6: Detected magnetic field strength meets conditions</td>
95-
<td></td>
96-
</tr>
7+
<thead>
8+
<th colspan=5>SCAN RSP AD Structure</th>
9+
</thead>
10+
<tbody>
11+
<tr>
12+
<td rowspan=20>AD Structure 1</td>
13+
<td>len</td>
14+
<td>Byte 0</td>
15+
<td></td>
16+
<td>0x09</td>
17+
</tr>
18+
<tr>
19+
<td>type</td>
20+
<td>Byte 1</td>
21+
<td>Service Data</td>
22+
<td>0x16</td>
23+
</tr>
24+
<tr>
25+
<td rowspan=18>data</td>
26+
<td>Byte 2~3</td>
27+
<td></td>
28+
<td>0xFD3D</td>
29+
</tr>
30+
<tr>
31+
<td rowspan=2>Byte 4</td>
32+
<td>Enc type</td>
33+
<td>Bit[7] NC</td>
34+
</tr>
35+
<tr>
36+
<td>Device Type</td>
37+
<td>Bit [6:0] – Device Type, <br>‘[’Const Adv Mode, <br>‘{’Pair Mode</td>
38+
</tr>
39+
<tr>
40+
<td rowspan=5>Byte 5</td>
41+
<td rowspan=3>Status</td>
42+
<td>Bit [7] – Whether to allow connection <br>1- allowed, 0- not allowed</td>
43+
</tr>
44+
<tr>
45+
<td>Bit [6] – Calibration situation<br>1-calibrated, 0-not calibrated, need to be calibrated</td>
46+
</tr>
47+
<tr>
48+
<td>Bit [5-0] NC</td>
49+
</tr>
50+
<tr>
51+
<td>Update utc flag</td>
52+
<td>Bit[7] NC</td>
53+
</tr>
54+
<tr>
55+
<td>Battery</td>
56+
<td>Bit [6:0] – Battery capacity 0~100%</td>
57+
</tr>
58+
<tr>
59+
<td rowspan=2>Byte 6</td>
60+
<td>MotionState</td>
61+
<td>bit [7] - Movement status, 0-stationary, 1-movement</td>
62+
</tr>
63+
<tr>
64+
<td>Position</td>
65+
<td>Bit [6:0] - The current position of the device (%)</td>
66+
</tr>
67+
<tr>
68+
<td rowspan=2>Byte 7</td>
69+
<td>LightLevel</td>
70+
<td>bit [7:4] - Light level (1-10)</td>
71+
</tr>
72+
<tr>
73+
<td>DeviceChain</td>
74+
<td>bit [3:0] - Device chain length</td>
75+
</tr>
76+
<tr>
77+
<td rowspan=2>Byte 8</td>
78+
<td>LightLevel</td>
79+
<td>bit [7:4]-light level(1-10)</td>
80+
</tr>
81+
<tr>
82+
<td>DeviceChain</td>
83+
<td>bit [3:0] - Device chain length</td>
84+
</tr>
85+
<tr>
86+
<td>Byte 9</td>
87+
<td>CrashType</td>
88+
<td>bit [7:0]-NC</td>
89+
</tr>
90+
</tbody>
9791
</table>
92+
9893
<a><img src="https://switchbot-open-api.s3.amazonaws.com/Curtain+BLE+open+api/curtain3-broadcast-1.jpeg"></a>
9994

10095

@@ -253,7 +248,7 @@ The basic format of the RSP packet returned by the device to the terminal is as
253248
</tr>
254249
</tbody>
255250
</table>
256-
- REQ Packet不同命令返回值不同。
251+
- REQ Packet returns different values with different commands.
257252

258253
<table>
259254
<thead>
@@ -303,7 +298,7 @@ The basic format of the RSP packet returned by the device to the terminal is as
303298
<th colspan=1>Function Code</th>
304299
<th colspan=1>Function Parameter Code</th>
305300
<th colspan=2>REQ Packet Payload</th>
306-
<th colspan=16>RSP Packet</th>
301+
<th colspan=8>RSP Packet</th>
307302
</tr>
308303
</thead>
309304
<tbody>
@@ -320,14 +315,6 @@ The basic format of the RSP packet returned by the device to the terminal is as
320315
<td rowspan=1>Byte: 5</td>
321316
<td rowspan=1>Byte: 6</td>
322317
<td rowspan=1>Byte: 7</td>
323-
<td rowspan=1>Byte: 8</td>
324-
<td rowspan=1>Byte: 9</td>
325-
<td rowspan=1>Byte: 10</td>
326-
<td rowspan=1>Byte: 11</td>
327-
<td rowspan=1>Byte: 12</td>
328-
<td rowspan=1>Byte: 13</td>
329-
<td rowspan=1>Byte: 14</td>
330-
<td rowspan=1>Byte: 15~19</td>
331318
</tr>
332319
<tr>
333320
<td rowspan=2>0x04-Basic attributes</td>
@@ -341,14 +328,6 @@ The basic format of the RSP packet returned by the device to the terminal is as
341328
<td rowspan=1></td>
342329
<td rowspan=1></td>
343330
<td rowspan=1></td>
344-
<td rowspan=1></td>
345-
<td rowspan=1></td>
346-
<td rowspan=1></td>
347-
<td rowspan=1></td>
348-
<td rowspan=1></td>
349-
<td rowspan=1></td>
350-
<td rowspan=1></td>
351-
<td rowspan=1></td>
352331
<td rowspan=1></td>
353332
</tr>
354333
<tr>
@@ -361,14 +340,6 @@ The basic format of the RSP packet returned by the device to the terminal is as
361340
<td rowspan=1>Device 1 battery power</td>
362341
<td rowspan=1>Device 1 Firmware version</td>
363342
<td rowspan=1>Device 1 State of charge A</td>
364-
<td rowspan=1></td>
365-
<td rowspan=1></td>
366-
<td rowspan=1></td>
367-
<td rowspan=1></td>
368-
<td rowspan=1></td>
369-
<td rowspan=1></td>
370-
<td rowspan=1></td>
371-
<td rowspan=1></td>
372343
<td rowspan=1></td>
373344
</tr>
374345
<tr>
@@ -383,14 +354,6 @@ The basic format of the RSP packet returned by the device to the terminal is as
383354
<td rowspan=1>bit7-charing or not, 0-not charging, 1-charging; bit6:0-device 0's current battery level</td>
384355
<td rowspan=1>bit7-solar panel connected or not, 0-not connected, 1- connected; bit6:0-device 1's current location</td>
385356
<td rowspan=1>bit7-charing or not, 0-not charging, 1-charging; bit6:0-device 1's current battery level</td>
386-
<td rowspan=1></td>
387-
<td rowspan=1></td>
388-
<td rowspan=1></td>
389-
<td rowspan=1></td>
390-
<td rowspan=1></td>
391-
<td rowspan=1></td>
392-
<td rowspan=1></td>
393-
<td rowspan=1></td>
394357
</tr>
395358
</tbody>
396359
</table>

0 commit comments

Comments
 (0)