This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git

commit d7fa4d1d5b3f02eb5b18927778f628b2ebc40d4d
Author: Matteo Golin <[email protected]>
AuthorDate: Mon Sep 21 15:55:45 2026 -0400

    bluetooth/nimble: Allow DIS service options to be changed
    
    This allows NuttX users to configure the NimBLE built-in DIS service
    options that are only available at compile-time. Now all the
    characteristics can be used if desired. The default Kconfig values match
    the original definitions, so there is no change in behaviour.
    
    Signed-off-by: Matteo Golin <[email protected]>
---
 wireless/bluetooth/nimble/Kconfig                 | 55 +++++++++++++++++++++++
 wireless/bluetooth/nimble/include/syscfg/syscfg.h | 21 ++++++---
 2 files changed, 69 insertions(+), 7 deletions(-)

diff --git a/wireless/bluetooth/nimble/Kconfig 
b/wireless/bluetooth/nimble/Kconfig
index 9be1030be..5aa2b1023 100644
--- a/wireless/bluetooth/nimble/Kconfig
+++ b/wireless/bluetooth/nimble/Kconfig
@@ -245,4 +245,59 @@ config NIMBLE_PORTING_EXAMPLE_STACKSIZE
 
 endif # NIMBLE_PORTING_EXAMPLE
 
+comment "NimBLE included services"
+
+menu "NimBLE DIS service options"
+
+config NIMBLE_DIS_FIRMWARE_REVISION_READ_PERM
+       int "Firmware revision read permission"
+       default -1
+       ---help---
+               A value >= 0 enables the firmware revision characteristic and 
acts as
+               the permission flags.
+
+config NIMBLE_DIS_HARDWARE_REVISION_READ_PERM
+       int "Hardware revision read permission"
+       default -1
+       ---help---
+               A value >= 0 enables the hardware revision characteristic and 
acts as
+               the permission flags.
+
+config NIMBLE_DIS_MANUFACTURER_NAME_READ_PERM
+       int "Manufacturer name read permission"
+       default -1
+       ---help---
+               A value >= 0 enables the manufacturer name characteristic and 
acts as
+               the permission flags.
+
+config NIMBLE_DIS_MODEL_NUMBER_READ_PERM
+       int "Model number read permission"
+       default 0
+       ---help---
+               A value >= 0 enables the model number characteristic and acts 
as the
+               permission flags.
+
+config NIMBLE_DIS_SERIAL_NUMBER_READ_PERM
+       int "Serial number read permission"
+       default -1
+       ---help---
+               A value >= 0 enables the serial number characteristic and acts 
as the
+               permission flags.
+
+config NIMBLE_DIS_SOFTWARE_REVISION_READ_PERM
+       int "Software revision read permission"
+       default -1
+       ---help---
+               A value >= 0 enables the software revision characteristic and 
acts as
+               the permission flags.
+
+config NIMBLE_DIS_SYSTEM_ID_READ_PERM
+       int "System ID read permission"
+       default -1
+       ---help---
+               A value >= 0 enables the system ID characteristic and acts as 
the
+               permission flags.
+
+endmenu # NimBLE DIS service options
+
 endif # NIMBLE
diff --git a/wireless/bluetooth/nimble/include/syscfg/syscfg.h 
b/wireless/bluetooth/nimble/include/syscfg/syscfg.h
index 22f93a5fa..38f919693 100644
--- a/wireless/bluetooth/nimble/include/syscfg/syscfg.h
+++ b/wireless/bluetooth/nimble/include/syscfg/syscfg.h
@@ -289,19 +289,26 @@
 
 #define MYNEWT_VAL_BLE_SVC_DIS_DEFAULT_READ_PERM           (-1)
 #define MYNEWT_VAL_BLE_SVC_DIS_FIRMWARE_REVISION_DEFAULT   (NULL)
-#define MYNEWT_VAL_BLE_SVC_DIS_FIRMWARE_REVISION_READ_PERM (-1)
+#define MYNEWT_VAL_BLE_SVC_DIS_FIRMWARE_REVISION_READ_PERM                   \
+  (CONFIG_NIMBLE_DIS_FIRMWARE_REVISION_READ_PERM)
 #define MYNEWT_VAL_BLE_SVC_DIS_HARDWARE_REVISION_DEFAULT   (NULL)
-#define MYNEWT_VAL_BLE_SVC_DIS_HARDWARE_REVISION_READ_PERM (-1)
+#define MYNEWT_VAL_BLE_SVC_DIS_HARDWARE_REVISION_READ_PERM                   \
+  (CONFIG_NIMBLE_DIS_HARDWARE_REVISION_READ_PERM)
 #define MYNEWT_VAL_BLE_SVC_DIS_MANUFACTURER_NAME_DEFAULT   (NULL)
-#define MYNEWT_VAL_BLE_SVC_DIS_MANUFACTURER_NAME_READ_PERM (-1)
+#define MYNEWT_VAL_BLE_SVC_DIS_MANUFACTURER_NAME_READ_PERM                   \
+  (CONFIG_NIMBLE_DIS_MANUFACTURER_NAME_READ_PERM)
 #define MYNEWT_VAL_BLE_SVC_DIS_MODEL_NUMBER_DEFAULT        "Apache NuttX 
NimBLE"
-#define MYNEWT_VAL_BLE_SVC_DIS_MODEL_NUMBER_READ_PERM      (0)
+#define MYNEWT_VAL_BLE_SVC_DIS_MODEL_NUMBER_READ_PERM                        \
+  (CONFIG_NIMBLE_DIS_MODEL_NUMBER_READ_PERM)
 #define MYNEWT_VAL_BLE_SVC_DIS_SERIAL_NUMBER_DEFAULT       (NULL)
-#define MYNEWT_VAL_BLE_SVC_DIS_SERIAL_NUMBER_READ_PERM     (-1)
+#define MYNEWT_VAL_BLE_SVC_DIS_SERIAL_NUMBER_READ_PERM                       \
+  (CONFIG_NIMBLE_DIS_SERIAL_NUMBER_READ_PERM)
 #define MYNEWT_VAL_BLE_SVC_DIS_SOFTWARE_REVISION_DEFAULT   (NULL)
-#define MYNEWT_VAL_BLE_SVC_DIS_SOFTWARE_REVISION_READ_PERM (-1)
+#define MYNEWT_VAL_BLE_SVC_DIS_SOFTWARE_REVISION_READ_PERM                   \
+  (CONFIG_NIMBLE_DIS_SOFTWARE_REVISION_READ_PERM)
 #define MYNEWT_VAL_BLE_SVC_DIS_SYSTEM_ID_DEFAULT           (NULL)
-#define MYNEWT_VAL_BLE_SVC_DIS_SYSTEM_ID_READ_PERM         (-1)
+#define MYNEWT_VAL_BLE_SVC_DIS_SYSTEM_ID_READ_PERM                           \
+  (CONFIG_NIMBLE_DIS_SYSTEM_ID_READ_PERM)
 
 /* GAP service */
 

Reply via email to