Uniot Core
0.8.1
Loading...
Searching...
No Matches
uniot::AppKit Class Reference

#include <AppKit.h>

Inheritance diagram for uniot::AppKit:
[legend]

Classes

struct  NetworkControllerConfig
 Configuration parameters for NetworkController. More...
 

Public Member Functions

unLispgetLisp ()
 Get the Lisp interpreter instance.
 
MQTTKitgetMQTT ()
 Get the MQTT communication kit instance.
 
const CredentialsgetCredentials ()
 Get the device credentials.
 
bool setWiFiCredentials (const String &ssid, const String &password)
 Set WiFi network credentials.
 
bool setUserId (const String &userId)
 Set the user identifier for device association.
 
virtual void pushTo (TaskScheduler &scheduler) override
 Add all managed tasks to the scheduler.
 
virtual void attach () override
 Initialize and attach all components.
 
virtual void registerWithBus (CoreEventBus &eventBus) override
 Register all components with the event bus.
 
virtual void unregisterFromBus (CoreEventBus &eventBus) override
 Unregister all components from the event bus.
 
void configureNetworkController (const NetworkControllerConfig &config)
 Configure the NetworkController using a config structure.
 
void configureNetworkController (uint8_t pinBtn=UINT8_MAX, uint8_t activeLevelBtn=LOW, uint8_t pinLed=UINT8_MAX, uint8_t activeLevelLed=HIGH, uint8_t maxRebootCount=3, uint32_t rebootWindowMs=10000, bool registerLispBtn=true)
 Configure the NetworkController with individual parameters.
 
void setLispEventInterceptor (LispEventInterceptor interceptor)
 Set event interceptor for Lisp interpreter.
 
void publishLispEvent (const String &eventID, int32_t value)
 Publish an event to the Lisp interpreter.
 
- Public Member Functions inherited from uniot::IEventBusConnectionKit< unsigned int, int, Bytes >
virtual ~IEventBusConnectionKit ()
 Virtual destructor to ensure proper cleanup of derived classes.
 
virtual ~IEventBusConnectionKit ()
 Virtual destructor to ensure proper cleanup of derived classes.
 
- Public Member Functions inherited from uniot::ISchedulerConnectionKit
virtual ~ISchedulerConnectionKit ()
 Virtual destructor for proper cleanup.
 
- Public Member Functions inherited from uniot::Singleton< AppKit >
 Singleton (const Singleton &)=delete
 Copy constructor is deleted to prevent duplicating the singleton instance.
 
Singletonoperator= (const Singleton &)=delete
 Assignment operator is deleted to prevent duplicating the singleton instance.
 

Friends

class Singleton< AppKit >
 

Additional Inherited Members

- Static Public Member Functions inherited from uniot::Singleton< AppKit >
static AppKitgetInstance ()
 Gets the singleton instance of the derived class.
 
- Protected Member Functions inherited from uniot::Singleton< AppKit >
 Singleton ()=default
 Default constructor is protected to prevent instantiation outside of derived classes.
 
 ~Singleton ()=default
 Default destructor is protected to prevent deletion through base class pointer.
 

Member Function Documentation

◆ attach()

virtual void uniot::AppKit::attach ( )
inlineoverridevirtual

Initialize and attach all components.

Implements ISchedulerConnectionKit interface to initialize all components including primitives, network, MQTT, and device controllers.

Implements uniot::ISchedulerConnectionKit.

◆ configureNetworkController() [1/2]

void uniot::AppKit::configureNetworkController ( const NetworkControllerConfig & config)
inline

Configure the NetworkController using a config structure.

Convenience method to configure the NetworkController using a single config structure. Creates and initializes the NetworkController instance if not already configured.

Parameters
configThe NetworkControllerConfig structure containing all parameters

◆ configureNetworkController() [2/2]

void uniot::AppKit::configureNetworkController ( uint8_t pinBtn = UINT8_MAX,
uint8_t activeLevelBtn = LOW,
uint8_t pinLed = UINT8_MAX,
uint8_t activeLevelLed = HIGH,
uint8_t maxRebootCount = 3,
uint32_t rebootWindowMs = 10000,
bool registerLispBtn = true )
inline

Configure the NetworkController with individual parameters.

Creates and initializes the NetworkController instance with the specified parameters if not already configured. Also links button click events to Lisp primitives.

Parameters
pinBtnButton pin (UINT8_MAX means not used)
activeLevelBtnActive level for button (LOW or HIGH)
pinLedLED pin (UINT8_MAX means not used)
activeLevelLedActive level for LED (LOW or HIGH)
maxRebootCountMaximum number of consecutive reboots
rebootWindowMsTime window in ms for counting reboots

◆ getCredentials()

const Credentials & uniot::AppKit::getCredentials ( )
inline

Get the device credentials.

Return values
Credentials&Reference to the Credentials instance

◆ getLisp()

unLisp & uniot::AppKit::getLisp ( )
inline

Get the Lisp interpreter instance.

Return values
unLisp&Reference to the unLisp instance

◆ getMQTT()

MQTTKit & uniot::AppKit::getMQTT ( )
inline

Get the MQTT communication kit instance.

Return values
MQTTKit&Reference to the MQTTKit instance

◆ publishLispEvent()

void uniot::AppKit::publishLispEvent ( const String & eventID,
int32_t value )
inline

Publish an event to the Lisp interpreter.

Parameters
eventIDUnique identifier for the event
valueNumeric value associated with the event

Sends events from the application to the Lisp interpreter, enabling bidirectional communication and script-driven responses to system events.

◆ pushTo()

virtual void uniot::AppKit::pushTo ( TaskScheduler & scheduler)
inlineoverridevirtual

Add all managed tasks to the scheduler.

Implements ISchedulerConnectionKit interface to register all component tasks with the provided scheduler.

Parameters
schedulerThe TaskScheduler to add tasks to

Implements uniot::ISchedulerConnectionKit.

◆ registerWithBus()

virtual void uniot::AppKit::registerWithBus ( CoreEventBus & eventBus)
inlineoverridevirtual

Register all components with the event bus.

Implements ICoreEventBusConnectionKit interface to register all components with the provided event bus. Opens necessary data channels and registers entities.

Parameters
eventBusThe CoreEventBus to register with

Implements uniot::IEventBusConnectionKit< unsigned int, int, Bytes >.

◆ setLispEventInterceptor()

void uniot::AppKit::setLispEventInterceptor ( LispEventInterceptor interceptor)
inline

Set event interceptor for Lisp interpreter.

Parameters
interceptorFunction to intercept and process Lisp events

Configures a callback function to intercept events generated by the Lisp interpreter, enabling custom event processing and application-specific behavior.

◆ setUserId()

bool uniot::AppKit::setUserId ( const String & userId)
inline

Set the user identifier for device association.

Parameters
userIdUser identifier string
Return values
booltrue if user ID was set successfully, false if empty

Sets the owner/user ID for device identification and association. The ID is stored persistently in credentials and used for device management within the Uniot ecosystem.

◆ setWiFiCredentials()

bool uniot::AppKit::setWiFiCredentials ( const String & ssid,
const String & password )
inline

Set WiFi network credentials.

Parameters
ssidNetwork SSID to connect to
passwordNetwork password (empty for open networks)
Return values
booltrue if credentials were set successfully, false otherwise

Configures the WiFi credentials for network connection. The credentials are stored persistently and used for automatic network connection.

◆ unregisterFromBus()

virtual void uniot::AppKit::unregisterFromBus ( CoreEventBus & eventBus)
inlineoverridevirtual

Unregister all components from the event bus.

Implements ICoreEventBusConnectionKit interface to unregister all components from the provided event bus. Closes data channels and unregisters entities.

Parameters
eventBusThe CoreEventBus to unregister from

Implements uniot::IEventBusConnectionKit< unsigned int, int, Bytes >.

Friends And Related Symbol Documentation

◆ Singleton< AppKit >

friend class Singleton< AppKit >
friend

The documentation for this class was generated from the following file: