diff mbox series

[v1] obex: Add supported features tag in MAP Client Connect Request

Message ID 20250128174327.1477546-1-quic_amisjain@quicinc.com (mailing list archive)
State New
Headers show
Series [v1] obex: Add supported features tag in MAP Client Connect Request | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/BuildEll success Build ELL PASS
tedd_an/BluezMake success Bluez Make PASS
tedd_an/MakeCheck success Bluez Make Check PASS
tedd_an/MakeDistcheck success Make Distcheck PASS
tedd_an/CheckValgrind success Check Valgrind PASS
tedd_an/CheckSmatch success CheckSparse PASS
tedd_an/bluezmakeextell success Make External ELL PASS
tedd_an/ScanBuild success Scan Build PASS

Commit Message

Amisha Jain Jan. 28, 2025, 5:43 p.m. UTC
This change is required for below PTS testcase -

1. MAP/MCE/MFB/BV-06-C
Verify that the MCE sends its MapSupportedFeatures in the
OBEX Connect request if the MSE declares support for the
feature MapSupportedFeatures in Connect Request in
its SDP record.

If Server's SDP record contains the field 'MapSupportedFeatures in
Connect Request' as supported then include the supported features tag in
obex connect request.

---
 obexd/client/map.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

Comments

Luiz Augusto von Dentz Jan. 28, 2025, 5:50 p.m. UTC | #1
Hi Amisha,

On Tue, Jan 28, 2025 at 12:43 PM Amisha Jain <quic_amisjain@quicinc.com> wrote:
>
> This change is required for below PTS testcase -
>
> 1. MAP/MCE/MFB/BV-06-C
> Verify that the MCE sends its MapSupportedFeatures in the
> OBEX Connect request if the MSE declares support for the
> feature MapSupportedFeatures in Connect Request in
> its SDP record.
>
> If Server's SDP record contains the field 'MapSupportedFeatures in
> Connect Request' as supported then include the supported features tag in
> obex connect request.

Can you include the btmon output with and without?

> ---
>  obexd/client/map.c | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
>
> diff --git a/obexd/client/map.c b/obexd/client/map.c
> index b8820335b..2fd0f74ec 100644
> --- a/obexd/client/map.c
> +++ b/obexd/client/map.c
> @@ -39,6 +39,7 @@
>  #define OBEX_MAS_UUID \
>         "\xBB\x58\x2B\x40\x42\x0C\x11\xDB\xB0\xDE\x08\x00\x20\x0C\x9A\x66"
>  #define OBEX_MAS_UUID_LEN 16
> +#define SUPPORTED_FEATURES_TAG  0x29
>
>  #define MAP_INTERFACE "org.bluez.obex.MessageAccess1"
>  #define MAP_MSG_INTERFACE "org.bluez.obex.Message1"
> @@ -2179,6 +2180,23 @@ static void parse_service_record(struct map_data *map)
>                 map->supported_features = 0x0000001f;
>  }
>
> +static void *map_supported_features(struct obc_session *session)
> +{
> +       const void *data;
> +
> +       /* Supported Feature Bits */
> +       data = obc_session_get_attribute(session,
> +                                       SDP_ATTR_MAP_SUPPORTED_FEATURES);
> +       if (!data)
> +               return NULL;
> +
> +       if(*(uint32_t *)data & 0x00080000)
> +               return g_obex_apparam_set_uint32(NULL, SUPPORTED_FEATURES_TAG,
> +                               0x0000027f);

Don't think it is safe to check the data like above, we don't know if
field returned is really 32 bits, perhaps it would be a good idea to
introduce something like obc_session_get_attribute_le32 that would
ensure the value is really 32 bits and also check its little/big
endian in the process.

> +
> +       return NULL;
> +}
> +
>  static int map_probe(struct obc_session *session)
>  {
>         struct map_data *map;
> @@ -2224,6 +2242,7 @@ static struct obc_driver map = {
>         .uuid = MAS_UUID,
>         .target = OBEX_MAS_UUID,
>         .target_len = OBEX_MAS_UUID_LEN,
> +       .supported_features = map_supported_features,
>         .probe = map_probe,
>         .remove = map_remove
>  };
> --
> 2.34.1
>
>
bluez.test.bot@gmail.com Jan. 28, 2025, 7:14 p.m. UTC | #2
This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=928899

---Test result---

Test Summary:
CheckPatch                    PENDING   0.21 seconds
GitLint                       PENDING   0.25 seconds
BuildEll                      PASS      20.39 seconds
BluezMake                     PASS      1490.18 seconds
MakeCheck                     PASS      12.96 seconds
MakeDistcheck                 PASS      161.08 seconds
CheckValgrind                 PASS      213.47 seconds
CheckSmatch                   PASS      269.20 seconds
bluezmakeextell               PASS      97.88 seconds
IncrementalBuild              PENDING   0.30 seconds
ScanBuild                     PASS      854.20 seconds

Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:

##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:

##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:



---
Regards,
Linux Bluetooth
diff mbox series

Patch

diff --git a/obexd/client/map.c b/obexd/client/map.c
index b8820335b..2fd0f74ec 100644
--- a/obexd/client/map.c
+++ b/obexd/client/map.c
@@ -39,6 +39,7 @@ 
 #define OBEX_MAS_UUID \
 	"\xBB\x58\x2B\x40\x42\x0C\x11\xDB\xB0\xDE\x08\x00\x20\x0C\x9A\x66"
 #define OBEX_MAS_UUID_LEN 16
+#define SUPPORTED_FEATURES_TAG  0x29
 
 #define MAP_INTERFACE "org.bluez.obex.MessageAccess1"
 #define MAP_MSG_INTERFACE "org.bluez.obex.Message1"
@@ -2179,6 +2180,23 @@  static void parse_service_record(struct map_data *map)
 		map->supported_features = 0x0000001f;
 }
 
+static void *map_supported_features(struct obc_session *session)
+{
+	const void *data;
+
+	/* Supported Feature Bits */
+	data = obc_session_get_attribute(session,
+					SDP_ATTR_MAP_SUPPORTED_FEATURES);
+	if (!data)
+		return NULL;
+
+	if(*(uint32_t *)data & 0x00080000)
+		return g_obex_apparam_set_uint32(NULL, SUPPORTED_FEATURES_TAG,
+				0x0000027f);
+
+	return NULL;
+}
+
 static int map_probe(struct obc_session *session)
 {
 	struct map_data *map;
@@ -2224,6 +2242,7 @@  static struct obc_driver map = {
 	.uuid = MAS_UUID,
 	.target = OBEX_MAS_UUID,
 	.target_len = OBEX_MAS_UUID_LEN,
+	.supported_features = map_supported_features,
 	.probe = map_probe,
 	.remove = map_remove
 };