bluetooth 1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data.tar.gz.sig +0 -0
- data/History.txt +4 -0
- data/Manifest.txt +21 -0
- data/README.txt +20 -0
- data/Rakefile +28 -0
- data/ext/bluetooth/extconf.rb +30 -0
- data/ext/bluetooth/linux/ruby_bluetooth.c +539 -0
- data/ext/bluetooth/linux/ruby_bluetooth.h +68 -0
- data/ext/bluetooth/macosx/device.m +230 -0
- data/ext/bluetooth/macosx/error.m +269 -0
- data/ext/bluetooth/macosx/host_controller.m +39 -0
- data/ext/bluetooth/macosx/ruby_bluetooth.h +69 -0
- data/ext/bluetooth/macosx/ruby_bluetooth.m +29 -0
- data/ext/bluetooth/macosx/scan.m +87 -0
- data/ext/bluetooth/win32/ruby_bluetooth.cpp +112 -0
- data/ext/bluetooth/win32/ruby_bluetooth.h +24 -0
- data/lib/bluetooth.rb +21 -0
- data/lib/bluetooth/device.rb +79 -0
- data/sample/name.rb +8 -0
- data/sample/pair.rb +15 -0
- data/sample/quality.rb +25 -0
- data/sample/scan.rb +8 -0
- metadata +178 -0
- metadata.gz.sig +0 -0
@@ -0,0 +1,68 @@
|
|
1
|
+
#include <unistd.h>
|
2
|
+
#include <sys/socket.h>
|
3
|
+
#include <bluetooth/bluetooth.h>
|
4
|
+
#include <bluetooth/rfcomm.h>
|
5
|
+
#include <bluetooth/l2cap.h>
|
6
|
+
#include <bluetooth/hci.h>
|
7
|
+
#include <bluetooth/hci_lib.h>
|
8
|
+
#include <bluetooth/sdp.h>
|
9
|
+
#include <bluetooth/sdp_lib.h>
|
10
|
+
|
11
|
+
// Prototype for the initialization method - Ruby calls this, not you
|
12
|
+
void Init_ruby_bluetooth();
|
13
|
+
|
14
|
+
struct bluetooth_device_struct
|
15
|
+
{
|
16
|
+
VALUE addr;
|
17
|
+
VALUE name;
|
18
|
+
};
|
19
|
+
|
20
|
+
struct bluetooth_service_struct
|
21
|
+
{
|
22
|
+
VALUE uuid;
|
23
|
+
VALUE name;
|
24
|
+
VALUE description;
|
25
|
+
VALUE provider;
|
26
|
+
VALUE registered;
|
27
|
+
sdp_session_t *session;
|
28
|
+
};
|
29
|
+
|
30
|
+
static VALUE bt_device_new(VALUE self, VALUE name, VALUE addr);
|
31
|
+
|
32
|
+
static VALUE bt_devices_scan(VALUE self);
|
33
|
+
|
34
|
+
static int bt_ruby_socket(int domain, int type, int proto);
|
35
|
+
|
36
|
+
static VALUE bt_init_sock(VALUE sock, int fd);
|
37
|
+
|
38
|
+
static VALUE bt_socket_inspect(VALUE self);
|
39
|
+
|
40
|
+
static VALUE bt_socket_s_for_fd(VALUE klass, VALUE fd);
|
41
|
+
|
42
|
+
static VALUE bt_socket_listen(VALUE klass, VALUE backlog);
|
43
|
+
|
44
|
+
static VALUE bt_socket_accept(VALUE sock);
|
45
|
+
|
46
|
+
static VALUE bt_rfcomm_socket_init(int argc, VALUE *argv, VALUE sock);
|
47
|
+
|
48
|
+
static VALUE bt_rfcomm_socket_connect(VALUE sock, VALUE host, VALUE port);
|
49
|
+
|
50
|
+
static VALUE bt_rfcomm_socket_bind(VALUE sock, VALUE port);
|
51
|
+
|
52
|
+
static VALUE bt_l2cap_socket_init(int argc, VALUE *argv, VALUE sock);
|
53
|
+
|
54
|
+
static VALUE bt_l2cap_socket_connect(VALUE sock, VALUE host, VALUE port);
|
55
|
+
|
56
|
+
static VALUE bt_l2cap_socket_bind(VALUE sock, VALUE port);
|
57
|
+
|
58
|
+
static VALUE bt_service_new(VALUE self, VALUE uuid, VALUE name, VALUE description, VALUE provider);
|
59
|
+
|
60
|
+
static VALUE bt_service_register(VALUE self, VALUE sock);
|
61
|
+
|
62
|
+
static VALUE bt_service_unregister(VALUE self);
|
63
|
+
|
64
|
+
static VALUE bt_service_registered(VALUE self);
|
65
|
+
|
66
|
+
int str2uuid(char *uuid_str, uuid_t *uuid);
|
67
|
+
|
68
|
+
static VALUE s_accept(VALUE klass, int fd, struct sockaddr *sockaddr, socklen_t *len);
|
@@ -0,0 +1,230 @@
|
|
1
|
+
#import "ruby_bluetooth.h"
|
2
|
+
|
3
|
+
#import <IOBluetooth/objc/IOBluetoothDevicePair.h>
|
4
|
+
|
5
|
+
static IOBluetoothDevice *rbt_device_get(VALUE self) {
|
6
|
+
BluetoothDeviceAddress address;
|
7
|
+
IOBluetoothDevice *device;
|
8
|
+
VALUE address_bytes;
|
9
|
+
char * tmp = NULL;
|
10
|
+
|
11
|
+
address_bytes = rb_funcall(self, rb_intern("address_bytes"), 0);
|
12
|
+
|
13
|
+
if (RSTRING_LEN(address_bytes) != 6) {
|
14
|
+
VALUE inspect = rb_inspect(address_bytes);
|
15
|
+
rb_raise(rb_eArgError, "%s doesn't look like a bluetooth address",
|
16
|
+
StringValueCStr(inspect));
|
17
|
+
}
|
18
|
+
|
19
|
+
tmp = StringValuePtr(address_bytes);
|
20
|
+
|
21
|
+
memcpy(address.data, tmp, 6);
|
22
|
+
|
23
|
+
device = [IOBluetoothDevice withAddress: &address];
|
24
|
+
|
25
|
+
return device;
|
26
|
+
}
|
27
|
+
|
28
|
+
VALUE rbt_device_link_quality(VALUE self) {
|
29
|
+
HCIDelegate *delegate;
|
30
|
+
IOBluetoothDevice *device;
|
31
|
+
IOBluetoothHostController *controller;
|
32
|
+
IOReturn status;
|
33
|
+
NSAutoreleasePool *pool;
|
34
|
+
|
35
|
+
pool = [[NSAutoreleasePool alloc] init];
|
36
|
+
|
37
|
+
device = rbt_device_get(self);
|
38
|
+
|
39
|
+
delegate = [[HCIDelegate alloc] init];
|
40
|
+
delegate.device = self;
|
41
|
+
|
42
|
+
controller = [IOBluetoothHostController defaultController];
|
43
|
+
[controller setDelegate: delegate];
|
44
|
+
|
45
|
+
status = [controller readLinkQualityForDevice: device];
|
46
|
+
|
47
|
+
if (status != noErr) {
|
48
|
+
[pool release];
|
49
|
+
return Qfalse;
|
50
|
+
}
|
51
|
+
|
52
|
+
CFRunLoopRun();
|
53
|
+
|
54
|
+
[pool release];
|
55
|
+
|
56
|
+
status = (IOReturn)NUM2INT(rb_iv_get(self, "@link_quality_error"));
|
57
|
+
|
58
|
+
rbt_check_status(status, nil);
|
59
|
+
|
60
|
+
return rb_iv_get(self, "@link_quality");
|
61
|
+
}
|
62
|
+
|
63
|
+
VALUE rbt_device_open_connection(VALUE self) {
|
64
|
+
IOBluetoothDevice *device;
|
65
|
+
IOReturn status;
|
66
|
+
NSAutoreleasePool *pool;
|
67
|
+
VALUE result;
|
68
|
+
|
69
|
+
pool = [[NSAutoreleasePool alloc] init];
|
70
|
+
|
71
|
+
device = rbt_device_get(self);
|
72
|
+
|
73
|
+
if (![device isConnected]) {
|
74
|
+
status = [device openConnection];
|
75
|
+
|
76
|
+
rbt_check_status(status, pool);
|
77
|
+
}
|
78
|
+
|
79
|
+
result = rb_yield(Qundef);
|
80
|
+
|
81
|
+
status = [device closeConnection];
|
82
|
+
|
83
|
+
[pool release];
|
84
|
+
|
85
|
+
rbt_check_status(status, nil);
|
86
|
+
|
87
|
+
return result;
|
88
|
+
}
|
89
|
+
|
90
|
+
VALUE rbt_device_pair(VALUE self) {
|
91
|
+
PairingDelegate *delegate;
|
92
|
+
IOBluetoothDevice *device;
|
93
|
+
IOBluetoothDevicePair *device_pair;
|
94
|
+
IOReturn status;
|
95
|
+
NSAutoreleasePool *pool;
|
96
|
+
|
97
|
+
pool = [[NSAutoreleasePool alloc] init];
|
98
|
+
|
99
|
+
device = rbt_device_get(self);
|
100
|
+
|
101
|
+
delegate = [[PairingDelegate alloc] init];
|
102
|
+
delegate.device = self;
|
103
|
+
|
104
|
+
device_pair = [IOBluetoothDevicePair pairWithDevice: device];
|
105
|
+
[device_pair setDelegate: delegate];
|
106
|
+
|
107
|
+
status = [device_pair start];
|
108
|
+
|
109
|
+
rbt_check_status(status, pool);
|
110
|
+
|
111
|
+
CFRunLoopRun();
|
112
|
+
|
113
|
+
[pool release];
|
114
|
+
|
115
|
+
status = (IOReturn)NUM2INT(rb_iv_get(self, "@pair_error"));
|
116
|
+
|
117
|
+
rbt_check_status(status, nil);
|
118
|
+
|
119
|
+
return Qtrue;
|
120
|
+
}
|
121
|
+
|
122
|
+
VALUE rbt_device_request_name(VALUE self) {
|
123
|
+
IOBluetoothDevice *device;
|
124
|
+
IOReturn status;
|
125
|
+
VALUE name;
|
126
|
+
NSAutoreleasePool *pool;
|
127
|
+
|
128
|
+
pool = [[NSAutoreleasePool alloc] init];
|
129
|
+
|
130
|
+
device = rbt_device_get(self);
|
131
|
+
|
132
|
+
status = [device remoteNameRequest: nil];
|
133
|
+
|
134
|
+
rbt_check_status(status, pool);
|
135
|
+
|
136
|
+
name = rb_str_new2([[device name] UTF8String]);
|
137
|
+
|
138
|
+
[pool release];
|
139
|
+
|
140
|
+
return name;
|
141
|
+
}
|
142
|
+
|
143
|
+
VALUE rbt_device_rssi(VALUE self) {
|
144
|
+
HCIDelegate *delegate;
|
145
|
+
IOBluetoothDevice *device;
|
146
|
+
IOBluetoothHostController *controller;
|
147
|
+
IOReturn status;
|
148
|
+
NSAutoreleasePool *pool;
|
149
|
+
|
150
|
+
pool = [[NSAutoreleasePool alloc] init];
|
151
|
+
|
152
|
+
device = rbt_device_get(self);
|
153
|
+
|
154
|
+
delegate = [[HCIDelegate alloc] init];
|
155
|
+
delegate.device = self;
|
156
|
+
|
157
|
+
controller = [IOBluetoothHostController defaultController];
|
158
|
+
[controller setDelegate: delegate];
|
159
|
+
|
160
|
+
status = [controller readRSSIForDevice: device];
|
161
|
+
|
162
|
+
if (status != noErr) {
|
163
|
+
[pool release];
|
164
|
+
return Qfalse;
|
165
|
+
}
|
166
|
+
|
167
|
+
CFRunLoopRun();
|
168
|
+
|
169
|
+
[pool release];
|
170
|
+
|
171
|
+
status = (IOReturn)NUM2INT(rb_iv_get(self, "@rssi_error"));
|
172
|
+
|
173
|
+
rbt_check_status(status, nil);
|
174
|
+
|
175
|
+
return rb_iv_get(self, "@rssi");
|
176
|
+
}
|
177
|
+
|
178
|
+
@implementation PairingDelegate
|
179
|
+
|
180
|
+
- (VALUE) device {
|
181
|
+
return device;
|
182
|
+
}
|
183
|
+
|
184
|
+
- (void) setDevice: (VALUE)input {
|
185
|
+
device = input;
|
186
|
+
}
|
187
|
+
|
188
|
+
- (void) devicePairingConnecting: (id)sender {
|
189
|
+
}
|
190
|
+
|
191
|
+
- (void) devicePairingStarted: (id)sender {
|
192
|
+
}
|
193
|
+
|
194
|
+
- (void) devicePairingFinished: (id)sender
|
195
|
+
error: (IOReturn)error {
|
196
|
+
CFRunLoopStop(CFRunLoopGetCurrent());
|
197
|
+
|
198
|
+
rb_iv_set(device, "@pair_error", INT2NUM(error));
|
199
|
+
}
|
200
|
+
|
201
|
+
- (void) devicePairingPasskeyNotification: (id)sender
|
202
|
+
passkey: (BluetoothPasskey)passkey {
|
203
|
+
printf("passkey %ld! I don't know what to do!", (unsigned long)passkey);
|
204
|
+
}
|
205
|
+
|
206
|
+
- (void) devicePairingPINCodeRequest: (id)sender {
|
207
|
+
puts("PIN code! I don't know what to do!");
|
208
|
+
}
|
209
|
+
|
210
|
+
- (void) devicePairingUserConfirmationRequest: (id)sender
|
211
|
+
numericValue: (BluetoothNumericValue)numericValue {
|
212
|
+
BOOL confirm;
|
213
|
+
VALUE result = Qtrue;
|
214
|
+
VALUE numeric_value = ULONG2NUM((unsigned long)numericValue);
|
215
|
+
VALUE callback = rb_iv_get(device, "@pair_confirmation_callback");
|
216
|
+
|
217
|
+
if (RTEST(callback))
|
218
|
+
result = rb_funcall(callback, rb_intern("call"), 1, numeric_value);
|
219
|
+
|
220
|
+
if (RTEST(result)) {
|
221
|
+
confirm = YES;
|
222
|
+
} else {
|
223
|
+
confirm = NO;
|
224
|
+
}
|
225
|
+
|
226
|
+
[sender replyUserConfirmation: confirm];
|
227
|
+
}
|
228
|
+
|
229
|
+
@end
|
230
|
+
|
@@ -0,0 +1,269 @@
|
|
1
|
+
#import "ruby_bluetooth.h"
|
2
|
+
#import <IOKit/IOKitLib.h>
|
3
|
+
|
4
|
+
extern VALUE rbt_mBluetooth;
|
5
|
+
extern VALUE rbt_cBluetoothError;
|
6
|
+
|
7
|
+
VALUE errors;
|
8
|
+
|
9
|
+
void rbt_check_status(IOReturn status, NSAutoreleasePool *pool) {
|
10
|
+
if (status != kIOReturnSuccess || status != noErr) {
|
11
|
+
[pool release];
|
12
|
+
|
13
|
+
rb_funcall(rbt_cBluetoothError, rb_intern("raise"), 1, INT2NUM(status));
|
14
|
+
}
|
15
|
+
}
|
16
|
+
|
17
|
+
void add_error(IOReturn status, const char *name, const char *message) {
|
18
|
+
VALUE klass;
|
19
|
+
VALUE value;
|
20
|
+
|
21
|
+
klass = rb_define_class_under(rbt_mBluetooth, name, rbt_cBluetoothError);
|
22
|
+
value = rb_ary_new3(2, klass, rb_str_new2(message));
|
23
|
+
rb_hash_aset(errors, INT2NUM(status), value);
|
24
|
+
}
|
25
|
+
|
26
|
+
void init_rbt_error() {
|
27
|
+
VALUE tmp;
|
28
|
+
|
29
|
+
errors = rb_const_get(rbt_mBluetooth, rb_intern("ERRORS"));
|
30
|
+
|
31
|
+
tmp = rb_ary_new3(2, rbt_cBluetoothError, rb_str_new2("general error"));
|
32
|
+
rb_hash_aset(errors, INT2NUM(kIOReturnError), tmp);
|
33
|
+
|
34
|
+
// IOKit
|
35
|
+
add_error(kIOReturnNoMemory, "NoMemoryError",
|
36
|
+
"can't allocate memory");
|
37
|
+
add_error(kIOReturnNoResources, "NoResourcesError",
|
38
|
+
"resource shortage");
|
39
|
+
add_error(kIOReturnIPCError, "IPCError",
|
40
|
+
"error during IPC");
|
41
|
+
add_error(kIOReturnNoDevice, "NoDeviceError",
|
42
|
+
"no such device");
|
43
|
+
add_error(kIOReturnNotPrivileged, "NotPrivilegedError",
|
44
|
+
"privilege violation");
|
45
|
+
add_error(kIOReturnBadArgument, "BadArgumentError",
|
46
|
+
"invalid argument");
|
47
|
+
add_error(kIOReturnLockedRead, "LockedReadError",
|
48
|
+
"device read locked");
|
49
|
+
add_error(kIOReturnLockedWrite, "LockedWriteError",
|
50
|
+
"device write locked");
|
51
|
+
add_error(kIOReturnExclusiveAccess, "ExclusiveAccessError",
|
52
|
+
"exclusive access and device already open");
|
53
|
+
add_error(kIOReturnBadMessageID, "BadMessageIDError",
|
54
|
+
"sent/received messages had different msg_id");
|
55
|
+
add_error(kIOReturnUnsupported, "UnsupportedError",
|
56
|
+
"unsupported function");
|
57
|
+
add_error(kIOReturnVMError, "VMError",
|
58
|
+
"misc. VM failure");
|
59
|
+
add_error(kIOReturnInternalError, "InternalError",
|
60
|
+
"internal error");
|
61
|
+
add_error(kIOReturnIOError, "IOError",
|
62
|
+
"General I/O error");
|
63
|
+
add_error(kIOReturnCannotLock, "CannotLockError",
|
64
|
+
"can't acquire lock");
|
65
|
+
add_error(kIOReturnNotOpen, "NotOpenError",
|
66
|
+
"device not open");
|
67
|
+
add_error(kIOReturnNotReadable, "NotReadableError",
|
68
|
+
"read not supported");
|
69
|
+
add_error(kIOReturnNotWritable, "NotWritableError",
|
70
|
+
"write not supported");
|
71
|
+
add_error(kIOReturnNotAligned, "NotAlignedError",
|
72
|
+
"alignment error");
|
73
|
+
add_error(kIOReturnBadMedia, "BadMediaError",
|
74
|
+
"Media Error");
|
75
|
+
add_error(kIOReturnStillOpen, "StillOpenError",
|
76
|
+
"device(s) still open");
|
77
|
+
add_error(kIOReturnRLDError, "RLDError",
|
78
|
+
"rld failure");
|
79
|
+
add_error(kIOReturnDMAError, "DMAError",
|
80
|
+
"DMA failure");
|
81
|
+
add_error(kIOReturnBusy, "BusyError",
|
82
|
+
"Device Busy");
|
83
|
+
add_error(kIOReturnTimeout, "TimeoutError",
|
84
|
+
"I/O Timeout");
|
85
|
+
add_error(kIOReturnOffline, "OfflineError",
|
86
|
+
"device offline");
|
87
|
+
add_error(kIOReturnNotReady, "NotReadyError",
|
88
|
+
"not ready");
|
89
|
+
add_error(kIOReturnNotAttached, "NotAttachedError",
|
90
|
+
"device not attached");
|
91
|
+
add_error(kIOReturnNoChannels, "NoChannelsError",
|
92
|
+
"no DMA channels left");
|
93
|
+
add_error(kIOReturnNoSpace, "NoSpaceError",
|
94
|
+
"no space for data");
|
95
|
+
add_error(kIOReturnPortExists, "PortExistsError",
|
96
|
+
"port already exists");
|
97
|
+
add_error(kIOReturnCannotWire, "CannotWireError",
|
98
|
+
"can't wire down physical memory");
|
99
|
+
add_error(kIOReturnNoInterrupt, "NoInterruptError",
|
100
|
+
"no interrupt attached");
|
101
|
+
add_error(kIOReturnNoFrames, "NoFramesError",
|
102
|
+
"no DMA frames enqueued");
|
103
|
+
add_error(kIOReturnMessageTooLarge, "MessageTooLargeError",
|
104
|
+
"oversized msg received on interrupt port");
|
105
|
+
add_error(kIOReturnNotPermitted, "NotPermittedError",
|
106
|
+
"not permitted");
|
107
|
+
add_error(kIOReturnNoPower, "NoPowerError",
|
108
|
+
"no power to device");
|
109
|
+
add_error(kIOReturnNoMedia, "NoMediaError",
|
110
|
+
"media not present");
|
111
|
+
add_error(kIOReturnUnformattedMedia, "UnformattedMediaError",
|
112
|
+
"media not formatted");
|
113
|
+
add_error(kIOReturnUnsupportedMode, "UnsupportedModeError",
|
114
|
+
"no such mode");
|
115
|
+
add_error(kIOReturnUnderrun, "UnderrunError",
|
116
|
+
"data underrun");
|
117
|
+
add_error(kIOReturnOverrun, "OverrunError",
|
118
|
+
"data overrun");
|
119
|
+
add_error(kIOReturnDeviceError, "DeviceError",
|
120
|
+
"the device is not working properly!");
|
121
|
+
add_error(kIOReturnNoCompletion, "NoCompletionError",
|
122
|
+
"a completion routine is required");
|
123
|
+
add_error(kIOReturnAborted, "AbortedError",
|
124
|
+
"operation aborted");
|
125
|
+
add_error(kIOReturnNoBandwidth, "NoBandwidthError",
|
126
|
+
"bus bandwidth would be exceeded");
|
127
|
+
add_error(kIOReturnNotResponding, "NotRespondingError",
|
128
|
+
"device not responding");
|
129
|
+
add_error(kIOReturnIsoTooOld, "IsoTooOldError",
|
130
|
+
"isochronous I/O request for distant past!");
|
131
|
+
add_error(kIOReturnIsoTooNew, "IsoTooNewError",
|
132
|
+
"isochronous I/O request for distant future");
|
133
|
+
add_error(kIOReturnNotFound, "NotFoundError",
|
134
|
+
"data was not found");
|
135
|
+
add_error(kIOReturnInvalid, "InvalidError",
|
136
|
+
"should never be seen");
|
137
|
+
|
138
|
+
// Bluetooth
|
139
|
+
add_error(kBluetoothHCIErrorUnknownHCICommand, "UnknownHCICommandError",
|
140
|
+
"unknown HCI command");
|
141
|
+
add_error(kBluetoothHCIErrorNoConnection, "NoConnectionError",
|
142
|
+
"no connection");
|
143
|
+
add_error(kBluetoothHCIErrorHardwareFailure, "HardwareFailureError",
|
144
|
+
"hardware failure");
|
145
|
+
add_error(kBluetoothHCIErrorPageTimeout, "PageTimeoutError",
|
146
|
+
"page timeout");
|
147
|
+
add_error(kBluetoothHCIErrorAuthenticationFailure,
|
148
|
+
"AuthenticationFailureError", "authentication failure");
|
149
|
+
add_error(kBluetoothHCIErrorKeyMissing, "KeyMissingError", "key missing");
|
150
|
+
add_error(kBluetoothHCIErrorMemoryFull, "MemoryFullError", "memory full");
|
151
|
+
add_error(kBluetoothHCIErrorConnectionTimeout, "ConnectionTimeoutError",
|
152
|
+
"connection timeout");
|
153
|
+
add_error(kBluetoothHCIErrorMaxNumberOfConnections,
|
154
|
+
"MaxNumberOfConnectionsError", "maximum number of connections");
|
155
|
+
add_error(kBluetoothHCIErrorMaxNumberOfSCOConnectionsToADevice,
|
156
|
+
"MaxNumberOfSCOConnectionsToADeviceError",
|
157
|
+
"maximum number of synchronous connections to a device");
|
158
|
+
add_error(kBluetoothHCIErrorACLConnectionAlreadyExists,
|
159
|
+
"ACLConnectionAlreadyExistsError",
|
160
|
+
"ACL connection already exists");
|
161
|
+
add_error(kBluetoothHCIErrorCommandDisallowed, "CommandDisallowedError",
|
162
|
+
"command disallowed");
|
163
|
+
add_error(kBluetoothHCIErrorHostRejectedLimitedResources,
|
164
|
+
"HostRejectedLimitedResourcesError",
|
165
|
+
"host rejected, limited resources");
|
166
|
+
add_error(kBluetoothHCIErrorHostRejectedSecurityReasons,
|
167
|
+
"HostRejectedSecurityReasonsError",
|
168
|
+
"host rejected, security reasons");
|
169
|
+
add_error(kBluetoothHCIErrorHostRejectedRemoteDeviceIsPersonal,
|
170
|
+
"HostRejectedRemoteDeviceIsPersonalError",
|
171
|
+
"host rejected, remote device is personal");
|
172
|
+
add_error(kBluetoothHCIErrorHostTimeout, "HostTimeoutError",
|
173
|
+
"host timeout");
|
174
|
+
add_error(kBluetoothHCIErrorUnsupportedFeatureOrParameterValue,
|
175
|
+
"UnsupportedFeatureOrParameterValueError",
|
176
|
+
"unsupported feature or parameter value");
|
177
|
+
add_error(kBluetoothHCIErrorInvalidHCICommandParameters,
|
178
|
+
"InvalidHCICommandParametersError",
|
179
|
+
"invalid HCI command parameters");
|
180
|
+
add_error(kBluetoothHCIErrorOtherEndTerminatedConnectionUserEnded,
|
181
|
+
"OtherEndTerminatedConnectionUserEndedError",
|
182
|
+
"the other end terminated the connection, by user");
|
183
|
+
add_error(kBluetoothHCIErrorOtherEndTerminatedConnectionLowResources,
|
184
|
+
"OtherEndTerminatedConnectionLowResourcesError",
|
185
|
+
"the other end terminated the connection, low resources");
|
186
|
+
add_error(kBluetoothHCIErrorOtherEndTerminatedConnectionAboutToPowerOff,
|
187
|
+
"OtherEndTerminatedConnectionAboutToPowerOffError",
|
188
|
+
"the other end terminated the connection, about to power off");
|
189
|
+
add_error(kBluetoothHCIErrorConnectionTerminatedByLocalHost,
|
190
|
+
"ConnectionTerminatedByLocalHostError",
|
191
|
+
"connection terminated by local host");
|
192
|
+
add_error(kBluetoothHCIErrorRepeatedAttempts, "RepeatedAttemptsError",
|
193
|
+
"repeated attempts");
|
194
|
+
add_error(kBluetoothHCIErrorPairingNotAllowed, "PairingNotAllowedError",
|
195
|
+
"pairing is not allowed");
|
196
|
+
add_error(kBluetoothHCIErrorUnknownLMPPDU, "UnknownLMPPDUError",
|
197
|
+
"unknown LMP PDU");
|
198
|
+
add_error(kBluetoothHCIErrorUnsupportedRemoteFeature,
|
199
|
+
"UnsupportedRemoteFeatureError", "unsupported remote feature");
|
200
|
+
add_error(kBluetoothHCIErrorSCOOffsetRejected, "SCOOffsetRejectedError",
|
201
|
+
"SCO offset rejected");
|
202
|
+
add_error(kBluetoothHCIErrorSCOIntervalRejected, "SCOIntervalRejectedError",
|
203
|
+
"SCO interval rejected");
|
204
|
+
add_error(kBluetoothHCIErrorSCOAirModeRejected, "SCOAirModeRejectedError",
|
205
|
+
"SCO air mode rejected");
|
206
|
+
add_error(kBluetoothHCIErrorInvalidLMPParameters,
|
207
|
+
"InvalidLMPParametersError",
|
208
|
+
"invalid LMP parameters");
|
209
|
+
add_error(kBluetoothHCIErrorUnspecifiedError, "UnspecifiedError",
|
210
|
+
"unspecified error");
|
211
|
+
add_error(kBluetoothHCIErrorUnsupportedLMPParameterValue,
|
212
|
+
"UnsupportedLMPParameterValueError",
|
213
|
+
"unsupported LMP parameter value");
|
214
|
+
add_error(kBluetoothHCIErrorRoleChangeNotAllowed,
|
215
|
+
"RoleChangeNotAllowedError",
|
216
|
+
"role change not allowed");
|
217
|
+
add_error(kBluetoothHCIErrorLMPResponseTimeout, "LMPResponseTimeoutError",
|
218
|
+
"LMP response timeout");
|
219
|
+
add_error(kBluetoothHCIErrorLMPErrorTransactionCollision,
|
220
|
+
"LMPErrorTransactionCollisionError",
|
221
|
+
"LMP error transaction collision");
|
222
|
+
add_error(kBluetoothHCIErrorLMPPDUNotAllowed, "LMPPDUNotAllowedError",
|
223
|
+
"LMP DU not allowed");
|
224
|
+
add_error(kBluetoothHCIErrorEncryptionModeNotAcceptable,
|
225
|
+
"EncryptionModeNotAcceptableError",
|
226
|
+
"encryption mode not acceptable");
|
227
|
+
add_error(kBluetoothHCIErrorUnitKeyUsed, "UnitKeyUsedError",
|
228
|
+
"unit key used");
|
229
|
+
add_error(kBluetoothHCIErrorQoSNotSupported, "QoSNotSupportedError",
|
230
|
+
"QoS not supported");
|
231
|
+
add_error(kBluetoothHCIErrorInstantPassed, "InstantPassedError",
|
232
|
+
"instant passed");
|
233
|
+
add_error(kBluetoothHCIErrorPairingWithUnitKeyNotSupported,
|
234
|
+
"PairingWithUnitKeyNotSupportedError",
|
235
|
+
"pairing with unit key not supported");
|
236
|
+
add_error(kBluetoothHCIErrorHostRejectedUnacceptableDeviceAddress,
|
237
|
+
"HostRejectedUnacceptableDeviceAddressError",
|
238
|
+
"host rejected, unacceptable device address");
|
239
|
+
add_error(kBluetoothHCIErrorDifferentTransactionCollision,
|
240
|
+
"DifferentTransactionCollisionError",
|
241
|
+
"different transaction collision");
|
242
|
+
add_error(kBluetoothHCIErrorQoSUnacceptableParameter,
|
243
|
+
"QoSUnacceptableParameterError",
|
244
|
+
"Qos unacceptable parameter");
|
245
|
+
add_error(kBluetoothHCIErrorQoSRejected, "QoSRejectedError",
|
246
|
+
"QoS rejected");
|
247
|
+
add_error(kBluetoothHCIErrorChannelClassificationNotSupported,
|
248
|
+
"ChannelClassificationNotSupportedError",
|
249
|
+
"channel classification not supported");
|
250
|
+
add_error(kBluetoothHCIErrorInsufficientSecurity,
|
251
|
+
"InsufficientSecurityError",
|
252
|
+
"insufficient security");
|
253
|
+
add_error(kBluetoothHCIErrorParameterOutOfMandatoryRange,
|
254
|
+
"ParameterOutOfMandatoryRangeError",
|
255
|
+
"parameter out of mandatory range");
|
256
|
+
add_error(kBluetoothHCIErrorRoleSwitchPending, "RoleSwitchPendingError",
|
257
|
+
"role switch pending");
|
258
|
+
add_error(kBluetoothHCIErrorReservedSlotViolation,
|
259
|
+
"ReservedSlotViolationError", "reserved slot violation");
|
260
|
+
add_error(kBluetoothHCIErrorRoleSwitchFailed, "RoleSwitchFailedError",
|
261
|
+
"role switch failed");
|
262
|
+
add_error(kBluetoothHCIErrorExtendedInquiryResponseTooLarge,
|
263
|
+
"ExtendedInquiryResponseTooLargeError",
|
264
|
+
"extended inquiry response too large");
|
265
|
+
add_error(kBluetoothHCIErrorSecureSimplePairingNotSupportedByHost,
|
266
|
+
"SecureSimplePairingNotSupportedByHostError",
|
267
|
+
"secure simple pairing not supported by host");
|
268
|
+
}
|
269
|
+
|