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

The mandatory services 0x1800 & 0x1801

Good day, support!

I have a couple of questions regarding the mandatory services of the nRF52840 dongle.

1) How to add characteristics to the mandatory services 0x1800 and 0x1801?

2) How to read the content and handles of the mandatory services on my dongle?

3) Is it possible to track access to these services?

Looking forward to your reply.

Best regards,

Anthony.

  • Hi Anton, 

    Which characteristics do you plan to add into 0x1800 and 0x1801. These are 2 system service that's not available to application for modification, at least on our softdevice ( I don't know if you are using our softdevice or use other platform). 


    You only have the flexibility to choose adding "Service Changed" characteristic to the service 0x1801 (Generic Attribute). 

    You can read the content and handles using nRF Connect (on Android or PC) or any central code ( except on iOS). 

  • Hi Hung,

    I am using the SoftDevice 6.1.1.

    When I am in the server role, I need to register access to existing services on the device and write them to the log. When I add a new service, I save the nested characteristics, their values, etc. to the structure. When a client accesses the characteristics, I save this event to the log. But what about preinstalled (mandatory) services? They are not in my structure. I can really read the contents and handles using nRF Connect (Windows PC and Android), but how can I do this in code using the SoftDevice?

  • Hi Hung,

    In addition to the previous letter.
    Actually, to solve my problem, a function similar to discovering services would be enough for me, but only on the server-side for these two services. Is it make sense for you?

  • Hi Anton, 

    What exactly do you meant by "access to the characteristic" . Is it a read ? or it's a service discovery ? I don't think you receive any event for either of them(it's handled by the softdevice and not notified to the application), unless you configured read with authorization. 

    So in short there isn't any event available to the application when the peer device perform a service discovery on the softdevice GATT server. 

    Could you explain a little bit more on the application requirement, why would you need to monitor the "access" activity of the client ? Maybe we can find a workaround. 

  • Hi Hung,

    Sure, I will try to clarify. To debug the application, there is a need to log for any action on my characteristics. I want to see when another device read the name of the device or when it read the appearance. I will explain why this is necessary. When Our other device is connected to the sensor, it reads sensor characteristics and checks them. For example, the device checks the Appearance that the type of device is really a sensor, else - disconnect.

    So: suppose we made a mistake and indicate the incorrect value of the characteristic, and the connection with this other device was not established. And we, from the sensor side, will not even know what went wrong. Therefore, I would like to control the reading of these characteristics.

    Thanks!

Related