Loading files
0b6762a64This file is pinned to the selected release. Download the original to open it in your design tool.
Files from this revision, including CAD and LFS contents. Git history is not included.
Or in GitHub Desktop, choose File → Clone repository → URL and paste this address.
Public repositories can be cloned without signing in. For pushing, use your ThingAtlas username and a Git access token as the password.
git lfs install git clone https://thingatlas.com/git/-unclaimed/stack-chan-374381865.git
Includes Git history, branches, and Git LFS files. Clones the repository’s default branch, regardless of the version shown here.
0b6762a64This file is pinned to the selected release. Download the original to open it in your design tool.
# Local Peer Hello
インターネットやアクセスポイントを使わず、近くのスタックチャン同士でテキストを送受信するサンプルです。
インストール直後は通信を停止しており、ドロワーの「P2P」で役割を選ぶと通信を開始します。
- **停止**:送信と受信を停止し、通信セッションを閉じます。
- **送信機**:受信機を発見し、3秒ごとに `hello world 1`、`hello world 2`……を確認付きで送信します。
- **受信機**:受け取ったテキストを吹き出しに表示します。
- 表示前に64 Unicodeコードポイントへ切り詰め、制御文字と双方向表示制御文字を空白へ置換します。
- `payload.text`が文字列でない場合と、空白だけの場合は表示しません。
2台をオフラインで使う場合は、両方のWi-Fi設定画面で「オフライン」を選択してください。
通常Wi-Fiに接続したまま使う場合は、両方を同じアクセスポイントへ接続してください。
## インストールする
送信機と受信機のどちらにも同じマニフェストをインストールします。
```sh
npm run mod:m5stackchan_cores3 -- mods/examples/local_peer_hello/manifest.json
```
## 役割を選択する
ドロワーを開き、「P2P」を選択します。
続いて「停止」「送信」「受信」のいずれかを選択します。
役割を切り替えると、実行中の通信セッションを閉じてから新しい役割を開始します。
送信側では「送信」を選択し、受信側では「受信」を選択してください。