ArduRPC¶
- class ardurpc.ArduRPC(handlers=None, **kwargs)[source]¶
Functions with camel-case names are directly mapped to a function on the device. Functions without camel-case names are not mapped. The second function type should be preferred.
- getHandlerList()[source]¶
Get a handler list.
Function ‘get_handlers()’ should be preferred.
Returns: Raw value returned by the device
- getHandlerName(handler_id)[source]¶
Get a handler name by its ID.
Parameters: handler_id (Integer) – The ID of the handler Returns: The name of the handler Return type: String
- getLibraryVersion()[source]¶
Get the version of the ArduRPC library running on the device.
Returns: Raw value returned by the device
- getMaxPacketSize()[source]¶
Get the max packet size supported by the device.
Returns: Raw value returned by the device
- get_handler(handler_id)[source]¶
Return a instance of the handler.
Parameters: handler_id (Integer) – The ID of the handler Returns: Class instance or None Return type: Instance
- get_handler_by_name(name)[source]¶
Return a instance of the handler.
Parameters: name (String) – The name of the handler Returns: Class instance or None Return type: Instance
- get_handler_cache()[source]¶
Get a list of all cached handlers.
Returns: Dict: Key = Name, Value = Instance Return type: Dict
- get_handler_names()[source]¶
Return a list of handler names present on the device.
Returns: List of names Return type: List
- ardurpc.register(handler_type, handler, mask=16)[source]¶
Register a new handler.
Parameters: - handler_type (Integer) – The ID of the handler type
- handler (Class) – The handler class (Not an instance)
- mask (Integer) – The mask to group handlers
ArduRPC exceptions.
- Failure
- FunctionNotFound
- HandlerNotFound
- CommandNotFound
- Timeout
- exception ardurpc.exception.ArduRPCException(value='')[source]¶
Base ArduRPC Exception.
- __weakref__¶
list of weak references to the object (if defined)
- exception ardurpc.exception.CommandNotFound(value='')[source]¶
The command is not available on the microcontroller.
- exception ardurpc.exception.Failure(value='')[source]¶
Something went wrong while executing a command.
But no reason was given.
- exception ardurpc.exception.FunctionNotFound(value='')[source]¶
The function is not available on the microcontroller.