Skip to content

feat(ds4): add updateFlags byte for output callback#33

Open
AhmedAmrNabil wants to merge 1 commit into
Alia5:mainfrom
AhmedAmrNabil:fix/ds4/out-callback-update
Open

feat(ds4): add updateFlags byte for output callback#33
AhmedAmrNabil wants to merge 1 commit into
Alia5:mainfrom
AhmedAmrNabil:fix/ds4/out-callback-update

Conversation

@AhmedAmrNabil

Copy link
Copy Markdown

Description

Adds an UpdateFlags byte to the DualShock4 OutputState struct and updates the corresponding libVIIPER callbacks.

When an output report is received for a DualShock4 device, it contains LED data, rumble data, flash data, and an update byte indicating which fields are valid:

  • Bit 0 set → update rumble
  • Bit 1 set → update LED
  • Bit 2 set → update flash

This PR adds that update byte to the OutputState struct so consumers can tell which fields changed.

Related Issue

Fixes #32

Motivation and Context

Previously, output callbacks only delivered the raw 7 bytes (rumble, LED, flash) with no way to know which of them actually changed. Without the update flags, consumers had no way to distinguish a rumble-only update from an LED-only update or a combination of both. This change exposes that information directly.

How Has This Been Tested?

  • Tested with hardware (specify configuration)
  • Unit tests
  • Code review only

Type of Change

  • Bug fix (non-breaking change addressing an issue)
  • New feature (non-breaking change adding functionality)
  • Breaking change (fix or feature causing existing functionality to change)
  • Documentation update

Checklist

  • My code follows the code style of this project
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] add the update byte for dualshock4 output report callback

1 participant