Skip to main content

Android BLE / Auth / Init SDK

Current status

As of April 24, 2026, aitalk_app_new_mesh/apps/android-ui/settings.gradle.kts still includes only :app, :mesh-sdk, and :stt-sdk. BLE transport, BLE authentication, BLE default initialization, and UART authentication/initialization are still mostly implemented inside :app.

This page and the three pages below define the Android device-access SDK boundaries and explicitly distinguish between the current code locations and the target split layout.

Entry pages

  • Android BLE Connection SDK
    • covers XTalkBleClient only
    • BLE init, scan, connect, disconnect, AT channel, binary send/receive
  • Android Device Auth SDK
    • covers authentication semantics only
    • AT+CHALLENGE, signature verification, DID read, BLE/UART auth boundaries
  • Android Device Init SDK
    • covers post-auth initialization only
    • AT+ADDTL / AT+FREQ / AT+RATE / AT+BCNID / AT+WORKMODE and UART vendor configuration

Current code locations

BLE transport

  • apps/android-ui/app/src/main/java/com/xtalk/mesh/uimock/ble/XTalkBleClient.kt
  • apps/android-ui/app/src/main/java/com/xtalk/mesh/uimock/ble/XTalkBleConstants.kt
  • apps/android-ui/app/src/main/java/com/xtalk/mesh/uimock/ble/BleDeviceNames.kt

Shared transport and UART

  • apps/android-ui/app/src/main/java/com/xtalk/mesh/uimock/transport/AppTransport.kt
  • apps/android-ui/app/src/main/java/com/xtalk/mesh/uimock/uart/XTalkUartClient.kt

Current auth/init implementation

  • BLE still has a legacy combined entry: XTalkBleClient.authenticateAndInitializeDefaults(...)
  • UART authentication and post-auth AT setup are still mainly in:
    • apps/android-ui/app/src/main/java/com/xtalk/mesh/uimock/XTalkMeshUiApp.kt

Target split layout

The docs site is now structured by SDK boundary. The recommended extraction layout is:

  • :ble-sdk
    • XTalkBleClient only
    • no authentication orchestration, no business initialization
  • :device-auth-sdk
    • BLE/UART authentication and DID read only
    • no frequency/rate/BCN/WORKMODE initialization
  • :device-init-sdk
    • BLE post-auth defaults, UART defaults, UART vendor configuration
  • BLE SDK
    • connection lifecycle, GATT, AT passthrough, binary send/receive
  • Auth SDK
    • AT+CHALLENGE
    • challenge parsing and signature verification
    • AT+EFUSESN? / AT+SN? DID read
  • Init SDK
    • BLE wireless defaults
    • UART defaults
    • UART vendor hardware configuration
  • Mesh SDK
    • higher-level mesh text, voice, routing, ACK, and business protocol logic

Mapping from logical SDKs to the current repository

Logical SDKCurrent locationStatus
BLE Connection SDK:app under uimock/ble/*clearly implemented
Device Auth SDKXTalkBleClient.authenticateAndInitializeDefaults(...) plus UART auth logic in XTalkMeshUiApp.ktnot extracted yet
Device Init SDKXTalkBleClient.authenticateAndInitializeDefaults(...) plus AppTransport.kt and XTalkMeshUiApp.ktnot extracted yet

BLE

  1. XTalkBleClient.ensureInitialized()
  2. XTalkBleClient.connect(...)
  3. Auth SDK
  4. Init SDK
  5. XTalkBleClient.sendBinaryFrame(...)

UART

  1. XTalkUartClient.open(...)
  2. Auth SDK
  3. Init SDK
  4. Business send/receive

Note

The desktop sources android_ble_sdk_integration.md and android_ble_sdk_integration.html are merged into this single docs page on the website. The site uses one Docusaurus page instead of keeping a duplicate raw HTML entry.