![]() |
BALTECH Docs |
BALTECH SDK wrapper functions reference
|
| BRP_LIB brp_protocol brp_create_custom | ( | int | custom_index | ) |
Creates a bare custom protocol whose callbacks are meant to be filled in by the caller (e.g.
a language binding implementing an I/O protocol or a transformation layer in its own runtime).
The returned protocol is allocated and owned by this library: its cb_destroy is preset to free the protocol via brp_protocol_free(), so it is released like any other protocol via brp_destroy(). The caller assigns the desired cb_* callbacks (and may wrap cb_destroy, as long as it still frees the protocol via brp_protocol_free()).
| custom_index | distinguishes custom protocol types; must be in [0, 0x80) so the protocol_id stays in the custom range BRP_PROTID_CUSTOM(custom_index) (= 0x80 + index). |