@@ -36,6 +36,7 @@ The client is able to send a `device info` to the Improv service if it is in the
3636- 2.0 - Added Service Data ` 4677 `
3737- 2.1 - Added Device Info RPC command
3838- 2.2 - Added Scan Wifi RPC command
39+ - 2.3 - Added Hostname RPC command
3940
4041## GATT Services
4142
@@ -50,6 +51,8 @@ This characteristic has binary encoded byte(s) of the device’s capabilities.
5051| ` 0 ` | 1 if the device supports the identify command. |
5152| ` 1 ` | 1 if the device supports the device info command. |
5253| ` 2 ` | 1 if the device supports the scan wifi command. |
54+ | ` 3 ` | 1 if the device supports the hostname command. |
55+
5356
5457### Characteristic: Current State
5558
@@ -71,12 +74,13 @@ Characteristic UUID: `00467768-6228-2272-4663-277478268002`
7174This characteristic will hold the current error of the provisioning service and will write and notify any listening clients for instant feedback.
7275
7376| Value | State | Purpose |
74- | ------ | ------------------- | --------------------------------------------------------------------------------------- |
77+ | -------- | --------------------- | ----------------------------------------------------------------------------------------- |
7578| ` 0x00 ` | No error | This shows there is no current error state. |
7679| ` 0x01 ` | Invalid RPC packet | RPC packet was malformed/invalid. |
7780| ` 0x02 ` | Unknown RPC command | The command sent is unknown. |
7881| ` 0x03 ` | Unable to connect | The credentials have been received and an attempt to connect to the network has failed. |
7982| ` 0x04 ` | Not Authorized | Credentials were sent via RPC but the Improv service is not authorized. |
83+ | ` 0x05 ` | Bad Hostname | The hostname provided was not valid or acceptable by the device. |
8084| ` 0xFF ` | Unknown Error |
8185
8286### Characteristic: RPC Command
@@ -181,6 +185,38 @@ Example: `MyWirelessNetwork`, `-60`, `WPA2`, `MyOtherWirelessNetwork`, `-52`, `W
181185
182186A response with no strings means no SSID was found.
183187
188+ ### RPC Command: Get/Set Hostname
189+
190+ Sends a request for the device to either get or set its hostname.
191+ This operation is only available while the device is Authorized. Sending the command with no data will return
192+ the current hostname in the response. Sending the command with data will set the hostname to the data and also
193+ return the updated hostname in the response.
194+
195+ Hostnames must conform to [ RFC 1123] ( https://datatracker.ietf.org/doc/html/rfc1123 ) and can contain only letters,
196+ numbers and hyphens with a length of up to 255 characters. Error code ` 0x05 ` will be returned if the hostname provided is not acceptable.
197+
198+ Command ID: ` 0x05 `
199+
200+ Get Hostname:
201+
202+ | Byte | Description |
203+ | ------| ------------------------|
204+ | 05 | command (` 0x05 ` ) |
205+ | 00 | 0 data bytes / no data |
206+ | CS | checksum |
207+
208+ Set Hostname:
209+
210+ | Byte | Description |
211+ | ------| --------------------|
212+ | 05 | command (` 0x05 ` ) |
213+ | XX | length of hostname |
214+ | | bytes of hostname |
215+ | CS | checksum |
216+
217+ This command will trigger one RPC Response which will contain the hostname of the device.
218+
219+
184220### Characteristic: RPC Result
185221
186222Characteristic UUID: ` 00467768-6228-2272-4663-277478268004 `
0 commit comments