-
Notifications
You must be signed in to change notification settings - Fork 6
Adding "Device Name" RPC for version 2.4 #60
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
base: main
Are you sure you want to change the base?
Conversation
|
@emontnemery Would love your opinion on this as well. |
src/ble.md
Outdated
| to set hostname first then device name. It should generally accept any UTF-8 encoded string however some device | ||
| manufacturers may choose not to support characters outside the ASCII range. Getting this property should | ||
| (unless it contains non-ASCII characters) return the same value as the Device Info's "Device Name" (4th) property. |
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.
Getting this property should (unless it contains non-ASCII characters) return the same value as the Device Info's "Device Name" (4th) property.
Why does the character set matter to the response of this command vs that of device info? The character encoding of the device info is not specified, should we do that?
Maybe specify strings sent from the device are either 7-bit ascii or UTF-8 (UTF-8 is backwards compatible with 7-bit ascii).
If the device does not accept UTF-8 in strings sent to the device, I think we need a flag for that.
My preference would be to simply specify all strings are UTF-8 (with restrictions for codes where applicable, such as for the hostname).
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.
I think just saying all strings for the entire protocol are encoded as 7 bit ASCII or UTF-8 if supported across the entire protocol and get rid of all the call out about special handling between Get Device Info and Set Device Name makes the most sense to me as well
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.
What does that statement mean though? If all strings can be encoded as 7-bit ASCII or UTF-8 without any exceptions, we might as well just say UTF-8 because 7-bit ASCII is a subset of UTF-8?
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.
Should we say manufacturers must support 7-bit ASCII and may choose to support the full UTF-8 character set? Or just say all strings are UTF-8 encoded and the full UTF character set must be supported for device name?
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.
Does the device manufacturer need to care? Isn't the device name just a NUL-terminated string for the device itself? 🤔
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.
I guess that's true. So I'l just change it to say all strings are assumed to be UTF-8 encoded.
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.
@emontnemery Are you good with the current version to be merged? I have PRs prepped for other libraries related to these changes. :-)
| Example without OS Name: `ESPHome`, `2021.11.0`, `esp32-s3-devkitc-1/esp32-s3`, `Temperature Monitor`. | ||
|
|
||
| Example: `ESPHome`, `2021.11.0`, `ESP32-C3`, `Temperature Monitor`. | ||
| Example with OS Name: `Bluetooth Proxy`, `v1.0.0`, `denky_d4/esp32`, `My Bluetooth Proxy`, `ESPHome`, `2025.12.2`. |
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.
Changes discussed with @balloob to device info specification that are non-breaking.
src/ble.md
Outdated
| manufacturer. It may alter the default "hostname" or not. If setting both this property and hostname, it is recommended | ||
| to set hostname first then device name. Getting this property should return the same value as the Device Info's |
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.
Why is it recommended to first set hostname and then device name?
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.
Because some manufacturers may choose to default the hostname to something based on the device name and if you set host name second you can be sure it isn’t modified by the device when the device name is set
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.
Exactly, so it would seem it's better to first set the device name and then the hostname.
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.
lol i feel dumb now youre absolutely right
No description provided.