fix compile of l2cap/rfcomm-name examples

This commit is contained in:
Matthias Ringwald 2016-01-21 21:20:22 +01:00
parent 423a3e4940
commit d6549a6e45
13 changed files with 36 additions and 37 deletions

View File

@ -36,7 +36,7 @@
*/
/*
* l2cap-server.c
* l2cap_server.c
*
* Created by Matthias Ringwald on 7/14/09.
*/

View File

@ -36,7 +36,7 @@
*/
/*
* l2cap-troughput.c
* l2cap_throughput.c
*
* Created by Matthias Ringwald on 7/14/09.
*/

View File

@ -36,7 +36,7 @@
*/
/*
* rfcomm-echo.c
* rfcomm_echo.c
*/
#include <unistd.h>
@ -89,7 +89,7 @@ void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint
if (packet[2] == HCI_STATE_WORKING) {
// get persistent RFCOMM channel
printf("HCI_STATE_WORKING\n");
bt_send_cmd(&rfcomm_persistent_channel_for_service_cmd, "ch.ringwald.btstack.rfcomm-echo2");
bt_send_cmd(&rfcomm_persistent_channel_for_service_cmd, "ch.ringwald.btstack.rfcomm_echo2");
}
break;

View File

@ -36,7 +36,7 @@
*/
/*
* rfcomm-echo.c
* rfcomm_echo.c
*/
#include <unistd.h>
@ -104,7 +104,7 @@ void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint
if (packet[2] == HCI_STATE_WORKING) {
// get persistent RFCOMM channel
printf("HCI_STATE_WORKING\n");
bt_send_cmd(&rfcomm_persistent_channel_for_service_cmd, "ch.ringwald.btstack.rfcomm-test");
bt_send_cmd(&rfcomm_persistent_channel_for_service_cmd, "ch.ringwald.btstack.rfcomm_test");
}
break;

View File

@ -3,9 +3,6 @@
#define EMBEDDED
// #define HAVE_INIT_SCRIPT
// #define HAVE_EHCILL
#define HAVE_BZERO
#define HAVE_TIME_MS

View File

@ -131,6 +131,8 @@ echo "#define HAVE_MALLOC" >> btstack_config.h
echo "#define HAVE_BZERO" >> btstack_config.h
if test "x$HAVE_SO_NOSIGPIPE" == xyes ; then
echo "#define HAVE_SO_NOSIGPIPE" >> btstack_config.h
else
echo "// #undef HAVE_SO_NOSIGPIPE" >> btstack_config.h
fi
echo >> btstack_config.h

View File

@ -1,9 +1,9 @@
Makefile
inquiry
l2cap-server
l2cap-throughput
l2cap_server
l2cap_throughput
le_scan
rfcomm-cat
rfcomm-echo
rfcomm-test
rfcomm_cat
rfcomm_echo
rfcomm_test
test

View File

@ -11,34 +11,34 @@ prefix = @prefix@
VPATH += ${BTSTACK_ROOT}/example/daemon
all: test rfcomm-cat rfcomm-echo rfcomm-test inquiry l2cap-server l2cap-throughput le_scan
all: test rfcomm_cat rfcomm_echo rfcomm_test inquiry l2cap_server l2cap_throughput le_scan
test: test.c
$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
l2cap-server: l2cap-server.c
l2cap_server: l2cap_server.c
$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
l2cap-throughput: l2cap-throughput.c
l2cap_throughput: l2cap_throughput.c
$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
inquiry: inquiry.c
$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
rfcomm-cat: rfcomm-cat.c
rfcomm_cat: rfcomm_cat.c
$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
rfcomm-echo: rfcomm-echo.c
rfcomm_echo: rfcomm_echo.c
$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
rfcomm-test: rfcomm-test.c
rfcomm_test: rfcomm_test.c
$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
le_scan: le_scan.c
$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
clean:
rm -f test mitm rfcomm-cat rfcomm-echo rfcomm-test inquiry l2cap-server l2cap-throughput le_scan
rm -f test mitm rfcomm_cat rfcomm_echo rfcomm_test inquiry l2cap_server l2cap_throughput le_scan
rm -rf *.dSYM
install:

View File

@ -17,15 +17,15 @@ ADDITIONAL_CFLAGS = -I.. \
ADDITIONAL_LDFLAGS = -L../src/.theos/obj -lBTstack
TOOL_NAME = inquiry l2cap-test rfcomm-echo rfcomm-cat rfcomm-test l2cap-server l2cap-throughput
TOOL_NAME = inquiry l2cap_test rfcomm_echo rfcomm_cat rfcomm_test l2cap_server l2cap_throughput
inquiry_FILES = inquiry.c
rfcomm-echo_FILES = rfcomm-echo.c
rfcomm-cat_FILES = rfcomm-cat.c
rfcomm-test_FILES = rfcomm-test.c
l2cap-test_FILES = test.c
l2cap-server_FILES = l2cap-server.c
l2cap-throughput_FILES = l2cap-throughput.c
rfcomm_echo_FILES = rfcomm_echo.c
rfcomm_cat_FILES = rfcomm_cat.c
rfcomm_test_FILES = rfcomm_test.c
l2cap_test_FILES = test.c
l2cap_server_FILES = l2cap_server.c
l2cap_throughput_FILES = l2cap_throughput.c
include $(THEOS)/makefiles/common.mk
include $(THEOS_MAKE_PATH)/tool.mk

2
port/mtk/.gitignore vendored
View File

@ -2,4 +2,4 @@ BTstackDaemon
BTstackDaemonRespawn
inquiry
le_scan
rfcomm-echo
rfcomm_echo

View File

@ -57,13 +57,13 @@ BTdaemon_OBJS = $(libBTstack_OBJS) \
daemon.o \
hci_transport_h4_mtk.o \
all: $(TOOLCHAIN) version BTstackDaemon libBTstack.so BTstackDaemonRespawn inquiry le_scan rfcomm-echo dist
all: $(TOOLCHAIN) version BTstackDaemon libBTstack.so BTstackDaemonRespawn inquiry le_scan rfcomm_echo dist
dist:
rm -f *.o
clean:
rm -f BTstackDaemon BTstackDaemonRespawn le_scan inquiry rfcomm-echo *.so *.o
rm -f BTstackDaemon BTstackDaemonRespawn le_scan inquiry rfcomm_echo *.so *.o
$(TOOLCHAIN):
$(NDK)/build/tools/make-standalone-toolchain.sh --install-dir=$@
@ -100,8 +100,8 @@ libBTstack.so: $(libBTstack_OBJS)
inquiry: inquiry.o
$(GCC) $(LDFLAGS) -Wl,-rpath,/system/lib libBTstack.so -o $@ inquiry.o
rfcomm-echo: rfcomm-echo.o
$(GCC) $(LDFLAGS) -Wl,-rpath,/system/lib libBTstack.so -o $@ rfcomm-echo.o
rfcomm_echo: rfcomm_echo.o
$(GCC) $(LDFLAGS) -Wl,-rpath,/system/lib libBTstack.so -o $@ rfcomm_echo.o
le_scan: le_scan.o
$(GCC) $(LDFLAGS) -Wl,-rpath,/system/lib libBTstack.so -o $@ le_scan.o

View File

@ -30,7 +30,7 @@ adb push $DIR/BTstackDaemonRespawn /system/btstack
adb push $DIR/libBTstack.so /system/btstack
adb push $DIR/inquiry /system/btstack
adb push $DIR/le_scan /system/btstack
adb push $DIR/rfcomm-echo /system/btstack
adb push $DIR/rfcomm_echo /system/btstack
echo "- put files in place"
adb shell su root mv /system/btstack/BTstackDaemon /system/bin
@ -54,8 +54,8 @@ adb shell su root chmod 755 /system/bin/inquiry
adb shell su root mv /system/btstack/le_scan /system/bin
adb shell su root chmod 755 /system/bin/le_scan
adb shell su root mv /system/btstack/rfcomm-echo /system/bin
adb shell su root chmod 755 /system/bin/rfcomm-echo
adb shell su root mv /system/btstack/rfcomm_echo /system/bin
adb shell su root chmod 755 /system/bin/rfcomm_echo
adb shell su root rm -r /system/btstack

View File

@ -586,7 +586,7 @@ static int rfcomm_send_uih_pn_command(rfcomm_multiplexer_t *multiplexer, uint8_t
return rfcomm_send_packet_for_multiplexer(multiplexer, address, BT_RFCOMM_UIH, 0, (uint8_t *) payload, pos);
}
// "The response may not change the DLCI, the priority, the convergence layer, or the timer value." RFCOMM-tutorial.pdf
// "The response may not change the DLCI, the priority, the convergence layer, or the timer value." rfcomm_tutorial.pdf
static int rfcomm_send_uih_pn_response(rfcomm_multiplexer_t *multiplexer, uint8_t dlci,
uint8_t priority, uint16_t max_frame_size){
uint8_t payload[10];