# ToCoNet\_Event\_Register\_State\_Machine()

## 解説

ユーザ定義イベント処理関数をシステムに登録する。本関数は [cbAppColdStart](/twelite-net-api-ref/krubakku/cbappcoldstart.md)(TRUE) で実行する。

## 引数

| 型      | 名前     | 詳細                       |
| ------ | ------ | ------------------------ |
| void\* | pvFunc | ユーザ定義イベント処理関数(\*1)を指定する。 |

```
*1: pvFunc の関数プロトタイプは以下である。
void vProcessEvCore(
        tsEvent *pEv,
        teEvent eEvent,
        uint32 u32evarg)
```

## 戻り値

| 型     | 詳細                    |
| ----- | --------------------- |
| uint8 | ユーザ定義イベント処理関数のハンドル番号。 |

## サンプル

```c
void vProcessEvCore(
        tsEvent *pEv,
        teEvent eEvent,
        uint32 u32evarg);

void cbAppColdStart(bool_t bInit) {
    if (bInit == FALSE) {
 		...
    } else {
    	...
    	ToCoNet_Event_Register_State_Machine(vProcessEvCore);
    }
}
```


---

# 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_register_state_machine.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.
