also forgot to add rfcomm.c, fix include path for rfcomm.h, update source code boilerplate

This commit is contained in:
matthias.ringwald 2011-05-01 11:36:12 +00:00
parent 45c2e81318
commit a7c3dae54a
5 changed files with 1448 additions and 9 deletions

View File

@ -146,7 +146,12 @@ extern "C" {
// RFCOMM EVENTS
// The current BTstack-0.3-50x in Cydia uses
// data: event(8), len(8), status (8), address (48), server channel(8), rfcomm_cid(16), max frame size(16)
// The SVN version and the next update will use
// data: event(8), len(8), status (8), address (48), handle (16), server channel(8), rfcomm_cid(16), max frame size(16)
// status: 0 = OK
#define RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE 0x80

View File

@ -31,6 +31,8 @@
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 */; };
9CC42187136D76B500BC4229 /* rfcomm-cat.c in Sources */ = {isa = PBXBuildFile; fileRef = 9CC42186136D76B500BC4229 /* rfcomm-cat.c */; };
9CC42189136D778700BC4229 /* rfcomm-echo.c in Sources */ = {isa = PBXBuildFile; fileRef = 9CC42188136D778700BC4229 /* rfcomm-echo.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 */; };
@ -114,16 +116,16 @@
9C88500D0FBF6702004980E4 /* l2cap.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; name = l2cap.h; path = src/l2cap.h; sourceTree = "<group>"; };
9C9485C41211D58300B66EF1 /* l2cap-throughput.c */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.c; name = "l2cap-throughput.c"; path = "example/l2cap-throughput.c"; sourceTree = "<group>"; };
9C978672113DC04900380B3E /* ch.ringwald.BTstackTCP.plist */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text.plist.xml; name = ch.ringwald.BTstackTCP.plist; path = resources/ch.ringwald.BTstackTCP.plist; sourceTree = "<group>"; };
9C994B8E106BEEB700C70311 /* rfcomm.c */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.c; name = rfcomm.c; path = example/rfcomm.c; sourceTree = "<group>"; };
9C9F1A3C122F02DD004E21AC /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
9CA3C0900FB8B3C4005F48DE /* TODO.txt */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = TODO.txt; sourceTree = "<group>"; };
9CAA573610A5D87400D0E1A9 /* inquiry.c */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.c; name = inquiry.c; path = example/inquiry.c; sourceTree = "<group>"; };
9CB9846A11BC32A800A2F346 /* sdp_util.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sdp_util.c; path = src/sdp_util.c; sourceTree = "<group>"; };
9CBE154810A354FF00597802 /* package.sh */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text.script.sh; path = package.sh; sourceTree = "<group>"; };
9CC152C61009052100223347 /* config.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = "<group>"; };
9CC42182136D6C2A00BC4229 /* rfcomm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = rfcomm.h; path = include/btstack/rfcomm.h; sourceTree = "<group>"; };
9CC42183136D6C9400BC4229 /* rfcomm.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = rfcomm.c; path = src/rfcomm.c; sourceTree = "<group>"; };
9CC42184136D6C9400BC4229 /* rfcomm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = rfcomm.h; path = src/rfcomm.h; sourceTree = "<group>"; };
9CC42186136D76B500BC4229 /* rfcomm-cat.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "rfcomm-cat.c"; path = "example/rfcomm-cat.c"; sourceTree = "<group>"; };
9CC42188136D778700BC4229 /* rfcomm-echo.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "rfcomm-echo.c"; path = "example/rfcomm-echo.c"; sourceTree = "<group>"; };
9CC813A10FFC0774002816F9 /* btstack.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = btstack.c; path = src/btstack.c; sourceTree = "<group>"; };
9CC813A40FFC0A51002816F9 /* daemon.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = daemon.c; path = src/daemon.c; sourceTree = "<group>"; };
9CE7CDD711BFF5470096F5B1 /* sdp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sdp.c; path = src/sdp.c; sourceTree = "<group>"; };
@ -200,8 +202,6 @@
08FB7795FE84155DC02AAC07 /* Source */ = {
isa = PBXGroup;
children = (
9CC42183136D6C9400BC4229 /* rfcomm.c */,
9CC42184136D6C9400BC4229 /* rfcomm.h */,
9CEB4B62107118E800DD5720 /* Makefile.in */,
9C7ECB810FCC85650085DAC5 /* bt_control.h */,
9C7ECB830FCC85650085DAC5 /* bt_control_iphone.h */,
@ -224,6 +224,8 @@
9C00F87110191130008DAB17 /* l2cap_signaling.h */,
9C00F87210191130008DAB17 /* l2cap_signaling.c */,
9C7B5ABF100BD3340065D87E /* linked_list.c */,
9CC42183136D6C9400BC4229 /* rfcomm.c */,
9CC42184136D6C9400BC4229 /* rfcomm.h */,
9C04B825107D1CED002A63D0 /* run_loop.c */,
9CEB4DAA10753B4B00DD5720 /* run_loop_cocoa.m */,
9C255D4911E0C59900CDD689 /* run_loop_embedded.c */,
@ -315,11 +317,12 @@
9C7B5B81100D04520065D87E /* Example */ = {
isa = PBXGroup;
children = (
9CC42186136D76B500BC4229 /* rfcomm-cat.c */,
9CC42188136D778700BC4229 /* rfcomm-echo.c */,
9C9485C41211D58300B66EF1 /* l2cap-throughput.c */,
9C5BABAF110E28E900D79BBE /* l2cap-server.c */,
9CAA573610A5D87400D0E1A9 /* inquiry.c */,
9C13C9F610ECECE900B04243 /* mouse.c */,
9C994B8E106BEEB700C70311 /* rfcomm.c */,
9C1813F71042FCCA00C68F09 /* mitm.c */,
9C7B5B7E100D04450065D87E /* test.c */,
);
@ -329,7 +332,6 @@
9CEB4B7510715DC200DD5720 /* include */ = {
isa = PBXGroup;
children = (
9CC42182136D6C2A00BC4229 /* rfcomm.h */,
9C5BA8A0110B756500D79BBE /* hci_cmds.h */,
9CEB4B8010715EB000DD5720 /* linked_list.h */,
9CEB4B8110715EB000DD5720 /* utils.h */,
@ -462,6 +464,8 @@
9C5E0F0E12DE39250013EF2C /* hci_transport_usb.c in Sources */,
9C2169D212F9FB7000072B00 /* platform_iphone.m in Sources */,
9CC42185136D6C9400BC4229 /* rfcomm.c in Sources */,
9CC42187136D76B500BC4229 /* rfcomm-cat.c in Sources */,
9CC42189136D778700BC4229 /* rfcomm-echo.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};

View File

@ -51,12 +51,12 @@
#include <btstack/btstack.h>
#include <btstack/linked_list.h>
#include <btstack/run_loop.h>
#include <btstack/rfcomm.h>
#include "hci.h"
#include "hci_dump.h"
#include "hci_transport.h"
#include "l2cap.h"
#include "rfcomm.h"
#include "sdp.h"
#include "socket_connection.h"

1401
src/rfcomm.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,36 @@
/*
* 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.
*
*/
/*
* RFCOMM.h
*
* Created by Matthias Ringwald on 10/19/09.
*/
#include <btstack/btstack.h>