# The callback functions

Callback functions are the functions used to handle the various TWENET events as they occur (flow diagram), all of which need to be implemented when building an application with the TWENET library. The most important function is [`cbAppColdStart()`](/en/twelite-net-api-ref/krubakku/cbappcoldstart.md), which is the equivalent of the general main() function.

* [cbAppColdStart](/en/twelite-net-api-ref/krubakku/cbappcoldstart.md)() – Function called on power up
* [cbAppWarmStart](broken://pages/-LAw9HYwdIalArKudw6K)() – Function called when sleep is restored
* [cbToCoNet\_vMain](broken://pages/-LAwCeaAWnYdm9POShfA)() – The main loop is not an infinite loop, but is called when an interrupt or other event occurs.
* [cbToCoNet\_vRxEvent](/en/twelite-net-api-ref/krubakku/cbtoconet_vrxevent.md)() – Called when a radio packet is received
* [cbToCoNet\_vTxEvent](broken://pages/-LB0Ll1M_KdcdY54bIgF)() – Called when radio packet transmission is complete
* [cbToCoNet\_vNwkEvent](broken://pages/-LB0Rr6THIaA1P6JILb0)() – Various event notifications at MAC and network layers
* [cbToCoNet\_vHwEvent](/en/twelite-net-api-ref/krubakku/cbtoconet_vhwevent.md) () – Delayed execution section of peripheral interrupt processing. Called after interrupt processing.
* [cbToCoNet\_u8HwInt](/en/twelite-net-api-ref/krubakku/cbtoconet_u8hwint.md)() – Peripheral interrupt handlers
* User defined event handling functions – 状Describes task processing with state transitions

Both callback functions need to return control after they have been called, and writing very long processes will affect the overall behaviour. Particular care should be taken when writing interrupt handlers.


---

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