2022-06-06 19:54:02 -04:00
|
|
|
/*
|
|
|
|
* This file is part of the MicroPython project, http://micropython.org/
|
|
|
|
*
|
|
|
|
* The MIT License (MIT)
|
|
|
|
*
|
|
|
|
* Copyright (c) 2022 Scott Shawcroft for Adafruit Industries
|
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
* of this software and associated documentation files (the "Software"), to deal
|
|
|
|
* in the Software without restriction, including without limitation the rights
|
|
|
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
* copies of the Software, and to permit persons to whom the Software is
|
|
|
|
* furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included in
|
|
|
|
* all copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
* THE SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
2023-01-11 19:05:19 -05:00
|
|
|
#include "shared-bindings/mdns/Server.h"
|
2022-08-10 14:31:52 -04:00
|
|
|
#include "shared-bindings/socketpool/Socket.h"
|
|
|
|
|
2022-06-14 20:02:34 -04:00
|
|
|
// This background function should be called repeatedly. It cannot be done based
|
|
|
|
// on events.
|
2023-04-04 15:07:04 -04:00
|
|
|
void supervisor_web_workflow_background(void *data);
|
2022-07-27 20:00:38 -04:00
|
|
|
bool supervisor_web_workflow_status_dirty(void);
|
2022-06-06 19:54:02 -04:00
|
|
|
void supervisor_web_workflow_status(void);
|
2023-05-11 12:33:01 -04:00
|
|
|
bool supervisor_start_web_workflow(void);
|
2022-06-06 19:54:02 -04:00
|
|
|
void supervisor_stop_web_workflow(void);
|
2022-08-10 14:31:52 -04:00
|
|
|
|
2023-01-11 19:05:19 -05:00
|
|
|
// Share the MDNS object with user code.
|
|
|
|
mdns_server_obj_t *supervisor_web_workflow_mdns(mp_obj_t network_interface);
|
|
|
|
|
2022-08-10 14:31:52 -04:00
|
|
|
// To share with websocket.
|
|
|
|
void web_workflow_send_raw(socketpool_socket_obj_t *socket, const uint8_t *buf, int len);
|