Devices - Programming Devices -Udayan Kumar...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
Programming Devices -Udayan Kumar ukumar@cise.ufl.edu
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Bluetooth Programming Refer : http://people.csail.mit.edu/albert/bluez-intro/ Book: http://www.btessentials.com Similar to TCP/IP programming
Background image of page 2
Basics Bluetooth programming can be modularized into several components: Choosing a device with which to communicate Figuring out communication protocol Making an outgoing connection Accepting an incoming connection Sending data Receiving data Adapted from http://people.csail.mit.edu/albert/bluez-intro/
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
How to communicate Small number of port prompt for Service Discovery Protocol (SDP) in RFCOMM. Universally Unique Identifier (UUID) are assigned to different services in the standard. Bluetooth devices have 48 bit address. Like MAC address Requirements Internet Ports Reliable, Stream-based TCP RFCOMM 30 TCP RFCOMM or L2CAP UDP L2CAP Odd # 1-32765 Bluetooth Reliable, Datagram Best effort, datagram
Background image of page 4
Programming Python is considered very good. (though I haven't tried programming using python) C programs using Bluez library
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/socket.h> #include <bluetooth/bluetooth.h> #include <bluetooth/hci.h> #include <bluetooth/hci_lib.h> int main(int argc, char **argv) { inquiry_info *ii = NULL; int max_rsp, num_rsp; int dev_id, sock, len, flags; int i; char addr[19] = { 0 }; char name[248] = { 0 }; dev_id = hci_get_route(NULL); sock = hci_open_dev( dev_id ); if (dev_id < 0 || sock < 0) { perror("opening socket");
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/27/2011 for the course CIS 4930 taught by Professor Staff during the Spring '08 term at University of Florida.

Page1 / 14

Devices - Programming Devices -Udayan Kumar...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online