llpm sample project not working correctly?

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

Parents Reply Children
  • Hello Susheel,

    Thanks for reply and sorry my explanation was not clear. Also, I'm using the latest SDK 2.9.0.

    > It looks like some thing is wrong with a fixed latency of 226403 seems a bit unlikely.

    This fixed value is rewritten to understand that the evaluation board is NOT communicating. It is by no means a defect or build error in the SDK, nor is the evaluation board broken. In other words, the LLPM sample projects appear to show each other's interval times. but are they not actually just displaying their own intervals?

    I also have a doubt about the sample project, the sample project does not define a callback to be used in the 'received_latency_request()' function in C:/ncs/v2.9.0/nrf/subsys/bluetooth/services/latency.c. How does this sample project extract incoming data? 

    There's one more thing that concerns me. Both central and peripheral are calling the same 'test_run()' function. But is it correct for the peripheral to call the 'bt_latency_request()' function using the 'latency_client' structure?

    https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/samples/bluetooth/llpm/README.html

    Best regards,
    Yoshihiro Goto.

Related