> For the complete documentation index, see [llms.txt](https://sdk.twelite.info/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sdk.twelite.info/twelite-net-api-ref/yzaibento/toconet_event-api/toconet_event_setstate.md).

# ToCoNet\_Event\_SetState()

## 解説

ユーザ定義イベント処理関数内で状態遷移を行う。

{% hint style="info" %}
ユーザ定義イベント処理関数を終了後に、続けて新しい状態にて E\_EVENT\_NEW\_STATE イベントが呼び出されます。
{% endhint %}

## 引数

| 型          | 名前        | 詳細                 |
| ---------- | --------- | ------------------ |
| tsEvent \* | pEv       | ユーザイベント定義関数の管理構造体。 |
| teState    | eNewState | 新しい状態。             |

## 戻り値

なし

## サンプル

```c
sToCoNet_Event_SetState(pEv, E_STATE_APP_NORMAL);
```
