> 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/krubakku/cbtoconet_vtxevent.md).

# cbToCoNet\_vTxEvent()

## 解説

無線パケットの送信が終了したときに、完了通知として呼び出される。

無線パケットの送信は API により送信要求を行うが、送信完了まで不確定の遅延が発生します。また、TWENET では送信に遅延を設定したり、再送を行ったりする機能があり、場合によっては複数の送信要求と実際の送信完了の順序が前後することもあります。

{% hint style="info" %}
Ack 付き送信の場合は、Ack を受け取ったら成功。
{% endhint %}

{% hint style="info" %}
出来るだけ短い時間に多くのパケットを送りたい場合は、送信完了確認後、速やかに次の送信要求を行います。
{% endhint %}

{% hint style="info" %}
送信要求は送信キューに格納されます。送信キューを超えた要求は無視されます。

遅延を設定した送信を複数要求した場合、同時に処理される要求数はデフォルトで３です。（[モジュール ToCoNet\_USE\_MOD\_TXRXQUEUE\_MID](/twelite-net-api-expl/mojru.md)）
{% endhint %}

## 引数

| 型       | 名前         | 詳細                                      |
| ------- | ---------- | --------------------------------------- |
| `uint8` | `u8CbId`   | 送信要求との紐付けを目的としてアプリケーションで設定するID。         |
| `uint8` | `u8Status` | `(u8Status & 0x01) == 0` なら失敗。`1` なら成功。 |

### u8Status

| 送信種別         | 成功条件                                                                     |
| ------------ | ------------------------------------------------------------------------ |
| MAC Ack 付き送信 | MAC Ack を受け取れば成功。                                                        |
| MAC Ack 無し送信 | 一度でもパケットが送信されたら成功。                                                       |
| ネットワーク層の送信   | 隣接ノードへの配送が実施されれば成功（複数ホップをすることで最終配送先に伝達されるが、最終配送先へ届いたかどうかは本ステータスでは確認できない） |

{% hint style="warning" %}
MAC Ack は単純な電文応答です。実際は相手に送信できていたが失敗と報告される場合、また、ごく稀に成功と報告されたが相手が受け取っていない場合があります。
{% endhint %}

## 戻り値

なし。

## サンプル

```c
void cbToCoNet_vTxEvent(uint8 u8CbId, uint8 bStatus) {
	if(bStatus & 0x01) {
		// success
	} else {
		// fail
	}
}
```


---

# 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:

```
GET https://sdk.twelite.info/twelite-net-api-ref/krubakku/cbtoconet_vtxevent.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.
