# ToCoNet\_NwkLyTr\_psConfig()

## 解説

中継ネットとしてLayerTreeネットワークを選択し、親機または中継器を構成する。

## 引数

| 型                                                                                                           | 名前          | 詳細               |
| ----------------------------------------------------------------------------------------------------------- | ----------- | ---------------- |
| [`tsToCoNet_NwkLyTr_Context*`](/twelite-net-api-ref/netto-api/layertree-netto/tstoconet_nwklytr_context.md) | pContextNwk | 中継ネットの設定情報格納構造体。 |

## 戻り値

| 型                                                                                             | 詳細                |
| --------------------------------------------------------------------------------------------- | ----------------- |
| [`tsToCoNet_Nwk_Context*`](/twelite-net-api-ref/netto-api/structure/tstoconet_nwk_context.md) | 設定済みの内部構造体へのポインタ。 |

## サンプル

```c
static tsToCoNet_NwkLyTr_Config sNwkLayerTreeConfig;
static tsToCoNet_Nwk_Context* pContextNwk;
...
		// layer 数の決定
		sNwkLayerTreeConfig.u8Layer = 4;
​
		// NBビーコン方式のネットワークを使用する
		sNwkLayerTreeConfig.u8StartOpt =
			TOCONET_MOD_LAYERTREE_STARTOPT_NB_BEACON;

		// Router として始動
		sNwkLayerTreeConfig.u8Role = TOCONET_NWK_ROLE_ROUTER;
		pContextNwk = ToCoNet_NwkLyTr_psConfig(&sNwkLayerTreeConfig);
		if (pContextNwk) {
			ToCoNet_Nwk_bInit(pContextNwk);
			ToCoNet_Nwk_bStart(pContextNwk);
		} else {
			// fatal error
		}

```


---

# 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/netto-api/layertree-netto/toconet_nwklytr_psconfig.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.
