bnep_lwip: add bnep_lwip_connect to establish BNEP connection and manage lwIP network interface

This commit is contained in:
Matthias Ringwald 2020-08-26 17:15:05 +02:00
parent e698d63d6c
commit 9c30c50ad9
3 changed files with 27 additions and 0 deletions

View File

@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- GAP: request role change for classic connection via `gap_request_role`
- GAP: LE Whitelist API with 'gap_le_whitelist_x' with x = add, remove, clear and new `gap_connect_with_whitelist`
- SDP Client: add sdp_client_register_query_callback() allows to register query request instead of polling sdp_client_ready()
- BNEP lwIP: add `bnep_lwip_connect` to establish BNEP connection and manage lwIP network interface
### Changed
- GAP: treat AES-CCM encrypted connection as mutually authenticated (BIAS)

View File

@ -528,3 +528,21 @@ void bnep_lwip_register_packet_handler(btstack_packet_handler_t handler){
uint8_t bnep_lwip_register_service(uint16_t service_uuid, uint16_t max_frame_size){
return bnep_register_service(packet_handler, service_uuid, max_frame_size);
}
/**
* @brief Creates BNEP connection (channel) to a given server on a remote device with baseband address. A new baseband connection will be initiated if necessary.
* @note: uses our packet handler to manage lwIP network interface
* @param addr
* @param l2cap_psm
* @param uuid_src
* @param uuid_dest
* @return status
*/
uint8_t bnep_lwip_connect(bd_addr_t addr, uint16_t l2cap_psm, uint16_t uuid_src, uint16_t uuid_dest){
int status = bnep_connect(packet_handler, addr, l2cap_psm, uuid_src, uuid_dest);
if (status != 0){
return ERROR_CODE_UNSPECIFIED_ERROR;
} else {
return ERROR_CODE_SUCCESS;
}
}

View File

@ -71,6 +71,14 @@ void bnep_lwip_register_packet_handler(btstack_packet_handler_t handler);
*/
uint8_t bnep_lwip_register_service(uint16_t service_uuid, uint16_t max_frame_size);
/**
* @brief Creates BNEP connection (channel) to a given server on a remote device with baseband address. A new baseband connection will be initiated if necessary.
* @param addr
* @param l2cap_psm
* @param uuid_src
* @param uuid_dest
*/
uint8_t bnep_lwip_connect(bd_addr_t addr, uint16_t l2cap_psm, uint16_t uuid_src, uint16_t uuid_dest);
#if defined __cplusplus
}