Changeset 117
- Timestamp:
- 03/17/06 00:02:34 (3 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/development-branch/configure.ac
r116 r117 73 73 fi 74 74 AM_CONDITIONAL(ENABLE_OBEX, test x$HAVE_OPENOBEX = xyes) 75 76 #### Check for bluetooth #### 77 AC_ARG_ENABLE(bluetooth, 78 AS_HELP_STRING([--enable-bluetooth], [enable obex over bluetooth transports]), 79 WANT_BLUETOOTH=$enableval) 80 81 PKG_CHECK_MODULES(LIBBLUETOOTH, bluez, HAVE_BLUETOOTH=yes, HAVE_BLUETOOTH=no) 82 if test "x${HAVE_BLUETOOTH}" = "xyes"; then 83 if test "x${WANT_BLUETOOTH}" = "xno"; then 84 ENABLE_BLUETOOTH=no 85 else 86 AC_SUBST(LIBBLUETOOTH_CFLAGS) 87 AC_SUBST(LIBBLUETOOTH_LIBS) 88 ENABLE_BLUETOOTH=yes 89 AC_SUBST(ENABLE_BLUETOOTH) 90 AC_DEFINE(ENABLE_BLUETOOTH,1,[Bluetooth Transport]) 91 fi 92 else 93 if test "x${WANT_BLUETOOTH}" = "xyes"; then 94 AC_MSG_ERROR("Bluez not found") 95 else 96 ENABLE_BLUETOOTH=no 97 fi 98 fi 99 AM_CONDITIONAL(ENABLE_BLUETOOTH, test x$HAVE_BLUETOOTH = xyes) 75 100 76 101 #### Ask if the tools are needed #### … … 156 181 AC_LIBSYNCML_ISENABLED([Obex Client], ENABLE_OBEX) 157 182 AC_LIBSYNCML_ISENABLED([Obex Server], ENABLE_OBEX) 183 AC_LIBSYNCML_ISENABLED([Bluetooth], ENABLE_BLUETOOTH) 158 184 echo 159 185 echo "Done configuring." branches/development-branch/libsyncml/transports/obex_client.c
r116 r117 25 25 #include <libsyncml/sml_error_internals.h> 26 26 #include <libsyncml/sml_transport_internals.h> 27 28 #ifdef ENABLE_BLUETOOTH 29 #include <bluetooth/bluetooth.h> 30 #endif 27 31 28 32 #include "obex_client.h" … … 338 342 } 339 343 smlTrace(TRACE_INTERNAL, "usb connect done"); 340 } else { 344 } else if (env->type == SML_OBEX_TYPE_BLUETOOTH) { 345 #ifdef ENABLE_BLUETOOTH 346 smlTrace(TRACE_INTERNAL, "connecting to bluetooth device %s channel %i", env->path, env->port); 347 348 uint8_t channel = env->port; 349 bdaddr_t bdaddr; 350 str2ba(env->path, &bdaddr); 351 352 if (BtOBEX_TransportConnect(env->obexhandle, BDADDR_ANY, &bdaddr, channel) < 0) { 353 smlErrorSet(&error, SML_ERROR_GENERIC, "Bluetooth connect error"); 354 goto error; 355 } 356 357 smlTrace(TRACE_INTERNAL, "bluetooth connect done"); 358 #else 359 smlErrorSet(&error, SML_ERROR_GENERIC, "Bluetooth not enabled"); 360 goto error; 361 #endif 362 } else { 341 363 struct termios tio; 342 364 memset(&tio, 0, sizeof(tio)); … … 373 395 } 374 396 375 if (env->type != SML_OBEX_TYPE_USB ) {397 if (env->type != SML_OBEX_TYPE_USB && env->type != SML_OBEX_TYPE_BLUETOOTH) { 376 398 /* Start the obex transport */ 377 399 if (FdOBEX_TransportSetup(env->obexhandle, fd, fd, 4096) < 0) { branches/development-branch/tools/syncml-obex-client.c
r116 r117 61 61 fprintf (stderr, "[-u <id>]\t\t\tConnect to the given usb interface number\n"); 62 62 fprintf (stderr, "\t\t\t\tIf you dont specify an id, all available interface will be listed\n\n"); 63 fprintf (stderr, "[-b <addr> <channel>]\t\tConnect to the given bluetooth device\n\n"); 63 64 fprintf (stderr, "[--identifier <name>]\t\tUse the given identifier in the initial alert.\n"); 64 65 fprintf (stderr, "\t\t\t\tSome devices require a special string here. Nokias for example require \"PC Suite\"\n\n"); … … 403 404 if (errno) 404 405 usage (argv[0], 1); 405 } else if (!strcmp (arg, "--identifier")) { 406 } else if (!strcmp (arg, "-b")) { 407 #ifdef ENABLE_BLUETOOTH 408 config.type = SML_OBEX_TYPE_BLUETOOTH; 409 410 i++; 411 if (!argv[i]) 412 usage (argv[0], 1); 413 config.url = g_strdup(argv[i]); 414 415 i++; 416 if (!argv[i]) 417 usage (argv[0], 1); 418 errno = 0; 419 config.port = strtol(argv[i], (char **)NULL, 10); 420 if (errno) 421 usage (argv[0], 1); 422 #else 423 printf("Bluetooth not available in this build\n"); 424 return 1; 425 #endif 426 } else if (!strcmp (arg, "--identifier")) { 406 427 i++; 407 428 if (!argv[i])
