BNEP API
#include "src/classic/bnep.h"
bnep_init
void bnep_init(void);
Set up BNEP.
bnep_can_send_packet_now
int bnep_can_send_packet_now(uint16_t bnep_cid);
Check if a data packet can be send out.
Returns
- int
bnep_request_can_send_now_event
void bnep_request_can_send_now_event(uint16_t bnep_cid);
Request emission of BNEP_CAN_SEND_NOW as soon as possible
Note: BNEP_CAN_SEND_NOW might be emitted during call to this function so packet handler should be ready to handle it
Parameters
- bnep_cid
bnep_send
int bnep_send(uint16_t bnep_cid, uint8_t *packet, uint16_t len);
Send a data packet.
Parameters
- bnep_cid: BNEP channel identifier.
- packet: Non-NULL Ethernet frame, including its 14-byte destination, source, and protocol header.
- len: Frame size, at least 14 bytes.
Returns
- int
bnep_set_net_type_filter
int bnep_set_net_type_filter(uint16_t bnep_cid, bnep_net_filter_t *filter, uint16_t len);
Set the network protocol filter.
Returns
- int
bnep_set_multicast_filter
int bnep_set_multicast_filter(uint16_t bnep_cid, bnep_multi_filter_t *filter, uint16_t len);
Set the multicast address filter.
Returns
- int
bnep_set_required_security_level
void bnep_set_required_security_level(gap_security_level_t security_level);
Set security level required for incoming connections, need to be called before registering services.
@deprecated: use gap_set_security_level instead
bnep_connect
int bnep_connect(btstack_packet_handler_t packet_handler, bd_addr_t addr, uint16_t l2cap_psm, uint16_t uuid_src, uint16_t uuid_dest);
Creates BNEP connection (channel) to a given server on a remote device with baseband address. A new baseband connection will be initiated if necessary.
Returns
- int
bnep_disconnect
void bnep_disconnect(bd_addr_t addr);
Disconnects BNEP channel with given identifier.
bnep_register_service
uint8_t bnep_register_service(btstack_packet_handler_t packet_handler, uint16_t service_uuid, uint16_t max_frame_size_incoming);
Registers BNEP service, set a maximum frame size and assigns a packet handler. On embedded systems, use NULL for connection parameter.
Returns
- uint8_t
bnep_unregister_service
void bnep_unregister_service(uint16_t service_uuid);
Unregister BNEP service.
bnep_deinit
void bnep_deinit(void);
De-Init BNEP