DeviceManager.h
Go to the documentation of this file.
83 * If more custom behaviour is required then this method can be used to up-cast to the appropriate
87 template <class RequestClass> ErrorCode createRequest(const String& devid, RequestClass*& request)
A Controller is responsible for serialising requests for a physical bus.
Definition: IOControl/include/IO/Controller.h:42
Definition: DeviceManager.h:32
ErrorCode begin(JsonObjectConst config)
Load device config and create device tree.
void registerDeviceClass(const Device::Factory &devclass)
Device classes call this to register themselves.
ErrorCode stop()
Device * findDevice(const String &id)
ErrorCode createRequest(const String &devid, RequestClass *&request)
Definition: DeviceManager.h:87
void registerController(Controller &controller)
Controllers register themselves so they can be located.
bool findDevice(const String &id, DeviceClass *&dev)
Definition: DeviceManager.h:65
bool canStop() const
ErrorCode handleMessage(JsonObject json, Request::Callback callback)
void start()
ErrorCode end()
void setCallback(Request::Callback callback)
set the callback handler function for all I/O requests
Definition: DeviceManager.h:103
Controller * findController(const String &id)
Definition: DeviceManager.h:45
void invokeCallback(Request &request)
invoke the callback, if one is registered
Definition: DeviceManager.h:112
ErrorCode createRequest(const String &devid, Request *&request)
Abstract class which allows device instances to be created.
Definition: Libraries/IOControl/include/IO/Device.h:45
Handles requests for a specific device; the requests are executed by the relevant controller.
Definition: Libraries/IOControl/include/IO/Device.h:36
Request represents a single user request/response over a bus.
Definition: IOControl/include/IO/Request.h:80
const char * c_str() const
Get a constant (un-modifiable) pointer to String content.
Definition: WString.h:616
Json json
String toString(ErrorCode err)
Definition: IOControl/include/IO/Controller.h:26
DeviceManager devmgr