1 /**
2 * BlueCove - Java library for Bluetooth
3 * Copyright (C) 2008 Vlad Skarzhevskyy
4 *
5 * Licensed to the Apache Software Foundation (ASF) under one
6 * or more contributor license agreements. See the NOTICE file
7 * distributed with this work for additional information
8 * regarding copyright ownership. The ASF licenses this file
9 * to you under the Apache License, Version 2.0 (the
10 * "License"); you may not use this file except in compliance
11 * with the License. You may obtain a copy of the License at
12 *
13 * http://www.apache.org/licenses/LICENSE-2.0
14 *
15 * Unless required by applicable law or agreed to in writing,
16 * software distributed under the License is distributed on an
17 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18 * KIND, either express or implied. See the License for the
19 * specific language governing permissions and limitations
20 * under the License.
21 *
22 * @version $Id: BlueCoveConfigProperties.java 2577 2008-12-13 18:21:46Z skarzhevskyy $
23 */
24 package com.intel.bluetooth;
25
26 /**
27 * BlueCove runtime configuration properties. Can be configured as system
28 * properties. If System property is not an option (e.g. when running in Web
29 * Start) create text file with property name e.g. "bluecove.stack.first" write
30 * the value and add this file to BlueCove or Application jar
31 *
32 * @see BlueCoveImpl#setConfigProperty(String, String)
33 */
34 public interface BlueCoveConfigProperties {
35
36 /**
37 * Will enable debug prints prints in BlueCove code. BlueCove log is
38 * redirected to log4j when log4j classes are available in classpath. Then
39 * BlueCove debug can be enabled using log4j configuration. Initialization
40 * property.
41 */
42 public static final String PROPERTY_DEBUG = "bluecove.debug";
43
44 /**
45 * BlueCove log when enabled is printed to System.out. You can disable this
46 * feature. Initialization property.
47 */
48 public static final String PROPERTY_DEBUG_STDOUT = "bluecove.debug.stdout";
49
50 /**
51 * BlueCove log is redirected to log4j when log4j classes are available in
52 * classpath. You can disable this feature. Initialization property.
53 */
54 public static final String PROPERTY_DEBUG_LOG4J = "bluecove.debug.log4j";
55
56 /**
57 * If automatic Bluetooth Stack detection is not enough this can be used to
58 * force desired Stack Initialization. Values "widcomm", "bluesoleil" or
59 * "winsock". Use "emulator" value to start jsr-82 emulator. By default
60 * winsock is selected if available. Initialization property.
61 */
62 public static final String PROPERTY_STACK = "bluecove.stack";
63
64 /**
65 * Used to optimize stack detection. If -Dbluecove.stack.first=widcomm then
66 * widcomm (bluecove.dll) stack is loaded first and if not available then
67 * BlueCove will switch to winsock. By default intelbth.dll is loaded first.
68 * Initialization property.
69 */
70 public static final String PROPERTY_STACK_FIRST = "bluecove.stack.first";
71
72 /**
73 * "false" to disable the load of native library from resources.
74 * Initialization property.
75 */
76 public static final String PROPERTY_NATIVE_RESOURCE = "bluecove.native.resource";
77
78 /**
79 * Load library (.dll) from specified location. Initialization property.
80 */
81 public static final String PROPERTY_NATIVE_PATH = "bluecove.native.path";
82
83 /**
84 * If Stack support multiple bluetooth adapters select one by its system ID.
85 * (Linux BlueZ and Emulator) Initialization property.
86 */
87 public static final String PROPERTY_LOCAL_DEVICE_ID = "bluecove.deviceID";
88
89 /**
90 * If Stack support multiple bluetooth adapters select one by its bluetooth
91 * address. (Linux BlueZ and Emulator) Initialization property.
92 */
93 public static final String PROPERTY_LOCAL_DEVICE_ADDRESS = "bluecove.deviceAddress";
94
95 /**
96 * JSR-82 air simulator server can be on remote computer, default
97 * 'localhost'. Initialization property.
98 */
99 public static final String PROPERTY_EMULATOR_HOST = "bluecove.emu.rmiRegistryHost";
100
101 /**
102 * JSR-82 air simulator server listen on different port, default 8090.
103 * <p>
104 * Use 0 on the client to enable in process server, RMI will not be used.
105 * Initialization property.
106 */
107 public static final String PROPERTY_EMULATOR_PORT = "bluecove.emu.rmiRegistryPort";
108
109 /**
110 * JSR-82 air simulator server and RMI registry can be started inside client
111 * JVM, default 'false'. Initialization property.
112 */
113 public static final String PROPERTY_EMULATOR_RMI_REGISTRY = "bluecove.emu.rmiRegistry";
114
115 /**
116 * Some properties can't be changed at runtime once the Stack was
117 * initialized.
118 */
119 public static final String[] INITIALIZATION_PROPERTIES = new String[] { PROPERTY_STACK, PROPERTY_STACK_FIRST, PROPERTY_NATIVE_RESOURCE,
120 PROPERTY_NATIVE_RESOURCE, PROPERTY_LOCAL_DEVICE_ID, PROPERTY_LOCAL_DEVICE_ADDRESS, PROPERTY_EMULATOR_HOST, PROPERTY_EMULATOR_PORT };
121
122 /**
123 * The amount of time in milliseconds for which the implementation will
124 * attempt to establish connection RFCOMM or L2CAP before it throws
125 * BluetoothConnectionException. Defaults to 2 minutes. WIDCOMM and OS X
126 * only.
127 */
128 public static final String PROPERTY_CONNECT_TIMEOUT = "bluecove.connect.timeout";
129
130 /**
131 * On MS stack retry connection automatically when received WSAENETUNREACH
132 * during connect. Default to 2 retry attempts.
133 *
134 * @since bluecove 2.1.0
135 */
136 public static final String PROPERTY_CONNECT_UNREACHABLE_RETRY = "bluecove.connect.unreachable_retry";
137
138 /**
139 * Device Inquiry time in seconds defaults to 11 seconds. MS Stack and OS X
140 * only.
141 */
142 public static final String PROPERTY_INQUIRY_DURATION = "bluecove.inquiry.duration";
143
144 static final int PROPERTY_INQUIRY_DURATION_DEFAULT = 11;
145
146 /**
147 * Set true to make Device Inquiry call DiscoveryListener?.deviceDiscovered
148 * without waiting for updated service class. WIDCOMM only.
149 */
150 public static final String PROPERTY_INQUIRY_REPORT_ASAP = "bluecove.inquiry.report_asap";
151
152 /**
153 * You can increase OBEX transfer speed by changing mtu to bigger value.
154 * Default is 1024
155 */
156 public static final String PROPERTY_OBEX_MTU = "bluecove.obex.mtu";
157
158 /**
159 * The amount of time in milliseconds for which the implementation will
160 * attempt to successfully transmit a packet before it throws
161 * InterruptedIOException. Defaults to 2 minutes.
162 */
163 public static final String PROPERTY_OBEX_TIMEOUT = "bluecove.obex.timeout";
164
165 /**
166 * Remove JSR-82 1.1 restriction for legal PSM values are in the range
167 * (0x1001..0xFFFF).
168 *
169 * For JSR-82 1.2 Reserved Ranges @see <A HREF="https://opensource.motorola.com/sf/discussion/do/listPosts/projects.jsr82/discussion.jsr_82_1_2_open_discussion.topc1808"
170 * >JSR-82 1.2</A>
171 */
172 public static final String PROPERTY_JSR_82_PSM_MINIMUM_OFF = "bluecove.jsr82.psm_minimum_off";
173 }