Hello,
I think llpm's sample project is wrong. Evaluation board is not supposed to be communicating.
To verify the defect, the value of the time variable is fixed. This time variable should be sent via the gatt latency service.
/* Start sending the timestamp to its peer */ while (default_conn) { uint32_t time = 1000000; err = bt_latency_request(&latency_client, &time, sizeof(time)); if (err && err != -EALREADY) { printk("Latency failed (err %d)\n", err); } k_sleep(K_MSEC(200)); /* wait for latency response */
In addition, it also removes the formula in the callback. This is not always necessary, but it makes it easier to understand.
static void latency_response_handler(const void *buf, uint16_t len) { uint32_t latency_time; if (len == sizeof(latency_time)) { /* compute how long the time spent */ latency_time = *((uint32_t *)buf); uint32_t cycles_spent = latency_time; llpm_latency.latency = (uint32_t)k_cyc_to_ns_floor64(cycles_spent) / 2000; } }
Build and run. Note that the other evaluation board will write an unmodified sample project.
Transmission Latency: 226403 (us), CRC mismatches: 0 Transmission Latency: 226403 (us), CRC mismatches: 0 Transmission Latency: 226403 (us), CRC mismatches: 0 Transmission Latency: 226403 (us), CRC mismatches: 0 Transmission Latency: 226403 (us), CRC mismatches: 0 Transmission Latency: 226403 (us), CRC mismatches: 0 Transmission Latency: 226403 (us), CRC mismatches: 0 Transmission Latency: 226403 (us), CRC mismatches: 0 Transmission Latency: 226403 (us), CRC mismatches: 0 Transmission Latency: 226403 (us), CRC mismatches: 0 Transmission Latency: 226403 (us), CRC mismatches: 0 Transmission Latency: 226403 (us), CRC mismatches: 0 Transmission Latency: 226403 (us), CRC mismatches: 0 Transmission Latency: 226403 (us), CRC mismatches: 0 Transmission Latency: 226403 (us), CRC mismatches: 0 Connection interval updated: LLPM (1 ms) Transmission Latency: 226403 (us), CRC mismatches: 0 Transmission Latency: 226403 (us), CRC mismatches: 0 Transmission Latency: 226403 (us), CRC mismatches: 0 Transmission Latency: 226403 (us), CRC mismatches: 0 Transmission Latency: 226403 (us), CRC mismatches: 0 Transmission Latency: 226403 (us), CRC mismatches: 0
Then the firmware that has not been modified will show the fixed values. I believe this should appear on the other side's evaluation board, am I wrong?
So this evaluation board is not communicating, correct?
If my understanding is incorrect, please correct.
Best Regards,
Yoshihiro Goto