#include <stddef.h>
#include <stdint.h>
#include "gamepad_codec_data_type.h"
#include "gamepad_input_tracker.h"
#include "robust_frame.h"
Go to the source code of this file.
|
| ByteBuffer | gamepad::codec::Encode (const gamepad::input::State &state) noexcept |
| | Encode a gamepad::input::State into a RobustFrame.
|
| |
| void | gamepad::codec::Encode (const gamepad::input::State &state, Stream &stream) noexcept |
| | Encode a gamepad::input::State into a robust frame and send directly to a Stream.
|
| |
◆ _GAMEPAD_CODEC_ENCODER_H_
| #define _GAMEPAD_CODEC_ENCODER_H_ |
◆ Encode() [1/2]
| ByteBuffer gamepad::codec::Encode |
( |
const gamepad::input::State & | state | ) |
|
|
noexcept |
Encode a gamepad::input::State into a RobustFrame.
- Parameters
-
| [in] | state | The input state to encode. |
- Returns
- ByteBuffer containing the encoded frame. The buffer is automatically sized to accommodate the maximum possible frame length.
- Note
- Use this function when you need to send the frame later or via custom transport. For direct sending via Stream, use the Stream overload.
Definition at line 10 of file gamepad_codec_encoder.cpp.
◆ Encode() [2/2]
| void gamepad::codec::Encode |
( |
const gamepad::input::State & | state, |
|
|
Stream & | stream ) |
|
noexcept |
Encode a gamepad::input::State into a robust frame and send directly to a Stream.
- Parameters
-
| [in] | state | The input state to encode. |
| [in] | stream | The output stream, to write the frame to. |
- Note
- This function is suitable for scenarios where frames are sent directly via Stream without requiring an intermediate buffer
Definition at line 18 of file gamepad_codec_encoder.cpp.