pyobjc-framework-IOBluetooth 12.2__cp315-cp315-macosx_10_15_universal2.whl

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.
@@ -0,0 +1,38 @@
1
+ """
2
+ Python mapping for the IOBluetooth framework.
3
+
4
+ This module does not contain docstrings for the wrapped code, check Apple's
5
+ documentation for details on how to use these functions and classes.
6
+ """
7
+
8
+
9
+ def _setup():
10
+ import sys
11
+
12
+ import AppKit
13
+ import objc
14
+ from . import _metadata, _funcmacros, _IOBluetooth
15
+
16
+ dir_func, getattr_func = objc.createFrameworkDirAndGetattr(
17
+ name="IOBluetooth",
18
+ frameworkIdentifier="com.apple.Bluetooth",
19
+ frameworkPath=objc.pathForFramework(
20
+ "/System/Library/Frameworks/IOBluetooth.framework"
21
+ ),
22
+ globals_dict=globals(),
23
+ inline_list=None,
24
+ parents=(
25
+ _IOBluetooth,
26
+ _funcmacros,
27
+ AppKit,
28
+ ),
29
+ metadict=_metadata.__dict__,
30
+ )
31
+
32
+ globals()["__dir__"] = dir_func
33
+ globals()["__getattr__"] = getattr_func
34
+
35
+ del sys.modules["IOBluetooth._metadata"]
36
+
37
+
38
+ globals().pop("_setup")()
@@ -0,0 +1,128 @@
1
+ from CoreFoundation import CFSwapInt16HostToLittle, CFSwapInt16LittleToHost
2
+
3
+ IOBluetooth = None
4
+
5
+
6
+ def BluetoothCoDMinorPeripheral1(minorClass):
7
+ return minorClass & 0x30
8
+
9
+
10
+ def BluetoothCoDMinorPeripheral2(minorClass):
11
+ return minorClass & 0x0F
12
+
13
+
14
+ def BluetoothGetDeviceClassMajor(inCOD):
15
+ return ((inCOD) & 0x00001F00) >> 8
16
+
17
+
18
+ def BluetoothGetDeviceClassMinor(inCOD):
19
+ return ((inCOD) & 0x000000FC) >> 2
20
+
21
+
22
+ def BluetoothGetSecondsFromSlots(inSlots):
23
+ return inSlots * 0.000625
24
+
25
+
26
+ def BluetoothGetServiceClassMajor(inCOD):
27
+ return ((inCOD) & 0x00FFE000) >> 13
28
+
29
+
30
+ def BluetoothGetSlotsFromSeconds(inSeconds):
31
+ return inSeconds / 0.000625
32
+
33
+
34
+ def BluetoothHCIExtractCommandOpCodeCommand(OPCODE):
35
+ return (OPCODE) & 0x03FF
36
+
37
+
38
+ def BluetoothHCIExtractCommandOpCodeGroup(OPCODE):
39
+ return ((OPCODE) >> 10) & 0x003F
40
+
41
+
42
+ def BluetoothHCIMakeCommandOpCode(GROUP, CMD):
43
+ return (((GROUP) & 0x003F) << 10) | ((CMD) & 0x03FF)
44
+
45
+
46
+ def BluetoothHCIMakeCommandOpCodeEndianSwap(GROUP, CMD):
47
+ return CFSwapInt16HostToLittle(BluetoothHCIMakeCommandOpCode(GROUP, CMD))
48
+
49
+
50
+ def BluetoothHCIMakeCommandOpCodeHostOrder(GROUP, CMD):
51
+ return CFSwapInt16LittleToHost((((GROUP) & 0x003F) << 10) | ((CMD) & 0x03FF))
52
+
53
+
54
+ def BluetoothMakeClassOfDevice(
55
+ inServiceClassMajor, inDeviceClassMajor, inDeviceClassMinor
56
+ ):
57
+ return (
58
+ (((inServiceClassMajor) << 13) & 0x00FFE000)
59
+ | (((inDeviceClassMajor) << 8) & 0x00001F00)
60
+ | (((inDeviceClassMinor) << 2) & 0x000000FC)
61
+ )
62
+
63
+
64
+ def GET_HEADER_ID_IS_1_BYTE_QUANTITY(HEADER_ID):
65
+ return (HEADER_ID & 0xC0) == 0x80
66
+
67
+
68
+ def GET_HEADER_ID_IS_4_BYTE_QUANTITY(HEADER_ID):
69
+ return (HEADER_ID & 0xC0) == 0xC0
70
+
71
+
72
+ def GET_HEADER_ID_IS_BYTE_SEQUENCE(HEADER_ID):
73
+ return (HEADER_ID & 0xC0) == 0x40
74
+
75
+
76
+ def GET_HEADER_ID_IS_NULL_TERMINATED_UNICODE_TEXT(HEADER_ID):
77
+ return (HEADER_ID & 0xC0) == 0x00
78
+
79
+
80
+ def IS_RESPONSE_CODE_FINAL_BIT_SET(RESPONSE_CODE):
81
+ return RESPONSE_CODE >> 7
82
+
83
+
84
+ def SET_HEADER_ID_IS_1_BYTE_QUANTITY(HEADER_ID):
85
+ return (HEADER_ID & 0x3F) | 0x80
86
+
87
+
88
+ def SET_HEADER_ID_IS_4_BYTE_QUANTITY(HEADER_ID):
89
+ return (HEADER_ID & 0x3F) | 0xC0
90
+
91
+
92
+ def SET_HEADER_ID_IS_BYTE_SEQUENCE(HEADER_ID):
93
+ return (HEADER_ID & 0x3F) | 0x40
94
+
95
+
96
+ def SET_HEADER_ID_IS_NULL_TERMINATED_UNICODE_TEXT(HEADER_ID):
97
+ return HEADER_ID & 0x3F
98
+
99
+
100
+ def STRIP_RESPONSE_CODE_FINAL_BIT(RESPONSE_CODE):
101
+ return RESPONSE_CODE & 0x7F
102
+
103
+
104
+ def IS_REQUEST_PDU(_pduID):
105
+ global IOBluetooth
106
+ if IOBluetooth is None:
107
+ import IOBluetooth
108
+ return (
109
+ (_pduID == IOBluetooth.kBluetoothSDPPDUIDServiceSearchRequest)
110
+ or (_pduID == IOBluetooth.kBluetoothSDPPDUIDServiceAttributeRequest)
111
+ or (_pduID == IOBluetooth.kBluetoothSDPPDUIDServiceSearchAttributeRequest)
112
+ )
113
+
114
+
115
+ def IS_RESPONSE_PDU(_pduID):
116
+ global IOBluetooth
117
+ if IOBluetooth is None:
118
+ import IOBluetooth
119
+ return (
120
+ (_pduID == IOBluetooth.kBluetoothSDPPDUIDErrorResponse)
121
+ or (_pduID == IOBluetooth.kBluetoothSDPPDUIDServiceSearchResponse)
122
+ or (_pduID == IOBluetooth.kBluetoothSDPPDUIDServiceAttributeResponse)
123
+ or (_pduID == IOBluetooth.kBluetoothSDPPDUIDServiceSearchAttributeResponse)
124
+ )
125
+
126
+
127
+ def RFCOMM_CHANNEL_ID_IS_VALID(CHANNEL):
128
+ return (CHANNEL >= 1) and (CHANNEL <= 30)