Skip to content

Feature/tuya ble control - #49

Draft
heshaoqiong-tuya wants to merge 3 commits into
masterfrom
feature/tuya-ble-control
Draft

heshaoqiong-tuya wants to merge 3 commits into
masterfrom
feature/tuya-ble-control

Conversation

@heshaoqiong-tuya

Copy link
Copy Markdown
Collaborator

No description provided.

@heshaoqiong-tuya
heshaoqiong-tuya force-pushed the feature/tuya-ble-control branch 2 times, most recently from b74a5d4 to 33e5480 Compare November 13, 2026 02:17
heshaoqiong-tuya and others added 3 commits November 17, 2026 18:05
Activated devices and BLE-only products need authenticated local control
without coupling the BLE owner to MQTT or partially applying DP batches.
Add bound advertising, KEY_14/KEY_15 authorization, validated DP TLV
callbacks and explicit ordinary or timestamped reports. Apply local DP
batches atomically through the public IoT API, notify outside the state
lock and keep every MQTT uplink application-owned.

Parse activation delivery as typed protocol JSON and verify credentials
from extended single-mode Pairing before installation. Queue the KEY_12
ACK before switching forms, retain credentials across reconnects, and
require a delivered or firmware-provisioned schema before binding.
Schema-less cloud activation remains supported and covered separately.

Announce protocol 4.8 after parsing bounded AppFlag and mesh extensions,
while accepting legacy pair requests. Derive device capability and V2
flags consistently, track the App DP-channel claim, and fence asynchronous
results across session generations. Transparent-DP routing remains a port
responsibility.

Register sources in both host and ESP-IDF builds, add lexical and bounded
string helpers with regression coverage, require the offline BLE-only
demo in CI, and document the API, owner-context boundary and bilingual
reference pages with sidebar navigation. Research-only HTML reports do
not form part of the SDK documentation.

The original series also passed ASan/UBSan 32/32, codec differential
checks 3135/3135, strict host and ESP32-S3 compilation 4/4 source files,
and documentation builds for 2/2 locales.

Verified after consolidation: host build; full serial CTest 32/32;
BLE 19 wire and 29 bound-control scenarios plus test_prov.

Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
The App needs turn-control callbacks, AI audio uplinks and BT device-info
responses in an authenticated session. Handle 0x0094 start, stop, error
and heartbeat opcodes, expose device-originated turn requests, and use
frame-level ACKs while the App answers turn requests with fresh frames.
Advertise Hey Tuya Flag2 bit 5 only when a voice callback is registered.

Send encoded AI audio on 0x0091 with caller-owned audio sequence,
ACK_SN=0, optional per-frame replies and distinct Opus format codes for
32 kbps and 16 kbps. Require a bound KEY_15 session and use the existing
bounded TX queue. Answer authenticated 0x0060 device-info queries with
session state and the device name.

Share DP command macros across authorization, dispatch and reporting,
and document the voice vocabulary and public interfaces. The application
continues to own capture, encoding and all BLE state access.

The original voice-frame suite also passed focused ASan/UBSan 1/1.

Verified after consolidation: host build; full serial CTest 32/32;
BLE 19 wire and 33 bound-control scenarios plus test_prov.

Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
The default log sink does not need a Win32 implementation. Use
localtime_r, flockfile and funlockfile directly to simplify timestamp
formatting and atomic stderr output.

Verified: cmake --build build -j 4; full serial ctest 32/32.

Co-Authored-By: Codex <noreply@openai.com>
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