@magicred-1/ble-mesh 1.2.7 → 1.2.8
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.
|
@@ -1050,12 +1050,12 @@ class BleMeshModule(reactContext: ReactApplicationContext) : ReactContextBaseJav
|
|
|
1050
1050
|
offset: Int,
|
|
1051
1051
|
value: ByteArray
|
|
1052
1052
|
) {
|
|
1053
|
-
Log.d(TAG, "onCharacteristicWriteRequest: ${value.size} bytes from ${device.address}, uuid=${characteristic.uuid}")
|
|
1053
|
+
Log.d(TAG, "📥 onCharacteristicWriteRequest: ${value.size} bytes from ${device.address}, uuid=${characteristic.uuid}")
|
|
1054
1054
|
if (characteristic.uuid == characteristicUUID) {
|
|
1055
|
-
Log.d(TAG, "Characteristic matches, handling packet")
|
|
1055
|
+
Log.d(TAG, "✅ Characteristic matches, handling packet (type: ${if (value.size > 1) value[1].toString() else "unknown"})")
|
|
1056
1056
|
handleReceivedPacket(value, device.address)
|
|
1057
1057
|
} else {
|
|
1058
|
-
Log.
|
|
1058
|
+
Log.w(TAG, "❌ Characteristic UUID mismatch: expected $characteristicUUID, got ${characteristic.uuid}")
|
|
1059
1059
|
}
|
|
1060
1060
|
if (responseNeeded) {
|
|
1061
1061
|
gattServer?.sendResponse(device, requestId, BluetoothGatt.GATT_SUCCESS, 0, null)
|
package/ios/BleMesh.swift
CHANGED
|
@@ -1674,7 +1674,14 @@ extension BleMesh: CBPeripheralManagerDelegate {
|
|
|
1674
1674
|
func peripheralManager(_ peripheral: CBPeripheralManager, didReceiveWrite requests: [CBATTRequest]) {
|
|
1675
1675
|
for request in requests {
|
|
1676
1676
|
if let data = request.value {
|
|
1677
|
-
|
|
1677
|
+
NSLog("[BleMesh] 📥 didReceiveWrite: \(data.count) bytes from central, characteristic: \(request.characteristic.uuid)")
|
|
1678
|
+
if request.characteristic.uuid == BleMesh.characteristicUUID {
|
|
1679
|
+
let messageType = data.count > 1 ? data[1] : 0
|
|
1680
|
+
NSLog("[BleMesh] ✅ Characteristic matches, handling packet (type: \(messageType))")
|
|
1681
|
+
handleReceivedPacket(data, from: nil)
|
|
1682
|
+
} else {
|
|
1683
|
+
NSLog("[BleMesh] ❌ Characteristic UUID mismatch: expected \(BleMesh.characteristicUUID), got \(request.characteristic.uuid)")
|
|
1684
|
+
}
|
|
1678
1685
|
}
|
|
1679
1686
|
peripheral.respond(to: request, withResult: .success)
|
|
1680
1687
|
}
|