question

MingiKim-6225 avatar image
0 Votes"
MingiKim-6225 asked MingiKim-6225 commented

CS_UWP_BluetoothRFCOMM SDP and SDP Attribute ID Question

Hi, Microsoft.

I know you are very busy, but please read my question, thank you.
Anyway I'm making an app uses RFCOMM. Because I have to measure my brainwave by using Neurosky's MindWave Mobile2. However, This headset device is now work in Windows 10. It worked in Windows 7 & 8 (My friend bought this before Windows 10 exist). Detail: the device can pair with Windows 10, and also The ThinkGearConnector Program(Neurosky's base program) run in Windows 10, but the public app can't connect with device.
So I focused on this device uses bluetooth. I thought "let's connect this device with bluetooth and handle or parse the program directly myself". I found your samples and documents but I can't uderstand some kinds of things. Let's read this => send-or-receive-files-with-rfcomm

When you read it, you can see these in client part :

  • const uint SERVICE_VERSION_ATTRIBUTE_ID = 0x0300;

  • const byte SERVICE_VERSION_ATTRIBUTE_TYPE = 0x0A; // UINT32

  • const uint MINIMUM_SERVICE_VERSION = 200;

I can't understand these What means ATTRIBUTE_ID? What means the ATTRIBUTE_TYPE?

So, I searched some kinds of examples and I found this project
https://ilovecsharp.com/tag/bluetooth/

In this project show me these:

  • private static readonly Guid RfcommServiceUuid = Guid.Parse("482af5ed-3faf-4a51-9dd0-718c85aa64d0");

  • private const UInt16 SdpServiceNameAttributeId = 0x100;

  • private const byte SdpServiceNameAttributeType = (4 << 3) | 5;

And I can compare between your example and this project, and I realize I have to use Guid, uint Service Attribute Id, and Attribute type.
But, I still can't understand about Id, and type. I suppose this Id, and Type follow the SDP.

Ok, Let's unite my question what I want to know

  1. I want to know about What means This Guid, Id, Type

  2. Is these attributes follows SDP or SDP's component?

  3. Whether 2. is correct, Is there any uint codes named public codes?

Thankyou, Microsoft. Please teach me.


windows-uwp
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

RoyLi-MSFT avatar image
0 Votes"
RoyLi-MSFT answered MingiKim-6225 commented

Hello,

Welcome to Microsoft Q&A!

I want to know about What means This Guid, Id, Type

SERVICE_VERSION_ATTRIBUTE_ID is the service identifier. It will be simply a 128-bit GUID(Globally Unique Identifier), it is also commonly specified as either a 16- or 32-bit integer.

An SDP service is described by service attributes, which provide information a client, needs to use the service, for example, service identifier.

Attributes have values, and those values can have various types and sizes. So that a device receiving an attribute knows what type and size it is receiving, attributes are sent in data elements. That's SERVICE_VERSION_ATTRIBUTE_TYPE.

Is these attributes follows SDP or SDP's component?

The Service Attributes are a part of the SDP.

Thank you.


If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.






· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Oh I really appreciate your answer. Thank you RolyLi.
However, I need more information, Is there any common or public Attribute ID or Type? I couldn't wait answer and I found the attribute which made by RfcommDeviceService.GetSdpRawAttributesAsync() is a KeyValuePairDictionary, so I read them.
And there are
- Attributes's Dictionary reading : key(uint) => 256 , value(IBuffer) => System.__ComObject
- Attributes's Dictionary reading : key(uint) => 2 , value(IBuffer) => System.__ComObject
- Attributes's Dictionary reading : key(uint) => 0 , value(IBuffer) => System.__ComObject
- Attributes's Dictionary reading : key(uint) => 4 , value(IBuffer) => System.__ComObject
- Attributes's Dictionary reading : key(uint) => 1 , value(IBuffer) => System.__ComObject
exist. Do you know those keys and values meaning?

0 Votes 0 ·

Is there any common or public Attribute ID or Type?

I have to say that you might need to search the SDP document to check all the Attributes of the SDP service.

0 Votes 0 ·

Hmm... Ok! Thankyou very much. Then I have to find SDP document.

0 Votes 0 ·