Sunshine master
Self-hosted game stream host for Moonlight.
platf::gamepad_feedback_msg_t Struct Reference

Feedback command sent from Sunshine to a virtual gamepad. More...

#include <src/platform/common.h>

Static Public Member Functions

static gamepad_feedback_msg_t make_adaptive_triggers (std::uint16_t id, uint8_t event_flags, uint8_t type_left, uint8_t type_right, const std::array< uint8_t, 10 > &left, const std::array< uint8_t, 10 > &right)
 Create adaptive triggers.
 
static gamepad_feedback_msg_t make_motion_event_state (std::uint16_t id, std::uint8_t motion_type, std::uint16_t report_rate)
 Motion-event feedback command payload for a controller.
 
static gamepad_feedback_msg_t make_rgb_led (std::uint16_t id, std::uint8_t r, std::uint8_t g, std::uint8_t b)
 Create RGB led.
 
static gamepad_feedback_msg_t make_rumble (std::uint16_t id, std::uint16_t lowfreq, std::uint16_t highfreq)
 Create a rumble object or message.
 
static gamepad_feedback_msg_t make_rumble_triggers (std::uint16_t id, std::uint16_t left, std::uint16_t right)
 Create rumble triggers.
 

Public Attributes

union { 
 
   struct { 
 
      uint16_t   controllerNumber 
 
      uint8_t   event_flags 
 
      std::array< uint8_t, 10 >   left 
 
      std::array< uint8_t, 10 >   right 
 
      uint8_t   type_left 
 
      uint8_t   type_right 
 
   }   adaptive_triggers 
 
   struct { 
 
      std::uint8_t   motion_type 
 
      std::uint16_t   report_rate 
 
   }   motion_event_state 
 
   struct { 
 
      std::uint8_t   b 
 
      std::uint8_t   g 
 
      std::uint8_t   r 
 
   }   rgb_led 
 
   struct { 
 
      std::uint16_t   highfreq 
 
      std::uint16_t   lowfreq 
 
   }   rumble 
 
   struct { 
 
      std::uint16_t   left_trigger 
 
      std::uint16_t   right_trigger 
 
   }   rumble_triggers 
 
data 
 Controller feedback payload for the selected feedback type.
 
std::uint16_t id
 Controller identifier associated with this message.
 
gamepad_feedback_e type
 Feedback command type stored in the union payload.
 

Detailed Description

Feedback command sent from Sunshine to a virtual gamepad.

Member Function Documentation

◆ make_adaptive_triggers()

static gamepad_feedback_msg_t platf::gamepad_feedback_msg_t::make_adaptive_triggers ( std::uint16_t id,
uint8_t event_flags,
uint8_t type_left,
uint8_t type_right,
const std::array< uint8_t, 10 > & left,
const std::array< uint8_t, 10 > & right )
inlinestatic

Create adaptive triggers.

Parameters
idIdentifier for the controller, session, display, or resource.
event_flagsEvent flags.
type_leftType left.
type_rightType right.
leftLeft trigger or motor payload for the feedback command.
rightRight trigger or motor payload for the feedback command.
Returns
Constructed adaptive triggers object.

◆ make_motion_event_state()

static gamepad_feedback_msg_t platf::gamepad_feedback_msg_t::make_motion_event_state ( std::uint16_t id,
std::uint8_t motion_type,
std::uint16_t report_rate )
inlinestatic

Motion-event feedback command payload for a controller.

Parameters
idIdentifier for the controller, session, display, or resource.
motion_typeMotion type.
report_rateReport rate.
Returns
Constructed motion event state object.

◆ make_rgb_led()

static gamepad_feedback_msg_t platf::gamepad_feedback_msg_t::make_rgb_led ( std::uint16_t id,
std::uint8_t r,
std::uint8_t g,
std::uint8_t b )
inlinestatic

Create RGB led.

Parameters
idIdentifier for the controller, session, display, or resource.
rRed color channel value.
gGreen color channel value.
bBlue color channel value.
Returns
Constructed RGB led object.

◆ make_rumble()

static gamepad_feedback_msg_t platf::gamepad_feedback_msg_t::make_rumble ( std::uint16_t id,
std::uint16_t lowfreq,
std::uint16_t highfreq )
inlinestatic

Create a rumble object or message.

Parameters
idIdentifier for the controller, session, display, or resource.
lowfreqLow-frequency rumble motor intensity.
highfreqHigh-frequency rumble motor intensity.
Returns
Constructed rumble object.

◆ make_rumble_triggers()

static gamepad_feedback_msg_t platf::gamepad_feedback_msg_t::make_rumble_triggers ( std::uint16_t id,
std::uint16_t left,
std::uint16_t right )
inlinestatic

Create rumble triggers.

Parameters
idIdentifier for the controller, session, display, or resource.
leftLeft trigger or motor payload for the feedback command.
rightRight trigger or motor payload for the feedback command.
Returns
Constructed rumble triggers object.

The documentation for this struct was generated from the following file: