Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

can read/Write authorisation reply be sent after a few milliseconds and not instantly

Hello Community,

According to my Applicatrion, it is so that I have to receive data from BLE App and send them to a different Device where these values are to be written. The Second device is connected to the Nordic BLE chip using UART and I am suppose to build the interface Software which translates data from App to Second Device and viceversa.

For this purpose, we have decided to use the Authorised Read and Write for every Characteristic. I have successfully implemented the Read / Write with Authorisation request- reply from BLE Chip to App. The problem is following:

On every read request, I have to coomunicate with the second device and get the data and send it as a response to the read request to the APP. And this process of communicating with the second device takes about 10 ms so that I could actually send a response with the correct data to the read request. 

The same thing with the Write request, i.e when I receive data from the APP, I have to send it to my Second device and wait till it is successfully written in the second device and then send the response to the APP that the write process was successful.

But unfortunately, I am always getting the error GATT_INVALID_ATTR_LENGTH whenver I try to send a response to the write request after a few milliseconds from the write request.

All I would like to know is is it actually possible to respond with a delay. I have a read in one of the discussions, that the response should be sent within 30 sec. But 30 sec in my case is a lot and it should somehow work in my case.

If its possible, then I would like to have an example code or so where I can refer to or atleast the important points to be noted when I would like to execute the Authorisation with a delay.

Your Suggestions are highly appreciated!

Thanks and regards,

Kumar

Parents
  • Hello Kumar,

    Can you please tell me what sd_function that triggers the APP_ERROR_CHECK to return, and what the hexadecimal value err_code is when it triggers? You can see it if you define DEBUG in your preprocessor defines, and set a breakpoint at line 73 in app error.c (at least line 73 in the newer SDKs).

    There you can find what file and line number the APP_ERROR_CHECK() that was triggered, and you can see what sd_***() function that returned err_code != 0.

    A few ms should not be a problem, so I don't think that should be the cause of the error.

    Best regards,

    Edvin

Reply
  • Hello Kumar,

    Can you please tell me what sd_function that triggers the APP_ERROR_CHECK to return, and what the hexadecimal value err_code is when it triggers? You can see it if you define DEBUG in your preprocessor defines, and set a breakpoint at line 73 in app error.c (at least line 73 in the newer SDKs).

    There you can find what file and line number the APP_ERROR_CHECK() that was triggered, and you can see what sd_***() function that returned err_code != 0.

    A few ms should not be a problem, so I don't think that should be the cause of the error.

    Best regards,

    Edvin

Children
Related