-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathBle.yml
More file actions
1047 lines (922 loc) · 39.8 KB
/
Copy pathBle.yml
File metadata and controls
1047 lines (922 loc) · 39.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
---
name: Modules.BLE
extends: Titanium.Module
summary: Add-on Bluetooth Low Energy module
since: "1.0.0"
description: |
Using Bluetooth Low Energy module is used to interact with Bluetooth Low Energy (BLE) devices.
<p class="note">Note: This feature requires a Pro or Enterprise subscription. More infos <a href="https://www.appcelerator.com/pricing/" target="_blank">here</a>!</p>
- Note (IOS): Starting iOS 13, it's mandatory for developers to specify the Privacy Usage Description
for Bluetooth by including NSBluetoothAlwaysUsageDescription in their tiapp.xml file. Otherwise
accessing any Core Bluetooth APIs would lead to a crash. For backward support for older iOS
versions, NSBluetoothPeripheralUsageDescription needs to be defined.
- If your app needs to run in background to perform certain Bluetooth-related tasks, it must declare
that it supports a Core Bluetooth background execution mode in tiapp.xml using UIBackgroundModes key
``` xml
<key>UIBackgroundModes</key>
<array>
<string>bluetooth-central</string>
<string>bluetooth-peripheral</string>
</array>
```
bluetooth-central : The app communicates with Bluetooth low energy peripherals using the Core Bluetooth framework.
bluetooth-peripheral :The app shares data using the Core Bluetooth framework.
The Apple documentation states that applications are allowed to scan while backgrounded but the
scan must specify the service types. wild card scan is not supported in the background.
Note: A detailed information about how to use module in your application, can be found with artifacts at path modules/iphone (platform)/appcelerator.ble/x.y.z (version of module)/documentation/index.html
platforms: [android, iphone, ipad]
properties:
- name: AUTHORISATION_STATUS_NOT_DETERMINED
type: Number
summary: A state that indicates the user has yet to authorize Bluetooth for this app.
permission: read-only
platforms: [iphone, ipad]
since: "1.0.0"
value: 0
- name: AUTHORISATION_STATUS_RESTRICTED
type: Number
summary: A state that indicates this app isn’t authorized to use Bluetooth.
permission: read-only
platforms: [iphone, ipad]
since: "1.0.0"
value: 1
- name: AUTHORISATION_STATUS_DENIED
type: Number
summary: A state that indicates the user explicitly denied Bluetooth access for this app.
permission: read-only
platforms: [iphone, ipad]
since: "1.0.0"
value: 2
- name: AUTHORISATION_STATUS_ALLOWED_ALWAYS
type: Number
summary: A state that indicates the user has authorized Bluetooth at any time.
permission: read-only
platforms: [iphone, ipad]
since: "1.0.0"
value: 3
- name: CHARACTERISTIC_PERMISSION_READABLE
type: Number
summary: A permission that indicates a peripheral can read the attribute’s value.
permission: read-only
platforms: [iphone, ipad, android]
since: "1.0.0"
value: 1 in android and 0 in iOS.
- name: CHARACTERISTIC_PERMISSION_WRITEABLE
type: Number
summary: A permission that indicates a peripheral can write the attribute’s value.
permission: read-only
platforms: [iphone, ipad, android]
since: "1.0.0"
value: 16 in android and 1 in iOS.
- name: CHARACTERISTIC_PERMISSION_READ_ENCRYPTED
type: Number
summary: A permission that indicates only trusted devices can read the attribute’s value.
permission: read-only
platforms: [iphone, ipad, android]
since: "1.0.0"
value: 2
- name: CHARACTERISTIC_PERMISSION_WRITE_ENCRYPTED
type: Number
summary: A permission that indicates only trusted devices can write the attribute’s value.
permission: read-only
platforms: [iphone, ipad, android]
since: "1.0.0"
value: 32 in android and 3 in iOS.
- name: CHARACTERISTIC_PROPERTIES_BROADCAST
type: Number
summary: A property that indicates the characteristic can broadcast its value using a characteristic configuration descriptor.
permission: read-only
platforms: [android, iphone, ipad]
since: "1.0.0"
value: 1 in android and 0 in iOS.
- name: CHARACTERISTIC_PROPERTIES_READ
type: Number
summary: A property that indicates a peripheral can read the characteristic’s value.
permission: read-only
platforms: [android, iphone, ipad]
since: "1.0.0"
value: 2 in android and 1 in iOS.
- name: CHARACTERISTIC_PROPERTIES_WRITE_WITHOUT_RESPONSE
type: Number
summary: A property that indicates a peripheral can write the characteristic's value, without a response to indicate that the write succeeded.
permission: read-only
platforms: [android, iphone, ipad]
since: "1.0.0"
value: 4 in android and 2 in iOS.
- name: CHARACTERISTIC_PROPERTIES_WRITE
type: Number
summary: A property that indicates a peripheral can write the characteristic’s value, with a response to indicate that the write succeeded.
permission: read-only
platforms: [android, iphone, ipad]
since: "1.0.0"
value: 8 in android and 3 in iOS.
- name: CHARACTERISTIC_PROPERTIES_NOTIFY
type: Number
summary: A property that indicates the peripheral permits notifications of the characteristic’s value, without a response from the central to indicate receipt of the notification.
permission: read-only
platforms: [android, iphone, ipad]
since: "1.0.0"
value: 16 in android and 4 in iOS.
- name: CHARACTERISTIC_PROPERTIES_INDICATE
type: Number
summary: A property that indicates the peripheral permits notifications of the characteristic’s value, with a response from the central to indicate receipt of the notification.
permission: read-only
platforms: [android, iphone, ipad]
since: "1.0.0"
value: 32 in android and 5 in iOS.
- name: CHARACTERISTIC_PROPERTIES_AUTHENTICATED_SIGNED_WRITES
type: Number
summary: A property that indicates the perhipheral allows signed writes of the characteristic’s value, without a response to indicate the write succeeded.
permission: read-only
platforms: [iphone, ipad]
since: "1.0.0"
value: 6
- name: CHARACTERISTIC_PROPERTIES_EXTENDED_PROPERTIES
type: Number
summary: A property that indicates the characteristic defines additional properties in the extended properties descriptor.A property that indicates the characteristic defines additional properties in the extended properties descriptor.
permission: read-only
platforms: [android, iphone, ipad]
since: "1.0.0"
value: 128 in android and 7 in iOS.
- name: CHARACTERISTIC_PROPERTIES_NOTIFY_ENCRYPTION_REQUIRED
type: Number
summary: A property that indicates that only trusted devices can enable notifications of the characteristic’s value.
permission: read-only
platforms: [iphone, ipad]
since: "1.0.0"
value: 8
- name: CHARACTERISTIC_PROPERTIES_INDICATE_ENCRYPTION_REQUIRED
type: Number
summary: A property that indicates only trusted devices can enable indications of the characteristic’s value.
permission: read-only
platforms: [iphone, ipad]
since: "1.0.0"
value: 9
- name: CBUUID_CHARACTERISTIC_EXTENDED_PROPERTIES_STRING
type: String
summary: The UUID for the Extended Properties descriptor, as a string. The corresponding value for this descriptor is an NSNumber object.
permission: read-only
platforms: [iphone, ipad]
since: "1.0.0"
value: 2900
- name: CBUUID_CHARACTERISTIC_USER_DESCRIPTION_STRING
type: String
summary: The UUID for the User Description descriptor, as a string. The corresponding value for this descriptor is an NSString object.
permission: read-only
platforms: [iphone, ipad]
since: "1.0.0"
value: 2901
- name: CBUUID_CLIENT_CHARACTERISTIC_CONFIGURATION_STRING
type: String
summary: The UUID for the Client Configuration descriptor, as a string. In iOS, the corresponding value for this descriptor is an NSNumber object. In android, it is a 32 bit uuid.
permission: read-only
platforms: [android, iphone, ipad]
since: {android: "1.1.0", iphone: "1.0.0", ipad: "1.0.0"}
value: 00002902-0000-1000-8000-00805f9b34fb in android and 2902 in iOS.
- name: CBUUID_SERVER_CHARACTERISTIC_CONFIGURATION_STRING
type: String
summary: The UUID for the Server Configuration descriptor, as a string. The corresponding value for this descriptor is an NSNumber object.
permission: read-only
platforms: [iphone, ipad]
since: "1.0.0"
value: 2903
- name: CBUUID_CHARACTERISTIC_FORMAT_STRING
type: String
summary: The UUID for the Presentation Format descriptor, as a string. The corresponding value for this descriptor is an NSData object.
permission: read-only
platforms: [iphone, ipad]
since: "1.0.0"
value: 2904
- name: CBUUID_CHARACTERISTIC_AGGREGATE_FORMAT_STRING
type: String
summary: The UUID for the Aggregate Format descriptor, as a string.
permission: read-only
platforms: [iphone, ipad]
since: "1.0.0"
value: 2905
- name: CBUUID_L2CAPPSM_CHARACTERISTIC_STRING
type: String
summary: The PSM of an L2CAP channel associated with the GATT service containing this characteristic.This PSM is a little-endian UInt16. Servers can publish this characteristic with the UUID ABDD3056-28FA-441D-A470-55A75A52553A.
permission: read-only
platforms: [android, iphone, ipad]
since: {android: "1.1.0", iphone: "1.0.0", ipad: "1.0.0"}
value: 2906
- name: PERIPHERAL_STATE_DISCONNECTED
type: Number
summary: The peripheral isn’t connected to the central manager.
permission: read-only
platforms: [iphone, ipad]
since: "1.0.0"
value: 0
- name: PERIPHERAL_STATE_CONNECTING
type: Number
summary: The peripheral is in the process of connecting to the central manager.
permission: read-only
platforms: [iphone, ipad]
since: "1.0.0"
value: 1
- name: PERIPHERAL_STATE_CONNECTED
type: Number
summary: The peripheral is connected to the central manager.
permission: read-only
platforms: [iphone, ipad]
since: "1.0.0"
value: 2
- name: PERIPHERAL_STATE_DISCONNECTING
type: Number
summary: The peripheral is disconnecting from the central manager.
permission: read-only
platforms: [iphone, ipad]
since: "1.0.0"
value: 3
- name: MANAGER_STATE_UNKNOWN
type: Number
summary: The Peripheral and Central manager’s state is unknown
permission: read-only
platforms: [iphone, ipad]
since: "1.0.0"
value: 0
- name: MANAGER_STATE_RESETTING
type: Number
summary: A state that indicates the connection with the system service was momentarily lost.
permission: read-only
platforms: [iphone, ipad]
since: "1.0.0"
value: 1
- name: MANAGER_STATE_UNSUPPORTED
type: Number
summary: A state that indicates this device doesn’t support the Bluetooth low energy central or client role.
permission: read-only
platforms: [iphone, ipad]
since: "1.0.0"
value: 2
- name: MANAGER_STATE_UNAUTHORIZED
type: Number
summary: A state that indicates the application isn’t authorized to use the Bluetooth low energy role.
permission: read-only
platforms: [iphone, ipad]
since: "1.0.0"
value: 3
- name: MANAGER_STATE_POWERED_OFF
type: Number
summary: A state that indicates Bluetooth is currently powered off.
permission: read-only
platforms: [android, iphone, ipad]
since: "1.0.0"
value: 10 in android and 4 in iOS.
- name: MANAGER_STATE_POWERED_ON
type: Number
summary: A state that indicates Bluetooth is currently powered on and available to use.
permission: read-only
platforms: [android, iphone, ipad]
since: "1.0.0"
value: 12 in android and 5 in iOS.
- name: CONNECTION_EVENT_TYPE_PEER_DISCONNECTED
type: Number
summary: Peer disconnect event type. This is 'event' type value for CENTREL_MANAGER_EVENT_PERIPHERAL_CONNECTION_EVENT_DID_OCCUR event.
permission: read-only
platforms: [iphone, ipad]
since: "1.0.0"
value: 0
- name: CONNECTION_EVENT_TYPE_PEER_CONNECTED
type: Number
summary: Peer connected event type. This is 'event' type value for CENTREL_MANAGER_EVENT_PERIPHERAL_CONNECTION_EVENT_DID_OCCUR event.
permission: read-only
platforms: [iphone, ipad]
since: "1.0.0"
value: 1
- name: CONNECT_PERIPHERAL_OPTIONS_KEY_NOTIFY_ON_CONNECTION
type: String
summary: A Boolean value that specifies whether the system should display an alert when connecting a peripheral in the background.
description: |
options object key used in Modules.BLE.CentralManager.connectPeripheral.
The value for this key is an Boolean. This key is useful for apps that haven’t specified the bluetooth-central background mode and can’t display their own alert.
If more than one app requests a notification for a given peripheral, the one that was most recently in the foreground receives the alert. If the key isn’t specified,
the default value is false.
permission: read-only
platforms: [iphone, ipad]
since: "1.0.0"
- name: CONNECT_PERIPHERAL_OPTIONS_KEY_NOTIFY_ON_DISCONNECTION
type: String
summary: A Boolean value that specifies whether the system should display an alert when disconnecting a peripheral in the background.
description: |
options object key used in Modules.BLE.CentralManager.connectPeripheral.
The value for this key is an Boolean. This key is useful for apps that haven’t specified the bluetooth-central background mode and can’t display their own alert.
If more than one app requests a notification for a given peripheral, the one that was most recently in the foreground receives the alert. If the key isn’t specified,
the default value is false.
permission: read-only
platforms: [iphone, ipad]
since: "1.0.0"
- name: CONNECT_PERIPHERAL_OPTIONS_KEY_NOTIFY_ON_NOTIFICATION
type: String
summary: A Boolean value that specifies whether the system should display an alert for any notification sent by a peripheral.
description: |
options object key used in Modules.BLE.CentralManager.connectPeripheral.
If true, the system displays an alert for all notifications received from a given peripheral while the app is suspended.
the default value is false.
permission: read-only
platforms: [iphone, ipad]
since: "1.0.0"
- name: CONNECT_PERIPHERAL_OPTIONS_KEY_START_DELAY
type: String
summary: An option that indicates a delay before the system makes a connection.
description: |
options object key used in Modules.BLE.CentralManager.connectPeripheral.
The corresponding value is an Number that indicates the duration of the delay in seconds.
permission: read-only
platforms: [iphone, ipad]
since: "1.0.0"
- name: CONNECT_PERIPHERAL_OPTIONS_KEY_ENABLE_TRANSPORT_BRIDGING
type: String
summary: An option to bridge classic Bluetooth technology profiles, if already connected over Bluetooth Low Energy.
description: |
options object key used in Modules.BLE.CentralManager.connectPeripheral.
This option tells the system to connect non-GATT profiles on classic Bluetooth devices, if there is a low energy GATT connection to the same device.
A true value instructs the system to bring up classic transport profiles when a low energy transport peripheral connects. A false value tells the system not to use the profiles.
permission: read-only
platforms: [iphone, ipad]
since: "1.0.0"
- name: CONNECT_PERIPHERAL_OPTIONS_KEY_REQUIRES_ANCS
type: String
summary: An option to require Apple Notification Center Service (ANCS) when connecting a device.
description: |
options object key used in Modules.BLE.CentralManager.connectPeripheral.
permission: read-only
platforms: [iphone, ipad]
since: "1.0.0"
- name: ADVERT_DATA_KEY_SERVICE_DATA
type: String
summary: A dictionary that contains service-specific advertisement data.
description: |
The keys (Strings objects) represent Service UUIDs, and the values (TiBuffer objects) represent service-specific data.
permission: read-only
platforms: [iphone, ipad]
since: "1.0.0"
- name: ADVERT_DATA_KEY_LOCAL_NAME
type: String
summary: The local name of a peripheral.
description: |
The value associated with this key is an String.
permission: read-only
platforms: [iphone, ipad]
since: "1.0.0"
- name: ADVERT_DATA_KEY_MANUFACTURER_DATA
type: String
summary: The manufacturer data of a peripheral.
description: |
The value associated with this key is an TiBuffer object.
permission: read-only
platforms: [iphone, ipad]
since: "1.0.0"
- name: ADVERT_DATA_KEY_SERVICE_UUIDS
type: String
summary: An array of service UUIDs.
description: |
The value associated with this key is an Array<String> object.
permission: read-only
platforms: [iphone, ipad]
since: "1.0.0"
- name: ADVERT_DATA_KEY_OVERFLOW_SERVICE_UUIDS
type: String
summary: An array of UUIDs found in the overflow area of the advertisement data.
description: |
The value associated with this key is an array of one or more String objects, representing Service UUIDs.
Because data stored in this area results from not fitting in the main advertisement, UUIDs listed here are “best effort” and may not always be accurate. For details about the overflow area of advertisement data, see the startAdvertising(_:) method in PeripheralManager.
permission: read-only
platforms: [iphone, ipad]
since: "1.0.0"
- name: ADVERT_DATA_KEY_TX_POWER_LEVEL
type: String
summary: The transmit power of a peripheral.
description: |
The value associated with this key is an instance of Number.
This key and value are available if the peripheral provides its transmitting power level in its advertising packet. You can calculate the path loss by comparing the RSSI value with the transmitting power level.
permission: read-only
platforms: [iphone, ipad]
since: "1.0.0"
- name: ADVERT_DATA_KEY_IS_CONNECTABLE
type: String
summary: A Boolean value that indicates whether the advertising event type is connectable.
description: |
The value for this key is an Number object. You can use this value to determine whether your app can currently connect to a peripheral.
permission: read-only
platforms: [iphone, ipad]
since: "1.0.0"
- name: ADVERT_DATA_KEY_SOLICITED_SERVICE_UUIDS
type: String
summary: An array of solicited service UUIDs.
description: |
The value associated with this key is an array of one or more String objects, representing Service UUIDs.
permission: read-only
platforms: [iphone, ipad]
since: "1.0.0"
- name: ATT_SUCCESS
type: Number
summary: The ATT command or request successfully completed.
permission: read-only
platforms: [android,iphone, ipad]
since: {android: "1.1.0", iphone: "1.0.0", ipad: "1.0.0"}
- name: ATT_FAILURE
type: Number
summary: The ATT command or request failed.
permission: read-only
platforms: [android]
since: "1.1.0"
- name: ATT_INVALID_HANDLE_ERROR
type: Number
summary: The attribute handle is invalid on this peripheral.
permission: read-only
platforms: [iphone, ipad]
since: "1.0.0"
- name: ATT_READ_NOT_PERMITTED_ERROR
type: Number
summary: The permissions prohibit reading the attribute’s value.
permission: read-only
platforms: [android, iphone, ipad]
since: {android: "1.1.0", iphone: "1.0.0", ipad: "1.0.0"}
- name: ATT_WRITE_NOT_PERMITTED_ERROR
type: Number
summary: The permissions prohibit writing the attribute’s value.
permission: read-only
platforms: [android, iphone, ipad]
since: {android: "1.1.0", iphone: "1.0.0", ipad: "1.0.0"}
- name: ATT_INVALID_PDU_ERROR
type: Number
summary: The attribute Protocol Data Unit (PDU) is invalid.
permission: read-only
platforms: [iphone, ipad]
since: "1.0.0"
- name: ATT_INSUFFICIENT_AUTHENTICATION_ERROR
type: Number
summary: Reading or writing the attribute’s value failed for lack of authentication.
permission: read-only
platforms: [android, iphone, ipad]
since: {android: "1.1.0", iphone: "1.0.0", ipad: "1.0.0"}
- name: ATT_REQUEST_NOT_SUPPORTED_ERROR
type: Number
summary: The attribute server doesn’t support the request received from the client.
permission: read-only
platforms: [android, iphone, ipad]
since: {android: "1.1.0", iphone: "1.0.0", ipad: "1.0.0"}
- name: ATT_INVALID_OFFSET_ERROR
type: Number
summary: The specified offset value was past the end of the attribute’s value.
permission: read-only
platforms: [android, iphone, ipad]
since: {android: "1.1.0", iphone: "1.0.0", ipad: "1.0.0"}
- name: ATT_INSUFFICIENT_AUTHORIZATION_ERROR
type: Number
summary: Reading or writing the attribute’s value failed for lack of authorization.
permission: read-only
platforms: [android, iphone, ipad]
since: {android: "1.1.0", iphone: "1.0.0", ipad: "1.0.0"}
- name: ATT_PREPARE_QUEUE_FULL_ERROR
type: Number
summary: The prepare queue is full, as a result of there being too many write requests in the queue.
permission: read-only
platforms: [iphone, ipad]
since: "1.0.0"
- name: ATT_ATTRIBUTE_NOT_FOUND_ERROR
type: Number
summary: The attribute wasn’t found within the specified attribute handle range.
permission: read-only
platforms: [iphone, ipad]
since: "1.0.0"
- name: ATT_ATTRIBUTE_NOT_LONG_ERROR
type: Number
summary: The ATT read blob request can’t read or write the attribute.
permission: read-only
platforms: [iphone, ipad]
since: "1.0.0"
- name: ATT_INSUFFICIENT_ENCRYPTION_KEY_SIZE_ERROR
type: Number
summary: The encryption key size used for encrypting this link is insufficient.
permission: read-only
platforms: [iphone, ipad]
since: "1.0.0"
- name: ATT_INVALID_ATTRIBUTE_VALUE_LENGTH_ERROR
type: Number
summary: The length of the attribute’s value is invalid for the intended operation.
permission: read-only
platforms: [android, iphone, ipad]
since: {android: "1.1.0", iphone: "1.0.0", ipad: "1.0.0"}
- name: ATT_UNLIKELY_ERROR
type: Number
summary: The ATT request encountered an unlikely error and wasn’t completed.
permission: read-only
platforms: [iphone, ipad]
since: "1.0.0"
- name: ATT_INSUFFICIENT_ENCRYPTION_ERROR
type: Number
summary: Reading or writing the attribute’s value failed for lack of encryption.
permission: read-only
platforms: [android, iphone, ipad]
since: {android: "1.1.0", iphone: "1.0.0", ipad: "1.0.0"}
- name: ATT_UNSUPPORTED_GROUP_TYPE_ERROR
type: Number
summary: The attribute type isn’t a supported grouping attribute as defined by a higher-layer specification.
permission: read-only
platforms: [iphone, ipad]
since: "1.0.0"
- name: ATT_INSUFFICIENT_RESOURCES_ERROR
type: Number
summary: Resources are insufficient to complete the ATT request.
permission: read-only
platforms: [iphone, ipad]
since: "1.0.0"
- name: PERIPHERAL_MANAGER_CONNECTION_LATENCY_LOW
type: Number
summary: A latency setting indicating that prioritizes rapid communication over battery life.
permission: read-only
platforms: [iphone, ipad]
since: "1.0.0"
- name: PERIPHERAL_MANAGER_CONNECTION_LATENCY_MEDIUM
type: Number
summary: A latency setting that balances communication frequency and battery life.
permission: read-only
platforms: [iphone, ipad]
since: "1.0.0"
- name: PERIPHERAL_MANAGER_CONNECTION_LATENCY_HIGH
type: Number
summary: A latency setting that prioritizes extending battery life over rapid communication.
permission: read-only
platforms: [iphone, ipad]
since: "1.0.0"
- name: MANAGER_STATE_TURNING_OFF
summary: One of the possible values returned by the [state](Modules.BLE.state) property.
This value indicates that the local Bluetooth adapter is turning off.
description: |
Listen for the [didUpdateState](Modules.BLE.didUpdateState) event to be notified when the
local Bluetooth adapter is turning off.
since: "1.0.0"
platforms: [android]
type: Number
permission: read-only
- name: MANAGER_STATE_TURNING_ON
summary: One of the possible values returned by the [state](Modules.BLE.state) property.
This value indicates that the local Bluetooth adapter is turning on.
description: |
Listen for the [didUpdateState](Modules.BLE.didUpdateState) event to be notified when the
local Bluetooth adapter is turning on.
since: "1.0.0"
platforms: [android]
type: Number
permission: read-only
- name: CHARACTERISTIC_TYPE_WRITE_WITH_RESPONSE
type: Number
summary: Write a characteristic value, without any response from the peripheral to indicate whether the write was successful.
permission: read-only
platforms: [iphone, ipad, android]
since: "1.0.0"
- name: CHARACTERISTIC_TYPE_WRITE_WITHOUT_RESPONSE
type: Number
summary: Write a characteristic value, with a response from the peripheral to indicate whether the write was successful.
permission: read-only
platforms: [iphone, ipad, android]
since: "1.0.0"
- name: CONNECTION_PRIORITY_HIGH
type: Number
summary: For a high priority, low latency connection.
permission: read-only
platforms: [android]
since: "1.0.0"
- name: CONNECTION_PRIORITY_BALANCED
type: Number
summary: Connection parameter recommended by the Bluetooth SIG.
permission: read-only
platforms: [android]
since: "1.0.0"
- name: CONNECTION_PRIORITY_LOW_POWER
type: Number
summary: For a low power, reduced data rate connection.
permission: read-only
platforms: [android]
since: "1.0.0"
- name: ENABLE_NOTIFICATION_VALUE
type: Titanium.Buffer
summary: Value used to enable notification for a client configuration descriptor. You may pass this constant to the subscribeToCharacteristic method.
permission: read-only
platforms: [android]
since: "1.0.0"
- name: ENABLE_INDICATION_VALUE
type: Titanium.Buffer
summary: Value used to enable indication for a client configuration descriptor. You may pass this constant to the subscribeToCharacteristic method.
permission: read-only
platforms: [android]
since: "1.0.0"
- name: DISABLE_NOTIFICATION_VALUE
type: Titanium.Buffer
summary: Value used to disable notifications or indications for a client configuration descriptor. You may pass this constant to the unsubscribeFromCharacteristic method.
permission: read-only
platforms: [android]
since: "1.0.0"
- name: DESCRIPTOR_PERMISSION_READ
type: Number
summary: A read permission for descriptor.
permission: read-only
platforms: [android]
since: "1.1.0"
- name: DESCRIPTOR_PERMISSION_READ_ENCRYPTED
type: Number
summary: An encrypted read permission for descriptor.
permission: read-only
platforms: [android]
since: "1.1.0"
- name: DESCRIPTOR_PERMISSION_WRITE
type: Number
summary: A write permission for descriptor.
permission: read-only
platforms: [android]
since: "1.1.0"
- name: DESCRIPTOR_PERMISSION_WRITE_ENCRYPTED
type: Number
summary: An encrypted write permission for descriptor.
permission: read-only
platforms: [android]
since: "1.1.0"
- name: LOCATION_MANAGER_AUTHORIZATION_STATUS_AUTHORIZED_ALWAYS
type: Number
summary: User has granted authorization to use their location only while they are using your app.
permission: read-only
platforms: [iphone, ipad]
since: "1.1.0"
- name: LOCATION_MANAGER_AUTHORIZATION_STATUS_AUTHORIZED_WHEN_IN_USE
type: Number
summary: Write a characteristic value, with a response from the peripheral to indicate whether the write was successful.
permission: read-only
platforms: [iphone, ipad]
since: "1.1.0"
- name: LOCATION_MANAGER_AUTHORIZATION_STATUS_DENIED
type: Number
summary: User has explicitly denied authorization for this application, or location services are disabled in Settings.
permission: read-only
platforms: [iphone, ipad]
since: "1.1.0"
- name: LOCATION_MANAGER_AUTHORIZATION_STATUS_NOT_DETERMINED
type: Number
summary: User has not yet made a choice with regards to this application
permission: read-only
platforms: [iphone, ipad]
since: "1.1.0"
- name: LOCATION_MANAGER_AUTHORIZATION_STATUS_RESTRICTED
type: Number
summary: This application is not authorized to use location services. Due to active restrictions on location services, the user cannot change this status, and may not have personally denied authorization
permission: read-only
platforms: [iphone, ipad]
since: "1.1.0"
- name: REGION_STATE_UNKNOWN
type: Number
summary: The current state of the device with reference to a region is unknown
permission: read-only
platforms: [iphone, ipad]
since: "1.1.0"
- name: REGION_STATE_INSIDE
type: Number
summary: The current state of the device with reference to a region is inside
permission: read-only
platforms: [iphone, ipad]
since: "1.1.0"
- name: REGION_STATE_OUTSIDE
type: Number
summary: The current state of the device with reference to a region is outside
permission: read-only
platforms: [iphone, ipad]
since: "1.1.0"
- name: BEACON_PROXIMITY_UNKNOWN
type: Number
summary: current state of the device with reference to a region is unknown
permission: read-only
platforms: [iphone, ipad]
since: "1.1.0"
- name: BEACON_PROXIMITY_IMMEDIATE
type: Number
summary: current state of the device with reference to a region is immediate
permission: read-only
platforms: [iphone, ipad]
since: "1.1.0"
- name: BEACON_PROXIMITY_NEAR
type: Number
summary: current state of the device with reference to a region is near
permission: read-only
platforms: [iphone, ipad]
since: "1.1.0"
- name: BEACON_PROXIMITY_FAR
type: Number
summary: current state of the device with reference to a region is far
permission: read-only
platforms: [iphone, ipad]
since: "1.1.0"
- name: SCAN_MODE_LOW_POWER
type: Number
summary: Perform Bluetooth LE scan in low power mode. This is the default scan mode as it consumes the least power. This mode is enforced if the scanning application is not in foreground.
permission: read-only
platforms: [android]
since: "2.1.0"
- name: SCAN_MODE_LOW_LATENCY
type: Number
summary: Scan using highest duty cycle. It's recommended to only use this mode when the application is running in the foreground.
permission: read-only
platforms: [android]
since: "2.1.0"
- name: SCAN_MODE_OPPORTUNISTIC
type: Number
summary: A special Bluetooth LE scan mode. Applications using this scan mode will passively listen for other scan results without starting BLE scans themselves.
permission: read-only
platforms: [android]
since: "2.1.0"
- name: SCAN_MODE_BALANCED
type: Number
summary: Perform Bluetooth LE scan in balanced power mode. Scan results are returned at a rate that provides a good trade-off between scan frequency and power consumption.
permission: read-only
platforms: [android]
since: "2.1.0"
methods:
- name: initCentralManager
summary: Initializes the module's central manager. This function must be called in an app that acts as a central before any other function can be used.
platforms: [android, iphone, ipad]
since: "1.0.0"
parameters:
- name: showPowerAlert
type: Boolean
summary: A Boolean value that specifies whether the system warns the user if the app instantiates the central manager when Bluetooth service isn’t available.
- name: restoreIdentifier
type: String
summary: A string containing a unique identifier (UID) for the central manager to instantiate.
- name: scanMode
type: Number
summary: Android only. defines the scan mode. Use one of the `SCAN_MODE_*` constants.
returns:
type: Modules.BLE.CentralManager
- name: initPeripheralManager
summary: Initializes the module's peripheral manager object. This function must be called in an app that acts as a peripheral before any other function can be used.
platforms: [android, iphone, ipad]
since: {android: "1.1.0", iphone: "1.0.0", ipad: "1.0.0"}
parameters:
- name: showPowerAlert
type: Boolean
summary: A Boolean value that specifies whether the system warns the user if the app instantiates the peripheral manager when Bluetooth service isn’t available.
- name: restoreIdentifier
type: String
summary: A string containing a unique identifier (UID) for the peripheral manager to instantiate.
returns:
type: Modules.BLE.PeripheralManager
- name: createBeaconRegion
summary: create Beacon Region.
platforms: [iphone, ipad]
since: "1.1.0"
parameters:
- name: uuid
type: String
summary: The value of uuid.
- name: identifier
type: String
summary: The value of beacon identifier.
- name: major
type: Number
summary: The value of major.
- name: minor
type: Number
summary: The value of minor.
returns:
type: Modules.BLE.BeaconRegion
- name: createDescriptor
summary: create descriptor.
platforms: [android, iphone, ipad]
since: {android: "1.1.0", iphone: "1.0.0", ipad: "1.0.0"}
parameters:
- name: value
type: Object
summary: The value of descriptor.
- name: uuid
type: String
summary: The Bluetooth-specific UUID of the descriptor.
- name: permission
type: Number
summary: The permission for descriptor. This parameter is only for android. In android, the
permissions can be different for characteristic and descriptor. If Characteristic have the
read permission then it is only readable and if descriptor have the write permission, then
it is only writable.
optional: false
returns:
type: Modules.BLE.Descriptor
- name: createMutableCharacteristic
summary: create mutable characteristic.
platforms: [android, iphone, ipad]
since: {android: "1.1.0", iphone: "1.0.0", ipad: "1.0.0"}
parameters:
- name: properties
type: Array<Number>
summary: Characteristic properties determine how the characteristic value can be used, or how the descriptor(s) can be accessed.
- name: permissions
type: Array<Number>
summary: The permissions of the characteristic value.
- name: uuid
type: String
summary: The Bluetooth-specific UUID of the characteristic.
- name: descriptors
type: Array<Modules.BLE.Descriptor>
summary: An array of the characteristic’s descriptors.
returns:
type: Modules.BLE.MutableCharacteristic
- name: createBeaconIdentityConstraint
summary: create a constraint that describes the identity caracteristics of a beacon.
platforms: [iphone, ipad]
osver: {ios: {min: "13.0"}}
since: "1.1.0"
parameters:
- name: uuid
type: String
summary: UUID associated with the constraint.
- name: major
type: Number
summary: Most significant value associated with the constraint. If a major value wasn't specified, this will be nil.
- name: minor
type: Number
summary: Least significant value associated with the constraint. If a minor value wasn't specified, this will be nil.
returns:
type: Modules.BLE.BeaconIdentityConstraint
- name: createRegionManager
summary: create a region manager to scan beacons.
platforms: [iphone, ipad]
since: "1.1.0"
returns:
type: Modules.BLE.RegionManager
- name: disable
summary: Disables the local Bluetooth adapter.
description: |
This method requires bluetooth permissions to successfully work. To check
whether these permissions are granted or not, call
[isBluetoothAndBluetoothAdminPermissionsGranted](Modules.BLE.isBluetoothAndBluetoothAdminPermissionsGranted) method.
Listen for the [didUpdateState](Modules.BLE.didUpdateState) event to be notified when the local
Bluetooth adapter is turning off.
since: "1.0.0"
platforms: [android]
returns:
type: "Boolean"
summary: "Returns true if the process is initiated successfully or when the bluetooth is already off."
- name: enable
summary: Enables the local Bluetooth adapter.
description: |
This method requires bluetooth permissions to successfully work. To check
whether these permissions are granted or not, call
[isBluetoothAndBluetoothAdminPermissionsGranted](Modules.BLE.isBluetoothAndBluetoothAdminPermissionsGranted) method.
Listen for the [didUpdateState](Modules.BLE.didUpdateState) event to be notified when the local
Bluetooth adapter is turning on.
since: "1.0.0"
platforms: [android]
returns:
type: "Boolean"
summary: "Returns true if the process is initiated successfully or when the bluetooth is already on."
- name: isEnabled
summary: Determines if Bluetooth is currently enabled and ready for use.
since: "1.0.0"
platforms: [android]
returns:
type: "Boolean"
summary: "Returns true if the local adapter is on."
- name: isBluetoothAndBluetoothAdminPermissionsGranted
summary: Determines if bluetooth permissions have been granted.
description: |
If this method returns `false`, then you'll need to call the