# サンプルアクト

アクトの動作を理解するため、いくつかのサンプルを用意しています。

{% hint style="info" %}
**サンプルは MWSDK をインストールしたディレクトリにある `Act_samples` にあります。**
{% endhint %}

最初に[BRD\_APPTWELITE](/v0.1.7/act_samples/brd_apptwelite.md)と[Parent\_MONOSTICK](/v0.1.7/act_samples/parent_monostick.md)の解説に目を通すようにしてください。

### 最新版の入手

{% hint style="info" %}
最新版のコードや MWSDK バージョン間の修正履歴を確認する目的で Github にソース一式を置いています。以下のリンク先を参照してください。

<https://github.com/monowireless/Act_samples>
{% endhint %}

### 共通の記述

アクトのサンプル中で以下の項目は共通の設定項目になり、以下で解説します。

```cpp
const uint32_t APP_ID = 0x1234abcd;
const uint8_t CHANNEL = 13;
const char APP_FOURCHAR[] = "BAT1";
```

{% hint style="info" %}
サンプルアクト共通として以下の設定をしています。

* アプリケーションID `0x1234abcd`
* チャネル `13`

アプリケーションIDとチャネルはともに他のネットワークと混在しないようにする仕組みです。

**アプリケーションIDが異なる者同士は、チャネルが同じであっても混信することはありません**。ただし、別のアプリケーションIDのシステムが頻繁に無線送信しているような場合はその無線送信が妨害となりますので影響は出ます。

チャネルは通信に使う周波数を決めます。TWELITE無線モジュールでは原則として**１６個のチャネル**が利用でき、通常のシステムでは実施しないような極めて例外的な場合を除き、**違うチャネルとは通信できません**。

サンプルアクト共通の仕様として、パケットのペイロード(データ部)の先頭には4バイトの文字列(`APP_FOURCHAR[]`)を格納しています。種別の識別性には1バイトで十分ですが、解説のための記述です。こういった**システム特有の識別子やデータ構造**を含めるのも混信対策の一つです。
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mwx.twelite.info/v0.1.7/act_samples.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
