head 1.3; access; symbols pkgsrc-2013Q2:1.3.0.26 pkgsrc-2013Q2-base:1.3 pkgsrc-2012Q4:1.3.0.24 pkgsrc-2012Q4-base:1.3 pkgsrc-2011Q4:1.3.0.22 pkgsrc-2011Q4-base:1.3 pkgsrc-2011Q2:1.3.0.20 pkgsrc-2011Q2-base:1.3 pkgsrc-2009Q4:1.3.0.18 pkgsrc-2009Q4-base:1.3 pkgsrc-2008Q4:1.3.0.16 pkgsrc-2008Q4-base:1.3 pkgsrc-2008Q3:1.3.0.14 pkgsrc-2008Q3-base:1.3 cube-native-xorg:1.3.0.12 cube-native-xorg-base:1.3 pkgsrc-2008Q2:1.3.0.10 pkgsrc-2008Q2-base:1.3 pkgsrc-2008Q1:1.3.0.8 pkgsrc-2008Q1-base:1.3 pkgsrc-2007Q4:1.3.0.6 pkgsrc-2007Q4-base:1.3 pkgsrc-2007Q3:1.3.0.4 pkgsrc-2007Q3-base:1.3 pkgsrc-2007Q2:1.3.0.2 pkgsrc-2007Q2-base:1.3 pkgsrc-2007Q1:1.2.0.6 pkgsrc-2007Q1-base:1.2 pkgsrc-2006Q4:1.2.0.4 pkgsrc-2006Q4-base:1.2 pkgsrc-2006Q3:1.2.0.2 pkgsrc-2006Q3-base:1.2 pkgsrc-base:1.1.1.1 TNF:1.1.1; locks; strict; comment @# @; 1.3 date 2007.05.22.18.53.56; author plunky; state dead; branches; next 1.2; 1.2 date 2006.07.09.16.35.31; author xtraeme; state Exp; branches; next 1.1; 1.1 date 2006.07.02.18.18.34; author xtraeme; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2006.07.02.18.18.34; author xtraeme; state Exp; branches; next ; desc @@ 1.3 log @update obexapp to version 1.4.7, which contains compiler warning fixes and NetBSD compatibility in the source. ok by xtraeme@@ @ text @$NetBSD: patch-ab,v 1.2 2006/07/09 16:35:31 xtraeme Exp $ --- sdp.c.orig 2003-09-07 21:00:55.000000000 +0200 +++ sdp.c 2006-07-09 18:27:44.000000000 +0200 @@@@ -34,6 +34,10 @@@@ #include #include +#ifdef __NetBSD__ +#define NG_HCI_BDADDR_ANY BDADDR_ANY +#endif + #undef PROTOCOL_DESCRIPTOR_LIST_BUFFER_SIZE #define PROTOCOL_DESCRIPTOR_LIST_BUFFER_SIZE 256 @ 1.2 log @Clean up previous patches for NetBSD bluetooth support. IMHO I can send them to the author now. @ text @d1 1 a1 1 $NetBSD$ @ 1.1 log @Initial revision @ text @d3 5 a7 3 --- main.c.orig 2004-12-24 00:09:48.000000000 +0100 +++ main.c 2006-07-02 19:48:19.000000000 +0200 @@@@ -90,8 +90,13 @@@@ a8 2 /* Prepare context */ memset(&context, 0, sizeof(context)); d10 1 a10 5 + context.addr.bt_len = sizeof(context.addr.bt_len); + context.addr.bt_family = AF_BLUETOOTH; +#else context.addr.rfcomm_len = sizeof(context.addr.rfcomm_len); context.addr.rfcomm_family = AF_BLUETOOTH; a11 66 context.tfd = context.sfd = -1; context.detach = 1; @@@@ -148,15 +153,23 @@@@ while ((n = getopt(argc, argv, "a:A:cC:dDfhnr:Ssu:")) != -1) { switch (n) { case 'a': +#ifdef __NetBSD__ + if (!bt_aton(optarg, &context.addr.bt_bdaddr)) { +#else if (!bt_aton(optarg, &context.addr.rfcomm_bdaddr)) { +#endif struct hostent *he = bt_gethostbyname(optarg); if (he == NULL) errx(1, "%s: %s", optarg, hstrerror(h_errno)); - +#ifdef __NetBSD__ + memcpy(&context.addr.bt_bdaddr, he->h_addr, + sizeof(context.addr.bt_bdaddr)); +#else memcpy(&context.addr.rfcomm_bdaddr, he->h_addr, sizeof(context.addr.rfcomm_bdaddr)); +#endif } break; @@@@ -178,11 +191,19 @@@@ break; case 'C': /* channel to listen on or connect to */ +#ifdef __NetBSD__ + context.addr.bt_channel = strtoul(optarg, &ep, 10); +#else context.addr.rfcomm_channel = strtoul(optarg, &ep, 10); +#endif if (*ep != '\0') { +#ifdef __NetBSD__ + context.addr.bt_channel = 0; +#else context.addr.rfcomm_channel = 0; +#endif - switch (tolower(optarg[0])) { + switch (tolower((unsigned char)optarg[0])) { case 'i': /* IrMC */ service = SDP_SERVICE_CLASS_IR_MC_SYNC; break; @@@@ -254,10 +275,25 @@@@ argv += optind; if (!context.server) { +#ifdef __NetBSD__ + if (memcmp(&context.addr.bt_bdaddr, + BDADDR_ANY, sizeof(context.addr.bt_bdaddr)) == 0) + errx(1, "Must specify server BD_ADDR"); + + /* Check channel, if was not set then obtain it via SDP */ + if (context.addr.bt_channel == 0 && service != 0) { + int channel; + + if (rfcomm_channel_lookup(NULL, + &context.addr.bt_bdaddr, + service, &channel, &n) != 0) + errx(1, "Could not obtain RFCOMM channel"); d13 2 a14 28 + context.addr.bt_channel = (u_int8_t) channel; +#else if (memcmp(&context.addr.rfcomm_bdaddr, NG_HCI_BDADDR_ANY, sizeof(context.addr.rfcomm_bdaddr)) == 0) errx(1, "Must specify server BD_ADDR"); - /* Check channel, if was not set then obtain it via SDP */ if (context.addr.rfcomm_channel == 0 && service != 0) { int channel; @@@@ -268,13 +304,21 @@@@ errc(1, n, "Could not obtain RFCOMM channel"); context.addr.rfcomm_channel = (u_int8_t) channel; +#endif } } +#ifdef __NetBSD__ + if (context.addr.bt_channel <= 0 || + context.addr.bt_channel > 30) + errx(1, "Invalid RFCOMM channel %d", + context.addr.bt_channel); +#else if (context.addr.rfcomm_channel <= 0 || context.addr.rfcomm_channel > 30) errx(1, "Invalid RFCOMM channel %d", context.addr.rfcomm_channel); +#endif a15 2 /* Detach server (if required) */ if (context.server && context.detach) { @ 1.1.1.1 log @Initial import of obexapp-1.4.4. An obex application to transfer objects (address book items, images, movies, anything the target can handle) to mobile devices via IrDA, Bluetooth and other protocol via the OBEX format. xtraeme: now it should be possible to transfer files from/to my cellular phone from NetBSD. @ text @@