diff --git a/project.xcodeproj/project.pbxproj b/project.xcodeproj/project.pbxproj index 5730dd796..efe709787 100644 --- a/project.xcodeproj/project.pbxproj +++ b/project.xcodeproj/project.pbxproj @@ -30,6 +30,7 @@ 9C88500E0FBF6702004980E4 /* l2cap.c in Sources */ = {isa = PBXBuildFile; fileRef = 9C88500C0FBF6702004980E4 /* l2cap.c */; }; 9C9F1A3D122F02DD004E21AC /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9C9F1A3C122F02DD004E21AC /* Foundation.framework */; }; 9CB9846B11BC32A800A2F346 /* sdp_util.c in Sources */ = {isa = PBXBuildFile; fileRef = 9CB9846A11BC32A800A2F346 /* sdp_util.c */; }; + 9CC42185136D6C9400BC4229 /* rfcomm.c in Sources */ = {isa = PBXBuildFile; fileRef = 9CC42183136D6C9400BC4229 /* rfcomm.c */; }; 9CC813A50FFC0A51002816F9 /* daemon.c in Sources */ = {isa = PBXBuildFile; fileRef = 9CC813A40FFC0A51002816F9 /* daemon.c */; }; 9CCE6CEA1025BD0000FCE9F4 /* hci.c in Sources */ = {isa = PBXBuildFile; fileRef = 9C46FC340FA906F700ABEF05 /* hci.c */; }; 9CE7CDD811BFF5470096F5B1 /* sdp.c in Sources */ = {isa = PBXBuildFile; fileRef = 9CE7CDD711BFF5470096F5B1 /* sdp.c */; }; @@ -120,6 +121,9 @@ 9CB9846A11BC32A800A2F346 /* sdp_util.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sdp_util.c; path = src/sdp_util.c; sourceTree = ""; }; 9CBE154810A354FF00597802 /* package.sh */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text.script.sh; path = package.sh; sourceTree = ""; }; 9CC152C61009052100223347 /* config.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = ""; }; + 9CC42182136D6C2A00BC4229 /* rfcomm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = rfcomm.h; path = include/btstack/rfcomm.h; sourceTree = ""; }; + 9CC42183136D6C9400BC4229 /* rfcomm.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = rfcomm.c; path = src/rfcomm.c; sourceTree = ""; }; + 9CC42184136D6C9400BC4229 /* rfcomm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = rfcomm.h; path = src/rfcomm.h; sourceTree = ""; }; 9CC813A10FFC0774002816F9 /* btstack.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = btstack.c; path = src/btstack.c; sourceTree = ""; }; 9CC813A40FFC0A51002816F9 /* daemon.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = daemon.c; path = src/daemon.c; sourceTree = ""; }; 9CE7CDD711BFF5470096F5B1 /* sdp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sdp.c; path = src/sdp.c; sourceTree = ""; }; @@ -196,6 +200,8 @@ 08FB7795FE84155DC02AAC07 /* Source */ = { isa = PBXGroup; children = ( + 9CC42183136D6C9400BC4229 /* rfcomm.c */, + 9CC42184136D6C9400BC4229 /* rfcomm.h */, 9CEB4B62107118E800DD5720 /* Makefile.in */, 9C7ECB810FCC85650085DAC5 /* bt_control.h */, 9C7ECB830FCC85650085DAC5 /* bt_control_iphone.h */, @@ -323,6 +329,7 @@ 9CEB4B7510715DC200DD5720 /* include */ = { isa = PBXGroup; children = ( + 9CC42182136D6C2A00BC4229 /* rfcomm.h */, 9C5BA8A0110B756500D79BBE /* hci_cmds.h */, 9CEB4B8010715EB000DD5720 /* linked_list.h */, 9CEB4B8110715EB000DD5720 /* utils.h */, @@ -454,6 +461,7 @@ 9C3AED88122C201C008046F4 /* remote_device_db_iphone.m in Sources */, 9C5E0F0E12DE39250013EF2C /* hci_transport_usb.c in Sources */, 9C2169D212F9FB7000072B00 /* platform_iphone.m in Sources */, + 9CC42185136D6C9400BC4229 /* rfcomm.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/src/rfcomm.h b/src/rfcomm.h new file mode 100644 index 000000000..a13ae639d --- /dev/null +++ b/src/rfcomm.h @@ -0,0 +1,29 @@ +/* + * RFCOMM.h + * + * Created by Matthias Ringwald on 10/19/09. + */ + +#include +#include + +#include + +void rfcomm_init(); + +// 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); +void rfcomm_register_service_internal(void * connection, uint16_t registration_id, uint16_t max_frame_size); +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); + + +