This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Custom BLE code

I followed the custom BLE tutorial and got the output.



1.  The result increments till 19 , but after that the value 20 is appended with extra character. May i know the reason behind this?


A	09:31:39.095	"(0x) 1D" received
I	09:31:39.885	Notification received from f3641401-00b0-4240-ba50-05ca45bf8abc, value: (0x) 1E
A	09:31:39.885	"(0x) 1E" received
I	09:31:39.885	Notification received from f3641401-00b0-4240-ba50-05ca45bf8abc, value: (0x) 1E
A	09:31:39.885	"(0x) 1E" received
I	09:31:39.886	Notification received from f3641401-00b0-4240-ba50-05ca45bf8abc, value: (0x) 1E
A	09:31:39.886	"(0x) 1E" received
I	09:31:40.879	Notification received from f3641401-00b0-4240-ba50-05ca45bf8abc, value: (0x) 1F
A	09:31:40.879	"(0x) 1F" received
I	09:31:40.879	Notification received from f3641401-00b0-4240-ba50-05ca45bf8abc, value: (0x) 1F
A	09:31:40.879	"(0x) 1F" received
I	09:31:40.879	Notification received from f3641401-00b0-4240-ba50-05ca45bf8abc, value: (0x) 1F
A	09:31:40.879	"(0x) 1F" received
I	09:31:42.072	Notification received from f3641401-00b0-4240-ba50-05ca45bf8abc, value: (0x) 20, " "
A	09:31:42.072	"(0x) 20, " "" received
I	09:31:42.073	Notification received from f3641401-00b0-4240-ba50-05ca45bf8abc, value: (0x) 20, " "
A	09:31:42.073	"(0x) 20, " "" received
I	09:31:42.074	Notification received from f3641401-00b0-4240-ba50-05ca45bf8abc, value: (0x) 20, " "
A	09:31:42.074	"(0x) 20, " "" received
I	09:31:43.069	Notification received from f3641401-00b0-4240-ba50-05ca45bf8abc, value: (0x) 21, "!"
A	09:31:43.069	"(0x) 21, "!"" received
I	09:31:43.070	Notification received from f3641401-00b0-4240-ba50-05ca45bf8abc, value: (0x) 21, "!"
A	09:31:43.070	"(0x) 21, "!"" received
I	09:31:43.265	Notification received from f3641401-00b0-4240-ba50-05ca45bf8abc, value: (0x) 21, "!"
A	09:31:43.265	"(0x) 21, "!"" received
I	09:31:44.456	Notification received from f3641401-00b0-4240-ba50-05ca45bf8abc, value: (0x) 22, """
A	09:31:44.456	"(0x) 22, """" received
I	09:31:44.457	Notification received from f3641401-00b0-4240-ba50-05ca45bf8abc, value: (0x) 22, """
A	09:31:44.457	"(0x) 22, """" received
I	09:31:44.458	Notification received from f3641401-00b0-4240-ba50-05ca45bf8abc, value: (0x) 22, """
A	09:31:44.458	"(0x) 22, """" received
I	09:31:45.052	Notification received from f3641401-00b0-4240-ba50-05ca45bf8abc, value: (0x) 23, "#"
A	09:31:45.052	"(0x) 23, "#"" received
I	09:31:45.053	Notification received from f3641401-00b0-4240-ba50-05ca45bf8abc, value: (0x) 23, "#"
A	09:31:45.053	"(0x) 23, "#"" received
I	09:31:45.053	Notification received from f3641401-00b0-4240-ba50-05ca45bf8abc, value: (0x) 23, "#"
A	09:31:45.053	"(0x) 23, "#"" received
I	09:31:46.047	Notification received from f3641401-00b0-4240-ba50-05ca45bf8abc, value: (0x) 24, "$"
A	09:31:46.047	"(0x) 24, "$"" received
I	09:31:46.048	Notification received from f3641401-00b0-4240-ba50-05ca45bf8abc, value: (0x) 24, "$"
A	09:31:46.048	"(0x) 24, "$"" received
I	09:31:46.049	Notification received from f3641401-00b0-4240-ba50-05ca45bf8abc, value: (0x) 24, "$"
A	09:31:46.049	"(0x) 24, "$"" received
I	09:31:47.045	Notification received from f3641401-00b0-4240-ba50-05ca45bf8abc, value: (0x) 25, "%"
A	09:31:47.045	"(0x) 25, "%"" received
I	09:31:47.243	Notification received from f3641401-00b0-4240-ba50-05ca45bf8abc, value: (0x) 25, "%"
A	09:31:47.243	"(0x) 25, "%"" received
I	09:31:47.244	Notification received from f3641401-00b0-4240-ba50-05ca45bf8abc, value: (0x) 25, "%"
A	09:31:47.244	"(0x) 25, "%"" received
I	09:31:48.034	Notification received from f3641401-00b0-4240-ba50-05ca45bf8abc, value: (0x) 26, "&"
A	09:31:48.035	"(0x) 26, "&"" received
I	09:31:48.035	Notification received from f3641401-00b0-4240-ba50-05ca45bf8abc, value: (0x) 26, "&"
A	09:31:48.035	"(0x) 26, "&"" received
I	09:31:48.042	Notification received from f3641401-00b0-4240-ba50-05ca45bf8abc, value: (0x) 26, "&"
A	09:31:48.042	"(0x) 26, "&"" received
I	09:31:49.028	Notification received from f3641401-00b0-4240-ba50-05ca45bf8abc, value: (0x) 27, "'"
A	09:31:49.028	"(0x) 27, "'"" received
I	09:31:49.028	Notification received from f3641401-00b0-4240-ba50-05ca45bf8abc, value: (0x) 27, "'"
A	09:31:49.028	"(0x) 27, "'"" received
I	09:31:49.028	Notification received from f3641401-00b0-4240-ba50-05ca45bf8abc, value: (0x) 27, "'"
A	09:31:49.028	"(0x) 27, "'"" received
I	09:31:50.022	Notification received from f3641401-00b0-4240-ba50-05ca45bf8abc, value: (0x) 28, "("
A	09:31:50.022	"(0x) 28, "("" received
I	09:31:50.023	Notification received from f3641401-00b0-4240-ba50-05ca45bf8abc, value: (0x) 28, "("
A	09:31:50.023	"(0x) 28, "("" received
I	09:31:50.023	Notification received from f3641401-00b0-4240-ba50-05ca45bf8abc, value: (0x) 28, "("
A	09:31:50.023	"(0x) 28, "("" received
I	09:31:51.218	Notification received from f3641401-00b0-4240-ba50-05ca45bf8abc, value: (0x) 29, ")"
A	09:31:51.218	"(0x) 29, ")"" received
I	09:31:51.414	Notification received from f3641401-00b0-4240-ba50-05ca45bf8abc, value: (0x) 29, ")"

2.  How the change the name of "Unknown Service" and "Unknown characteristics" to a specific names?

3.  I tried to extend the code to add more characteristics to the same service,

      a. when i added the second characteristics, even if i enable the notifications, i cannot see the value on the front page. But i see the notifications.

                                                             

      b.  when i added the third characteristics, i could see the value for two of them and not the third.

                                                                         

4.  Is it possible to have one notification for all 3 characteristics? If so, what needs to be corrected.

5.    Is there any reference that shows how to use the nordic connect app for android? To configure GATT server. 

Parents Reply
  • Hi,

    HW looks OK with regard to the LF crystal. I see you get a Fatal error, but it is not clear to mere from where it comes, though from the screenshot I assume sd_softdevice_enable(). Can you clarify? What is the return value? You could get it by inspecting the ret_code variable in the debugger or by enabling debug logging (select "Debug" from the build configuration dropdown). In that case, you should get more information than just Fatal error (filename, line number, and error code).

Children
No Data
Related