Skip to content

Commit

Permalink
update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
foxzool committed Sep 26, 2024
1 parent 559d85f commit afa9a80
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ fn setup_clients(mut commands: Commands) {
cap: 10,
});

// spawn websocket client
let mut mqtt_options = MqttOptions::new("mqtt-ws-client", "ws://127.0.0.1:8080", 8080);
mqtt_options.set_transport(Transport::Ws);
// mqtt_options.set_credentials("username", "password");
Expand All @@ -56,6 +57,7 @@ fn setup_clients(mut commands: Commands) {
));
}

// just a marker component for filter
#[derive(Component)]
struct WebsocketMqttClient;

Expand Down Expand Up @@ -140,10 +142,10 @@ fn publish_message(mqtt_client: Query<&MqttClient, With<MqttClientConnected>>) {

## Supported Versions

| bevy | bevy_mqtt |
|------|-----------|
| 0.14 | 0.2, 0.3 |
| 0.13 | 0.1 |
| bevy | bevy_mqtt |
|------|---------------|
| 0.14 | 0.2, 0.3, 0.4 |
| 0.13 | 0.1 |

## License

Expand Down
2 changes: 2 additions & 0 deletions examples/pub_and_sub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ fn setup_clients(mut commands: Commands) {
cap: 10,
});

// spawn websocket client
let mut mqtt_options = MqttOptions::new("mqtt-ws-client", "ws://127.0.0.1:8080", 8080);
mqtt_options.set_transport(Transport::Ws);
// mqtt_options.set_credentials("username", "password");
Expand All @@ -39,6 +40,7 @@ fn setup_clients(mut commands: Commands) {
));
}

// just a marker component for filter
#[derive(Component)]
struct WebsocketMqttClient;

Expand Down

0 comments on commit afa9a80

Please sign in to comment.