move btstack_version.h to platform/daemon and only use by daemon

This commit is contained in:
Matthias Ringwald 2016-01-31 20:31:52 +01:00
parent 591605b768
commit 0e537d1e66
12 changed files with 17 additions and 26 deletions

View File

@ -95,9 +95,6 @@ PAN_OBJ = $(PAN:.c=.o)
default_target: all
${BTSTACK_ROOT}/src/btstack_version.h:
${BTSTACK_ROOT}/tool/get_version.sh
# compile .gatt descriptions
profile.h: profile.gatt
python ${BTSTACK_ROOT}/tool/compile-gatt.py $< $@
@ -171,7 +168,6 @@ hsp_hs_test: ${CORE_OBJ} ${COMMON_OBJ} ${SDP_CLIENT} hsp_hs.o hsp_hs_test.c
clean:
rm -f ${EXAMPLES}
rm -f *.o *.out *.hex
rm -f ${BTSTACK_ROOT}/src/btstack_version.h
rm -f ancs_client_demo.h profile.h spp_and_le_counter.h
rm -rf *.dSYM
rm -rf ${BTSTACK_ROOT}/ble/*.o

View File

@ -668,6 +668,16 @@ static void daemon_disconnect_client(connection_t * connection){
free(client);
}
static void hci_emit_btstack_version(void){
log_info("BTSTACK_EVENT_VERSION %u.%u", BTSTACK_MAJOR, BTSTACK_MINOR);
uint8_t event[6];
event[0] = BTSTACK_EVENT_VERSION;
event[1] = sizeof(event) - 2;
event[2] = BTSTACK_MAJOR;
event[3] = BTSTACK_MINOR;
little_endian_store_16(event, 4, 3257); // last SVN commit on Google Code + 1
socket_connection_send_packet_all(HCI_EVENT_PACKET, 0, event, sizeof(event));
}
static void send_l2cap_connection_open_failed(connection_t * connection, bd_addr_t address, uint16_t psm, uint8_t status){
// emit error - see l2cap.c:l2cap_emit_channel_opened(..)

View File

@ -5,7 +5,7 @@
DIR=.
BTSTACK_ROOT=${DIR}/../..
DUMMY=$(shell )
VERSION=`sed -n -e 's/^.*BTSTACK_VERSION \"\(.*\)\"/\1/p' ${BTSTACK_ROOT}/src/btstack_version.h`
VERSION=`sed -n -e 's/^.*BTSTACK_VERSION \"\(.*\)\"/\1/p' ${BTSTACK_ROOT}/platform/daemon/btstack_version.h`
BTSTACK_PACKAGE=/tmp/btstack
ARCHIVE=btstack-arduino-${VERSION}.zip

View File

@ -28,4 +28,4 @@ CFLAGS += $(shell pkg-config libusb-1.0 --cflags)
LDFLAGS += $(shell pkg-config libusb-1.0 --libs)
endif
all: ${BTSTACK_ROOT}/src/btstack_version.h ${EXAMPLES}
all: ${EXAMPLES}

View File

@ -19,7 +19,7 @@ popd
pushd .
cd $DIR/../..
VERSION=`sed -n -e 's/^.*BTSTACK_VERSION \"\(.*\)\"/\1/p' src/btstack_version.h`
VERSION=`sed -n -e 's/^.*BTSTACK_VERSION \"\(.*\)\"/\1/p' platform/daemon/btstack_version.h`
ARCHIVE=btstack-android-mtk-$VERSION.tar.gz
echo "Create Archive $ARCHIVE"
rm -f $ARCHIVE

View File

@ -54,4 +54,4 @@ ifneq ($(OS),Windows_NT)
EXAMPLES += ${EXAMPLES_CLI}
endif
all: ${BTSTACK_ROOT}/src/btstack_version.h ${EXAMPLES}
all: ${EXAMPLES}

View File

@ -56,7 +56,6 @@
#include "btstack_memory_pool.h"
#include "btstack_run_loop.h"
#include "btstack_util.h"
#include "btstack_version.h"
#include "gap.h"
#include "hci.h"
#include "hci_cmd.h"

View File

@ -65,7 +65,6 @@
#include "btstack_debug.h"
#include "btstack_linked_list.h"
#include "btstack_memory.h"
#include "btstack_version.h"
#include "gap.h"
#include "hci.h"
#include "hci_cmd.h"
@ -2997,18 +2996,6 @@ void hci_emit_hci_open_failed(void){
hci_stack->packet_handler(HCI_EVENT_PACKET, event, sizeof(event));
}
void hci_emit_btstack_version(void){
log_info("BTSTACK_EVENT_VERSION %u.%u", BTSTACK_MAJOR, BTSTACK_MINOR);
uint8_t event[6];
event[0] = BTSTACK_EVENT_VERSION;
event[1] = sizeof(event) - 2;
event[2] = BTSTACK_MAJOR;
event[3] = BTSTACK_MINOR;
little_endian_store_16(event, 4, 3257); // last SVN commit on Google Code + 1
hci_dump_packet( HCI_EVENT_PACKET, 0, event, sizeof(event));
hci_stack->packet_handler(HCI_EVENT_PACKET, event, sizeof(event));
}
void hci_emit_system_bluetooth_enabled(uint8_t enabled){
log_info("BTSTACK_EVENT_SYSTEM_BLUETOOTH_ENABLED %u", enabled);
uint8_t event[3];

View File

@ -703,7 +703,6 @@ void hci_emit_l2cap_check_timeout(hci_connection_t *conn);
void hci_emit_disconnection_complete(uint16_t handle, uint8_t reason);
void hci_emit_nr_connections_changed(void);
void hci_emit_hci_open_failed(void);
void hci_emit_btstack_version(void);
void hci_emit_system_bluetooth_enabled(uint8_t enabled);
void hci_emit_remote_name_cached(bd_addr_t addr, device_name_t *name);
void hci_emit_discoverable_enabled(uint8_t enabled);

View File

@ -60,7 +60,7 @@ LDFLAGS += -lCppUTest -lCppUTestExt
EXAMPLES = hfp_ag_parser_test hfp_ag_client_test hfp_hf_parser_test hfp_hf_client_test
all: ${BTSTACK_ROOT}/src/btstack_version.h ${EXAMPLES}
all: ${EXAMPLES}
clean:
rm -rf *.o $(EXAMPLES) $(CLIENT_EXAMPLES) *.dSYM

View File

@ -31,7 +31,7 @@ LDFLAGS += $(shell pkg-config libusb-1.0 --libs)
EXAMPLES = iopt hfp_hf_test hfp_ag_test ble_peripheral_test ble_central_test l2cap_test classic_test bnep_test hsp_ag_test hsp_hs_test sco_loopback
all: ${BTSTACK_ROOT}/src/btstack_version.h ${EXAMPLES}
all: ${EXAMPLES}
# compile .gatt descriptions
ble_peripheral_test.h: ble_peripheral_test.gatt

View File

@ -1,6 +1,6 @@
#!/bin/sh
DIR=`dirname $0`
FILE=$DIR/../src/btstack_version.h
FILE=$DIR/../platform/daemon/btstack_version.h
COMMIT=`git log -1 --pretty=format:%h`
MAJOR=0
MINOR=9