Low energy Bluetooth for Samsung Galaxy S3 and TI CC2540 for measuring heart rate

I am developing a low energy application for the Bluetooth Galaxy S3. I am using the Broadcom blar file in my project. I can search for the TI CC2540 device.

But when I try to connect the Galaxy S3 to the CC2540, I immediately get a null exception pointer, and I cannot connect to it. I tried many times, but I can’t connect to it. Below is a line of code in my application that connects to a remote device.

mFindMe.connect(mDevice); 

mfindme is my HRM profile, and mDevice is the Bluetooth address of my CC2540 TI device.

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

+4
source share
1 answer

I am using the following code for my project. Hope this helps you 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 also found that the public static final String BLUETOOTH_LE_SERVICE missing from the broadcom jar file, so the mservice variable is null.

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

0
source

All Articles