> 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/netto-api/structure/tstoconet_nwk_context.md).

# tsToCoNet\_Nwk\_Context

中継ネットの基本的なパラメータを定義します。

{% hint style="info" %}
将来の拡張性のためごく基本的な内容を tsToCoNet\_Nwk\_Context 構造体にまとめ、この構造体を拡張する形で、例えば[`tsToCoNet_NwkLrTr_Context`](/en/twelite-net-api-ref/netto-api/layertree-netto/tstoconet_nwklytr_context.md)構造体を定義します。中継ネットAPIでは、常に `tsToCoNet_Nwk_Context *` にキャストして利用します。
{% endhint %}

| 定義名                                       | 解説                                                                                                                                                                                                                                                 |
| ----------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `tsToCoNet_Nwk_\ Context_Base_Info sInfo` | ネットワーク情報の共通構造体。本構造体は主にデバッグ表示目的として参照できる。                                                                                                                                                                                                            |
| `sInfo.u8Role`                            | ネットワークの役割(親機`TOCONET_NWK_ROLE_PARENT`・中継機`TOCONET_NWK_ROLE_ROUTER`・子機`TOCONET_NWK_ROLE_ENDDEVICE`)。                                                                                                                                                |
| `sInfo.u8State`                           | <p>接続状態を示す。<br><code>TOCONET\_NWK\_STATUS\_INACTIVE</code> (<code>0x00</code>) : ネットワークが開始されていない<br><code>TOCONET\_NWK\_STATUS\_START\_MASK</code> : ネットワークが開始ビット（未接続の場合も）<code>TOCONET\_NWK\_STATUS\_READY\_MASK</code> : ネットワークが接続可能を意味するビット</p> |
| `sInfo.u8Layer`                           | 中継機の場合、設定したレイヤ数（接続先のレイヤではなく自身のレイヤ）子機の場合、接続先のレイヤ数                                                                                                                                                                                                   |
| `sInfo.u8NwkTypeId`                       | どの種類のネットワークかを格納する。`TOCONET_NWK_TYPE_LAYER_TREE`はLayerTree ネットワークとなり、本構造体は`tsToCoNet_NwkLyTr_Context *` にダウンキャストできます。                                                                                                                               |


---

# 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/en/twelite-net-api-ref/netto-api/structure/tstoconet_nwk_context.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.
