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)
ErrorCode begin(JsonObjectConst config)
Load device config and create device tree.
Definition: DeviceManager.h:31
void setCallback(Request::Callback callback)
set the callback handler function for all I/O requests
Definition: DeviceManager.h:103
ErrorCode end()
ErrorCode createRequest(const String &devid, RequestClass *&request)
Definition: DeviceManager.h:87
void registerDeviceClass(const Device::Factory &devclass)
Device classes call this to register themselves.
void invokeCallback(Request &request)
invoke the callback, if one is registered
Definition: DeviceManager.h:112
Request represents a single user request/response over a bus.
Definition: IOControl/include/IO/Request.h:79
bool findDevice(const String &id, DeviceClass *&dev)
Definition: DeviceManager.h:65
Definition: IOControl/include/IO/Controller.h:25
DeviceManager devmgr
Device * findDevice(const String &id)
Abstract class which allows device instances to be created.
Definition: Libraries/IOControl/include/IO/Device.h:44
void start()
ErrorCode handleMessage(JsonObject json, Request::Callback callback)
const char * c_str() const
Get a constant (un-modifiable) pointer to String content.
Definition: WString.h:616
Handles requests for a specific device; the requests are executed by the relevant controller.
Definition: Libraries/IOControl/include/IO/Device.h:35
Json json
ErrorCode createRequest(const String &devid, Request *&request)
A Controller is responsible for serialising requests for a physical bus.
Definition: IOControl/include/IO/Controller.h:41
ErrorCode stop()
bool canStop() const
Controller * findController(const String &id)
Definition: DeviceManager.h:45
String toString(ErrorCode err)
void registerController(Controller &controller)
Controllers register themselves so they can be located.