From ca6fc0c8b4ee4dd8aff85445f0af7b42ef681a5e Mon Sep 17 00:00:00 2001 From: "Timmer, Daan" Date: Thu, 9 Nov 2023 11:05:37 +0000 Subject: [PATCH 1/3] feat!: moved Gap.proto to services.ble and added Gatt.proto --- services/ble/CMakeLists.txt | 8 ++++++++ services/{network => ble}/Gap.proto | 0 services/ble/Gatt.proto | 20 ++++++++++++++++++++ services/network/CMakeLists.txt | 4 ---- 4 files changed, 28 insertions(+), 4 deletions(-) rename services/{network => ble}/Gap.proto (100%) create mode 100644 services/ble/Gatt.proto diff --git a/services/ble/CMakeLists.txt b/services/ble/CMakeLists.txt index fdf9b58a2..e973c1085 100644 --- a/services/ble/CMakeLists.txt +++ b/services/ble/CMakeLists.txt @@ -1,5 +1,13 @@ add_library(services.ble ${EMIL_EXCLUDE_FROM_ALL} STATIC) +protocol_buffer_echo_cpp(services.ble Gap.proto) +protocol_buffer_csharp(services.ble Gap.proto) +protocol_buffer_java(services.ble Gap.proto) + +protocol_buffer_echo_cpp(services.ble Gatt.proto) +protocol_buffer_csharp(services.ble Gatt.proto) +protocol_buffer_java(services.ble Gatt.proto) + target_link_libraries(services.ble PUBLIC hal.interfaces infra.util diff --git a/services/network/Gap.proto b/services/ble/Gap.proto similarity index 100% rename from services/network/Gap.proto rename to services/ble/Gap.proto diff --git a/services/ble/Gatt.proto b/services/ble/Gatt.proto new file mode 100644 index 000000000..3ae03799a --- /dev/null +++ b/services/ble/Gatt.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; + +import "EchoAttributes.proto"; + +package gatt; +option java_package = "com.philips.emil.ProtobufEcho"; +option java_outer_classname = "GattProto"; + +message DisServiceData +{ + bytes manufacturerName = 1 [(bytes_size) = 32]; + bytes modelNumber = 2 [(bytes_size) = 32]; + bytes serialNumber = 3 [(bytes_size) = 32]; + bytes hardwareRevision = 4 [(bytes_size) = 32]; + bytes firmwareRevision = 5 [(bytes_size) = 32]; + bytes softwareRevision = 6 [(bytes_size) = 32]; + bytes systemId = 7 [(bytes_size) = 8]; + bytes ieeeRegulatoryCertificationDataList = 8 [(bytes_size) = 32]; + bytes pnpId = 9 [(bytes_size) = 7]; +} diff --git a/services/network/CMakeLists.txt b/services/network/CMakeLists.txt index d159d486d..af2b8fa28 100644 --- a/services/network/CMakeLists.txt +++ b/services/network/CMakeLists.txt @@ -4,10 +4,6 @@ protocol_buffer_echo_cpp(services.network Network.proto) protocol_buffer_csharp(services.network Network.proto) protocol_buffer_java(services.network Network.proto) -protocol_buffer_echo_cpp(services.network Gap.proto) -protocol_buffer_csharp(services.network Gap.proto) -protocol_buffer_java(services.network Gap.proto) - target_link_libraries(services.network PUBLIC infra.syntax infra.timer From 31b408a6a8fe081d0e8d41b79f7a958439cd9155 Mon Sep 17 00:00:00 2001 From: "Timmer, Daan" Date: Thu, 9 Nov 2023 13:42:59 +0000 Subject: [PATCH 2/3] feat: added AttAttribute UUIDs for common gatt attributes --- services/ble/Gatt.hpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/services/ble/Gatt.hpp b/services/ble/Gatt.hpp index 69fcf0f7b..7cce20025 100644 --- a/services/ble/Gatt.hpp +++ b/services/ble/Gatt.hpp @@ -37,6 +37,20 @@ namespace services }; }; + namespace uuid + { + constexpr static AttAttribute::Uuid16 deviceInformationService{ 0x180A }; + constexpr static AttAttribute::Uuid16 systemId{ 0x2A23 }; + constexpr static AttAttribute::Uuid16 modelNumber{ 0x2A24 }; + constexpr static AttAttribute::Uuid16 serialNumber{ 0x2A25 }; + constexpr static AttAttribute::Uuid16 firmwareRevision{ 0x2A26 }; + constexpr static AttAttribute::Uuid16 hardwareRevision{ 0x2A27 }; + constexpr static AttAttribute::Uuid16 softwareRevision{ 0x2A28 }; + constexpr static AttAttribute::Uuid16 manufacturerName{ 0x2A29 }; + constexpr static AttAttribute::Uuid16 ieeeCertification{ 0x2A2A }; + constexpr static AttAttribute::Uuid16 pnpId{ 0x2A50 }; + } + class GattCharacteristic { public: From 5f8644a2a8d672b1f8bbc4a3e5a13838acd87bfc Mon Sep 17 00:00:00 2001 From: "Timmer, Daan" Date: Mon, 13 Nov 2023 10:06:33 +0000 Subject: [PATCH 3/3] chore: replaced constexpr static with constexpr inline in Gatt.hpp --- services/ble/Gatt.hpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/services/ble/Gatt.hpp b/services/ble/Gatt.hpp index 7cce20025..82e9972c5 100644 --- a/services/ble/Gatt.hpp +++ b/services/ble/Gatt.hpp @@ -39,16 +39,16 @@ namespace services namespace uuid { - constexpr static AttAttribute::Uuid16 deviceInformationService{ 0x180A }; - constexpr static AttAttribute::Uuid16 systemId{ 0x2A23 }; - constexpr static AttAttribute::Uuid16 modelNumber{ 0x2A24 }; - constexpr static AttAttribute::Uuid16 serialNumber{ 0x2A25 }; - constexpr static AttAttribute::Uuid16 firmwareRevision{ 0x2A26 }; - constexpr static AttAttribute::Uuid16 hardwareRevision{ 0x2A27 }; - constexpr static AttAttribute::Uuid16 softwareRevision{ 0x2A28 }; - constexpr static AttAttribute::Uuid16 manufacturerName{ 0x2A29 }; - constexpr static AttAttribute::Uuid16 ieeeCertification{ 0x2A2A }; - constexpr static AttAttribute::Uuid16 pnpId{ 0x2A50 }; + constexpr inline AttAttribute::Uuid16 deviceInformationService{ 0x180A }; + constexpr inline AttAttribute::Uuid16 systemId{ 0x2A23 }; + constexpr inline AttAttribute::Uuid16 modelNumber{ 0x2A24 }; + constexpr inline AttAttribute::Uuid16 serialNumber{ 0x2A25 }; + constexpr inline AttAttribute::Uuid16 firmwareRevision{ 0x2A26 }; + constexpr inline AttAttribute::Uuid16 hardwareRevision{ 0x2A27 }; + constexpr inline AttAttribute::Uuid16 softwareRevision{ 0x2A28 }; + constexpr inline AttAttribute::Uuid16 manufacturerName{ 0x2A29 }; + constexpr inline AttAttribute::Uuid16 ieeeCertification{ 0x2A2A }; + constexpr inline AttAttribute::Uuid16 pnpId{ 0x2A50 }; } class GattCharacteristic