Skip to content

Phase 7 SP3: làn bulk qua Bluetooth (kênh 0x02) - #20

Open
xuandung38 wants to merge 9 commits into
mainfrom
feat/p07-sp3-bulk-bluetooth
Open

xuandung38 wants to merge 9 commits into
mainfrom
feat/p07-sp3-bulk-bluetooth

Conversation

@xuandung38

Copy link
Copy Markdown
Contributor

Làn bulk qua Bluetooth (kênh 0x02) cho ảnh và clipboard lớn khi không có mạng: contract spec 0.4.7, tiến độ từ 128 KiB, ghi chú Bluetooth trên tiến độ. Thứ tự merge: shared → android → apple → hub. Merge bằng 'Create a merge commit'.

The clipboard engine now picks EnvelopeLane (CONTROL/BULK) on every send
path for chunked transfers: clipboard/push with transfer, every
clipboard/chunk, clipboard/cancel from either side, and the matching
ack/clipboard/conflict all travel on channel 0x02 instead of 0x01 when
the session is over Bluetooth (ignored on LAN/relay, single lane).

BluetoothPeerSocket implements BulkLaneSocket.sendBulk, gated by a
Semaphore(BT_BULK_QUEUED=2) that releases once the scheduler reports a
bulk envelope's last fragment fully written; a new
BluetoothBulkLaneReassembler reassembles channel 0x02 in its own
buffer, separate from the long control lane's. BtTransportFrame.decode
closes the link when long=1 is set on channel 0x02 (bulk rule 5). A
duplicate request's kept ack (0.5.1 rule 2) now resends on the lane it
was first sent on, tracked through ReplayWindow/SessionCipher.

Until Wi-Fi Direct (A7.5) ships, every Bluetooth transfer runs on the
bulk lane regardless of size.
BluetoothBulkLane now holds the BT_BULK_QUEUED gate and the channel 0x02
reassembler; BluetoothLinkScheduler.poll keeps short > long > bulk and
the BT_BULK_INFLIGHT cap in a single expression. ClipReceiver derives the
reply lane from the push, and the SMS test harness takes the lane
argument added to EnvelopeSender. Clears detekt and ktlint on check.
Over a Bluetooth session an image of at least BULK_DIRECT_MIN shows
sending and receiving progress flagged for the Bluetooth note (CLIP-03
fields 2 and 10); below it, and on LAN under 1 MiB, nothing shows.
TransferProgress carries overBluetooth so the notifier can add the
CLIP-03 field 10 line; LAN and relay keep the 1 MiB threshold.
Over the Bluetooth link the progress notification carries the CLIP-03
field 10 line under the percent, in English and Vietnamese; LAN
progress has none.
When a transfer runs over the Bluetooth link the progress notification
expands to the percent line followed by clipboard.bulk_bluetooth_sending
or _receiving (CLIP-03 field 10); LAN and relay progress is unchanged.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant