[oe-commits] org.oe.oz354x bluez-utils-dbus: update to 2.25 supporting new dbus api

florian commit openembedded-commits at lists.openembedded.org
Mon Sep 11 19:53:54 UTC 2006


bluez-utils-dbus: update to 2.25 supporting new dbus api

Author: florian at openembedded.org
Branch: org.openembedded.oz354x
Revision: 9a1b5b6052376c58ec051553bdc9ec1ca408556f
ViewMTN: http://monotone.openembedded.org/revision.psp?id=9a1b5b6052376c58ec051553bdc9ec1ca408556f
Files:
1
packages/bluez/bluez-libs_2.25.bb
packages/bluez/bluez-utils-dbus/dbus-2.24.patch
packages/bluez/bluez-utils-dbus/hciattach-ti-bts.patch
packages/bluez/bluez-utils-dbus_2.25.bb
Diffs:

#
# mt diff -r57e5be33ebed498e6d20d663bee07dfec61e6292 -r9a1b5b6052376c58ec051553bdc9ec1ca408556f
#
# 
# 
# add_file "packages/bluez/bluez-libs_2.25.bb"
#  content [bcb7abab221d50aeb8ffc947ad8660b5b7aa21af]
# 
# add_file "packages/bluez/bluez-utils-dbus/dbus-2.24.patch"
#  content [c4f2be77cd12b6154cd33df56124f442158a50ab]
# 
# add_file "packages/bluez/bluez-utils-dbus/hciattach-ti-bts.patch"
#  content [c24cd0c10f3804651316bda0285435cb2386f41f]
# 
# add_file "packages/bluez/bluez-utils-dbus_2.25.bb"
#  content [9ad06dc392cf83fc3abb06a5c5b54903bbd57361]
# 
============================================================
--- packages/bluez/bluez-libs_2.25.bb	bcb7abab221d50aeb8ffc947ad8660b5b7aa21af
+++ packages/bluez/bluez-libs_2.25.bb	bcb7abab221d50aeb8ffc947ad8660b5b7aa21af
@@ -0,0 +1,22 @@
+DESCRIPTION = "Linux Bluetooth Stack Userland Libaries."
+SECTION = "libs"
+PRIORITY = "optional"
+HOMEPAGE = "http://www.bluez.org"
+LICENSE = "GPL"
+PR = "r0"
+
+SRC_URI = "http://bluez.sourceforge.net/download/bluez-libs-${PV}.tar.gz"
+
+inherit autotools pkgconfig
+
+HEADERS = "bluetooth.h bnep.h cmtp.h hci.h hci_lib.h hidp.h l2cap.h rfcomm.h sco.h sdp.h sdp_lib.h"
+
+do_stage() {
+        oe_libinstall -a -so -C src libbluetooth ${STAGING_LIBDIR}
+
+        install -d ${STAGING_INCDIR}/bluetooth/
+        for f in ${HEADERS}
+        do
+		install -m 0644 include/$f ${STAGING_INCDIR}/bluetooth/$f
+        done
+}
============================================================
--- packages/bluez/bluez-utils-dbus/dbus-2.24.patch	c4f2be77cd12b6154cd33df56124f442158a50ab
+++ packages/bluez/bluez-utils-dbus/dbus-2.24.patch	c4f2be77cd12b6154cd33df56124f442158a50ab
@@ -0,0 +1,53 @@
+--- bluez-utils-2.24/acinclude.m4.orig	2006-01-12 08:21:38.000000000 +0100
++++ bluez-utils-2.24/acinclude.m4	2006-01-12 08:23:18.000000000 +0100
+@@ -131,46 +131,15 @@
+ ])
+ 
+ AC_DEFUN([AC_PATH_DBUS], [
+-	dbus_prefix=${prefix}
+-
+-	AC_ARG_WITH(dbus, AC_HELP_STRING([--with-dbus=DIR], [D-BUS library is installed in DIR]), [
+-		if (test "${withval}" != "yes"); then
+-			dbus_prefix=${withval}
+-		fi
+-	])
+-
+-	ac_save_CPPFLAGS=$CPPFLAGS
+-	ac_save_LDFLAGS=$LDFLAGS
+-
+-	DBUS_CFLAGS="-DDBUS_API_SUBJECT_TO_CHANGE"
+-	test -d "${dbus_prefix}/include/dbus-1.0" && DBUS_CFLAGS="$DBUS_CFLAGS -I${dbus_prefix}/include/dbus-1.0"
+-	if (test "${prefix}" = "${bluez_prefix}"); then
+-		test -d "${libdir}/dbus-1.0/include" && DBUS_CFLAGS="$DBUS_CFLAGS -I${libdir}/dbus-1.0/include"
+-	else
+-		test -d "${dbus_prefix}/lib64/dbus-1.0/include" && DBUS_CFLAGS="$DBUS_CFLAGS -I${dbus_prefix}/lib64/dbus-1.0/include"
+-		test -d "${dbus_prefix}/lib/dbus-1.0/include" && DBUS_CFLAGS="$DBUS_CFLAGS -I${dbus_prefix}/lib/dbus-1.0/include"
+-	fi
++	if pkg-config --exists dbus-1; then
++	dbus_found=yes ; DBUS_CFLAGS="`pkg-config --cflags dbus-1` -DDBUS_API_SUBJECT_TO_CHANGE"
++	DBUS_LIBS="`pkg-config --libs dbus-1`"
+ 
+ 	CPPFLAGS="$CPPFLAGS $DBUS_CFLAGS"
+-	AC_CHECK_HEADER(dbus/dbus.h, dbus_found=yes, dbus_found=no)
+-
+-	DBUS_LIBS=""
+-	if (test "${prefix}" = "${dbus_prefix}"); then
+-		test -d "${libdir}" && DBUS_LIBS="$DBUS_LIBS -L${libdir}"
+-	else
+-		test -d "${dbus_prefix}/lib64" && DBUS_LIBS="$DBUS_LIBS -L${dbus_prefix}/lib64"
+-		test -d "${dbus_prefix}/lib" && DBUS_LIBS="$DBUS_LIBS -L${dbus_prefix}/lib"
+-	fi
+-
+ 	LDFLAGS="$LDFLAGS $DBUS_LIBS"
+-	AC_CHECK_LIB(dbus-1, dbus_error_init, DBUS_LIBS="$DBUS_LIBS -ldbus-1", dbus_found=no)
+-	AC_CHECK_LIB(dbus-1, dbus_message_iter_get_basic, dummy=yes, dbus_found=no)
+-
+-	CPPFLAGS=$ac_save_CPPFLAGS
+-	LDFLAGS=$ac_save_LDFLAGS
+-
+	AC_SUBST(DBUS_CFLAGS)
+	AC_SUBST(DBUS_LIBS)
++	fi
+ ])
+ 
+ AC_DEFUN([AC_PATH_FUSE], [
============================================================
--- packages/bluez/bluez-utils-dbus/hciattach-ti-bts.patch	c24cd0c10f3804651316bda0285435cb2386f41f
+++ packages/bluez/bluez-utils-dbus/hciattach-ti-bts.patch	c24cd0c10f3804651316bda0285435cb2386f41f
@@ -0,0 +1,489 @@
+--- bluez-utils-2.24/tools/hciattach.c.orig	2005-12-10 15:14:36.000000000 +0100
++++ bluez-utils-2.24/tools/hciattach.c	2006-01-22 13:56:13.000000000 +0100
+@@ -57,6 +57,8 @@
+ #define HCI_UART_3WIRE	2
+ #define HCI_UART_H4DS	3
+ 
++#include "ti_bts.h"
++
+ struct uart_t {
+ 	char *type;
+ 	int  m_id;
+@@ -66,6 +68,7 @@
+ 	int  speed;
+ 	int  flags;
+ 	int  (*init) (int fd, struct uart_t *u, struct termios *ti);
++	char *bts;	/* bluetooth script */
+ };
+ 
+ #define FLOW_CTL	0x0001
+@@ -241,6 +244,114 @@
+ 	return 0;
+ }
+ 
++static int brf6150(int fd, struct uart_t *u, struct termios *ti)
++{
++	bts_t *bfp;
++	int i;
++	unsigned long vers;
++	unsigned char actionbuf[256];
++	unsigned char resp[128];		/* Response */
++	unsigned long count;
++	unsigned short atype;
++
++	if (u->bts == NULL)	/* no script, ignore */
++		return 0;
++
++	bfp = bts_load_script( u->bts, &vers );
++	if (bfp == NULL)
++		return -1;
++
++	fprintf( stderr, "Loading BTS script version %lu\n", vers );
++
++	while ((count = bts_next_action( bfp, actionbuf,
++			sizeof actionbuf - 1, &atype )) != 0) {
++		if (atype == ACTION_REMARKS) {
++			if (actionbuf[0] != 0)
++				fprintf( stderr, "%s\n", actionbuf );
++		}
++		else if (atype == ACTION_SEND_COMMAND) {
++#if 0
++			fprintf( stderr, "ACTION_SEND_COMMAND: ", (int)atype );
++			for (i=0; i<count; i++) {
++				fprintf( stderr, "0x%02x ", actionbuf[i] );
++			}
++			fprintf( stderr, "\n" );
++#endif
++			int n;
++			n = write(fd, actionbuf, count);
++			if (n < 0 || n < count) {
++				perror("Failed to write TI action command");
++				return -1;
++			}
++		}
++		else if (atype == ACTION_WAIT_EVENT) {
++			action_wait_t *wait = (action_wait_t *)actionbuf;
++#if 0
++			fprintf( stderr, "ACTION_WAIT_EVENT: %u msec, %u size, data = ", wait->msec, wait->size );
++			for (i=0; i<wait->size; i++) {
++				fprintf( stderr, "0x%02x ", wait->data[i] );
++			}
++			fprintf( stderr, "\n" );
++#endif
++			usleep(wait->msec);	/* seems they give usec, not msec */
++			/* Read reply. */
++			if ((count = read_hci_event(fd, resp, sizeof resp)) < 0) {
++				perror("Failed to read TI command response");
++				return -1;
++			}
++			if (count < wait->size) {
++				fprintf( stderr, "TI command response is short.");
++			}
++			for (i=0; i<wait->size; i++) {
++				if (i == 3) continue;	/* ignore */
++				if (resp[i] != wait->data[i]) {
++					fprintf( stderr, "TI command response does not match expected result.\n" );
++				}
++			}
++		}
++		else if (atype == ACTION_SERIAL_PORT_PARAMETERS) {
++			action_serial_t *sercmd = (action_serial_t *)actionbuf;
++
++			/* Set actual baudrate */
++			fprintf( stderr,
++				"BTS changing baud rate to %u, flow control to %u\n",
++				sercmd->baud, sercmd->flow_control );
++
++			tcflush(fd, TCIOFLUSH);
++
++			if (sercmd->flow_control)
++				ti->c_cflag |= CRTSCTS;
++			else
++				ti->c_cflag &= ~CRTSCTS;
++			if (tcsetattr(fd, TCSANOW, ti) < 0) {
++				perror("Can't set port settings");
++				return -1;
++			}
++
++			u->speed = sercmd->baud;
++
++			tcflush(fd, TCIOFLUSH);
++			if (set_speed(fd, ti, sercmd->baud) < 0) {
++				perror("Can't set baud rate");
++				return -1;
++			}
++		}
++		else if (atype == ACTION_DELAY) {
++			action_delay_t *delay = (action_delay_t *)actionbuf;
++			usleep(delay->msec);	/* seems they give usec, not msec */
++		}
++		else {
++			fprintf( stderr, "BTS action type = %d: ", (int)atype );
++			for (i=0; i<count; i++) {
++				fprintf( stderr, "0x%02x ", actionbuf[i] );
++			}
++			fprintf( stderr, "\n" );
++		}
++	}
++	bts_unload_script( bfp );
++	return 0;
++}
++
+ static int texas(int fd, struct uart_t *u, struct termios *ti)
+ {
+ 	struct timespec tm = {0, 50000};
+@@ -281,14 +392,25 @@
+ 	} while (resp[4] != cmd[1] && resp[5] != cmd[2]);
+ 
+ 	/* Verify manufacturer */
+-	if ((resp[11] & 0xFF) != 0x0d)
++	if (resp[11] != 0x0d)
+ 		fprintf(stderr,"WARNING : module's manufacturer is not Texas Instrument\n");
+ 
+ 	/* Print LMP version */
+-	fprintf(stderr, "Texas module LMP version : 0x%02x\n", resp[10] & 0xFF);
++	fprintf(stderr, "TI module LMP version : 0x%02x\n", resp[10]);
+ 
+ 	/* Print LMP subversion */
+-	fprintf(stderr, "Texas module LMP sub-version : 0x%02x%02x\n", resp[14] & 0xFF, resp[13] & 0xFF);
++	fprintf(stderr, "TI module LMP sub-version : 0x%02x%02x\n", resp[14], resp[13]);
++	if ((resp[14] >> 2) == 3) {
++		int err;
++		nanosleep(&tm, NULL);
++
++		/* BRF6150 */
++		if ((err=brf6150( fd, u, ti )) != 0) {
++			fprintf( stderr, "TI script failed (err=%d)\n",
++				err );
++			return -1;
++		}
++	}
+ 	
+ 	nanosleep(&tm, NULL);
+ 	return 0;
+@@ -953,7 +1075,7 @@
+ {
+ 	printf("hciattach - HCI UART driver initialization utility\n");
+ 	printf("Usage:\n");
+-	printf("\thciattach [-n] [-p] [-b] [-t timeout] [-s initial_speed] <tty> <type | id> [speed] [flow|noflow]\n");
++	printf("\thciattach [-n] [-p] [-b] [-t timeout] [-s initial_speed] [-S bts-script] <tty> <type | id> [speed] [flow|noflow]\n");
+ 	printf("\thciattach -l\n");
+ }
+ 
+@@ -970,11 +1092,12 @@
+ 	pid_t pid;
+ 	struct sigaction sa;
+ 	char dev[PATH_MAX];
++	char *bts = NULL;
+ 
+ 	detach = 1;
+ 	printpid = 0;
+ 	
+-	while ((opt=getopt(argc, argv, "bnpt:s:l")) != EOF) {
++	while ((opt=getopt(argc, argv, "bnpt:s:S:l")) != EOF) {
+ 		switch(opt) {
+ 		case 'b':
+ 			send_break = 1;
+@@ -996,6 +1119,10 @@
+ 			init_speed = atoi(optarg);
+ 			break;
+ 
++		case 'S':
++			bts = optarg;
++			break;
++
+ 		case 'l':
+ 			for (i = 0; uart[i].type; i++) {
+ 				printf("%-10s0x%04x,0x%04x\n", uart[i].type,
+@@ -1067,6 +1194,8 @@
+ 	if (init_speed)
+ 		u->init_speed = init_speed;
+ 
++	u->bts = bts;
++
+ 	memset(&sa, 0, sizeof(sa));
+ 	sa.sa_flags = SA_NOCLDSTOP;
+ 	sa.sa_handler = sig_alarm;
+--- bluez-utils-2.24/tools/Makefile.am.orig	2005-12-03 07:22:16.000000000 +0100
++++ bluez-utils-2.24/tools/Makefile.am	2006-01-22 13:53:59.000000000 +0100
+@@ -37,6 +37,9 @@
+ 
+ noinst_PROGRAMS = hcisecfilter ppporc
+ 
++hciattach_SOURCES = hciattach.c ti_bts.h ti_bts.c
++hciattach_LDADD = @BLUEZ_LIBS@
++ 
+ hciconfig_SOURCES = hciconfig.c csr.h csr.c
+ hciconfig_LDADD = @BLUEZ_LIBS@ $(top_builddir)/common/libtextfile.a
+ 
+--- bluez-utils-2.24/tools/ti_bts.h.orig	2006-01-22 13:56:38.000000000 +0100
++++ bluez-utils-2.24/tools/ti_bts.h	2006-01-22 13:53:59.000000000 +0100
+@@ -0,0 +1,116 @@
++/*
++ * Copyright (c) 2005 Texas Instruments, Inc.
++ *    Ported by SDG Systems, LLC
++ *
++ *  This program is free software; you can redistribute it and/or modify
++ *  it under the terms of the GNU General Public License version 2 as
++ *  published by the Free Software Foundation;
++ *
++ *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
++ *  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
++ *  IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
++ *  CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES 
++ *  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 
++ *  ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 
++ *  OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++ *
++ *  ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, 
++ *  COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS 
++ *  SOFTWARE IS DISCLAIMED.
++ *
++ */
++
++#ifndef BT_SCRIPT_H
++#define BT_SCRIPT_H
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++/*
++ * Define the interface of Bluetooth Script
++ */
++
++typedef void bts_t;
++
++
++#define ACTION_SEND_COMMAND             1   /* Send out raw data (as is) */
++#define ACTION_WAIT_EVENT               2   /* Wait for data */
++#define ACTION_SERIAL_PORT_PARAMETERS   3   
++#define ACTION_DELAY                    4   
++#define ACTION_RUN_SCRIPT               5   
++#define ACTION_REMARKS                  6
++
++/*
++ * Structure for ACTION_SEND_COMMAND
++ */
++typedef struct tagCActionCommand
++{
++    unsigned char data[1]; /* Data to send */
++} action_command_t;
++
++/*
++ * Structure for ACTION_WAIT_EVENT
++ */
++typedef struct tagCActionWaitEvent
++{
++    unsigned long msec; /* in milliseconds */
++    unsigned long size;
++    unsigned char data[1]; /* Data to wait for */
++} action_wait_t;
++
++
++/*
++ * Structure for ACTION_SERIAL_PORT_PARAMETERS
++ */
++typedef struct tagCActionSerialPortParameters
++{
++    unsigned long baud;
++    unsigned long flow_control;
++} action_serial_t;
++
++/* Flow Control Type */
++#define FCT_NONE        0
++#define FCT_HARDWARE    1
++
++#define DONT_CHANGE     0xFFFFFFFF  /* For both baud rate and flow control */
++
++
++/*
++ * Structure for ACTION_DELAY
++ */
++typedef struct tagCActionDelay
++{
++    unsigned long msec; /* in milliseconds */
++} action_delay_t;
++
++/*
++ * Structure for ACTION_RUN_SCRIPT
++ */
++typedef struct tagCActionRunScript
++{
++    char filename[1];
++} action_run_t;
++
++/*
++ * Structure for ACTION_REMARKS
++ */
++typedef struct tagCActionRemarks
++{
++    char m_szRemarks[1];
++} action_remarks_t;
++
++
++const char *cis_create_filename(const unsigned char* cmdparms);
++bts_t * bts_load_script(const char* fname, unsigned long* version);
++unsigned long bts_next_action(const bts_t* bts_fp, unsigned char* action_buf,
++	unsigned long nMaxSize, unsigned short* ptype);
++void bts_unload_script(bts_t* bts_fp);
++
++#ifdef __cplusplus
++};
++#endif
++
++#endif /* BT_SCRIPT_H */
++
+--- bluez-utils-2.24/tools/ti_bts.c.orig	2006-01-22 13:56:36.000000000 +0100
++++ bluez-utils-2.24/tools/ti_bts.c	2006-01-22 13:56:31.000000000 +0100
+@@ -0,0 +1,149 @@
++/*
++ * Copyright (c) 2005 Texas Instruments, Inc.
++ *    Ported by SDG Systems, LLC
++ *
++ *  This program is free software; you can redistribute it and/or modify
++ *  it under the terms of the GNU General Public License version 2 as
++ *  published by the Free Software Foundation;
++ *
++ *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
++ *  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
++ *  IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
++ *  CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES 
++ *  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 
++ *  ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 
++ *  OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++ *
++ *  ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, 
++ *  COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS 
++ *  SOFTWARE IS DISCLAIMED.
++ *
++ */
++
++
++#include <stdio.h>
++#include <stdlib.h>
++#include "ti_bts.h"
++
++#ifndef MAKEWORD
++#define MAKEWORD(a, b)      ((unsigned short)(((unsigned char)(a)) | ((unsigned short)((unsigned char)(b))) << 8))
++#endif
++
++#define TI_MANUFACTURER_ID  13
++
++/*
++ * Common Init Script specific
++ */
++const char *
++cis_create_filename(const unsigned char* cmdparms)
++{
++    static char bts_file[50];
++
++    /* Check for TI's id */
++    unsigned short manfid = MAKEWORD(cmdparms[8], cmdparms[9]);
++
++    if (TI_MANUFACTURER_ID == manfid) {
++        unsigned short version = MAKEWORD(cmdparms[10], cmdparms[11]);
++        
++        unsigned short chip =  (version & 0x7C00) >> 10;
++        unsigned short min_ver = (version & 0x007F);
++        unsigned short maj_ver = (version & 0x0380) >> 7;
++
++        if (0 != (version & 0x8000)) {
++            maj_ver |= 0x0008;
++        }
++        
++        sprintf( bts_file, "TIInit_%d.%d.%d.bts", 
++            (int)chip, (int)maj_ver, (int)min_ver);
++
++        return &bts_file[0];
++    }
++    return NULL;
++}
++
++typedef struct tagCHeader 
++{
++    unsigned long magic;
++    unsigned long version;
++    unsigned char future[24];
++} cheader_t;
++
++
++/* The value 0x42535442 stands for (in ASCII) BTSB */
++/* which is Bluetooth Script Binary */
++#define FILE_HEADER_MAGIC   0x42535442
++
++
++bts_t *
++bts_load_script(const char* fname, unsigned long* version)
++{
++    bts_t* bts = NULL;
++    FILE* fp = fopen(fname, "rb");
++
++    if (NULL != fp) {
++        /* Read header */
++        cheader_t header;
++
++        /* Read header */
++        if (1 == fread(&header, sizeof(header), 1, fp)) {
++            /* Check magic number for c%s
>>> DIFF TRUNCATED @ 16K






More information about the Openembedded-commits mailing list