- Ref. CN5E, NT@UW, WUSTL
CS5530
CS5530 Mobile/Wireless Systems Android Bluetooth Interface
Yanyan Zhuang
Department of Computer Science http://www.cs.uccs.edu/~yzhuang
- UC. Colorado Springs
CS5530 Mobile/Wireless Systems Android Bluetooth Interface Yanyan - - PowerPoint PPT Presentation
CS5530 Mobile/Wireless Systems Android Bluetooth Interface Yanyan Zhuang Department of Computer Science http://www.cs.uccs.edu/~yzhuang UC. Colorado Springs CS5530 Ref. CN5E, NT@UW, WUSTL Bluetooth Communication Bluetooth-enabled
CS5530
2 CS5530
3 CS5530
4 CS5530
5 CS5530
} Paired devices are aware of each other’s existence and share a link
} Connected devices share a channel, allowing them to send and
} Remote devices that visible but the current device isn't paired with
6 CS5530
7 CS5530
8 CS5530
} The system broadcasts this intent for each discovered device (WiFi
} The intent contains the extra fields EXTRA_DEVICE and EXTRA_CLASS,
9 CS5530
} E.g., Intent bluetoothIntent =
10 CS5530
11 CS5530
12 CS5530
String action = intent.getAction(); if (BluetoothDevice.ACTION_FOUND.equals(action)) { BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE); Log.d(TAG, "Device name: " + device.getName()); Log.d(TAG, "Device address: " + device.getAddress()); short rssi = intent.getShortExtra(BluetoothDevice.EXTRA_RSSI, Short.MIN_VALUE); Log.d(TAG, "RSSI: " + rssi); BluetoothClass deviceClass = intent.getParcelableExtra(BluetoothDevice.EXTRA_CLASS); Log.d(TAG, "Class: " + deviceClass.getMajorDeviceClass()); } }
13 CS5530
14 CS5530
15 CS5530
16 CS5530
17 CS5530
18 CS5530