You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Example demonstrating the `send_bytes` method for sending a custom packet to participants in a room.
4
+
5
+
## Usage
6
+
7
+
1. Run the example in sender mode:
8
+
9
+
```sh
10
+
export LIVEKIT_URL="..."
11
+
export LIVEKIT_TOKEN="<first participant token>"
12
+
cargo run -- sender
13
+
```
14
+
15
+
2. In a second terminal, run the example in receiver mode:
16
+
17
+
```sh
18
+
export LIVEKIT_URL="..."
19
+
export LIVEKIT_TOKEN="<second participant token>"
20
+
cargo run
21
+
```
22
+
23
+
## Custom Packet
24
+
25
+
This example uses the following hypothetical 4-byte packet structure to teleoperate 16 discrete LED indicators by setting their power states and RGB values:
26
+
27
+
```mermaid
28
+
---
29
+
title: "LED Control Packet"
30
+
config:
31
+
packet:
32
+
bitsPerRow: 8
33
+
---
34
+
packet
35
+
+2: "Version"
36
+
+5: "Channel"
37
+
+1: "On"
38
+
+8: "Red"
39
+
+8: "Green"
40
+
+8: "Blue"
41
+
```
42
+
43
+
The [_bitfield-struct_](https://crates.io/crates/bitfield-struct) crate is used to create a type-safe wrapper for getting and setting the bitfields by name.
0 commit comments