# ToCoNet\_Event\_SetState()

## 解説

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

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

## 引数

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

## 戻り値

なし

## サンプル

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


---

# 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://sdk.twelite.info/twelite-net-api-ref/yzaibento/toconet_event-api/toconet_event_setstate.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.
