1#!/usr/bin/env python3
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
49class ScanSettingsReportDelaySeconds(Enum):
50    MIN = 0
51    MAX = 9223372036854775807
52
53class ScanSettingsPhy(Enum):
54    PHY_LE_1M = 1
55    PHY_LE_CODED = 3
56    PHY_LE_ALL_SUPPORTED = 255
57
58class AdvertiseSettingsAdvertiseType(Enum):
59    ADVERTISE_TYPE_NON_CONNECTABLE = 0
60    ADVERTISE_TYPE_CONNECTABLE = 1
61
62
63class AdvertiseSettingsAdvertiseMode(Enum):
64    ADVERTISE_MODE_LOW_POWER = 0
65    ADVERTISE_MODE_BALANCED = 1
66    ADVERTISE_MODE_LOW_LATENCY = 2
67
68
69class AdvertiseSettingsAdvertiseTxPower(Enum):
70    ADVERTISE_TX_POWER_ULTRA_LOW = 0
71    ADVERTISE_TX_POWER_LOW = 1
72    ADVERTISE_TX_POWER_MEDIUM = 2
73    ADVERTISE_TX_POWER_HIGH = 3
74
75
76class JavaInteger(Enum):
77    MIN = -2147483648
78    MAX = 2147483647
79
80
81class Uuids(Enum):
82    P_Service = "0000feef-0000-1000-8000-00805f9b34fb"
83    HR_SERVICE = "0000180d-0000-1000-8000-00805f9b34fb"
84
85
86class AdvertiseErrorCode(Enum):
87    DATA_TOO_LARGE = 1
88    TOO_MANY_ADVERTISERS = 2
89    ADVERTISE_ALREADY_STARTED = 3
90    BLUETOOTH_INTERNAL_FAILURE = 4
91    FEATURE_NOT_SUPPORTED = 5
92
93
94class BluetoothAdapterState(Enum):
95    STATE_OFF = 10
96    STATE_TURNING_ON = 11
97    STATE_ON = 12
98    STATE_TURNING_OFF = 13
99    STATE_BLE_TURNING_ON = 14
100    STATE_BLE_ON = 15
101    STATE_BLE_TURNING_OFF = 16
102