# 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);
```


---

# 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/en/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.
