Debug Write From Source #611
-
Hi all--I'm running into an occasional issue where a This is a snippet of the usage: fun writeCharacteristic(data: ByteArray) {
if(isConnected.get()) {
owner.lifecycleScope.launch(Dispatchers.IO) {
try {
Log.i(LOG_TAG, "$peripheral about to write")
peripheral.write(CUSTOM_RX_CHARACTERISTIC, data, WriteType.WithoutResponse)
Log.i(LOG_TAG, "$peripheral write complete")
} catch(e: Exception) {
Log.w(LOG_TAG, "Unable to write to characteristic.")
}
}
}
} I haven't characterized the problem completely yet, but I've chased it down to the "about to write" message no longer being followed by a "write complete" message--it appears that the write is hung somehow. Once that's happened once, it'll happen on subsequent writes. I'm trying to debug this myself for a bit in an effort to understand if it's our business logic somehow putting us in this spot, but I'm having a heck of a time trying to bring in kable as an external module to debug from source. I've tried "File->New->Import module..." in Android studio and variants of the following in our gradle files with no avail:
Do you have any hints on how to do that? Or ideas about what might be happening to the write? Thanks a ton and have a great holiday. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
I believe the easiest way to test locally is via Maven local install as described in #494 (comment). |
Beta Was this translation helpful? Give feedback.
-
How large is the |
Beta Was this translation helpful? Give feedback.
I believe the easiest way to test locally is via Maven local install as described in #494 (comment).