diff mbox series

[BlueZ,v1] shared/ad: move MAX_ADV_DATA_LEN macro to the header

Message ID 20200813233952.BlueZ.v1.1.I716fc87b0c97e5349a04766a61ecad1f5b0fd28e@changeid (mailing list archive)
State Superseded
Headers show
Series [BlueZ,v1] shared/ad: move MAX_ADV_DATA_LEN macro to the header | expand

Commit Message

Miao-chen Chou Aug. 14, 2020, 6:40 a.m. UTC
This moves MAX_ADV_DATA_LEN macro to src/shared/ad.h.
---
Hi Maintainers,

In order to avoid duplicate definition of the maximum data length of
advertisement for the following series of advertisement monitor API,
we'd like to reuse the one in shared/ad.

Thanks,
Miao

 src/shared/ad.c | 2 --
 src/shared/ad.h | 2 ++
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Luiz Augusto von Dentz Aug. 14, 2020, 7:49 p.m. UTC | #1
Hi Miao-chen,

On Thu, Aug 13, 2020 at 11:43 PM Miao-chen Chou <mcchou@chromium.org> wrote:
>
> This moves MAX_ADV_DATA_LEN macro to src/shared/ad.h.
> ---
> Hi Maintainers,
>
> In order to avoid duplicate definition of the maximum data length of
> advertisement for the following series of advertisement monitor API,
> we'd like to reuse the one in shared/ad.
>
> Thanks,
> Miao
>
>  src/shared/ad.c | 2 --
>  src/shared/ad.h | 2 ++
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/shared/ad.c b/src/shared/ad.c
> index 8d276842e..6d882a9b3 100644
> --- a/src/shared/ad.c
> +++ b/src/shared/ad.c
> @@ -33,8 +33,6 @@
>  #include "src/shared/queue.h"
>  #include "src/shared/util.h"
>
> -#define MAX_ADV_DATA_LEN 31
> -
>  struct bt_ad {
>         int ref_count;
>         char *name;
> diff --git a/src/shared/ad.h b/src/shared/ad.h
> index 19aa1d035..dc92c89bc 100644
> --- a/src/shared/ad.h
> +++ b/src/shared/ad.h
> @@ -27,6 +27,8 @@
>  #include "lib/bluetooth.h"
>  #include "lib/uuid.h"
>
> +#define MAX_ADV_DATA_LEN 31

Id suggest renaming this to BT_AD_MAX_DATA_LEN or something like that
so it is consistent with the prefixing we are using for bt_ad related
defines.

> +
>  #define BT_AD_FLAGS                    0x01
>  #define BT_AD_UUID16_SOME              0x02
>  #define BT_AD_UUID16_ALL               0x03
> --
> 2.26.2
>
diff mbox series

Patch

diff --git a/src/shared/ad.c b/src/shared/ad.c
index 8d276842e..6d882a9b3 100644
--- a/src/shared/ad.c
+++ b/src/shared/ad.c
@@ -33,8 +33,6 @@ 
 #include "src/shared/queue.h"
 #include "src/shared/util.h"
 
-#define MAX_ADV_DATA_LEN 31
-
 struct bt_ad {
 	int ref_count;
 	char *name;
diff --git a/src/shared/ad.h b/src/shared/ad.h
index 19aa1d035..dc92c89bc 100644
--- a/src/shared/ad.h
+++ b/src/shared/ad.h
@@ -27,6 +27,8 @@ 
 #include "lib/bluetooth.h"
 #include "lib/uuid.h"
 
+#define MAX_ADV_DATA_LEN 31
+
 #define BT_AD_FLAGS			0x01
 #define BT_AD_UUID16_SOME		0x02
 #define BT_AD_UUID16_ALL		0x03