• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#/usr/bin/env python3.4
2#
3# Copyright (C) 2016 The Android Open Source Project
4#
5# Licensed under the Apache License, Version 2.0 (the "License"); you may not
6# use this file except in compliance with the License. You may obtain a copy of
7# the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14# License for the specific language governing permissions and limitations under
15# the License.
16
17from enum import Enum
18
19
20class ScanSettingsCallbackType(Enum):
21    CALLBACK_TYPE_ALL_MATCHES = 1
22    CALLBACK_TYPE_FIRST_MATCH = 2
23    CALLBACK_TYPE_MATCH_LOST = 4
24    CALLBACK_TYPE_FOUND_AND_LOST = 6
25
26
27class ScanSettingsMatchMode(Enum):
28    AGGRESIVE = 1
29    STICKY = 2
30
31
32class ScanSettingsMatchNum(Enum):
33    MATCH_NUM_ONE_ADVERTISEMENT = 1
34    MATCH_NUM_FEW_ADVERTISEMENT = 2
35    MATCH_NUM_MAX_ADVERTISEMENT = 3
36
37
38class ScanSettingsScanResultType(Enum):
39    SCAN_RESULT_TYPE_FULL = 0
40    SCAN_RESULT_TYPE_ABBREVIATED = 1
41
42
43class ScanSettingsScanMode(Enum):
44    SCAN_MODE_OPPORTUNISTIC = -1
45    SCAN_MODE_LOW_POWER = 0
46    SCAN_MODE_BALANCED = 1
47    SCAN_MODE_LOW_LATENCY = 2
48
49
50class ScanSettingsReportDelaySeconds(Enum):
51    MIN = 0
52    MAX = 9223372036854775807
53
54
55class AdvertiseSettingsAdvertiseType(Enum):
56    ADVERTISE_TYPE_NON_CONNECTABLE = 0
57    ADVERTISE_TYPE_CONNECTABLE = 1
58
59
60class AdvertiseSettingsAdvertiseMode(Enum):
61    ADVERTISE_MODE_LOW_POWER = 0
62    ADVERTISE_MODE_BALANCED = 1
63    ADVERTISE_MODE_LOW_LATENCY = 2
64
65
66class AdvertiseSettingsAdvertiseTxPower(Enum):
67    ADVERTISE_TX_POWER_ULTRA_LOW = 0
68    ADVERTISE_TX_POWER_LOW = 1
69    ADVERTISE_TX_POWER_MEDIUM = 2
70    ADVERTISE_TX_POWER_HIGH = 3
71
72
73class JavaInteger(Enum):
74    MIN = -2147483648
75    MAX = 2147483647
76
77
78class Uuids(Enum):
79    P_Service = "0000feef-0000-1000-8000-00805f9b34fb"
80    HR_SERVICE = "0000180d-0000-1000-8000-00805f9b34fb"
81
82
83class AdvertiseErrorCode(Enum):
84    DATA_TOO_LARGE = 1
85    TOO_MANY_ADVERTISERS = 2
86    ADVERTISE_ALREADY_STARTED = 3
87    BLUETOOTH_INTERNAL_FAILURE = 4
88    FEATURE_NOT_SUPPORTED = 5
89
90
91class BluetoothAdapterState(Enum):
92    STATE_OFF = 10
93    STATE_TURNING_ON = 11
94    STATE_ON = 12
95    STATE_TURNING_OFF = 13
96    STATE_BLE_TURNING_ON = 14
97    STATE_BLE_ON = 15
98    STATE_BLE_TURNING_OFF = 16
99