iOS Question BLE WriteData question - Resolved

megaB4x

Member
Licensed User
Longtime User
Hi all,

I am having an issue here. I am using a BLE module and I can read and write characteristic fine using BLE explorer and LightBlue apps. However, when I try to write some data to same characteristic there is no error message but it does not write to the characteristic. The code snippet below is pretty simple but any ideas what else I can look for? BTW I do read the values before I write as explained in the documentation.

Thanks all!
B4X:
Dim ByteC As ByteConverter

Dim data() As Byte
data=ByteC.HexToBytes("2222")
manager.WriteData("AB230001-4A12-1234-ABCD-123456789012", "AB230003-4A12-1234-ABCD-123456789012", data)
 

megaB4x

Member
Licensed User
Longtime User
Hi Erel,

B4X:
Sub btnWrite_Click
Dim ByteC As ByteConverter
Dim data() As Byte
data=ByteC.HexToBytes("11")
manager.WriteData("11111111-1111-1111-1111-111111111111", "33333333-3333-3333-3333-333333333333", data)   
End Sub


Above is the current code and below is the output of DataAvailable:

Service: 180A
NSMapTable {
[9] Model Number String -> <B4IArray: 0x17eb4b70>
[12] System ID -> <B4IArray: 0x17e77560>
[13] Manufacturer Name String -> <B4IArray: 0x17e9cce0>
}

Service: 11111111-1111-1111-1111-111111111111
NSMapTable {
[12] 22222222-2222-2222-2222-222222222222 -> <B4IArray: 0x17e72ec0>
[15] 33333333-3333-3333-3333-333333333333 -> <B4IArray: 0x17eb1dc0>
}


Thanks!
 
Upvote 0
Top