Past Presentations/12162006-bluetooth

From Sfvlug

(Difference between revisions)
(Slides)
(Scripts/Config files)
Line 11: Line 11:
==Scripts/Config files==
==Scripts/Config files==
 +
 +
This will get you a connection to the phone. Still working on ppp issues
 +
 +
===/etc/bluetooth/rfcomm.conf: (You will need to change the device setting and possibly channel)===
 +
#
 +
# RFCOMM configuration file.
 +
#
 +
 +
rfcomm0 {
 +
# Automatically bind the device at startup
 +
bind yes;
 +
# Bluetooth address of the device
 +
device 00:0F:86:F6:35:0C;
 +
# RFCOMM channel for the connection
 +
channel 1;
 +
# Description of the connection
 +
comment "EDGE Internet connection";
 +
}
 +
 +
===/etc/bluetooth/hcid.conf===
 +
 +
#
 +
# HCI daemon configuration file.
 +
#
 +
 +
# HCId options
 +
options {
 +
# Automatically initialize new devices
 +
autoinit yes;
 +
 +
# Security Manager mode
 +
# none - Security manager disabled
 +
# auto - Use local PIN for incoming connections
 +
# user - Always ask user for a PIN
 +
#
 +
security auto;
 +
 +
# Pairing mode
 +
# none - Pairing disabled
 +
# multi - Allow pairing with already paired devices
 +
# once - Pair once and deny successive attempts
 +
pairing multi;
 +
 +
#Custom pin handler
 +
pin_helper /usr/local/bin/bluez_pin_simple;
 +
 +
}
 +
 +
# Default settings for HCI devices
 +
device {
 +
# Local device name
 +
# %d - device id
 +
# %h - host name
 +
name "ch@r7s";
 +
 +
# Local device class
 +
class 0x100;
 +
 +
# Default packet type
 +
#pkt_type DH1,DM1,HV1;
 +
 +
# Inquiry and Page scan
 +
iscan enable; pscan enable;
 +
#discovto 0;
 +
 +
# Default link mode
 +
# none - no specific policy
 +
# accept - always accept incoming connections
 +
# master - become master on incoming connections,
 +
# deny role switch on outgoing connections
 +
lm accept,master;
 +
 +
# Default link policy
 +
# none - no specific policy
 +
# rswitch - allow role switch
 +
# hold - allow hold mode
 +
# sniff - allow sniff mode
 +
# park - allow park mode
 +
lp hold,sniff,park;
 +
 +
 +
===# File: /etc/ppp/peers/edge===
 +
connect "/usr/sbin/chat -v -f /etc/chatscripts/edge"
 +
/dev/rfcomm0 # Motorola Phone Cable
 +
115200 # speed
 +
nodetach # don't fork
 +
debug # show debugging info
 +
defaultroute # set the default route
 +
replacedefaultroute # yes, override the default route
 +
usepeerdns # get the dns servers from the tunnel
 +
crtscts # do flow control
 +
noauth # no authentication required
 +
deflate 0 # don't compress
 +
asyncmap 0
 +
mtu 1500
 +
mru 1500
 +
noipdefault
 +
idle 600
 +
}
 +
 +
===/etc/chatscripts/edge===
 +
ABORT ERROR
 +
'' AT&F
 +
OK AT+CGDCONT=1,"IP","internet2.voicestream.com"
 +
OK ATDT*99#
 +
CONNECT ''

Revision as of 17:50, 17 December 2006

Contents

Using bluetooth under linux (12/16/2006)

Slides

Scripts/Config files

This will get you a connection to the phone. Still working on ppp issues

/etc/bluetooth/rfcomm.conf: (You will need to change the device setting and possibly channel)

  1. RFCOMM configuration file.

rfcomm0 {

  1. Automatically bind the device at startup

bind yes;

  1. Bluetooth address of the device

device 00:0F:86:F6:35:0C;

  1. RFCOMM channel for the connection

channel 1;

  1. Description of the connection

comment "EDGE Internet connection"; }

/etc/bluetooth/hcid.conf

  1. HCI daemon configuration file.
  1. HCId options

options {

  1. Automatically initialize new devices

autoinit yes;

  1. Security Manager mode
  2. none - Security manager disabled
  3. auto - Use local PIN for incoming connections
  4. user - Always ask user for a PIN

security auto;

  1. Pairing mode
  2. none - Pairing disabled
  3. multi - Allow pairing with already paired devices
  4. once - Pair once and deny successive attempts

pairing multi;

  1. Custom pin handler

pin_helper /usr/local/bin/bluez_pin_simple;

}

  1. Default settings for HCI devices

device {

  1. Local device name
  2.  %d - device id
  3.  %h - host name

name "ch@r7s";

  1. Local device class

class 0x100;

  1. Default packet type
  2. pkt_type DH1,DM1,HV1;
  1. Inquiry and Page scan

iscan enable; pscan enable;

  1. discovto 0;
  1. Default link mode
  2. none - no specific policy
  3. accept - always accept incoming connections
  4. master - become master on incoming connections,
  5. deny role switch on outgoing connections

lm accept,master;

  1. Default link policy
  2. none - no specific policy
  3. rswitch - allow role switch
  4. hold - allow hold mode
  5. sniff - allow sniff mode
  6. park - allow park mode

lp hold,sniff,park;


# File: /etc/ppp/peers/edge

connect "/usr/sbin/chat -v -f /etc/chatscripts/edge" /dev/rfcomm0 # Motorola Phone Cable 115200 # speed nodetach # don't fork debug # show debugging info defaultroute # set the default route replacedefaultroute # yes, override the default route usepeerdns # get the dns servers from the tunnel crtscts # do flow control noauth # no authentication required deflate 0 # don't compress asyncmap 0 mtu 1500 mru 1500 noipdefault idle 600 }

/etc/chatscripts/edge

ABORT ERROR AT&F OK AT+CGDCONT=1,"IP","internet2.voicestream.com" OK ATDT*99# CONNECT

Personal tools