This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How can I sent customize packet through llpm mode?

Dear all,

I am now using two nrf52840DK and nrf connect sdk v1.7.1,and I want to send packet using llpm mode between two devices,one is receiver and the other is sender,

the following is how I want to do it.

In the " sample / bluetooth/ llpm ", Master will write request with timestamp (application layer) and send to Slave ,once Slave receive the packet( GATT ) ,it will write response.

What I am going to do is to replace the time stamp packet with our data at sender side(Master), Slave can receive the data, but the problem is I can't find the received part code

and figure out how to read the data from the GATT layer.

So,Is there any better approach to do this, for example, enable llpm mode in other example like UART ..., many thanks!!  

this is code for sender part

Best regards.

Parents
  • You need to add a callback to bt_latency_init(). Currently it's NULL when called by err = bt_latency_init(&latency, NULL);, however you should change this to:

    err = bt_latency_init(&latency, &data_callbacks);

    And add the following to main(void)

        static const struct bt_latency_cb data_callbacks =
        {
            .latency_request = latency_request,
        };

    And add the following to main.c

    void latency_request(const void *buf, uint16_t len)
    {
        // here you can handle your data
    }

Reply
  • You need to add a callback to bt_latency_init(). Currently it's NULL when called by err = bt_latency_init(&latency, NULL);, however you should change this to:

    err = bt_latency_init(&latency, &data_callbacks);

    And add the following to main(void)

        static const struct bt_latency_cb data_callbacks =
        {
            .latency_request = latency_request,
        };

    And add the following to main.c

    void latency_request(const void *buf, uint16_t len)
    {
        // here you can handle your data
    }

Children
Related