> 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/twelite-net-api-ref/netto-api/layertree-netto/toconet_nwklytr_psconfig.md).

# 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://sdk.twelite.info/twelite-net-api-ref/netto-api/layertree-netto/toconet_nwklytr_psconfig.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
