Regarding receiving epoch value

Please understand that I am a novice at BLE, though I have read many threads where people solved BLE problems and curated some BLE FAQs based on this board's BLE expert posts.

I have also not ever actually used a BLE device in AI2.

Before going further, I have seen people helped along in their development using this diagnostic app:

It is by a BLE manufacturer, so no pesky ads or ulterior motives, and there's support by a real vendor.

Given that, here are my concerns with your code.

  • Your BLE_operations procedure starts scanning and sets BLE_connected false, yet you call it in the BLE BytesReceived event. I would imagine once you have received bytes, you would have no more need to go scanning for devices, assuming you are just dealing with a single device. Such a procedure might be called from Screen1.Initialize, just once.

  • you do not show what that epoch procedure does.

  • Looking at your C (?) code, I am guessing the epoch is a uint64 (Unsigned 64 bit integer.) You are receiving bytes (uint8) and Integers (uint32) because that's what you registered for, so there will need to be some type conversion to build that 64 bit epoch value from the incoming byte list or integer list (I don't know which one will bring the epoch.)

  • Understand that the incoming intValues and byteValues will be lists, so you should be testing for list length as you reconstruct the epoch value from the input stream. This is a good place to try that nRFConnect app to see how many bytes/integers arrive.

  • In case you have not encountered it yet, there might some permissions that need to be granted to the app. Here's some general purpose advice on that:

(Canned Reply ABG - BLE FAQ with Latest Versions for Permissions)