2011-05-01 10:25:46 +00:00
|
|
|
/*
|
2011-05-01 11:36:12 +00:00
|
|
|
* Copyright (C) 2009 by Matthias Ringwald
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
*
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
* 3. Neither the name of the copyright holders nor the names of
|
|
|
|
* contributors may be used to endorse or promote products derived
|
|
|
|
* from this software without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY MATTHIAS RINGWALD AND CONTRIBUTORS
|
|
|
|
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
|
|
|
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MATTHIAS
|
|
|
|
* RINGWALD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
|
|
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
|
|
|
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
|
|
|
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
|
|
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
|
|
|
* THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
2011-05-01 10:25:46 +00:00
|
|
|
*
|
2011-05-01 11:36:12 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* RFCOMM.h
|
2011-05-01 10:25:46 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <btstack/btstack.h>
|
|
|
|
#include <btstack/utils.h>
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
2011-06-06 14:12:38 +00:00
|
|
|
void rfcomm_init(void);
|
2011-05-01 10:25:46 +00:00
|
|
|
|
|
|
|
// register packet handler
|
|
|
|
void rfcomm_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size);
|
|
|
|
void rfcomm_register_packet_handler(void (*handler)(void * connection, uint8_t packet_type,
|
|
|
|
uint16_t channel, uint8_t *packet, uint16_t size));
|
|
|
|
|
|
|
|
// BTstack Internal RFCOMM API
|
|
|
|
void rfcomm_create_channel_internal(void * connectio, bd_addr_t *addr, uint8_t channel);
|
|
|
|
void rfcomm_disconnect_internal(uint16_t rfcomm_cid);
|
2011-05-03 21:14:41 +00:00
|
|
|
void rfcomm_register_service_internal(void * connection, uint8_t channel, uint16_t max_frame_size);
|
2011-05-01 10:25:46 +00:00
|
|
|
void rfcomm_unregister_service_internal(uint8_t service_channel);
|
|
|
|
void rfcomm_accept_connection_internal(uint16_t rfcomm_cid);
|
|
|
|
void rfcomm_decline_connection_internal(uint16_t rfcomm_cid);
|
|
|
|
int rfcomm_send_internal(uint8_t rfcomm_cid, uint8_t *data, uint16_t len);
|
2011-05-27 20:46:16 +00:00
|
|
|
void rfcomm_close_connection(void *connection);
|
2011-05-01 10:25:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
|