bnep_lwip.c (45e58dda4deca09f53f4b6fe7a10868144234162) bnep_lwip.c (9c30c50ad9bd9aea4c7d19b660a546f058597946)
1/*
2 * Copyright (C) 2017 BlueKitchen GmbH
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright

--- 514 unchanged lines hidden (view full) ---

523 * @brief Register BNEP service
524 * @brief Same as benp_register_service, but bnep lwip adapter handles all events
525 * @param service_uuid
526 * @Param max_frame_size
527 */
528uint8_t bnep_lwip_register_service(uint16_t service_uuid, uint16_t max_frame_size){
529 return bnep_register_service(packet_handler, service_uuid, max_frame_size);
530}
1/*
2 * Copyright (C) 2017 BlueKitchen GmbH
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright

--- 514 unchanged lines hidden (view full) ---

523 * @brief Register BNEP service
524 * @brief Same as benp_register_service, but bnep lwip adapter handles all events
525 * @param service_uuid
526 * @Param max_frame_size
527 */
528uint8_t bnep_lwip_register_service(uint16_t service_uuid, uint16_t max_frame_size){
529 return bnep_register_service(packet_handler, service_uuid, max_frame_size);
530}
531
532/**
533 * @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.
534 * @note: uses our packet handler to manage lwIP network interface
535 * @param addr
536 * @param l2cap_psm
537 * @param uuid_src
538 * @param uuid_dest
539 * @return status
540 */
541uint8_t bnep_lwip_connect(bd_addr_t addr, uint16_t l2cap_psm, uint16_t uuid_src, uint16_t uuid_dest){
542 int status = bnep_connect(packet_handler, addr, l2cap_psm, uuid_src, uuid_dest);
543 if (status != 0){
544 return ERROR_CODE_UNSPECIFIED_ERROR;
545 } else {
546 return ERROR_CODE_SUCCESS;
547 }
548}