Thanks in advanced. The peripheral platform is nrf52832, sdk17.0.2. I'm migrating examples\ble_peripheral\ble_app_hts to read temperature value. When I run this example alone, I add prints and get below traces and example works well:
0> <info> app_timer: RTC: initialized. 0> <info> app: Health Thermometer example started. 0> <info> app: Fast advertising. 0> <info> app: ble_hts_on_ble_evt() is run. 0> <info> app: Connected. 0> <info> app: ble_hts_on_ble_evt() is run. 0> <info> app: ble_hts_on_ble_evt() is run. 0> <info> app: ble_hts_on_ble_evt() is run. 0> <info> app: pm_evt_handler() is run. 0> <info> app: pm_evt_handler() is run. 0> <info> app: ble_hts_on_ble_evt() is run.
I notice there is something different that only you read temp value, pairing window jumps out. But after migrating, the temperature value is always 0. I notice requirement in pm_evt_handler, it says: "NOTE: For this to work, make sure ble_hts_on_ble_evt() is called before pm_evt_handler() in ble_evt_dispatch()". But I'm not clear how to ensure this. So would anyone tell me the mechanism?