Upon execution, btsrv reads its configuration from a configuration file, which, by default, is /etc/affix/btsrv.conf. It contains various configuration entries. Comments are denoted by a '#' at any place of the line.
Each entry is represented in XML style and starts with element <entryname> and ends with element </entryname>. Starting element can have attributes. Each entry has certain parameters depending on the semantic of the entry. Currently two entries are defined in configuration file: service and device.
service entry contains parameters related to the service and has the following syntax:
<service name> param1 param2; param3 param4 arg1, arg2, .., argn param5 arg1 arg2 .. argn </service>Different parameters can be placed on the same line and separated by a semicolon. Each parameter can have arguments followed by a parameter and can be separated by a comma or white space.
Service entry has the following parameters:
name. It has a string type and defines service name. Service name in SDP database is set to this value.
profile. It has a word type and defines profile to which this service belongs to: SerialPort, DialupNetworking, LANAccess, OBEXFileTransfer, OBEXObjectPush.
provider. It has a string type and defines service provider name. Service provider name in SDP database is set to this value.
descript. It has a string type and defines service description. Service description in SDP database is set to this value.
security. It has a list type and defines security level to access a service. This parameter accepts following arguments: open, auth, author, encrypt. open argument defines that no security control has to be involved to access this service (no authentication, authorization and encryption requires). auth tells that authentication requires to access this service. author tells that authorization requires to access this service. encrypt tells that connection encryption requires for accessing this service.
class. It has a list type and defines Bluetooth service class that this service belongs to. This parameter affects "Class of Device" which is available after "inquiry" or "Discovery" procedure. It accepts the same values as service class for device (see in device entry description).
flags. It has a list type and controls special behavior of the incoming connection. This parameter accepts following arguments: tty, std. tty tells that connection has to be bound to TTY line (/dev/btyXX) and allows applications to use legacy TTY device to communicate through Bluetooth. std tells that connection has to be multiplexed to stdin/stdout streams (it allows applications working on stdin/stdout communicate through Bluetooth).
exec. It has string argument and defines command that is to be executed when request is found. Command line can have special format characters with preceded "%": %a, %l, %i, %c. "%a" replaced by remote device address, "%l" - TTY line number of virtual device (/dev/btyXX), "%i" - connection identifier (file descriptor), "%c" - RFCOMM server channel.
Device entry contains parameter related to device configuration and has the following syntax:
<device ifname> param1 param2; param3 param4 arg1, arg2, .., argn param5 arg1 arg2 .. argn </device>Different parameters can be placed on the same line and separated by a semicolon. Each parameter can have arguments followed by a parameter and can be separated by a comma or white space.
Service entry has the following parameters:
ifname. Defines interface name to which this entry belongs to (*, bt0, bt1, ...).
name. Has a string argument and defines Bluetooth device name. This name is available for remote devices after discovery procedure.
class. Has a list type and defines Bluetooth "Class of Device". This class is available for remote devices after inquiry or discovery procedure. Class arguments consist of 3 groups: major class, minor class and service class. minor class takes values depending on the major and defines device type inside certain major class.
Major can be one of: misc, computer, phone, audio, lap, peripheral. It defines what this device actually is.
Computer devices (major - computer): desktop, server, laptop, handheld, palm.
Phone devices (major - phone): cellular, cordless, smart, modem.
Audio devices (major - audio): headset.
Service Class can be set of following: networking, information, audio, transfer, rendering, capturing, telephony.
scan. Has list argument and defines scanning mode for device: disc, conn. disc tells that device will be discoverable (visible for remote devices). conn tells that device has to be connectible (allow remote device to connect to local).
security. Has a list type and defines what security mode device will use. It accepts following arguments: open, link, service, auth, author, encrypt. open mode means that no security actions has to be taken and any device can connect without authentication, authorization and encryption does not required for the connection. link mode means that security actions has to be taken at link level. Before connection is created certain actions are taken. It depends on the rest of parameters (auth, author and encrypt) and has the same meaning as for security option in service entry except that extends to link level. service means
role. Has two arguments and defines connection roles for incoming and outgoing connections. First argument defines roles for outgoing connections: allow or deny. allow - allows role switching, deny - denies role switching. Second argument defines roles for incoming connections: slave or master. slave - remain slave, master - become the master.
pkt_type. Has a list type and defines what packets to use for connections: DM1, DH1, DM3, DH3, DM5, DH5.
The following example shows how to configure service and device bt0.
<service "Serial Port"> profile SerialPort; provider "Nokia"; descript "Serial Port Profile"; security open class information networking; flags tty; exec "/etc/affix/serial %l %i %a %c"; </service> <device bt0> name "Selma" class computer handheld, information, audio, networking, transfer; scan disc, conn security service role allow, slave pkt_type DM1, DH1, DM3, DH3, DM5, DH5 </device>