1 / 10

Bluetooth Connection

Bluetooth Connection. Marsel Willem Aipassa, S. Kom. Pemrograman Aplikasi Mobile. Bluetooth Connection. Bluetooth didesain bagi alat komunikasi personal yang mendukung konumikasi nirkabel pada jarak sampai 10 kilometer.

dionne
Download Presentation

Bluetooth Connection

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Bluetooth Connection Marsel Willem Aipassa, S. Kom. Pemrograman Aplikasi Mobile

  2. Bluetooth Connection Bluetooth didesain bagi alat komunikasi personal yang mendukung konumikasi nirkabel pada jarak sampai 10 kilometer. Bluetooth dapat digunakan untuk mengirim file, membangun sebuah jaringan tertentu, sinkronisasi data, berkoneksi dengan perangkat disekitar misalnya hands-free kits dan gaming. Marsel Willem Aipassa, S. Kom.

  3. Bluetooth Protocol Stack Marsel Willem Aipassa, S. Kom. 3

  4. Koneksi Bluetooth • Untuk mengirimkan data antara perangkat yang menggunakan bluetooth dapat digunakan koneksi berikut: • L2CAP (Logical Link Control and Adaptation Protocol) – untuk data packet. • RFCOMM (Radio Frequency Communication)– satu layer diatas protokol L2CAP dan digunakan untuk data streaming. • OBEX (Object Exchange) – digunakan untuk data object. Marsel Willem Aipassa, S. Kom. 4

  5. Aplikasi RFCOMM (1) • Format koneksi URL yang digunakan adalah: btspp://<host>:<optional:port>:name=<service_name>;authorize=<true/false> • Port pada koneksi bluetooth digunakan lewat kelas UUID. Kelas ini mendefenisikan indentifier universal yang unik. Marsel Willem Aipassa, S. Kom. 5

  6. Aplikasi RFCOMM – Server (2) • Server mendaftarkan service-nya: localDevice = LocalDevice.getLocalDevice(); localDevice.setDiscoverable(DiscoveryAgent.GIAC); notifier =(StreamConnectionNotifier) Connector.open(url); • Kemudian dia akan menunggu koneksi: StreamConnection conn = notifier.acceptAndOpen(); Marsel Willem Aipassa, S. Kom. 6

  7. Aplikasi RFCOMM - Client (3) • Client pertama kali akan mencari device yang tersedia untuk service tersebut: LocalDevice localDevice = LocalDevice.getLocalDevice(); discoveryAgent = localDevice.getDiscoveryAgent(); discoveryAgent.startInquiry(DiscoveryAgent.GIAC, this); • Client akan meng-implement DiscoveryListener dan meng-override method yang diperlukan untuk menerima notifikasi dari device. Sekali device ditemukan dan proses pencarian servis sudah selesai dilaksanakan, kemudian dilaksanakan perintah selanjutnya (mengirim/menerima data). Marsel Willem Aipassa, S. Kom. 7

  8. Aplikasi RFCOMM (4) • Method-method yang harus di-override pada kelas yang mengimplementasikan kelas DiscoveryListener antara lain: public void deviceDiscovered(RemoteDevice d, DeviceClass c) public void inquiryCompleted(int arg) public void serviceSearchCompleted (int arg0, int arg1) public void servicesDiscovered (int arg0, ServiceRecord[] records) Marsel Willem Aipassa, S. Kom. 8

  9. Contoh Marsel Willem Aipassa, S. Kom. 9

  10. Terima Kasih Marsel Willem Aipassa, S. Kom. 10

More Related