About Meshtastic Communication Protocol With BLE To Mobile. Source Doc
以下有經過Claude AI協助解釋,可能會有不正確的內容,還請見諒。
6ba1b218-15a8-461f-9fa8-5dcae273eafd
f75c76d2-129e-4dad-a1dd-7866124401e7
2c55e69e-4993-11ed-b878-0242ac120002
ed9da18c-a800-4f66-a670-aa7547e34453
0x2a19
0x2A19
0x2904
0x27AD
(Percentage)NimbleBluetoothToRadioCallback::onWrite()
:負責處理藍牙通訊的 ToRadio Services。當該特性值發生變化時,會觸發此Callback。 (ID: f75c76d2-129e-4dad-a1dd-7866124401e7
)
NimbleBluetoothFromRadioCallback::onRead()
:負責處理藍牙通訊的 FromRadio Services。當手機讀取此特性值時,會觸發此Callback。 (ID: 2c55e69e-4993-11ed-b878-0242ac120002
)
PhoneAPI::handleToRadio()
:處理從手機向無線電發送的 ToRadio 協定訊息。
meshtastic_ToRadio_packet_tag
: 呼叫 handleToRadioPacket() 函數處理封包。meshtastic_ToRadio_want_config_id_tag
: 取得設定檔 ID (config_nonce),並呼叫 handleStartConfig() 函數。meshtastic_ToRadio_disconnect_tag
: 關閉與手機的連接。meshtastic_ToRadio_xmodemPacket_tag
: 呼叫 xModem.handlePacket() 處理 xmodem 封包。2024.4.13 blackcat
)meshtastic_ToRadio_mqttClientProxyMessage_tag
: 呼叫 mqtt->onClientProxyReceive() 處理 MQTT 代理訊息。meshtastic_ToRadio_heartbeat_tag
: 記錄已收到手機的心跳訊號。PhoneAPI::getFromRadio()
:處理從無線電向手機發送的 FromRadio 協定訊息。
STATE_SEND_MY_INFO
:發送個人資訊。STATE_SEND_METADATA
:發送設備 (這裡指無線電) 的原始資料。STATE_SEND_NODEINFO
:發送節點資訊。STATE_SEND_CHANNELS
:發送頻道配置。STATE_SEND_CONFIG
:發送設備 (這裡指無線電) 設定資訊。
meshtastic_Config_device_tag
:裝置資訊meshtastic_Config_position_tag
:GPS定位meshtastic_Config_power_tag
:省電meshtastic_Config_network_tag
:WiFi網路meshtastic_Config_display_tag
:螢幕 (如SSD1306 / SSD1308…等)meshtastic_Config_lora_tag
:LoRa模組 (如SX1262 / 1276 / 1278…等)meshtastic_Config_bluetooth_tag
:藍芽STATE_SEND_MODULECONFIG
:發送功能模組的設定資訊。
meshtastic_ModuleConfig_mqtt_tag
:MQTT網路meshtastic_ModuleConfig_serial_tag
:序列埠 (如TTL / RS232…等)meshtastic_ModuleConfig_external_notification_tag
:外部裝置輸出 (如LED / 蜂鳴器…等)meshtastic_ModuleConfig_store_forward_tag
:告訴路由節點暫時存儲 / 轉發訊息給其他裝置
2024.4.13 blackcat
)meshtastic_ModuleConfig_range_test_tag
:兩節點之間的距離測試meshtastic_ModuleConfig_telemetry_tag
:遙測模組 (如BME280、SHT31…等 Sensor)meshtastic_ModuleConfig_canned_message_tag
:事先設定好預發送的訊息meshtastic_ModuleConfig_audio_tag
:音頻資料meshtastic_ModuleConfig_remote_hardware_tag
:遙控其他節點的GPIO開/關meshtastic_ModuleConfig_neighbor_info_tag
:鄰近節點的資訊meshtastic_ModuleConfig_detection_sensor_tag
:開關 / 壓力感測器 / 紅外線感測器 (輸出訊號為Low或者High)meshtastic_ModuleConfig_ambient_lighting_tag
:漸變燈 / 呼吸燈meshtastic_ModuleConfig_paxcounter_tag
:透過WiFi或者藍芽 MAC位置計算該周圍的人數STATE_SEND_COMPLETE_ID
:發送設定完成的標識。STATE_SEND_PACKETS
:發送從Mesh網路接收的封包。<Top Folder>\protoc\bin
meshtastic專案資料夾/bin/regen-protos.bat
NimbleBluetooth.cpp
,將封包透過Hex印出:0a 17
: 表示這是一個 ToRadio 訊息,長度為 0x17(23)個字節。15 ff ff ff ff
: 這是一個 Packet 類型的訊息,具有 4 個字節的目的地 ID。22 09
: 是協議版本號。08 01
: 表示這是一個 DATA_MESSAGE 類型的封包。12 05
: 表示接下來有 5 個字節的荷載資料。48 65 6c 6c 6f
: 這就是荷載資料,解碼出來是 "Hello" 字串。35 5b 06 ec 94 50 01
: 這是一些其他的封包資訊,如來源 ID、crc 校驗碼等。