Ken Van Hoeylandt 64a01df750
Wifi support and much more (#9)
* add wifi service

* updates for service/app registry changes

* wifi wip

* basic wifi functionality

radio on/off is working
scanning state is working

* fix for wifi switch state

* reduce singleton usage

* various improvements

* improved error handling for low memory issues

* working scanning

* various improvements

* various improvements and fixes

+ added auto-start support in Config

* allow hardwareconfig customizations

* fix for rgb format

* increased lvgl fps

17ms works but 16ms makes the touch events hang for some reason

* layout improvements

* wip on multi-screen view

* basic connection dialog

* more connection logic

* created proper app stack and lifecycle

* cleanup

* cleanup

* cleanup lv widgets

* proper toolbar implementation

* split up wifi apps

* wip

* revert naming

* wip

* temp fix for internal disconnect

* added bundle

* app/service vs appdata/servicedata

* working wifi connect parameters
2024-01-13 14:15:53 +01:00

52 lines
1.1 KiB
C

#pragma once
#include "app_manifest.h"
#include "bundle.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
APP_STATE_INITIAL, // App is being activated in loader
APP_STATE_STARTED, // App is in memory
APP_STATE_SHOWING, // App view is created
APP_STATE_HIDING, // App view is destroyed
APP_STATE_STOPPED // App is not in memory
} AppState;
typedef union {
struct {
bool show_statusbar : 1;
bool show_toolbar : 1;
};
unsigned char flags;
} AppFlags;
typedef void* App;
/** @brief Create an app
* @param manifest
* @param parameters optional bundle. memory ownership is transferred to App
* @return
*/
App app_alloc(const AppManifest* manifest, Bundle* _Nullable parameters);
void app_free(App app);
void app_set_state(App app, AppState state);
AppState app_get_state(App app);
const AppManifest* app_get_manifest(App app);
AppFlags app_get_flags(App app);
void app_set_flags(App app, AppFlags flags);
void* _Nullable app_get_data(App app);
void app_set_data(App app, void* data);
Bundle* _Nullable app_get_parameters(App app);
#ifdef __cplusplus
}
#endif