Bluetooth SPP not working on HTC Desire

by ssozonoff » Tue, 20 Apr 2010 00:40:51 GMT


Sponsored Links
 ello,

I have been doing some Bluetooth SPP development with an HTC Legend
which was working just fine.
Today I received my HTC Desire and I cant get an SPP connection to
work.

The first thing I had to do is remove the mAdapter.cancelDiscovery()
call in the connectThread().
It seems there is some sort of timing issue here and with the faster
processor its not working like this.

Below is an extract from the logs when mAdapter.cancelDiscovery() was
being called just prior to mmSocket.connect();

04-19 16:30:58.984: DEBUG/BluetoothSppService(759): Running
mConnectThread
04-19 16:30:58.984: ERROR/BluetoothEventLoop.cpp(92): pollData[0] is
revented, check next one
04-19 16:30:58.984: ERROR/BluetoothService.cpp(92):
stopDiscoveryNative: D-Bus error in StopDiscovery:
org.bluez.Error.Failed (Invalid discovery session)
04-19 16:30:59.024: DEBUG/DEVICE(293): BLTA -
*************DiscoverServices********


I get a little farther after this change and it almost seems as if the
connection is up because the BT Icon on my laptop changes to green but
then the connection fails anyway.
Here is an extract of the stack after the call to mmSocket.connect();

04-19 16:33:40.314: DEBUG/DEVICE(293): BLTA -
*************DiscoverServices********
04-19 16:33:40.314: INFO/DTUN_HCID_BZ4(293):
dtun_client_get_remote_svc_channel: starting discovery on
(uuid16=0x0011)
04-19 16:33:40.314: INFO/DTUN_HCID_BZ4(293): bdaddr=00:23:4D:F3:3B:BE
04-19 16:33:40.314: INFO/DTUN_CLNT(293): Client calling
DTUN_METHOD_DM_GET_REMOTE_SERVICE_CHANNEL (id 4)
04-19 16:33:40.314: INFO/(260): DTUN_ReceiveCtrlMsg: [DTUN] Received
message [BTLIF_DTUN_METHOD_CALL] 4354
04-19 16:33:40.314: INFO/(260): handle_method_call:
handle_method_call :: received
DTUN_METHOD_DM_GET_REMOTE_SERVICE_CHANNEL (id 4), len 134
04-19 16:33:40.314: ERROR/BTLD(260): ****************search UUID =
1101***********
04-19 16:33:40.314: INFO//system/bin/btld(256):
btapp_dm_GetRemoteServiceChannel()
04-19 16:33:40.314: INFO//system/bin/btld(256): ##### USerial_Ioctl:
BT_Wake, 0x8003 ####
04-19 16:33:40.914: INFO//system/bin/btld(256): ##### USerial_Ioctl:
BT_Sleep, 0x8004 ####
04-19 16:33:41.394: WARN/BTLD(260): ccb timer ticks: 0
04-19 16:33:41.394: INFO//system/bin/btld(256): ##### USerial_Ioctl:
BT_Wake, 0x8003 ####
04-19 16:33:41.464: WARN/BTLD(260): info:x10
04-19 16:33:41.464: INFO/BTL-IFS(260): send_ctrl_msg: [BTL_IFS CTRL]
send BTLIF_DTUN_SIGNAL_EVT (CTRL) 10 pbytes (hdl 14)
04-19 16:33:41.464: DEBUG/DTUN_HCID_BZ4(293): dtun_dm_sig_link_up()
04-19 16:33:41.464: INFO/DTUN_HCID_BZ4(293): dtun_dm_sig_link_up:
dummy_handle = 260
04-19 16:33:41.464: DEBUG/ADAPTER(293):
adapter_get_device(00:23:4D:F3:3B:BE)
04-19 16:33:41.464: ERROR/BluetoothEventLoop.cpp(92): pollData[0] is
revented, check next one
04-19 16:33:41.464: ERROR/BluetoothEventLoop.cpp(92): event_filter:
Received signal org.bluez.Device:PropertyChanged from /org/bluez/293/
hci0/dev_00_23_4D_F3_3B_BE
04-19 16:33:41.584: WARN/BTLD(260): process_service_search_attr_rsp
04-19 16:33:41.624: INFO/BTL-IFS(260): send_ctrl_msg: [BTL_IFS CTRL]
send BTLIF_DTUN_SIGNAL_EVT (CTRL) 13 pbytes (hdl 14)
04-19 16:33:41.624: INFO/DTUN_HCID_BZ4(293):
dtun_dm_sig_rmt_service_channel: success=0, service=00000000
04-19 16:33:41.624: ERROR/DTUN_HCID_BZ4(293): discovery unsuccessful!
04-19 16:33:42.126: INFO//system/bin/btld(256): ##### USerial_Ioctl:
BT_Sleep, 0x8004 ####
04-19 16:33:42.724: INFO//system/bi



Bluetooth SPP not working on HTC Desire

by atlee » Fri, 28 May 2010 03:52:14 GMT


 ello,
i have android application which connects to the paired bluetooth
device. I have tested it on motorola milestone it works fine. But
while testing it on HTC desire i couldn't connect to the paired
bluetooth device. It gives me discovery failed when i checked log then
i found the UUID(0000112D-0000-1000-8000-00805F9B34FB ) which i pass
get changed. The sniffer log which i got is 0x2d, 0x11, 0x11, 0x2d,
0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34,
0xfb. I have tried various UUID but problem not resolved. Is it a
firmware problem of HTC desire. My HTC desire firmware build number is
1.15.110.11. Can it be resolved by upgrading firmware. Please help me.

On Apr 19, 9:40pm, ssozonoff <se...@sozonoff.com> wrote:
>


Sponsored Links


Other Threads

1. Plotting geopoints

Hi,
(This application is kinda like a wardriver application)
I am attempting to plot points on a mapview however I'm having some
issues.
Following this tutorial
And have also done some extensive browsing to try and solve my issue
without much luck (but it's got me this far).

I have the following,

        private void GPSloc() {
                GeoPoint arg0 = new GeoPoint(
                                (int) (realLat),
                                (int) (realLong));
                mc.animateTo(arg0);
                try {
                        ArrayList<String> ssidArray = ((scanner) 
receiver).getssidArray();
                        //ArrayList<Integer> levelArray = ((scanner)
receiver).getlevelArray();
                        plotter(ssidArray, levelArray);
                        List<Overlay> mapOverlays = mapView.getOverlays();
                        Drawable drawable =
this.getResources().getDrawable(R.drawable.marker);
                        SSIDPoints itemizedoverlay = new SSIDPoints(drawable);
                        GeoPoint point = new 
GeoPoint(getRealLati(),getRealLongi());
                        OverlayItem overlayitem = new OverlayItem(point, 
"Avilable Wifi",
ssidArray.toString());/*debug*/
                        itemizedoverlay.addOverlay(overlayitem);
                        mapOverlays.add(itemizedoverlay);
                } catch (Exception e) {
                        String message = String.format(e.getMessage());
                            Toast.makeText(this, message, 
Toast.LENGTH_LONG).show();/
*debug*/
                }

That is ran via a button.

my SSIDPoints class is similar to the tutorial



import java.util.ArrayList;

import android.app.AlertDialog;
import android.content.Context;
import android.graphics.drawable.Drawable;

import com.google.android.maps.GeoPoint;
import com.google.android.maps.ItemizedOverlay;
import com.google.android.maps.OverlayItem;
public class SSIDPoints extends ItemizedOverlay {

        private ArrayList<OverlayItem> mOverlays = new
ArrayList<OverlayItem>();
        private Context mapTap;
        public SSIDPoints(Drawable mainPointer) {
                //Zoom map to the correct location for user
                super(boundCenterBottom(mainPointer));
        }
        /*
         * Populate is required to show the new point
         */
        public void addOverlay(OverlayItem newPoint) {
            mOverlays.add(newPoint);
            populate();
        }
        /*
         * Populate calls this method found on the link below
         */
        protected OverlayItem createItem(int i) {
                  return mOverlays.get(i);
                }
        /*
         * auto gen'd
         */
        @Override
        public int size() {
                // TODO Auto-generated method stub
                return 0;
        }
        /*
         * Handles map taps from the user to show the point information
<unused>
         */
        public SSIDPoints(Drawable mainPointer, Context context) {
                  super(mainPointer);
                  mapTap = context;
                }
        @Override
        protected boolean onTap(int index) {
          OverlayItem item = mOverlays.get(index);
          AlertDialog.Builder dialog = new AlertDialog.Builder(mapTap);
          dialog.setTitle(item.getTitle());
          dialog.setMessage(item.getSnippet());
          dialog.show();
          return true;
        }
}

my getLoc() method is getting all the right information required to
plot a point (I think) however when it's ran it doesn't plot anything.

Does anyone have any ideas? I'm going insane here.

-- 

2. How to do use WebView load html?

I want use webView load html.however, shows only the screen size of the
html, and other areas not show, a user can't drag it to other areas



-- 
Cary

-- 

3. Eclipse says ADT installed but no Android options appear

4. Android App using SMS HTTP API to send/receive SMS

5. Consume WCF service localhost, from Android emulator

6. Concatenate two audio files

7. onTouchEvent() continuous touch causes system_server GC