I'm trying connecting my Android phone to my health device with
BluetoothHDP - Bluetooth HDP Demo(http://developer.android.com/intl/ja/
resources/samples/BluetoothHDP/index.html).
I can get an association-request-message from the device.
(Message example: E2 00 00 32 80 00 00 00 ...)
Then, I want to send associaton-response-message to the device.
How can I send a message to a device with Bluetooth HDP Demo?

I executed a program like following, but it doesn't looks device
sending messages.

/* ReadThread in BluetoothHDPService.java */
private class ReadThread extends Thread {
        private ParcelFileDescriptor mFd;

        public void run() {
                FileInputStream fis = new 
FileInputStream(mFd.getFileDescriptor());
                FileOutputStream fos = new
FileOutputStream(mFd.getFileDescriptor()); // I add this for sending
messages.
                final byte data[] = new byte[8192];
                while(fis.read(data) > -1) {
                        MyParser parser = new MyParser(); // Example parsing 
data.
                        parser.parse(data);
                        if (parser.need_to_send_message()) {
                                        byte message[] = 
MyParser.CreateByteMessage();
                                        fos.write(message); // I mean sending 
the message to a health
device.
                        }
                }
        }
}

Should I make a new Thread for writing?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to