4

I am developing a bluetooth low energy application for the Samsung Galaxy S3. I am using Broadcom ble jar file into my project. I am able to search the TI CC2540 ble device.

But when I try to connect the Galaxy S3 to CC2540, I immediately get a null pointer exception and I am not able to connect to it. I tried many times but I am not able to connect to it. Below is the line of code in my application which connects to the remote ble device.

mFindMe.connect(mDevice);

mfindme is my HRM profile and mDevice is the bluetooth address of my CC2540 TI ble device.

It always throws a null pointer exception when I try to connect to the device.

user1955086
  • 141
  • 2
  • 7
  • full stack, more surounding code. – Ifor Jan 07 '13 at 15:19
  • please provide any help with working example for bluetooth low energy for samsung galaxy s3. i have update my galaxy s3 with jelly bean 4.1. i am able to search TI ble module. but when i m try to connect it always failed. broadcom ble is really stucking and helpless in android. – user1955086 Jan 10 '13 at 06:06
  • Can you please share your experience with S3 and Broadcom ble jar file ? I'm blocked on a "no method found BleAdapter.getDeviceType"... – fvisticot Feb 26 '13 at 08:05

1 Answers1

0

I am using the following code for my project. I hope it helps you to understand my problem.

btconnect = (Button)findViewById(R.id.btn_connect);
btconnect.setOnClickListener(new View.OnClickListener()
{
    @Override
    public void onClick(View view)
    {
        try
        {
            mFindMe.connect(mDevice);
        }
        catch(Exception e)
        {
            Log.d("Error","connecting");
        }
    }
});

setUiState();
registerReceiver(regReceiver, new IntentFilter(FindMeProfileClient.FINDME_REGISTERD));

mDevice = BluetoothAdapter.getDefaultAdapter().getRemoteDevice(HRM_BD_ADDRESS);
mFindMe = new FindMeProfileClient(this);

I have also found that the public static final String BLUETOOTH_LE_SERVICE is missing in the broadcom jar file so mservice variable is null.

Please kindly provide any help on this bluetooth low energy profile.

Peter
  • 13,733
  • 11
  • 75
  • 122
user1955086
  • 141
  • 2
  • 7