we only need to detect the presence of "Bluetooth Device Address" type in order to provide the function prototype, which needs to be from a header included prior to <openobex/obex.h>
while here constify arguments --- include/openobex/obex.h | 25 ++++++++++++++++--------- lib/obex.c | 6 +++--- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/include/openobex/obex.h b/include/openobex/obex.h index f948113..6dda861 100644 --- a/include/openobex/obex.h +++ b/include/openobex/obex.h @@ -131,18 +131,25 @@ OPENOBEX_SYMBOL(int) IrOBEX_TransportConnect(obex_t *self, const char *service); * Bluetooth OBEX API */ #if !defined(bt_addr_t) -# if defined(SOL_RFCOMM) -# if defined(_WIN32) /* Windows */ -# define bt_addr_t BTH_ADDR -# else /* Linux, FreeBSD, NetBSD */ -# define bt_addr_t bdaddr_t +# if defined(_WIN32) +# if defined(BTH_ADDR_NULL) +# define bt_addr_t BTH_ADDR +# endif +# elif defined(__FreeBSD__) +# if defined(NG_HCI_BDADDR_ANY) +# define bt_addr_t bdaddr_t +# endif +# else /* Linux, NetBSD, etc.. */ +# if defined(BDADDR_ANY) +# define bt_addr_t bdaddr_t # endif -# else /* no bluetooth stack available */ -# define bt_addr_t unsigned long # endif #endif -OPENOBEX_SYMBOL(int) BtOBEX_ServerRegister(obex_t *self, bt_addr_t *src, uint8_t channel); -OPENOBEX_SYMBOL(int) BtOBEX_TransportConnect(obex_t *self, bt_addr_t *src, bt_addr_t *dst, uint8_t channel); + +#if defined(bt_addr_t) +OPENOBEX_SYMBOL(int) BtOBEX_ServerRegister(obex_t *self, const bt_addr_t *src, uint8_t channel); +OPENOBEX_SYMBOL(int) BtOBEX_TransportConnect(obex_t *self, const bt_addr_t *src, const bt_addr_t *dst, uint8_t channel); +#endif /* * OBEX File API diff --git a/lib/obex.c b/lib/obex.c index 165fcb8..874cfcd 100644 --- a/lib/obex.c +++ b/lib/obex.c @@ -1058,7 +1058,7 @@ int CALLAPI IrOBEX_TransportConnect(obex_t *self, const char *service) An easier server function to use for Bluetooth (Bluetooth OBEX) only. */ LIB_SYMBOL -int CALLAPI BtOBEX_ServerRegister(obex_t *self, bdaddr_t *src, uint8_t channel) +int CALLAPI BtOBEX_ServerRegister(obex_t *self, const bt_addr_t *src, uint8_t channel) { DEBUG(3, "\n"); @@ -1085,8 +1085,8 @@ int CALLAPI BtOBEX_ServerRegister(obex_t *self, bdaddr_t *src, uint8_t channel) An easier connect function to use for Bluetooth (Bluetooth OBEX) only. */ LIB_SYMBOL -int CALLAPI BtOBEX_TransportConnect(obex_t *self, bdaddr_t *src, - bdaddr_t *dst, uint8_t channel) +int CALLAPI BtOBEX_TransportConnect(obex_t *self, const bt_addr_t *src, + const bt_addr_t *dst, uint8_t channel) { DEBUG(4, "\n"); -- 1.7.4.1 ------------------------------------------------------------------------------ EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev _______________________________________________ Openobex-users mailing list Openobex-users@lists.sourceforge.net http://lists.sourceforge.net/lists/listinfo/openobex-users