3 Replies Latest reply on Apr 9, 2018 12:51 PM by e.pratt_1639216

    How to disable write property on Device Name Characteristic

    antertech_1597356

      Hi everyone,

             for my application (on cyble022001 module) I have the necessity to change the device name. So I had do it, but now I want to disable or enable the write property.

      I tryed enable/disable the Generic Access Service with CyBle_GattsDisableAttribute but seem that it works only with custom service, not with Generic Access Service.

      Is there a way to disable or enable the Device name characteristic (or write property) via software?

      Thanks for help.

        • 1. Re: How to disable write property on Device Name Characteristic
          e.pratt_1639216

          The CyBle_GattsDisableAttribute() should work for any attribute; You just need to pass the handle to the attribute to disable (The Generic Access Service should have a handle associated with it that will allow you to disable it as well). The handle is merely an integer representing which "index" to enable/disable and is not dependent on what type of attribute it is (AFAIK).

          1 of 1 people found this helpful
          • 2. Re: How to disable write property on Device Name Characteristic
            antertech_1597356

            Thanks for the reply.

            What you say is true, but I tried to write CyBle_GattsDisableAttribute(0x0001) where 0x0001 is the handle index for Generic Access Service and I didn't get any results.

            So I tried to write CyBle_GattsDisableAttribute(0x0009) where 0x0009 is the handle index for my custom Service and in this case I disabled the service. Where am I wrong? Is it maybe wrong the handle index? How can I know which is the right handle index for Generic Access Service?

            • 3. Re: How to disable write property on Device Name Characteristic
              e.pratt_1639216

              It could be you are using the wrong handle. The "handle" value will be associated with the peripheral device's specific BT profile, and should be constant as long as the software image doesn't change.

              One way to be sure is to use the characteristic or service discovery to figure out what handle each service/attribute/characteristic is actually using. The function CyBle_GattcDiscoverCharacteristicByUuid(CYBLE_CONN_HANDLE_T connHandle, CYBLE_GATTC_READ_BY_TYPE_REQ_T * readByTypeReqParam) will discover a specific handle based on a single UUID and will fire the CYBLE_EVT_GATTC_READ_BY_TYPE_RSP event in the callback handler with the correct handle to use.

              If you want to discover all handles on the remote device, then you can use the CyBle_GattcDicoverAllCharacteristicDescriptors() function to get all possible handles. This will confirm whether the Generic Access Service has a handle

              I don't think you can disable the service itself, but you can disable the Characteristics and the Attributes underneath the service. (Descriptor, Characteristic, "Device Name", "Appearance", etc.)

              Some of the BLE component profile parts are required for the BLE to operate correctly, like the Server, Generic Access services. Thus, I would expect them to be unchangeable due to their required nature for the chip to work.

              1 of 1 people found this helpful