| 
    Kodi Documentation 22.0
    
   Kodi is an open source media player and entertainment hub. 
   | 
 
Peripheral operations to handle control about. More...
Functions | |
| virtual void | kodi::addon::CInstancePeripheral::GetCapabilities (kodi::addon::PeripheralCapabilities &capabilities) | 
| Get the list of features that this add-on provides.   | |
| virtual PERIPHERAL_ERROR | kodi::addon::CInstancePeripheral::PerformDeviceScan (std::vector< std::shared_ptr< kodi::addon::Peripheral > > &scan_results) | 
| Perform a scan for joysticks.   | |
| virtual PERIPHERAL_ERROR | kodi::addon::CInstancePeripheral::GetEvents (std::vector< kodi::addon::PeripheralEvent > &events) | 
| Get all events that have occurred since the last call to GetEvents().   | |
| virtual bool | kodi::addon::CInstancePeripheral::SendEvent (const kodi::addon::PeripheralEvent &event) | 
| Send an input event to the peripheral.   | |
Peripheral operations to handle control about.
Peripheral parts in interface:
 Copy this to your project and extend with your parts or leave functions complete away where not used or supported.
      
  | 
  inlinevirtual | 
Get the list of features that this add-on provides.
Called by the frontend to query the add-on's capabilities and supported peripherals. All capabilities that the add-on supports should be set to true.
| [out] | capabilities | The add-on's capabilities | 
The following table contains values that can be set with class PeripheralCapabilities :
| Name | Type | Set call | Get call | 
|---|---|---|---|
| Provides joysticks | boolean    | SetProvidesJoysticks | GetProvidesJoysticks | 
| Provides joystick rumble | boolean    | SetProvidesJoystickRumble | GetProvidesJoystickRumble | 
| Provides joystick power off | boolean    | SetProvidesJoystickPowerOff | GetProvidesJoystickPowerOff | 
| Provides button maps | boolean    | SetProvidesButtonmaps | GetProvidesButtonmaps | 
Example:
      
  | 
  inlinevirtual | 
Get all events that have occurred since the last call to GetEvents().
| [out] | events | List of available events within addon | 
The following table contains values that can be set with class PeripheralEvent :
| Name | Type | Set call | Get call | 
|---|---|---|---|
| Peripheral event type | PERIPHERAL_EVENT_TYPE | SetType | Type | 
| Peripheral index | unsigned int    | SetPeripheralIndex | PeripheralIndex | 
| Peripheral event driver index | unsigned int    | SetDriverIndex | DriverIndex | 
| Peripheral event button state | JOYSTICK_STATE_BUTTON | SetButtonState | ButtonState | 
| Peripheral event hat state | JOYSTICK_STATE_HAT | SetHatState | HatState | 
| Peripheral event axis state | JOYSTICK_STATE_AXIS (float)    | SetAxisState | AxisState | 
| Peripheral event motor state | JOYSTICK_STATE_MOTOR (float)    | SetMotorState | MotorState | 
Further are several class constructors with values included.
      
  | 
  inlinevirtual | 
Perform a scan for joysticks.
The frontend calls this when a hardware change is detected. If an add-on detects a hardware change, it can trigger this function using the TriggerScan() callback.
| [in] | scan_results | Assigned to allocated memory | 
The following table contains values that can be set with class Peripheral :
| Name | Type | Set call | Get call | 
|---|---|---|---|
| Peripheral type | PERIPHERAL_TYPE | SetType | Type | 
| Peripheral name | const std::string&    | SetName | Name | 
| Peripheral vendor id | uint16_t    | SetVendorID | VendorID | 
| Peripheral product id | uint16_t    | SetProductID | ProductID | 
| Peripheral index | unsigned int    | SetIndex | Index | 
Further are following included:
      
  | 
  inlinevirtual | 
Send an input event to the peripheral.
| [in] | event | The input event |