@@ -38,6 +38,10 @@ auto render(vamp_pico::display& display, link_status status, vamp_pico::remote_d
|
||||
display.show_remote(color_for(status), remote.title, remote.part, remote.page, remote.pages, remote.active);
|
||||
}
|
||||
|
||||
auto clear_remote(vamp_pico::remote_display_state& remote) -> void {
|
||||
remote = vamp_pico::remote_display_state{};
|
||||
}
|
||||
|
||||
auto connect_wifi(vamp_pico::display& display) -> std::bool_t {
|
||||
auto empty = vamp_pico::remote_display_state{};
|
||||
render(display, link_status::CONNECTING, empty);
|
||||
@@ -58,6 +62,7 @@ auto connect_wifi(vamp_pico::display& display) -> std::bool_t {
|
||||
auto send_command(vamp_protocol::page_command command, link_status& status, vamp_pico::remote_display_state& remote, vamp_pico::display& display) -> void {
|
||||
if (!vamp_pico::post_remote_command(command, remote)) {
|
||||
status = link_status::RETRYING;
|
||||
clear_remote(remote);
|
||||
render(display, status, remote);
|
||||
return;
|
||||
}
|
||||
@@ -136,6 +141,7 @@ auto main() -> int {
|
||||
status = link_status::CONNECTED;
|
||||
} else {
|
||||
status = link_status::RETRYING;
|
||||
clear_remote(remote);
|
||||
}
|
||||
render(display, status, remote);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user