This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
while true | |
do | |
for tic in $(seq 1000) | |
do | |
TIC=$(cat <<EOF | |
tedge mqtt pub --qos 1 te/device/main///m/ {"tic":$tic,"time":$(date +%s.%N)} | |
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Bridging local messages to the cloud | |
The two `half-bridge` instances cooperate: | |
- The `half_bridge(local_event_loop,cloud_client)` receives local messages and publishes these message on the cloud. | |
- The `half_bridge(cloud_event_loop,local_client)` handles the acknowledgements: waiting for messages be acknowledged by the cloud, before sending acks for the original messages. | |
┌───────────────┐ ┌───────────────┐ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
DEVICE=$(tedge config get device.id) | |
## Signing certificate | |
openssl req \ | |
-new \ | |
-x509 \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Fun<A,B> { | |
B apply(A a); | |
} |