This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How can I measure the advertising intervals of a peripheral?

I would like to know how frequently my peripheral is sending advertising and data packets. I've tried using ble-sniffer-osx but it doesn't actually reveal any device names for some reason, so it's not trivial to use. Is it possible to do this using Xcode's Bluetooth Explorer utility to do this?

  • Yes, pretty much any BLE Peripheral examples do it, e.g. there is examples\ble_peripheral\ble_app_beacon (but runs only on PCA10040 aka nRF52 DK, otherwise you need to do small modifications)

  • Hi Petter, thank you for the response and info. I am basically just trying to find out how frequently my peripheral is sending out data (from a sensor). Regarding the link here, I'm not clear on where I would be viewing evt.gap_evt.params.connected.conn_params.max_conn_interval, etc

  • I've updated my answer. As Petter mentioned this indication is only measured and displayed by Android app. There is no way to find out Adv. Interval, app is just measuring deltas between received events from lower Android BT stack (through API) and it displays it. As explained if you want exact value you either need to know it from app developer or you need to run some larger statistics (dozens of packets) and precise time measurement with some more professional 2.4 GHz (BLE PHY enabled) analyzer ("sniffer" if you want) and take average value (assuming interval is not changing over time and that you don't miss any packet).

  • To connection parameters (which is quite different story so it looks like you are mixing several things into one question):

    • You can read it precisely from RF packet sniffer because it's in CONNECT_REQ packet and then it can be changed later but always explicitly by Master (GAP Central device) by LL command so you can again see the value in the log.
    • You can also observe it on upper layers if LL/GAP API allows it. I'm afraid that's not the case on Android or iOS (but I suggest to verify in API documentation) but you can again measure it indirectly if devices exchange one packer each interval you can measure time in the app, it should be pretty close to reality.
  • Oh and if you really wants to know PPCP (aka Preferred Peripheral Connection Parameters) as you indicate above that should be visible after connecting to GATT Server right under GATT Primary Service.

Related