armchair_fw/main/http.hpp
jonny_ji7 3cb5bc410b Create http server, Add HTTP mode
- Create http.cpp and http.hpp
  - functions for initializing a http server
  - function for URL api/joystick
    - receive joystick data from http post request
    - parse json, define joystick position (function from joystick.hpp)
    - send data to control task via queue

- control.hpp/cpp:
  - add HTTP mode to handle loop
    - receive joystick commands from queue, generate commands, send to
      motorctl
  - upgrade changeMode function with ability to run functions at switch
    FROM and TO certain modes
    - add code to start/stop wifi and webserver when switching to/from
      HTTP mode
  - change toggleModes and toggleIdle to use the changeMode function

- main.cpp:
  - add several sections with code for testing new functions (commented
    out)
  - add http loglevel

- buzzer.cpp:
  - add command (press 4 times) to toggle between HTTP and JOYSTICK mode

FIXME: moved initialization of wifi to main.cpp at startup because of an
error -> resolve this and place wifi start and stop functions into
mode-change as intended

currently works best in accesspoint mode with laptop connected using the
react-webapp
2022-06-17 18:24:11 +02:00

24 lines
602 B
C++

#pragma once
extern QueueHandle_t joystickDataQueue;
//============================
//===== init http server =====
//============================
//function that initializes http server and configures available urls
void http_init_server();
//==============================
//===== start mdns service =====
//==============================
//function that initializes and starts mdns server for host discovery
void start_mdns_service();
//============================
//===== stop http server =====
//============================
//function that destroys the http server
void http_stop_server();