Skip to content

Commit

Permalink
Use new version of the mqtt package.
Browse files Browse the repository at this point in the history
  • Loading branch information
floitsch committed Jun 6, 2024
1 parent 6831c5d commit dc68ffd
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion docs/tutorials/mqtt/adafruit.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ main:
temperature := 25.0
10.repeat:
temperature += ((random 100) - 50) / 100.0
client.publish topic "$temperature".to-byte-array
client.publish topic "$temperature"
// Don't publish too often to avoid rate limiting.
sleep --ms=2_500
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/mqtt/aws.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ main:
--certificate=create-aws-certificate
options := mqtt.SessionOptions --client-id=CLIENT-ID
client.start --options=options
client.publish TOPIC "hello".to-byte-array
client.publish TOPIC "hello"
client.close
```

Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/mqtt/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ main:
client.close
```

Note that the payload must be a byte array. If your data is a string, simply
call `.to-byte-array` on it.
Note that the payload must be an `io.Data`, which is typically a string or a
byte array. If your data is neither, you need to convert it first.

This program publishes a JSON object with the value `42` to the topic and then
disconnects. Let's verify that the message was published by subscribing to the
Expand Down
22 changes: 11 additions & 11 deletions tools/package.lock
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
sdk: ^2.0.0-alpha.144
sdk: ^2.0.0-alpha.145
prefixes:
bme280: bme280-driver
cellular: cellular
Expand Down Expand Up @@ -31,13 +31,13 @@ packages:
cellular:
url: github.com/toitware/cellular
name: cellular
version: 2.2.0
hash: 2f50148ed01e28ab2c3de09182b09f67ffcde776
version: 2.2.3
hash: ea31024e16ebf62c4a376c83d510bc27c5d00762
mqtt:
url: github.com/toitware/mqtt
name: mqtt
version: 2.8.1
hash: 79c44885b4544257e1e2c94c9d1fb4c53e69fbbd
version: 2.9.0
hash: ab5cda567a9b35e09ec0773ec08f4cb0ee90873d
pkg-cli:
url: github.com/toitlang/pkg-cli
name: cli
Expand All @@ -54,8 +54,8 @@ packages:
pkg-fs:
url: github.com/toitlang/pkg-fs
name: fs
version: 2.2.0
hash: 863280c5c62ac259d16d0d3b24df21209b461b14
version: 2.3.1
hash: 60836d4500317af2093d59d50c117d612c33f1fa
prefixes:
host: pkg-host
pkg-host:
Expand All @@ -66,8 +66,8 @@ packages:
pkg-http:
url: github.com/toitlang/pkg-http
name: http
version: 2.7.1
hash: 54a5bb458d9fc9305e839b878e6de3b456f5c4a6
version: 2.7.2
hash: 614dd0f374e70aab09f12e9466a35b779b9a8d63
pkg-ntp:
url: github.com/toitlang/pkg-ntp
name: ntp
Expand Down Expand Up @@ -135,8 +135,8 @@ packages:
toit-qubitro:
url: github.com/kasperl/toit-qubitro
name: qubitro
version: 0.4.0
hash: 51dce189860a3d8224ed8ea233c5382b35358845
version: 0.4.1
hash: fb720f5ac40d91e0ae8714f07e8a81c4bf00a3fb
prefixes:
artemis: toit-artemis
certificate_roots: toit-cert-roots
Expand Down
8 changes: 4 additions & 4 deletions tools/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ dependencies:
version: ^1.0.0
cellular:
url: github.com/toitware/cellular
version: ^2.2.0
version: ^2.2.3
certificate_roots:
url: github.com/toitware/toit-cert-roots
version: ^1.6.1
Expand All @@ -28,13 +28,13 @@ dependencies:
version: ^1.15.1
http:
url: github.com/toitlang/pkg-http
version: ^2.7.1
version: ^2.7.2
morse:
url: github.com/toitware/toit-morse
version: ^1.0.6
mqtt:
url: github.com/toitware/mqtt
version: ^2.8.1
version: ^2.9.0
ntp:
url: github.com/toitlang/pkg-ntp
version: ^1.1.0
Expand All @@ -52,7 +52,7 @@ dependencies:
version: ^0.3.0
qubitro:
url: github.com/kasperl/toit-qubitro
version: ^0.4.0
version: ^0.4.1
ssd1306:
url: github.com/toitware/toit-ssd1306
version: ^2.0.1
Expand Down
2 changes: 1 addition & 1 deletion tutorial_code/mqtt_adafruit/adafruit.toit
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ main:
temperature := 25.0
10.repeat:
temperature += ((random 100) - 50) / 100.0
client.publish topic "$temperature".to-byte-array
client.publish topic "$temperature"
// Don't publish too often to avoid rate limiting.
sleep --ms=2_500

Expand Down
4 changes: 2 additions & 2 deletions tutorial_code/mqtt_adafruit/package.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ packages:
mqtt:
url: github.com/toitware/mqtt
name: mqtt
version: 2.8.1
hash: 79c44885b4544257e1e2c94c9d1fb4c53e69fbbd
version: 2.9.0
hash: ab5cda567a9b35e09ec0773ec08f4cb0ee90873d
toit-cert-roots:
url: github.com/toitware/toit-cert-roots
name: certificate_roots
Expand Down
2 changes: 1 addition & 1 deletion tutorial_code/mqtt_adafruit/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ dependencies:
version: ^1.6.1
mqtt:
url: github.com/toitware/mqtt
version: ^2.8.1
version: ^2.9.0
2 changes: 1 addition & 1 deletion tutorial_code/mqtt_aws/aws.toit
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ main:
--certificate=create-aws-certificate
options := mqtt.SessionOptions --client-id=CLIENT-ID
client.start --options=options
client.publish TOPIC "hello".to-byte-array
client.publish TOPIC "hello"
client.close
4 changes: 2 additions & 2 deletions tutorial_code/mqtt_aws/package.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ packages:
mqtt:
url: github.com/toitware/mqtt
name: mqtt
version: 2.8.1
hash: 79c44885b4544257e1e2c94c9d1fb4c53e69fbbd
version: 2.9.0
hash: ab5cda567a9b35e09ec0773ec08f4cb0ee90873d
toit-cert-roots:
url: github.com/toitware/toit-cert-roots
name: certificate_roots
Expand Down
2 changes: 1 addition & 1 deletion tutorial_code/mqtt_aws/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ dependencies:
version: ^1.6.1
mqtt:
url: github.com/toitware/mqtt
version: ^2.8.1
version: ^2.9.0

0 comments on commit dc68ffd

Please sign in to comment.