> 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/en/twelite-net-api-ref/yzaibento/toconet_event-api/toconet_event_setstate.md).

# ToCoNet\_Event\_SetState()

## Explanation

State transitions are performed within user-defined event processing functions.

{% hint style="info" %}
After the user-defined event processing function has finished, the `E_EVENT_NEW_STATE` event is called in a new state.
{% endhint %}

## Argumtents

| Type       | Name      | Remark                                                    |
| ---------- | --------- | --------------------------------------------------------- |
| tsEvent \* | pEv       | Management structure for user event definition functions. |
| teState    | eNewState | New state.                                                |

## Returns

None

## Sample code

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