-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add id member in SerialPortInfo #208
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -635,9 +635,21 @@ <h3> | |
</li> | ||
</ol> | ||
</li> | ||
<li>If the port is [=identifiable=], perform the following steps: | ||
<ol> | ||
<li>Set |info|["{{SerialPortInfo/id}}"] to the [=identifier=] | ||
of the port. | ||
</li> | ||
</ol> | ||
</li> | ||
<li>Return |info|. | ||
</li> | ||
</ol> | ||
<p> | ||
A serial port is <dfn>identifiable</dfn> if the port can be uniquely | ||
identified through an <dfn>identifier</dfn> across the user agent | ||
restarts while it remains [=logically connected=]. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The identifier needs to remain the same even after the device is disconnected and reconnected. Suggesting various ways to achieve this (e.g. using the Windows device interface ID, or USB device IDs and bus topology) would be a good non-normative note. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just to clarify, you meant here we should allow the Because I thought if we don't enforce location information the same (i.e. same topology), we won't be able to identify a device if the device itself doesn't provide that property, for example, two devices with the same pid, vid, and serial number. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, we can limit the use case to devices that are still plugged into the same location on the system OR have a serial number. This is how Windows tracks device identity. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, on a second thought, I feel serial number is necessary and location information might be less useful. I am thinking with the below two cases:
In this case, how do you think if I put a non-normative note this way?
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will, unfortunately, always be a heuristic. I think treating devices with identical (or missing) serial numbers that are connected to the same port as the same device is a reasonable behavior. After all, Windows has gotten away with it for years. The "should not" bit should be normative. Exactly which properties of the device are used can be suggested non-normatively. |
||
</p> | ||
<section data-dfn-for="SerialPortInfo"> | ||
<h4> | ||
<dfn>SerialPortInfo</dfn> dictionary | ||
|
@@ -647,6 +659,7 @@ <h4> | |
unsigned short usbVendorId; | ||
unsigned short usbProductId; | ||
BluetoothServiceUUID bluetoothServiceClassId; | ||
DOMString id; | ||
}; | ||
</pre> | ||
<dl> | ||
|
@@ -674,6 +687,14 @@ <h4> | |
be a {{BluetoothServiceUUID}} containing the service class UUID. | ||
Otherwise it will be `undefined`. | ||
</dd> | ||
<dt> | ||
<dfn>id</dfn> member | ||
</dt> | ||
<dd> | ||
If the port is [=identifiable=], this member will be a | ||
{{DOMString}} representing the [=identifier=] of the port. Otherwise | ||
it will be `undefined`. | ||
</dd> | ||
</dl> | ||
</section> | ||
</section> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be a note here similar to the one in Web Bluetooth on this not being a cross-site tracking ID: https://webbluetoothcg.github.io/web-bluetooth/#ref-for-dom-allowedbluetoothdevice-deviceid%E2%91%A1