Android Question BLE2 Communications Implementation

Denny Hopp

Member
Licensed User
Longtime User
The BLE2 library is working great for me and I am able to read and write characteristics to/from my custom target. I have a timer running that performs a characteristics read every 2 seconds. However, if I perform a write at the same time a read is occurring, the App crashes. How can I tell if a read is occurring so that I can wait to perform a write? Thanks!
 

Denny Hopp

Member
Licensed User
Longtime User
Also, I am using the following instructions to turn on the notify characteristic:

Public Sub startSwitchNotify
manager.SetNotify ("feedbeef-face-deaf-fade-beadbeadaced", "a1b2c3d4-e5f6-a1b2-c3d4-e5f6a1b2c3d4",True)
Log("Set Notify")
End Sub

Whenever this sub is called, the program crashes. Any ideas?
 
Upvote 0

Denny Hopp

Member
Licensed User
Longtime User
Hi Erel. I figured out what was happening. I was not connected and tried to enable the notify characteristic. The notify is working great now! The only issue I am having is the app crashing when I try to Write to a characteristic while a characteristic Read is occurring. Is this a normal occurrence?
 
Upvote 0

Denny Hopp

Member
Licensed User
Longtime User
Here is the error log. The error is flagged at the line that calls the characteristic write.

upload_2016-3-15_14-37-5.png
 

Attachments

  • upload_2016-3-15_14-36-22.png
    upload_2016-3-15_14-36-22.png
    76.2 KB · Views: 254
Upvote 0
Top