Hi Mina,
Thank you for your time.
So, to make GPL work, I would probably have to write it's JNI part from the scratch (libbluecove.so), right?
Another thing, for now, I am focusing my attention on android2 project.
I made dumb mistake by passing this(in my case it was reference to OnClickListener) instead of reference to activity. :)
So now, another problem occurs.
If I understand correctly logs say that setDeviceServiceClasses is not supported on Android 2.x (bold lines).
The code that I use very similar to OBEXServer example found
here.
I attached my code as well, just in case.
Another problem is, although ProtocolDescriptorList is set as in example, exception is thrown (next bold lines).
In my activity code I set following properties before I make call to LocalDevice (LocalDevice.getLocalDevice()):
BlueCoveImpl.setConfigObject(BlueCoveConfigProperties.PROPERTY_ANDROID_CONTEXT, context);
String obexUUIDs = "0x1105"; // a comma separated string of UUIDs.
BlueCoveImpl.setConfigProperty(BlueCoveConfigProperties.PROPERTY_ANDROID_OBEX_UUIDS, obexUUIDs);
// just for testing
BlueCoveImpl.setConfigProperty(BlueCoveConfigProperties.PROPERTY_ANDROID_DISCOVERABLE_DURATION, String.valueOf(10));
I am wondering if it is possible to make OBEX server work on android?
If that is not possible, I guess then I have no choice but to move back to GPL project, right?
All the best,
Ivan
04-04 09:55:24.832: I/dalvikvm(21509): Could not find method org.apache.log4j.Logger.getLogger, referenced from method com.intel.bluetooth.DebugLog4jAppender.<init>
04-04 09:55:24.832: W/dalvikvm(21509): VFY: unable to resolve static method 15791: Lorg/apache/log4j/Logger;.getLogger (Ljava/lang/String;)Lorg/apache/log4j/Logger;
04-04 09:55:24.832: D/dalvikvm(21509): VFY: replacing opcode 0x71 at 0x0005
04-04 09:55:24.835: D/dalvikvm(21509): VFY: dead code 0x0008-000b in Lcom/intel/bluetooth/DebugLog4jAppender;.<init> ()V
04-04 09:55:24.851: W/dalvikvm(21509): VFY: unable to resolve static field 4499 (DEBUG) in Lorg/apache/log4j/Level;
04-04 09:55:24.851: D/dalvikvm(21509): VFY: replacing opcode 0x62 at 0x0008
04-04 09:55:24.867: W/dalvikvm(21509): VFY: unable to resolve static field 4500 (ERROR) in Lorg/apache/log4j/Level;
04-04 09:55:24.867: D/dalvikvm(21509): VFY: replacing opcode 0x62 at 0x0012
04-04 09:55:24.867: D/dalvikvm(21509): VFY: dead code 0x000a-000d in Lcom/intel/bluetooth/DebugLog4jAppender;.appendLog (ILjava/lang/String;Ljava/lang/Throwable;)V
04-04 09:55:24.867: D/dalvikvm(21509): VFY: dead code 0x0014-0017 in Lcom/intel/bluetooth/DebugLog4jAppender;.appendLog (ILjava/lang/String;Ljava/lang/Throwable;)V
04-04 09:55:24.875: I/dalvikvm(21509): Could not find method org.apache.log4j.Category.isDebugEnabled, referenced from method com.intel.bluetooth.DebugLog4jAppender.isLogEnabled
04-04 09:55:24.875: W/dalvikvm(21509): VFY: unable to resolve virtual method 15789: Lorg/apache/log4j/Category;.isDebugEnabled ()Z
04-04 09:55:24.875: D/dalvikvm(21509): VFY: replacing opcode 0x6e at 0x0007
04-04 09:55:24.875: D/dalvikvm(21509): VFY: dead code 0x000a-000b in Lcom/intel/bluetooth/DebugLog4jAppender;.isLogEnabled (I)Z
04-04 09:55:24.933: I/System.out(21509): BlueCove version 2.1.1-SNAPSHOT on android_2.x
04-04 09:55:26.664: D/BluetoothSocket(21509): create BluetoothSocket: type = 1, fd = -1, uuid = [null], port = 8
04-04 09:55:26.664: I/BLZ20_WRAPPER(21509): blz20_wrp_socket: fam 31, type 1, prot BTPROTO_RFCOMM
04-04 09:55:26.664: D/BLZ20_WRAPPER(21509): blz20_init: initializing...
04-04 09:55:26.664: D/BTL_IFC_WRP(21509): wsactive_init: init active list
04-04 09:55:26.664: I/BTL_IFC(21509): main_client_thread: Client main thread starting
04-04 09:55:26.765: D/BLZ20_WRAPPER(21509): blz20_init: success
04-04 09:55:26.765: I/BTL_IFC(21509): BTL_IFC_RegisterSubSystem: Register subsystem [BTS]
04-04 09:55:26.765: I/BTL_IFC(21509): btl_ifc_ctrl_connect: Connect control channel for subsystem [BTS]
04-04 09:55:26.765: D/BTL_IFC_WRP(21509): wrp_sock_create: CTRL
04-04 09:55:26.765: D/BTL_IFC_WRP(21509): wrp_alloc_new_sock: wrp_alloc_new_sock sub 1
04-04 09:55:26.765: D/BTL_IFC_WRP(21509): wrp_sock_create: 57
04-04 09:55:26.765: D/BTL_IFC_WRP(21509): wrp_sock_connect: wrp_sock_connect brcm.bt.btlif:9000 (57)
04-04 09:55:26.765: D/BTL_IFC_WRP(21509): wrp_sock_connect: BTLIF_MAKE_LOCAL_SERVER_NAME return name: brcm.bt.btlif.9000
04-04 09:55:26.765: D/BTL_IFC_WRP(21509): wrp_sock_connect: wrp_sock_connect ret:0 server name:brcm.bt.btlif.9000
04-04 09:55:26.765: I/BTL_IFC_WRP(21509): wrp_sock_connect: Connected. (57)
04-04 09:55:26.765: I/BTL_IFC(21509): send_ctrl_msg: [BTL_IFC CTRL] send BTLIF_REGISTER_SUBSYS_REQ (BTS) 0 pbytes (hdl 57)
04-04 09:55:26.769: D/BTL_IFC(21509): BTL_IFC_RegisterSubSystem: add new ctrl fd to active set
04-04 09:55:26.769: D/BTL_IFC_WRP(21509): wrp_wsock_create: BTS
04-04 09:55:26.769: D/BTL_IFC_WRP(21509): wrp_alloc_new_sock: wrp_alloc_new_sock sub 16
04-04 09:55:26.769: D/BTL_IFC_WRP(21509): wrp_wsock_create: 58
04-04 09:55:26.769: D/BLZ20_WRAPPER(21509): btsk_alloc_add: success
04-04 09:55:26.769: D/BLZ20_WRAPPER(21509): btsk_dump_list: fd (-1:58), bta -1, rc 0, wflags 0x0, cflags 0x0, port 0
04-04 09:55:26.769: I/BLZ20_WRAPPER(21509): blz20_wrp_socket: return 58
04-04 09:55:26.769: D/BLZ20_WRAPPER(21509): blz20_wrp_setsockopt: fd (-1:58), bta -1, rc 0, wflags 0x0, cflags 0x0, port 0
04-04 09:55:26.769: I/BLZ20_WRAPPER(21509): blz20_wrp_setsockopt: configure rfcomm lm mode 0x26, (master:0, auth 1, enc 1)
04-04 09:55:26.769: I/BLZ20_WRAPPER(21509): blz20_wrp_setsockopt: success
04-04 09:55:26.769: D/BLZ20_WRAPPER(21509): blz20_wrp_setsockopt: fd (-1:58), bta -1, rc 0, wflags 0x0, cflags 0x0, port 0
04-04 09:55:26.769: I/BLZ20_WRAPPER(21509): blz20_wrp_setsockopt: configure rfcomm sndbuf len 71680 bytes
04-04 09:55:26.769: I/BLZ20_WRAPPER(21509): blz20_wrp_setsockopt: success
04-04 09:55:26.769: D/BLZ20_ASOCKWRP(21509): asocket_init
04-04 09:55:26.769: I/BLZ20_WRAPPER(21509): blz20_wrp_fcntl: s 58, cmd 3
04-04 09:55:26.769: D/BLZ20_WRAPPER(21509): blz20_wrp_fcntl: fd (-1:58), bta -1, rc 0, wflags 0x0, cflags 0x0, port 0
04-04 09:55:26.769: I/BLZ20_WRAPPER(21509): blz20_wrp_fcntl: s 58, cmd 4
04-04 09:55:26.769: D/BLZ20_WRAPPER(21509): blz20_wrp_fcntl: fd (-1:58), bta -1, rc 0, wflags 0x0, cflags 0x0, port 0
04-04 09:55:26.769: D/BLZ20_WRAPPER(21509): blz20_wrp_fcntl: transparant fcntl
04-04 09:55:26.769: I/BLZ20_WRAPPER(21509): blz20_wrp_fcntl: s 60, cmd 3
04-04 09:55:26.769: I/BLZ20_WRAPPER(21509): blz20_wrp_fcntl: wsock not found, pass through transparantly
04-04 09:55:26.769: I/BLZ20_WRAPPER(21509): blz20_wrp_fcntl: s 60, cmd 4
04-04 09:55:26.769: I/BLZ20_WRAPPER(21509): blz20_wrp_fcntl: wsock not found, pass through transparantly
04-04 09:55:26.769: I/BLZ20_WRAPPER(21509): blz20_set_asocket: success (58,59,60)
04-04 09:55:26.777: I/BLZ20_WRAPPER(21509): blz20_wrp_bind: s 58
04-04 09:55:26.777: D/BLZ20_WRAPPER(21509): blz20_wrp_bind: bind socket fd (-1:58), bta -1, rc 0, wflags 0x0, cflags 0x0, port 0
04-04 09:55:26.777: D/BLZ20_WRAPPER(21509): __bind_prot_rfcomm: rc_chan 8
04-04 09:55:26.777: D/BLZ20_WRAPPER(21509): btlif_send_msg_wait_response: send BTLIF_BTS_RFC_BIND_REQ, wait for |BTLIF_BTS_RFC_BIND_RSP|
04-04 09:55:26.777: I/BTL_IFC(21509): send_ctrl_msg: [BTL_IFC CTRL] send BTLIF_BTS_RFC_BIND_REQ (BTS) 8 pbytes (hdl 57)
04-04 09:55:26.785: I/BTL_IFC(21509): btl_ifc_ctrl_rx: [BTL_IFC CTRL] recv BTLIF_BTS_RFC_BIND_RSP (BTS) 14 pbytes (hdl 57)
04-04 09:55:26.785: I/BLZ20_WRAPPER(21509): btlif_ctrl_callback: btlif_ctrl_callback : msg id BTLIF_BTS_RFC_BIND_RSP
04-04 09:55:26.785: D/BLZ20_WRAPPER(21509): btlif_signal_event: fd (-1:58), bta -1, rc 0, wflags 0x2, cflags 0x0, port 0
04-04 09:55:26.785: D/BLZ20_WRAPPER(21509): btlif_signal_event: event BTLIF_BTS_RFC_BIND_RSP matched
04-04 09:55:26.785: D/BLZ20_WRAPPER(21509): btlif_send_msg_wait_response: unblocked fd (-1:58), bta -1, rc 0, wflags 0x0, cflags 0x0, port 0
04-04 09:55:26.785: D/BTL_IFC_WRP(21509): wrp_sock_bind: BTLIF_MAKE_LOCAL_SERVER_NAME return name: brcm.bt.btlif.9049
04-04 09:55:26.785: D/BTL_IFC_WRP(21509): wrp_sock_bind: socket_local_server_bind result:0 server_name:brcm.bt.btlif.9049
04-04 09:55:26.785: D/BTL_IFC_WRP(21509): wrp_sock_bind: socket_local_server_bind on port 9049
04-04 09:55:26.785: I/BLZ20_WRAPPER(21509): blz20_wrp_listen: s 58, backlog 1
04-04 09:55:26.785: D/BLZ20_WRAPPER(21509): blz20_wrp_listen: fd (-1:58), bta -1, rc 8, wflags 0x0, cflags 0x2, port 9049
04-04 09:55:26.785: D/BTL_IFC_WRP(21509): wrp_sock_listen_bl: wrp_sock_listen_bl : fd 58 brcm.bt.btlif:9049 backlog 1
04-04 09:55:26.785: D/BLZ20_WRAPPER(21509): btlif_send_msg_wait_response: send BTLIF_BTS_RFC_LISTEN_REQ, wait for |BTLIF_BTS_RFC_LISTEN_RSP|
04-04 09:55:26.785: I/BTL_IFC(21509): send_ctrl_msg: [BTL_IFC CTRL] send BTLIF_BTS_RFC_LISTEN_REQ (BTS) 24 pbytes (hdl 57)
04-04 09:55:26.789: I/BTL_IFC(21509): btl_ifc_ctrl_rx: [BTL_IFC CTRL] recv BTLIF_BTS_RFC_LISTEN_RSP (BTS) 19 pbytes (hdl 57)
04-04 09:55:26.789: I/BLZ20_WRAPPER(21509): btlif_ctrl_callback: btlif_ctrl_callback : msg id BTLIF_BTS_RFC_LISTEN_RSP
04-04 09:55:26.789: I/BLZ20_WRAPPER(21509): btlif_process_listen_rsp: listen response for bta hdl 1
04-04 09:55:26.789: D/BLZ20_WRAPPER(21509): btlif_signal_event: fd (58:58), bta 1, rc 8, wflags 0x8, cflags 0x2, port 9049
04-04 09:55:26.789: D/BLZ20_WRAPPER(21509): btlif_signal_event: event BTLIF_BTS_RFC_LISTEN_RSP matched
04-04 09:55:26.789: D/BLZ20_WRAPPER(21509): btlif_send_msg_wait_response: unblocked fd (58:58), bta 1, rc 8, wflags 0x0, cflags 0x2, port 9049
04-04 09:55:26.789: I/BLZ20_WRAPPER(21509): __listen_prot_rfcomm: success, scn 8
04-04 09:55:28.320: D/BTServer(21509): BT server url: null
04-04 09:55:30.140: D/BTServer(21509): setDeviceServiceClasses Not Supported on android_2.x
04-04 09:55:30.144: W/System.err(21509): com.intel.bluetooth.NotSupportedRuntimeException: Not Supported on android_2.x
04-04 09:55:30.152: W/System.err(21509): at com.intel.bluetooth.ServiceRecordImpl.setDeviceServiceClasses(ServiceRecordImpl.java:551)
04-04 09:55:30.156: W/System.err(21509): at de.is04.telemedic.connector.connectionmanager.BluecoveOBEXBTManager.connect(BluecoveOBEXBTManager.java:66)
04-04 09:55:30.164: W/System.err(21509): at de.is04.telemedic.activity.MeasureActivity$5.onClick(MeasureActivity.java:268)
04-04 09:55:30.167: W/System.err(21509): at android.view.View.performClick(View.java:2538)
04-04 09:55:30.171: W/System.err(21509): at android.view.View$PerformClick.run(View.java:9152)
04-04 09:55:30.179: W/System.err(21509): at android.os.Handler.handleCallback(Handler.java:587)
04-04 09:55:30.183: W/System.err(21509): at android.os.Handler.dispatchMessage(Handler.java:92)
04-04 09:55:30.191: W/System.err(21509): at android.os.Looper.loop(Looper.java:123)
04-04 09:55:30.195: W/System.err(21509): at android.app.ActivityThread.main(ActivityThread.java:3687)
04-04 09:55:30.199: W/System.err(21509): at java.lang.reflect.Method.invokeNative(Native Method)
04-04 09:55:30.207: W/System.err(21509): at java.lang.reflect.Method.invoke(Method.java:507)
04-04 09:55:30.210: W/System.err(21509): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
04-04 09:55:30.210: W/System.err(21509): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
04-04 09:55:30.210: W/System.err(21509): at dalvik.system.NativeStart.main(Native Method)
04-04 09:55:35.726: E/BTServer(21509): Updating SDP ProtocolDescriptorList is mandatory
04-04 09:55:35.726: W/System.err(21509): java.lang.IllegalArgumentException: ProtocolDescriptorList is mandatory04-04 09:55:35.738: W/System.err(21509): at com.intel.bluetooth.BluetoothConnectionNotifierBase.validateServiceRecord(BluetoothConnectionNotifierBase.java:167)
04-04 09:55:35.742: W/System.err(21509): at com.intel.bluetooth.BluetoothRFCommConnectionNotifier.validateServiceRecord(BluetoothRFCommConnectionNotifier.java:91)
04-04 09:55:35.746: W/System.err(21509): at com.intel.bluetooth.BluetoothConnectionNotifierBase.updateServiceRecord(BluetoothConnectionNotifierBase.java:208)
04-04 09:55:35.753: W/System.err(21509): at com.intel.bluetooth.ServiceRecordsRegistry.updateServiceRecord(ServiceRecordsRegistry.java:81)
04-04 09:55:35.761: W/System.err(21509): at javax.bluetooth.LocalDevice.updateRecord(LocalDevice.java:491)
04-04 09:55:35.765: W/System.err(21509): at de.is04.telemedic.connector.connectionmanager.BluecoveOBEXBTManager.connect(BluecoveOBEXBTManager.java:91)
04-04 09:55:35.769: W/System.err(21509): at de.is04.telemedic.activity.MeasureActivity$5.onClick(MeasureActivity.java:268)
04-04 09:55:35.777: W/System.err(21509): at android.view.View.performClick(View.java:2538)
04-04 09:55:35.781: W/System.err(21509): at android.view.View$PerformClick.run(View.java:9152)
04-04 09:55:35.781: W/System.err(21509): at android.os.Handler.handleCallback(Handler.java:587)
04-04 09:55:35.781: W/System.err(21509): at android.os.Handler.dispatchMessage(Handler.java:92)
04-04 09:55:35.785: W/System.err(21509): at android.os.Looper.loop(Looper.java:123)
04-04 09:55:35.785: W/System.err(21509): at android.app.ActivityThread.main(ActivityThread.java:3687)
04-04 09:55:35.785: W/System.err(21509): at java.lang.reflect.Method.invokeNative(Native Method)
04-04 09:55:35.785: W/System.err(21509): at java.lang.reflect.Method.invoke(Method.java:507)
04-04 09:55:35.789: W/System.err(21509): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
04-04 09:55:35.789: W/System.err(21509): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
04-04 09:55:35.789: W/System.err(21509): at dalvik.system.NativeStart.main(Native Method)
04-04 09:55:38.445: D/BTServer(21509): Accepting OBEX connections
04-04 09:55:42.863: E/BTServer(21509): acceptAndOpen ProtocolDescriptorList is mandatory
04-04 09:55:42.863: W/System.err(21509): javax.bluetooth.ServiceRegistrationException: ProtocolDescriptorList is mandatory
04-04 09:55:42.875: W/System.err(21509): at com.intel.bluetooth.BluetoothConnectionNotifierBase.updateServiceRecord(BluetoothConnectionNotifierBase.java:211)04-04 09:55:42.878: W/System.err(21509): at com.intel.bluetooth.BluetoothRFCommConnectionNotifier.acceptAndOpen(BluetoothRFCommConnectionNotifier.java:72)
04-04 10:30:27.312: W/System.err(21593): at com.intel.bluetooth.obex.OBEXSessionNotifierImpl.acceptAndOpen(OBEXSessionNotifierImpl.java:89)
04-04 10:30:27.316: W/System.err(21593): at com.intel.bluetooth.obex.OBEXSessionNotifierImpl.acceptAndOpen(OBEXSessionNotifierImpl.java:79)
04-04 10:30:27.324: W/System.err(21593): at de.is04.telemedic.connector.connectionmanager.BluecoveOBEXBTManager.connect(BluecoveOBEXBTManager.java:100)
04-04 10:30:27.332: W/System.err(21593): at de.is04.telemedic.activity.MeasureActivity$5.onClick(MeasureActivity.java:268)
04-04 10:30:27.335: W/System.err(21593): at android.view.View.performClick(View.java:2538)
04-04 10:30:27.339: W/System.err(21593): at android.view.View$PerformClick.run(View.java:9152)
04-04 10:30:27.343: W/System.err(21593): at android.os.Handler.handleCallback(Handler.java:587)
04-04 10:30:27.343: W/System.err(21593): at android.os.Handler.dispatchMessage(Handler.java:92)
04-04 10:30:27.343: W/System.err(21593): at android.os.Looper.loop(Looper.java:123)
04-04 10:30:27.347: W/System.err(21593): at android.app.ActivityThread.main(ActivityThread.java:3687)
04-04 10:30:27.347: W/System.err(21593): at java.lang.reflect.Method.invokeNative(Native Method)
04-04 10:30:27.347: W/System.err(21593): at java.lang.reflect.Method.invoke(Method.java:507)
04-04 10:30:27.347: W/System.err(21593): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
04-04 10:30:27.347: W/System.err(21593): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
04-04 10:30:27.351: W/System.err(21593): at dalvik.system.NativeStart.main(Native Method)
04-04 10:30:37.375: D/BTServer(21593): OBEX Server finished!