[][src]Crate kpal_plugin

The KPAL plugin crate provides tools to write your own KPAL plugins.

See the examples folder for ideas on how to implement the datatypes and methods defined in this library.

Modules

constants

Structs

Attribute

A single piece of information that partly determines the state of a peripheral.

Peripheral

An opaque struct that contains the state of an individual peripheral.

Plugin

A Plugin combines the data that represents a peripheral's state and with its functionality.

VTable

A table of function pointers that comprise the plugin API for the foreign function interface.

Enums

Value

The value of an attribute.

Statics

ERRORS

Traits

PluginAPI

The set of functions that must be implemented by a plugin.

PluginError

The set of functions that must be implemented by a plugin library's main error type.

Functions

attribute_name

Writes the name of an attribute to a buffer that is provided by the caller.

attribute_value

Writes the value of an attribute to a Value instance that is provided by the caller.

copy_string

Copies a C-compatible string to a buffer.

error_message

Returns an error message to the daemon given an error code.

peripheral_free

Frees the memory associated with the peripheral.

set_attribute_value

Sets the value of an attribute.

Type Definitions

KpalPluginInit

The type signature of the function that returns a new plugin instance.