Skip to content
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 initial doc for imperial #7

Merged
merged 14 commits into from
Nov 10, 2021
4 changes: 3 additions & 1 deletion src/_includes/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
- - /
- Home
- - /documentation/
- Documentation
- BLE Documentation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't fit in the header. Maybe just do BLE ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will change to just BLE and Serial

- - /serial_documentation/
- Serial Documentation
- - /code/
- Code
---
Expand Down
3 changes: 1 addition & 2 deletions src/documentation.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
layout: base
title: Documentation
Copy link
Contributor

@balloob balloob Oct 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's update the filename too, and add a Netlify redirect so the old URL remains working. Do that by creating a _redirects file like this in the public folder https://github.com/home-assistant/home-assistant.io/blob/current/source/_redirects

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had this exact thought..haha

title: Improv via BLE
description: All the implementation details necessary to make your own client and service implementation.
---

Expand Down Expand Up @@ -143,4 +143,3 @@ This characteristic is where the client can read results from the RPC service if
| X...Y | String 2 |
| ... | etc |
| last byte | Checksum - A simple sum checksum keeping only the LSB |

24 changes: 14 additions & 10 deletions src/imperial.md → src/serial_documentation.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
---
layout: base
title: Imperial
title: Improv via Serial
description:
---

## Imperial Service
## Improv via Serial Service

Imperial is Improv via Serial and allows a client to send the Wi-Fi credentials to a device to save via a serial connection.
Improv via Serial allows a client to send the Wi-Fi credentials to a device to save via a serial connection.

### Serial packet format

| Byte | Purpose |
| ------ | ------------------------------- |
| 1-8 | Header will equal `IMPERIAL` |
| 9 | Version CURRENT VERSION = `1` |
| 10 | Type (see below) |
| 11 | Length |
| 12...X | Data |
| X + 12 | Checksum (Not for RPC/Response) |
| 1-6 | Header will equal `IMPROV` |
| 7 | Version CURRENT VERSION = `1` |
| 8 | Type (see below) |
| 9 | Length |
| 10...X | Data |
| X + 10 | Checksum (Not for RPC/Response) |


### Current State (_Device to client_)
Expand All @@ -31,6 +31,10 @@ The current status of the provisioning service and will write and notify any lis
| `0x02` | Ready (Authorized) | Ready to accept credentials. |
| `0x03` | Provisioning | Credentials received, attempt to connect. |
| `0x04` | Provisioned | Connection successful. |
| 3 | Length of string 1 |
| 4...X | String 1 |
| X | Length of string 2 |
| X...Y | String 2 |

### Error state (_Device to client_)

Expand Down Expand Up @@ -85,7 +89,7 @@ This command will generate an RPC result. The first entry in the list is an URL

#### RPC Command: Request current state

Sends a request for the device to send the current state of imperial to the client.
Sends a request for the device to send the current state of improv to the client.

Command ID: `0x02`

Expand Down