@kubohiroya/turbowarp-webrtc-qrcode-pairing 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja.md +21 -14
- package/README.md +64 -27
- package/dist/extension-manifest.json +30 -0
- package/dist/webrtc-qrcode-pairing.js +2788 -2640
- package/docs/architecture.ja.md +2 -2
- package/docs/architecture.md +2 -2
- package/docs/design/qr-pairing/README.md +6 -0
- package/docs/index.html +4 -4
- package/docs/integration-guide.ja.md +81 -42
- package/docs/integration-guide.md +77 -37
- package/docs/migration.ja.md +7 -6
- package/docs/migration.md +7 -6
- package/package.json +10 -11
- package/src/block-definitions.json +193 -49
- package/src/config/qr-config.ts +25 -5
- package/src/errors.ts +0 -2
- package/src/extension.ts +12 -0
- package/src/pairing/controller.ts +259 -89
- package/src/pairing/types.ts +31 -4
- package/src/ports/qr-scan.ts +62 -16
- package/src/qr/courier.ts +154 -193
- package/src/qr/limits.ts +36 -31
- package/src/qr/message.ts +200 -0
- package/src/qr/envelope.ts +0 -0
- package/src/qr/svg.ts +0 -34
package/README.ja.md
CHANGED
|
@@ -8,14 +8,14 @@ QRコードを使ってWebRTCの接続情報を交換するTurboWarp拡張です
|
|
|
8
8
|
|
|
9
9
|
## できること
|
|
10
10
|
|
|
11
|
-
- WebRTCのOfferとAnswer
|
|
12
|
-
- スプライト上に1
|
|
13
|
-
- 読み取った
|
|
11
|
+
- WebRTCのOfferとAnswerを連結QRコード(Structured Append、ISO/IEC 18004)として符号化します。QRの規格自身が定める、1つのメッセージを最大16枚に分ける方式です。
|
|
12
|
+
- スプライト上に1枚ずつ表示します。統合側端末はOfferのQRをコマ送りでループ表示できます。
|
|
13
|
+
- 読み取ったQRを順不同で受け付け、同じQRの重複読取りを許容し、別の連結QRの読取りは報告して無視し、未取得のQRを報告します。
|
|
14
14
|
- 長さとハッシュを検証してからWebRTCへ渡し、検証済みの接続情報を一度だけ引き渡します。
|
|
15
15
|
- Answerがどの Offer への応答かを追跡し、2台のカメラ側端末の接続情報が入れ替わらないようにします。
|
|
16
16
|
- 搬送の進捗と接続状態を別々の状態として報告します。エラー、取消、再試行、期限にも対応します。
|
|
17
17
|
|
|
18
|
-
`0.1.0
|
|
18
|
+
`0.2.0`では、メッセージを連結QRコードで運び、1枚のQRを既定でOfferはversion 15、Answerはversion 20までに抑え、読んだペアリング用のQRをすべて報告します。`turbowarp-jsqr` 0.4.0以降が必要です。`0.2.1`では、QRがカメラに写り続けている間の読取りがページの処理を止めてしまう不具合を直しました。
|
|
19
19
|
|
|
20
20
|
> [!NOTE]
|
|
21
21
|
> ペアリング用ブロックは起動時固定のフィーチャーフラグの内側にあり、既定は無効です。
|
|
@@ -37,15 +37,16 @@ QRコードを使ってWebRTCの接続情報を交換するTurboWarp拡張です
|
|
|
37
37
|
3. 担当者がスマートフォンでAnswerを撮影し、統合側端末まで画像を運ぶ。
|
|
38
38
|
4. 統合側端末のカメラで画像を読み取り、Answerを受理して接続成立を確認する。
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
Offerは統合側端末がループ表示し、カメラ側端末は順不同で全部そろうまで読み取ります。Answerも複数枚の場合は各QRを搬送します。スマートフォンは接続情報を光学的に運び、接続成立後のカメラデータはWebRTC経由で送ります。担当者への案内や投影画面の構成は利用アプリが担当します。
|
|
41
41
|
|
|
42
42
|
## パッケージ間の責務
|
|
43
43
|
|
|
44
44
|
| パッケージ | 責務 |
|
|
45
45
|
|---|---|
|
|
46
46
|
| `turbowarp-webrtc` | Offer/Answerの生成・受理、ICE、WebRTC接続 |
|
|
47
|
-
| 本パッケージ | QR
|
|
48
|
-
| `
|
|
47
|
+
| 本パッケージ | ペアリング用メッセージの形式、そのQRの表示と収集、ペアリングの進行 |
|
|
48
|
+
| `qrcode-structured-append` | 連結QRコードの作成と結合。拡張ではなくライブラリ |
|
|
49
|
+
| `turbowarp-jsqr` | カメラ画像からのQR読取り。連結QRコードの位置も読む |
|
|
49
50
|
| `turbowarp-camera-source` | カメラ取得とフレームへのアクセス |
|
|
50
51
|
| `turbowarp-time-space-sync` | 光学的な時刻対応の推定、カメラ配置の校正 |
|
|
51
52
|
| `turbowarp-time-space-sync-app` | time-space-sync拡張の検証用アプリ |
|
|
@@ -59,13 +60,17 @@ QRコードを使ってWebRTCの接続情報を交換するTurboWarp拡張です
|
|
|
59
60
|
|
|
60
61
|
## 搬送形式
|
|
61
62
|
|
|
62
|
-
|
|
63
|
+
ペアリング用メッセージは`twqr/2`形式のテキストです。protocol、JSONのheader、接続情報を1行ずつ並べます。headerには、session、送信側と受信側のpeer名、メッセージ種別、message ID、reply-to、接続情報の長さとSHA-256ハッシュを含みます。
|
|
63
64
|
|
|
64
|
-
|
|
65
|
+
メッセージは1つの連結QRコードとして運びます。作成には[`@kubohiroya/qrcode-structured-append`](https://github.com/kubohiroya/qrcode-structured-append)を使います。各QRは規格のheaderに自分の位置、枚数、連結QRのparityを持つため、本拡張独自の包みなしに、読み手はどのQRを読んだかが分かります。headerの行が先頭にあるため、連結QRの1枚目だけで誰宛てのメッセージかが分かります。
|
|
65
66
|
|
|
66
|
-
|
|
67
|
+
読取りは連結QR単位です。最初に読んだQRが収集する連結QRを決め、それ以外の連結QRのQRは`foreign`として報告して無視します。ただし収集中の連結QRの1枚目をまだ読んでいない間は、この交換に属する1枚目が読まれれば入れ替えます。古い投影のQRが1枚写り込んでも、正しいOfferの収集を妨げないためです。別の交換のものや破損していたと分かった連結QRは破棄し、表示が続いているQRから集め直します。
|
|
67
68
|
|
|
68
|
-
|
|
69
|
+
parityは連結QRをまとめるだけのもので、256回に1回は一致してしまいます。光学搬送での破損や混在を検出するのはheader内のハッシュです。これは認証ではありません。QRを撮影できる人は誰でも同じ値を計算できます。投影された接続情報は、その投影を見られる全員に見えているものとして扱ってください。
|
|
70
|
+
|
|
71
|
+
QRごとにJSONのenvelopeを入れていた`twqr/1`と、`turbowarp-realtime-motion-capture`の`twmp-qr/1`は、この形式と相互運用せず、`unsupported-protocol`として拒否します。
|
|
72
|
+
|
|
73
|
+
上限は、1メッセージ16枚(連結QRコードの規格上の上限)、接続情報32768文字です。約1,250文字のOfferはversion 15のQR約4枚になり、文字数の上限より先にversionの上限が効きます。
|
|
69
74
|
|
|
70
75
|
## フィーチャーフラグと切戻し
|
|
71
76
|
|
|
@@ -79,12 +84,14 @@ globalThis.__TWQP_FEATURE_FLAGS__ = {qrCodePairing: true};
|
|
|
79
84
|
|
|
80
85
|
切り戻すときはフラグの設定をやめ、`turbowarp-webrtc`のブロック(`create offer code`、`accept offer code`、`answer code`、`accept answer code`)で直接ペアリングします。フラグの無効化は経路の選択であり、成立済みの接続を切断することはありません。
|
|
81
86
|
|
|
82
|
-
|
|
87
|
+
誤り訂正レベルと、方向ごとに1枚のQRが使えるversionの上限も、同じ方法で起動時に固定できます。
|
|
83
88
|
|
|
84
89
|
```js
|
|
85
|
-
globalThis.__TWQP_QR_CONFIG__ = {errorCorrectionLevel: '
|
|
90
|
+
globalThis.__TWQP_QR_CONFIG__ = {errorCorrectionLevel: 'M', offerMaxVersion: 15, answerMaxVersion: 20};
|
|
86
91
|
```
|
|
87
92
|
|
|
93
|
+
上限(1〜40)は、1枚のQRをどこまで細かくしてよいかを決めます。Offer全体を1枚にしたversion 29〜32のQRは、投影をカメラで読むには画面の大半を占める必要があります。Offerは既定でversion 15、約4枚で、統合側端末が自動でループ表示し、測定したすべての条件でカメラが読めました。Answerは既定でversion 20、担当者が手で切り替える約2枚です。
|
|
94
|
+
|
|
88
95
|
## 開発と確認
|
|
89
96
|
|
|
90
97
|
Node.js >=22.18.0、pnpm 11.11.0を利用します。
|
|
@@ -104,7 +111,7 @@ pnpm run dev
|
|
|
104
111
|
## 必要な環境と注意
|
|
105
112
|
|
|
106
113
|
- Node.js >=22.18.0、pnpm 11.11.0。
|
|
107
|
-
- 併用する拡張: 接続は`turbowarp-webrtc`、QRのデコードは`turbowarp-jsqr
|
|
114
|
+
- 併用する拡張: 接続は`turbowarp-webrtc`、QRのデコードは`turbowarp-jsqr` 0.4.0以降、カメラフレームは`turbowarp-camera-source`。本拡張より先に読み込んでください。それより前の`turbowarp-jsqr`はテキストしか返さないため、`qr-decoder-missing`として拒否します。
|
|
108
115
|
- `turbowarp-webrtc`はruntime capability v3(`acceptOffer`、`getAnswer`、`acceptAnswer`、`connectionState`、`hasPeer`、`closePeer`)を公開している必要があります。0.4.0以降が該当します。0.3.0以前はv2までで、Offerは作れても受理できないため往復を完結できません。
|
|
109
116
|
- QRで接続情報を運べたことは、接続が到達可能であることを意味しません。ネットワーク条件、ICE、STUN/TURNは`turbowarp-webrtc`の責務です。
|
|
110
117
|
|
package/README.md
CHANGED
|
@@ -8,14 +8,14 @@ A TurboWarp extension for exchanging WebRTC connection information through QR co
|
|
|
8
8
|
|
|
9
9
|
## What it does
|
|
10
10
|
|
|
11
|
-
- Encodes a WebRTC Offer or Answer
|
|
12
|
-
- Displays one
|
|
13
|
-
-
|
|
11
|
+
- Encodes a WebRTC Offer or Answer as a Structured Append sequence (ISO/IEC 18004), the QR standard's own way of splitting one message across up to 16 codes.
|
|
12
|
+
- Displays one code at a time on a sprite, so the integration machine can cycle the Offer codes in a loop.
|
|
13
|
+
- Reads the codes in any order, tolerates repeated readings, reports codes of other sequences and ignores them, and reports which codes are still missing.
|
|
14
14
|
- Verifies length and hash before a code reaches WebRTC, and hands each verified code over exactly once.
|
|
15
15
|
- Tracks which offer an answer replies to, so two camera machines never receive each other's connection.
|
|
16
16
|
- Reports transport progress and connection state as separate states, plus errors, cancellation, retry and deadlines.
|
|
17
17
|
|
|
18
|
-
Version 0.
|
|
18
|
+
Version 0.2.0 carries messages as Structured Append sequences, caps Offer codes at QR version 15 and Answer codes at 20, and reports every pairing code read. It needs `turbowarp-jsqr` 0.4.0 or later. 0.2.1 fixes a camera scan that starved the page while a code stayed in view.
|
|
19
19
|
|
|
20
20
|
> [!NOTE]
|
|
21
21
|
> The pairing blocks are behind a startup feature flag that is off by default. See
|
|
@@ -44,8 +44,9 @@ The smartphone carries signaling information optically. Camera data is sent over
|
|
|
44
44
|
| Package | Responsibility |
|
|
45
45
|
|---|---|
|
|
46
46
|
| `turbowarp-webrtc` | Offer/Answer creation and acceptance, ICE and WebRTC connections |
|
|
47
|
-
| `turbowarp-webrtc-qrcode-pairing` |
|
|
48
|
-
| `
|
|
47
|
+
| `turbowarp-webrtc-qrcode-pairing` | Pairing message format, display and collection of its codes, and pairing orchestration |
|
|
48
|
+
| `qrcode-structured-append` | Creating and joining Structured Append sequences; a library, not an extension |
|
|
49
|
+
| `turbowarp-jsqr` | Decode QR codes from camera frames, including Structured Append positions |
|
|
49
50
|
| `turbowarp-camera-source` | Camera acquisition and frame access |
|
|
50
51
|
| `turbowarp-time-space-sync` | Optical time correspondence and camera placement calibration |
|
|
51
52
|
| `turbowarp-time-space-sync-app` | Verification app for the time-space-sync extension |
|
|
@@ -59,13 +60,17 @@ A pairing session cannot be handed from one app to another. Opening a different
|
|
|
59
60
|
|
|
60
61
|
## Transport format
|
|
61
62
|
|
|
62
|
-
|
|
63
|
+
A pairing message is text in the `twqr/2` format: the protocol, a JSON header, and the pairing code, one per line. The header names the session, the sender and target peers, the message kind, the message id, what it replies to, the code's length and its SHA-256 hash.
|
|
63
64
|
|
|
64
|
-
The
|
|
65
|
+
The message is carried as one Structured Append sequence, made by [`@kubohiroya/qrcode-structured-append`](https://github.com/kubohiroya/qrcode-structured-append). Each code holds its position, the count and the sequence's parity in the standard header, so a reader knows which code it has without any wrapper of this extension's. The header line comes first, so the first code of a sequence already tells a reader whose message it is.
|
|
65
66
|
|
|
66
|
-
|
|
67
|
+
Reading goes by sequence. The first code read decides the sequence being collected; codes of any other sequence are reported as `foreign` and ignored. Until the first code of that sequence has been read, a first code that belongs to this exchange replaces it, so a stray code of an old projection cannot block the right one. A sequence that turns out to be another exchange's, or damaged, is dropped and collected again from the codes still being shown.
|
|
67
68
|
|
|
68
|
-
|
|
69
|
+
The parity only groups codes and collides one time in 256, so the hash in the header is what detects optical damage and mixed sequences. It is not authentication: anyone who can photograph the codes can recompute it. Treat a projected pairing code as visible to everyone who can see the projection.
|
|
70
|
+
|
|
71
|
+
`twqr/1`, which put a JSON envelope into every code, and `twmp-qr/1` from `turbowarp-realtime-motion-capture` do not interoperate with this format and are rejected with `unsupported-protocol`.
|
|
72
|
+
|
|
73
|
+
Limits: at most 16 codes per message, the Structured Append limit, and 32768 characters per pairing code. A pairing offer of about 1,250 characters is about four version 15 codes; the version cap binds long before the character limit.
|
|
69
74
|
|
|
70
75
|
## Feature flag and rollback
|
|
71
76
|
|
|
@@ -79,16 +84,18 @@ Set it before the extension loads. While the flag is off, `getInfo` publishes no
|
|
|
79
84
|
|
|
80
85
|
To roll back, stop setting the flag and pair with the `turbowarp-webrtc` blocks directly: `create offer code`, `accept offer code`, `answer code` and `accept answer code`. Turning the flag off selects the other route; it never disconnects an established connection.
|
|
81
86
|
|
|
82
|
-
Error correction level can be fixed at startup the same way:
|
|
87
|
+
Error correction level and the largest QR version each direction uses can be fixed at startup the same way:
|
|
83
88
|
|
|
84
89
|
```js
|
|
85
|
-
globalThis.__TWQP_QR_CONFIG__ = {errorCorrectionLevel: '
|
|
90
|
+
globalThis.__TWQP_QR_CONFIG__ = {errorCorrectionLevel: 'M', offerMaxVersion: 15, answerMaxVersion: 20};
|
|
86
91
|
```
|
|
87
92
|
|
|
93
|
+
The caps (1 to 40) decide how fine each code gets. A single version 29-32 code for a whole offer is read off a projection only when it fills most of the frame. Offer codes default to version 15, about four codes that the integration machine cycles automatically and a camera read under every measured condition; Answer codes default to version 20, about two codes an operator turns by hand.
|
|
94
|
+
|
|
88
95
|
## Requirements and safety
|
|
89
96
|
|
|
90
97
|
- Node.js >=22.18.0 and pnpm 11.11.0.
|
|
91
|
-
- Companion extensions: `turbowarp-webrtc` for the connection, `turbowarp-jsqr` for decoding and `turbowarp-camera-source` for camera frames. Load them before this one.
|
|
98
|
+
- Companion extensions: `turbowarp-webrtc` for the connection, `turbowarp-jsqr` 0.4.0 or later for decoding and `turbowarp-camera-source` for camera frames. Load them before this one. Earlier `turbowarp-jsqr` versions return text only and are refused with `qr-decoder-missing`.
|
|
92
99
|
- `turbowarp-webrtc` must publish runtime capability v3, which adds `acceptOffer`, `getAnswer`, `acceptAnswer`, `connectionState`, `hasPeer` and `closePeer`. Version 0.4.0 publishes it; 0.3.0 and earlier publish v2, which can produce an offer but not accept one, so a round trip cannot complete.
|
|
93
100
|
- Carrying a code by QR does not make a connection reachable. Network conditions, ICE and STUN/TURN belong to `turbowarp-webrtc`.
|
|
94
101
|
|
|
@@ -109,7 +116,7 @@ pnpm run dev
|
|
|
109
116
|
|
|
110
117
|
Build output: `dist/webrtc-qrcode-pairing.js` and `dist/extension-manifest.json`. Load the JavaScript file as a custom TurboWarp extension. The manifest always records every declared block, including blocks the feature flag hides at runtime: it is the build-time contract, not the runtime state.
|
|
111
118
|
|
|
112
|
-
Package name and version
|
|
119
|
+
Package name and version: `@kubohiroya/turbowarp-webrtc-qrcode-pairing@0.2.1`.
|
|
113
120
|
|
|
114
121
|
## Block reference
|
|
115
122
|
|
|
@@ -117,7 +124,7 @@ Package name and version for future consumers (not a claim of publication): `@ku
|
|
|
117
124
|
|
|
118
125
|
### `start offer pairing [SESSION] as [LOCAL_PEER] to [REMOTE_PEER]`
|
|
119
126
|
|
|
120
|
-
Creates a WebRTC offer for the integration machine and prepares
|
|
127
|
+
Creates a WebRTC offer for the integration machine and prepares it as a Structured Append sequence of QR codes.
|
|
121
128
|
|
|
122
129
|
| Property | Value |
|
|
123
130
|
|---|---|
|
|
@@ -138,9 +145,9 @@ Waits for an offer on the camera machine. Leave the name empty to adopt the name
|
|
|
138
145
|
| `SESSION` | String, default: `pairing-1` |
|
|
139
146
|
| `LOCAL_PEER` | String, default: `` |
|
|
140
147
|
|
|
141
|
-
### `receive pairing
|
|
148
|
+
### `receive pairing message [TEXT] for [SESSION]`
|
|
142
149
|
|
|
143
|
-
Accepts one
|
|
150
|
+
Accepts a whole pairing message as text, such as one pasted or carried some other way. Camera scanning reads the QR codes of a sequence itself.
|
|
144
151
|
|
|
145
152
|
| Property | Value |
|
|
146
153
|
|---|---|
|
|
@@ -151,7 +158,7 @@ Accepts one decoded QR text. Repeated readings of the same part are ignored.
|
|
|
151
158
|
|
|
152
159
|
### `scan pairing QR for [SESSION] from camera [CAMERA_ID]`
|
|
153
160
|
|
|
154
|
-
Reads
|
|
161
|
+
Reads QR codes from the named camera, in any order, until the exchange has every code of the sequence. Codes of other sequences are reported and ignored.
|
|
155
162
|
|
|
156
163
|
| Property | Value |
|
|
157
164
|
|---|---|
|
|
@@ -162,7 +169,7 @@ Reads parts from the named camera until the exchange has every part it needs.
|
|
|
162
169
|
|
|
163
170
|
### `received parts of [SESSION]`
|
|
164
171
|
|
|
165
|
-
Returns how many distinct
|
|
172
|
+
Returns how many distinct codes of the incoming sequence have been read.
|
|
166
173
|
|
|
167
174
|
| Property | Value |
|
|
168
175
|
|---|---|
|
|
@@ -172,7 +179,7 @@ Returns how many distinct parts have been accepted.
|
|
|
172
179
|
|
|
173
180
|
### `required parts of [SESSION]`
|
|
174
181
|
|
|
175
|
-
Returns how many
|
|
182
|
+
Returns how many codes the incoming sequence has, or zero before the first code arrives.
|
|
176
183
|
|
|
177
184
|
| Property | Value |
|
|
178
185
|
|---|---|
|
|
@@ -182,7 +189,7 @@ Returns how many parts the incoming message has, or zero before the first part a
|
|
|
182
189
|
|
|
183
190
|
### `missing parts of [SESSION]`
|
|
184
191
|
|
|
185
|
-
Returns the one-based
|
|
192
|
+
Returns the one-based code numbers that have not been read yet, separated by commas.
|
|
186
193
|
|
|
187
194
|
| Property | Value |
|
|
188
195
|
|---|---|
|
|
@@ -190,9 +197,39 @@ Returns the one-based part numbers that have not been read yet, separated by com
|
|
|
190
197
|
| Opcode | `pairingMissingParts` |
|
|
191
198
|
| `SESSION` | String, default: `pairing-1` |
|
|
192
199
|
|
|
200
|
+
### `pairing QR reads of [SESSION]`
|
|
201
|
+
|
|
202
|
+
Returns how many pairing QR codes this session has read, of any result. It rises by one per read, so a change means there is a new result to show.
|
|
203
|
+
|
|
204
|
+
| Property | Value |
|
|
205
|
+
|---|---|
|
|
206
|
+
| Type | Reporter |
|
|
207
|
+
| Opcode | `pairingReadCount` |
|
|
208
|
+
| `SESSION` | String, default: `pairing-1` |
|
|
209
|
+
|
|
210
|
+
### `last pairing QR read of [SESSION]`
|
|
211
|
+
|
|
212
|
+
Returns what the latest pairing QR code was: accepted (a new code of the sequence), duplicate (a code already read), foreign (a code this exchange cannot use, which is ignored), or an empty string before the first read. QR codes that are not pairing codes are not reported.
|
|
213
|
+
|
|
214
|
+
| Property | Value |
|
|
215
|
+
|---|---|
|
|
216
|
+
| Type | Reporter |
|
|
217
|
+
| Opcode | `pairingLastRead` |
|
|
218
|
+
| `SESSION` | String, default: `pairing-1` |
|
|
219
|
+
|
|
220
|
+
### `last pairing QR read detail of [SESSION]`
|
|
221
|
+
|
|
222
|
+
Returns the code as "2 / 4" for accepted and duplicate reads, or why a foreign code was ignored as an error code such as message-mismatch (another sequence), stale-exchange or peer-mismatch.
|
|
223
|
+
|
|
224
|
+
| Property | Value |
|
|
225
|
+
|---|---|
|
|
226
|
+
| Type | Reporter |
|
|
227
|
+
| Opcode | `pairingLastReadDetail` |
|
|
228
|
+
| `SESSION` | String, default: `pairing-1` |
|
|
229
|
+
|
|
193
230
|
### `show pairing QR part [INDEX] of [SESSION] on this sprite`
|
|
194
231
|
|
|
195
|
-
Shows the selected one-based
|
|
232
|
+
Shows the selected one-based code of the sequence using a temporary sprite skin.
|
|
196
233
|
|
|
197
234
|
| Property | Value |
|
|
198
235
|
|---|---|
|
|
@@ -203,7 +240,7 @@ Shows the selected one-based part using a temporary sprite skin.
|
|
|
203
240
|
|
|
204
241
|
### `show next pairing QR part of [SESSION] on this sprite`
|
|
205
242
|
|
|
206
|
-
Shows the next
|
|
243
|
+
Shows the next code and wraps from the last back to the first, so a loop with a short wait cycles the whole sequence.
|
|
207
244
|
|
|
208
245
|
| Property | Value |
|
|
209
246
|
|---|---|
|
|
@@ -213,7 +250,7 @@ Shows the next part and wraps from the last part back to the first.
|
|
|
213
250
|
|
|
214
251
|
### `pairing QR part count of [SESSION]`
|
|
215
252
|
|
|
216
|
-
Returns how many
|
|
253
|
+
Returns how many codes are prepared for display, or zero when none are.
|
|
217
254
|
|
|
218
255
|
| Property | Value |
|
|
219
256
|
|---|---|
|
|
@@ -223,7 +260,7 @@ Returns how many parts are prepared for display, or zero when none are.
|
|
|
223
260
|
|
|
224
261
|
### `current pairing QR part of [SESSION]`
|
|
225
262
|
|
|
226
|
-
Returns the one-based
|
|
263
|
+
Returns the one-based code selected for display, or zero when none is selected.
|
|
227
264
|
|
|
228
265
|
| Property | Value |
|
|
229
266
|
|---|---|
|
|
@@ -233,7 +270,7 @@ Returns the one-based part selected for display, or zero when none is selected.
|
|
|
233
270
|
|
|
234
271
|
### `pairing QR part [INDEX] of [SESSION] as SVG`
|
|
235
272
|
|
|
236
|
-
Returns the
|
|
273
|
+
Returns the code as SVG markup so a project can display it its own way.
|
|
237
274
|
|
|
238
275
|
| Property | Value |
|
|
239
276
|
|---|---|
|
|
@@ -244,7 +281,7 @@ Returns the part as SVG markup so a project can display it its own way.
|
|
|
244
281
|
|
|
245
282
|
### `pairing QR part [INDEX] of [SESSION] as data URI`
|
|
246
283
|
|
|
247
|
-
Returns the
|
|
284
|
+
Returns the code as a base64 SVG data URI for costumes and HTML images.
|
|
248
285
|
|
|
249
286
|
| Property | Value |
|
|
250
287
|
|---|---|
|
|
@@ -86,6 +86,26 @@
|
|
|
86
86
|
}
|
|
87
87
|
]
|
|
88
88
|
},
|
|
89
|
+
{
|
|
90
|
+
"opcode": "pairingLastRead",
|
|
91
|
+
"blockType": "REPORTER",
|
|
92
|
+
"arguments": [
|
|
93
|
+
{
|
|
94
|
+
"id": "SESSION",
|
|
95
|
+
"type": "STRING"
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"opcode": "pairingLastReadDetail",
|
|
101
|
+
"blockType": "REPORTER",
|
|
102
|
+
"arguments": [
|
|
103
|
+
{
|
|
104
|
+
"id": "SESSION",
|
|
105
|
+
"type": "STRING"
|
|
106
|
+
}
|
|
107
|
+
]
|
|
108
|
+
},
|
|
89
109
|
{
|
|
90
110
|
"opcode": "pairingLocalPeer",
|
|
91
111
|
"blockType": "REPORTER",
|
|
@@ -164,6 +184,16 @@
|
|
|
164
184
|
}
|
|
165
185
|
]
|
|
166
186
|
},
|
|
187
|
+
{
|
|
188
|
+
"opcode": "pairingReadCount",
|
|
189
|
+
"blockType": "REPORTER",
|
|
190
|
+
"arguments": [
|
|
191
|
+
{
|
|
192
|
+
"id": "SESSION",
|
|
193
|
+
"type": "STRING"
|
|
194
|
+
}
|
|
195
|
+
]
|
|
196
|
+
},
|
|
167
197
|
{
|
|
168
198
|
"opcode": "pairingReceivedParts",
|
|
169
199
|
"blockType": "REPORTER",
|