├── .github
└── logo.png
├── .gitignore
├── LICENSE
├── README.md
├── app
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── sirvar
│ │ └── bluetoothkit
│ │ └── ExampleInstrumentedTest.kt
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── sirvar
│ │ │ └── bluetoothkit
│ │ │ └── MainActivity.kt
│ └── res
│ │ ├── drawable-v24
│ │ └── ic_launcher_foreground.xml
│ │ ├── drawable
│ │ └── ic_launcher_background.xml
│ │ ├── layout
│ │ └── activity_main.xml
│ │ ├── mipmap-anydpi-v26
│ │ ├── ic_launcher.xml
│ │ └── ic_launcher_round.xml
│ │ ├── mipmap-hdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-mdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ └── values
│ │ ├── colors.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── com
│ └── sirvar
│ └── bluetoothkit
│ └── ExampleUnitTest.kt
├── bluetoothkit
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── sirvar
│ │ └── bluetoothkit
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ └── java
│ │ └── com
│ │ └── sirvar
│ │ └── bluetoothkit
│ │ ├── BluetoothKit.kt
│ │ ├── BluetoothKitSecuredSocket.kt
│ │ ├── BluetoothKitSocket.kt
│ │ └── BluetoothKitSocketInterface.kt
│ └── test
│ └── java
│ └── com
│ └── sirvar
│ └── bluetoothkit
│ └── ExampleUnitTest.java
├── build.gradle
├── docs
├── alltypes
│ └── index.html
├── com.sirvar.bluetoothkit
│ ├── -bluetooth-kit-secured-socket
│ │ ├── -init-.html
│ │ ├── close.html
│ │ ├── connect.html
│ │ ├── index.html
│ │ ├── input-stream.html
│ │ └── output-stream.html
│ ├── -bluetooth-kit-socket-interface
│ │ ├── close.html
│ │ ├── connect.html
│ │ ├── device-address.html
│ │ ├── device-name.html
│ │ ├── index.html
│ │ ├── input-stream.html
│ │ ├── output-stream.html
│ │ └── socket.html
│ ├── -bluetooth-kit-socket
│ │ ├── -init-.html
│ │ ├── close.html
│ │ ├── connect.html
│ │ ├── device-address.html
│ │ ├── device-name.html
│ │ ├── index.html
│ │ ├── input-stream.html
│ │ ├── output-stream.html
│ │ └── socket.html
│ ├── -bluetooth-kit
│ │ ├── -init-.html
│ │ ├── connect.html
│ │ ├── disable.html
│ │ ├── disconnect.html
│ │ ├── enable.html
│ │ ├── get-bluetooth-adapter.html
│ │ ├── get-bluetooth-socket.html
│ │ ├── get-device-by-address.html
│ │ ├── get-device-by-name.html
│ │ ├── get-paired-devices.html
│ │ ├── index.html
│ │ └── is-enabled.html
│ └── index.html
├── index-outline.html
├── index.html
└── style.css
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
/.github/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirvar/bluetoothkit-android/4fc8c592071bdb1d4f9369e2642785a6409df7a8/.github/logo.png
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Built application files
2 | *.apk
3 | *.ap_
4 |
5 | # Files for the ART/Dalvik VM
6 | *.dex
7 |
8 | # Java class files
9 | *.class
10 |
11 | # Generated files
12 | bin/
13 | gen/
14 | out/
15 |
16 | # Gradle files
17 | .gradle/
18 | build/
19 |
20 | # Local configuration file (sdk path, etc)
21 | local.properties
22 |
23 | # Proguard folder generated by Eclipse
24 | proguard/
25 |
26 | # Log Files
27 | *.log
28 |
29 | # Android Studio Navigation editor temp files
30 | .navigation/
31 |
32 | # Android Studio captures folder
33 | captures/
34 |
35 | # IntelliJ
36 | *.iml
37 | .idea/workspace.xml
38 | .idea/tasks.xml
39 | .idea/gradle.xml
40 | .idea/assetWizardSettings.xml
41 | .idea/dictionaries
42 | .idea/libraries
43 | .idea/caches
44 |
45 | # Keystore files
46 | # Uncomment the following line if you do not want to check your keystore files in.
47 | #*.jks
48 |
49 | # External native build folder generated in Android Studio 2.2 and later
50 | .externalNativeBuild
51 |
52 | # Google Services (e.g. APIs or Firebase)
53 | google-services.json
54 |
55 | # Freeline
56 | freeline.py
57 | freeline/
58 | freeline_project_description.json
59 |
60 | # fastlane
61 | fastlane/report.xml
62 | fastlane/Preview.html
63 | fastlane/screenshots
64 | fastlane/test_output
65 | fastlane/readme.md.idea
66 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 Rikin Katyal
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
77 | get() = bluetoothAdapter.bondedDevices
78 |
79 | /**
80 | * Get a paired BluetoothDevice by name
81 | * @param name paired device name to get
82 | * @return BluetoothDevice the device if it exists, else null
83 | * @see android.bluetooth.BluetoothDevice
84 | */
85 | fun getDeviceByName(name: String): BluetoothDevice? {
86 | return pairedDevices.singleOrNull { device ->
87 | device.name == name
88 | }
89 | }
90 |
91 | /**
92 | * Get a paired BluetoothDevice by MAC address
93 | * @param address MAC address of device to get
94 | * @return BluetoothDevice the device if it exists, else null
95 | * @see android.bluetooth.BluetoothDevice
96 | */
97 | fun getDeviceByAddress(address: String): BluetoothDevice? {
98 | return pairedDevices.singleOrNull { device ->
99 | device.address == address
100 | }
101 | }
102 |
103 | /**
104 | * Connect to a BluetoothDevice with a given string UUID
105 | * @param device device to connect to
106 | * @param uuid connection UUID
107 | * @return whether or not the connection was successful
108 | */
109 | fun connect(device: BluetoothDevice, uuid: String): Boolean {
110 | return connect(device, UUID.fromString(uuid))
111 | }
112 |
113 | /**
114 | * Connect to BluetoothDevice with specific UUID or a random one if not specified
115 | * @param device device to connect to
116 | * @param uuid connection UUID
117 | * @return whether or not the connection was successful
118 | */
119 | fun connect(device: BluetoothDevice, uuid: UUID = UUID.randomUUID()): Boolean {
120 | // attempt fast insecure connection
121 | bluetoothSocket = BluetoothKitSocket(device.createRfcommSocketToServiceRecord(uuid))
122 | return try {
123 | bluetoothSocket.connect()
124 | true
125 | } catch (e: IOException) {
126 | Log.w(TAG, "Connection failed. Trying to establish a secure connection")
127 | try {
128 | // attempt slow secured connection
129 | bluetoothSocket = BluetoothKitSecuredSocket(bluetoothSocket.socket)
130 | try {
131 | bluetoothSocket.connect()
132 | true
133 | } catch (e: IOException) {
134 | Log.w(TAG, "Secure connection failed. Stopping.", e)
135 | false
136 | }
137 | } catch (e: IllegalStateException) {
138 | Log.w(TAG, "Could not create secure connection. Stopping.", e)
139 | false
140 | }
141 | } catch (e: Exception) {
142 | Log.w(TAG, "Could not connect to device. Stopping.", e)
143 | false
144 | }
145 | }
146 |
147 | /**
148 | * Write Int byte to the output stream
149 | * @param b the byte
150 | */
151 | fun write(b: Int) {
152 | bluetoothSocket.outputStream.write(b)
153 | }
154 |
155 | /**
156 | * Write ByteArray to the output stream with offset and length
157 | * @param b the data
158 | * @param off the start offset in the data (defaults to 0)
159 | * @param len the number of bytes to write (defaults to the total number of bytes)
160 | */
161 | fun write(b: ByteArray, off: Int = 0, len: Int = b.size) {
162 | bluetoothSocket.outputStream.write(b, off, len)
163 | }
164 |
165 | /**
166 | * Reads next byte of data
167 | * @return the total number of bytes read into the buffer, or -1 if there is no more data
168 | */
169 | fun read(): Int {
170 | return bluetoothSocket.inputStream.read()
171 | }
172 |
173 | /**
174 | * Reads up to len bytes of data from the input stream into an array of bytes
175 | * @param b the data
176 | * @param off the start offset in the data (defaults to 0)
177 | * @param len the max number of bytes to write (defaults to the total number of bytes)
178 | * @return the total number of bytes read into the buffer, or -1 if there is no more data
179 | */
180 | fun read(b: ByteArray, off: Int = 0, len: Int = b.size): Int {
181 | return bluetoothSocket.inputStream.read(b, off, len)
182 | }
183 |
184 | /**
185 | * Closes all IO streams and terminates the socket.
186 | * NOTE: does not turn off bluetooth
187 | */
188 | fun disconnect() {
189 | bluetoothSocket.inputStream.close()
190 | bluetoothSocket.outputStream.close()
191 | bluetoothSocket.close()
192 | }
193 | }
194 |
--------------------------------------------------------------------------------
/bluetoothkit/src/main/java/com/sirvar/bluetoothkit/BluetoothKitSecuredSocket.kt:
--------------------------------------------------------------------------------
1 | package com.sirvar.bluetoothkit
2 |
3 | import android.bluetooth.BluetoothSocket
4 | import java.io.InputStream
5 | import java.io.OutputStream
6 | import java.lang.reflect.Method
7 |
8 | /**
9 | * Secured Bluetooth Socket wrapper with low level method invocation
10 | * @author Rikin Katyal
11 | */
12 | class BluetoothKitSecuredSocket(bluetoothSocket: BluetoothSocket) : BluetoothKitSocket(bluetoothSocket) {
13 |
14 | private val securedSocket: BluetoothSocket
15 |
16 | init {
17 | val bluetoothDeviceClass = bluetoothSocket.remoteDevice.javaClass
18 | // createRfcommSocket has 2 overloaded methods, we want channel type int
19 | val intParamType = arrayOf(Integer.TYPE)
20 | val method: Method? = bluetoothDeviceClass.getMethod("createRfcommSocket", *intParamType)
21 | val securedSocket = method?.invoke(socket.remoteDevice, 1)
22 | ?: throw IllegalStateException("Unable to create a secure socket using reflection.")
23 | this.securedSocket = securedSocket as BluetoothSocket
24 | }
25 |
26 | override val inputStream: InputStream
27 | get() = securedSocket.inputStream
28 |
29 | override val outputStream: OutputStream
30 | get() = securedSocket.outputStream
31 |
32 | override fun connect() {
33 | securedSocket.connect()
34 | }
35 |
36 | override fun close() {
37 | securedSocket.close()
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/bluetoothkit/src/main/java/com/sirvar/bluetoothkit/BluetoothKitSocket.kt:
--------------------------------------------------------------------------------
1 | package com.sirvar.bluetoothkit
2 |
3 | import android.bluetooth.BluetoothSocket
4 | import java.io.InputStream
5 | import java.io.OutputStream
6 |
7 | /**
8 | * Bluetooth Socket wrapper
9 | * @author Rikin Katyal
10 | */
11 | open class BluetoothKitSocket(override val socket: BluetoothSocket) : BluetoothKitSocketInterface {
12 |
13 | override val inputStream: InputStream
14 | get() = socket.inputStream
15 | override val outputStream: OutputStream
16 | get() = socket.outputStream
17 | override val deviceName: String
18 | get() = socket.remoteDevice.name
19 | override val deviceAddress: String
20 | get() = socket.remoteDevice.address
21 |
22 | override fun connect() {
23 | socket.connect()
24 | }
25 |
26 | override fun close() {
27 | socket.close()
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/bluetoothkit/src/main/java/com/sirvar/bluetoothkit/BluetoothKitSocketInterface.kt:
--------------------------------------------------------------------------------
1 | package com.sirvar.bluetoothkit
2 |
3 | import android.bluetooth.BluetoothSocket
4 | import java.io.IOException
5 | import java.io.InputStream
6 | import java.io.OutputStream
7 |
8 | /**
9 | * Bluetooth Socket interface for primary functions
10 | * @author Rikin Katyal
11 | */
12 | interface BluetoothKitSocketInterface {
13 |
14 | val inputStream: InputStream
15 | val outputStream: OutputStream
16 | val deviceName: String
17 | val deviceAddress: String
18 | val socket: BluetoothSocket
19 |
20 | @Throws(IOException::class)
21 | fun connect()
22 |
23 | @Throws(IOException::class)
24 | fun close()
25 | }
26 |
--------------------------------------------------------------------------------
/bluetoothkit/src/test/java/com/sirvar/bluetoothkit/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.sirvar.bluetoothkit;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 |
5 | ext {
6 | kotlin_version = '1.3.11'
7 | }
8 |
9 | repositories {
10 | google()
11 | jcenter()
12 | }
13 | dependencies {
14 | classpath 'com.android.tools.build:gradle:3.2.1'
15 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
16 | // NOTE: Do not place your application dependencies here; they belong
17 | // in the individual module build.gradle files
18 | }
19 | }
20 |
21 | allprojects {
22 | repositories {
23 | google()
24 | jcenter()
25 | }
26 | }
27 |
28 | task clean(type: Delete) {
29 | delete rootProject.buildDir
30 | }
31 |
--------------------------------------------------------------------------------
/docs/alltypes/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | alltypes -
5 |
6 |
7 |
8 | All Types
9 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/docs/com.sirvar.bluetoothkit/-bluetooth-kit-secured-socket/-init-.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | BluetoothKitSecuredSocket. -
5 |
6 |
7 |
8 | com.sirvar.bluetoothkit / BluetoothKitSecuredSocket / <init>
9 |
10 | <init>
11 | BluetoothKitSecuredSocket(bluetoothSocket: <ERROR CLASS>)
12 | Secured Bluetooth Socket wrapper with low level method invocation
13 | Author
14 | Rikin Katyal
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/com.sirvar.bluetoothkit/-bluetooth-kit-secured-socket/close.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | BluetoothKitSecuredSocket.close -
5 |
6 |
7 |
8 | com.sirvar.bluetoothkit / BluetoothKitSecuredSocket / close
9 |
10 | close
11 |
12 | fun close(): Unit
13 | Overrides BluetoothKitSocket.close
14 |
15 |
16 |
--------------------------------------------------------------------------------
/docs/com.sirvar.bluetoothkit/-bluetooth-kit-secured-socket/connect.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | BluetoothKitSecuredSocket.connect -
5 |
6 |
7 |
8 | com.sirvar.bluetoothkit / BluetoothKitSecuredSocket / connect
9 |
10 | connect
11 |
12 | fun connect(): Unit
13 | Overrides BluetoothKitSocket.connect
14 |
15 |
16 |
--------------------------------------------------------------------------------
/docs/com.sirvar.bluetoothkit/-bluetooth-kit-secured-socket/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | BluetoothKitSecuredSocket -
5 |
6 |
7 |
8 | com.sirvar.bluetoothkit / BluetoothKitSecuredSocket
9 |
10 | BluetoothKitSecuredSocket
11 | class BluetoothKitSecuredSocket : BluetoothKitSocket
12 | Secured Bluetooth Socket wrapper with low level method invocation
13 | Author
14 | Rikin Katyal
15 | Constructors
16 |
17 |
18 |
19 |
20 | <init> |
21 |
22 | BluetoothKitSecuredSocket(bluetoothSocket: <ERROR CLASS>)
23 | Secured Bluetooth Socket wrapper with low level method invocation
24 | |
25 |
26 |
27 |
28 | Properties
29 |
30 |
31 |
32 |
33 | inputStream |
34 |
35 | val inputStream: <ERROR CLASS> |
36 |
37 |
38 |
39 | outputStream |
40 |
41 | val outputStream: <ERROR CLASS> |
42 |
43 |
44 |
45 | Inherited Properties
46 |
47 |
48 |
49 |
50 | deviceAddress |
51 |
52 | open val deviceAddress: String |
53 |
54 |
55 |
56 | deviceName |
57 |
58 | open val deviceName: String |
59 |
60 |
61 |
62 | socket |
63 |
64 | open val socket: <ERROR CLASS> |
65 |
66 |
67 |
68 | Functions
69 |
70 |
71 |
72 |
73 | close |
74 |
75 | fun close(): Unit |
76 |
77 |
78 |
79 | connect |
80 |
81 | fun connect(): Unit |
82 |
83 |
84 |
85 |
86 |
87 |
--------------------------------------------------------------------------------
/docs/com.sirvar.bluetoothkit/-bluetooth-kit-secured-socket/input-stream.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | BluetoothKitSecuredSocket.inputStream -
5 |
6 |
7 |
8 | com.sirvar.bluetoothkit / BluetoothKitSecuredSocket / inputStream
9 |
10 | inputStream
11 |
12 | val inputStream: <ERROR CLASS>
13 | Overrides BluetoothKitSocket.inputStream
14 |
15 |
16 |
--------------------------------------------------------------------------------
/docs/com.sirvar.bluetoothkit/-bluetooth-kit-secured-socket/output-stream.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | BluetoothKitSecuredSocket.outputStream -
5 |
6 |
7 |
8 | com.sirvar.bluetoothkit / BluetoothKitSecuredSocket / outputStream
9 |
10 | outputStream
11 |
12 | val outputStream: <ERROR CLASS>
13 | Overrides BluetoothKitSocket.outputStream
14 |
15 |
16 |
--------------------------------------------------------------------------------
/docs/com.sirvar.bluetoothkit/-bluetooth-kit-socket-interface/close.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | BluetoothKitSocketInterface.close -
5 |
6 |
7 |
8 | com.sirvar.bluetoothkit / BluetoothKitSocketInterface / close
9 |
10 | close
11 |
12 | abstract fun close(): Unit
13 |
14 |
15 |
--------------------------------------------------------------------------------
/docs/com.sirvar.bluetoothkit/-bluetooth-kit-socket-interface/connect.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | BluetoothKitSocketInterface.connect -
5 |
6 |
7 |
8 | com.sirvar.bluetoothkit / BluetoothKitSocketInterface / connect
9 |
10 | connect
11 |
12 | abstract fun connect(): Unit
13 |
14 |
15 |
--------------------------------------------------------------------------------
/docs/com.sirvar.bluetoothkit/-bluetooth-kit-socket-interface/device-address.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | BluetoothKitSocketInterface.deviceAddress -
5 |
6 |
7 |
8 | com.sirvar.bluetoothkit / BluetoothKitSocketInterface / deviceAddress
9 |
10 | deviceAddress
11 |
12 | abstract val deviceAddress: String
13 |
14 |
15 |
--------------------------------------------------------------------------------
/docs/com.sirvar.bluetoothkit/-bluetooth-kit-socket-interface/device-name.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | BluetoothKitSocketInterface.deviceName -
5 |
6 |
7 |
8 | com.sirvar.bluetoothkit / BluetoothKitSocketInterface / deviceName
9 |
10 | deviceName
11 |
12 | abstract val deviceName: String
13 |
14 |
15 |
--------------------------------------------------------------------------------
/docs/com.sirvar.bluetoothkit/-bluetooth-kit-socket-interface/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | BluetoothKitSocketInterface -
5 |
6 |
7 |
8 | com.sirvar.bluetoothkit / BluetoothKitSocketInterface
9 |
10 | BluetoothKitSocketInterface
11 | interface BluetoothKitSocketInterface : Any
12 | Bluetooth Socket interface for primary functions
13 | Author
14 | Rikin Katyal
15 | Properties
16 |
17 |
18 |
19 |
20 | deviceAddress |
21 |
22 | abstract val deviceAddress: String |
23 |
24 |
25 |
26 | deviceName |
27 |
28 | abstract val deviceName: String |
29 |
30 |
31 |
32 | inputStream |
33 |
34 | abstract val inputStream: <ERROR CLASS> |
35 |
36 |
37 |
38 | outputStream |
39 |
40 | abstract val outputStream: <ERROR CLASS> |
41 |
42 |
43 |
44 | socket |
45 |
46 | abstract val socket: <ERROR CLASS> |
47 |
48 |
49 |
50 | Functions
51 |
52 |
53 |
54 |
55 | close |
56 |
57 | abstract fun close(): Unit |
58 |
59 |
60 |
61 | connect |
62 |
63 | abstract fun connect(): Unit |
64 |
65 |
66 |
67 | Inheritors
68 |
69 |
70 |
71 |
72 | BluetoothKitSocket |
73 |
74 | open class BluetoothKitSocket : BluetoothKitSocketInterface
75 | Bluetooth Socket wrapper
76 | |
77 |
78 |
79 |
80 |
81 |
82 |
--------------------------------------------------------------------------------
/docs/com.sirvar.bluetoothkit/-bluetooth-kit-socket-interface/input-stream.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | BluetoothKitSocketInterface.inputStream -
5 |
6 |
7 |
8 | com.sirvar.bluetoothkit / BluetoothKitSocketInterface / inputStream
9 |
10 | inputStream
11 |
12 | abstract val inputStream: <ERROR CLASS>
13 |
14 |
15 |
--------------------------------------------------------------------------------
/docs/com.sirvar.bluetoothkit/-bluetooth-kit-socket-interface/output-stream.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | BluetoothKitSocketInterface.outputStream -
5 |
6 |
7 |
8 | com.sirvar.bluetoothkit / BluetoothKitSocketInterface / outputStream
9 |
10 | outputStream
11 |
12 | abstract val outputStream: <ERROR CLASS>
13 |
14 |
15 |
--------------------------------------------------------------------------------
/docs/com.sirvar.bluetoothkit/-bluetooth-kit-socket-interface/socket.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | BluetoothKitSocketInterface.socket -
5 |
6 |
7 |
8 | com.sirvar.bluetoothkit / BluetoothKitSocketInterface / socket
9 |
10 | socket
11 |
12 | abstract val socket: <ERROR CLASS>
13 |
14 |
15 |
--------------------------------------------------------------------------------
/docs/com.sirvar.bluetoothkit/-bluetooth-kit-socket/-init-.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | BluetoothKitSocket. -
5 |
6 |
7 |
8 | com.sirvar.bluetoothkit / BluetoothKitSocket / <init>
9 |
10 | <init>
11 | BluetoothKitSocket(socket: <ERROR CLASS>)
12 | Bluetooth Socket wrapper
13 | Author
14 | Rikin Katyal
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/com.sirvar.bluetoothkit/-bluetooth-kit-socket/close.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | BluetoothKitSocket.close -
5 |
6 |
7 |
8 | com.sirvar.bluetoothkit / BluetoothKitSocket / close
9 |
10 | close
11 |
12 | open fun close(): Unit
13 | Overrides BluetoothKitSocketInterface.close
14 |
15 |
16 |
--------------------------------------------------------------------------------
/docs/com.sirvar.bluetoothkit/-bluetooth-kit-socket/connect.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | BluetoothKitSocket.connect -
5 |
6 |
7 |
8 | com.sirvar.bluetoothkit / BluetoothKitSocket / connect
9 |
10 | connect
11 |
12 | open fun connect(): Unit
13 | Overrides BluetoothKitSocketInterface.connect
14 |
15 |
16 |
--------------------------------------------------------------------------------
/docs/com.sirvar.bluetoothkit/-bluetooth-kit-socket/device-address.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | BluetoothKitSocket.deviceAddress -
5 |
6 |
7 |
8 | com.sirvar.bluetoothkit / BluetoothKitSocket / deviceAddress
9 |
10 | deviceAddress
11 |
12 | open val deviceAddress: String
13 | Overrides BluetoothKitSocketInterface.deviceAddress
14 |
15 |
16 |
--------------------------------------------------------------------------------
/docs/com.sirvar.bluetoothkit/-bluetooth-kit-socket/device-name.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | BluetoothKitSocket.deviceName -
5 |
6 |
7 |
8 | com.sirvar.bluetoothkit / BluetoothKitSocket / deviceName
9 |
10 | deviceName
11 |
12 | open val deviceName: String
13 | Overrides BluetoothKitSocketInterface.deviceName
14 |
15 |
16 |
--------------------------------------------------------------------------------
/docs/com.sirvar.bluetoothkit/-bluetooth-kit-socket/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | BluetoothKitSocket -
5 |
6 |
7 |
8 | com.sirvar.bluetoothkit / BluetoothKitSocket
9 |
10 | BluetoothKitSocket
11 | open class BluetoothKitSocket : BluetoothKitSocketInterface
12 | Bluetooth Socket wrapper
13 | Author
14 | Rikin Katyal
15 | Constructors
16 |
17 |
18 |
19 |
20 | <init> |
21 |
22 | BluetoothKitSocket(socket: <ERROR CLASS>)
23 | Bluetooth Socket wrapper
24 | |
25 |
26 |
27 |
28 | Properties
29 |
30 |
31 |
32 |
33 | deviceAddress |
34 |
35 | open val deviceAddress: String |
36 |
37 |
38 |
39 | deviceName |
40 |
41 | open val deviceName: String |
42 |
43 |
44 |
45 | inputStream |
46 |
47 | open val inputStream: <ERROR CLASS> |
48 |
49 |
50 |
51 | outputStream |
52 |
53 | open val outputStream: <ERROR CLASS> |
54 |
55 |
56 |
57 | socket |
58 |
59 | open val socket: <ERROR CLASS> |
60 |
61 |
62 |
63 | Functions
64 |
65 |
66 |
67 |
68 | close |
69 |
70 | open fun close(): Unit |
71 |
72 |
73 |
74 | connect |
75 |
76 | open fun connect(): Unit |
77 |
78 |
79 |
80 | Inheritors
81 |
82 |
83 |
84 |
85 | BluetoothKitSecuredSocket |
86 |
87 | class BluetoothKitSecuredSocket : BluetoothKitSocket
88 | Secured Bluetooth Socket wrapper with low level method invocation
89 | |
90 |
91 |
92 |
93 |
94 |
95 |
--------------------------------------------------------------------------------
/docs/com.sirvar.bluetoothkit/-bluetooth-kit-socket/input-stream.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | BluetoothKitSocket.inputStream -
5 |
6 |
7 |
8 | com.sirvar.bluetoothkit / BluetoothKitSocket / inputStream
9 |
10 | inputStream
11 |
12 | open val inputStream: <ERROR CLASS>
13 | Overrides BluetoothKitSocketInterface.inputStream
14 |
15 |
16 |
--------------------------------------------------------------------------------
/docs/com.sirvar.bluetoothkit/-bluetooth-kit-socket/output-stream.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | BluetoothKitSocket.outputStream -
5 |
6 |
7 |
8 | com.sirvar.bluetoothkit / BluetoothKitSocket / outputStream
9 |
10 | outputStream
11 |
12 | open val outputStream: <ERROR CLASS>
13 | Overrides BluetoothKitSocketInterface.outputStream
14 |
15 |
16 |
--------------------------------------------------------------------------------
/docs/com.sirvar.bluetoothkit/-bluetooth-kit-socket/socket.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | BluetoothKitSocket.socket -
5 |
6 |
7 |
8 | com.sirvar.bluetoothkit / BluetoothKitSocket / socket
9 |
10 | socket
11 |
12 | open val socket: <ERROR CLASS>
13 | Overrides BluetoothKitSocketInterface.socket
14 |
15 |
16 |
--------------------------------------------------------------------------------
/docs/com.sirvar.bluetoothkit/-bluetooth-kit/-init-.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | BluetoothKit. -
5 |
6 |
7 |
8 | com.sirvar.bluetoothkit / BluetoothKit / <init>
9 |
10 | <init>
11 | BluetoothKit()
12 | BluetoothKit controller to interface with Android BluetoothAdapter and BluetoothSocket
13 | Author
14 | Rikin Katyal
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/com.sirvar.bluetoothkit/-bluetooth-kit/connect.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | BluetoothKit.connect -
5 |
6 |
7 |
8 | com.sirvar.bluetoothkit / BluetoothKit / connect
9 |
10 | connect
11 |
12 |
13 | fun connect(device: <ERROR CLASS>): Unit
14 |
Connect to BluetoothDevice with random UUID
15 | Parameters
16 |
17 |
18 | BluetoothDevice
- device to connect to
19 |
20 | fun connect(device: <ERROR CLASS>, uuid: String): Unit
21 |
Connect to BluetoothDevice with UUID as string
22 | Parameters
23 |
24 |
25 | BluetoothDevice
- device to connect to
26 |
27 | String
- connection UUID
28 |
29 | fun connect(device: <ERROR CLASS>, uuid: <ERROR CLASS>): Unit
30 |
Connect to BluetoothDevice with specific UUID
31 | Parameters
32 |
33 |
34 | BluetoothDevice
- device to connect to
35 |
36 | UUID
- connection UUID
37 |
38 |
39 |
--------------------------------------------------------------------------------
/docs/com.sirvar.bluetoothkit/-bluetooth-kit/disable.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | BluetoothKit.disable -
5 |
6 |
7 |
8 | com.sirvar.bluetoothkit / BluetoothKit / disable
9 |
10 | disable
11 |
12 | fun disable(): Boolean
13 | Disable bluetooth on device
14 |
15 |
16 |
--------------------------------------------------------------------------------
/docs/com.sirvar.bluetoothkit/-bluetooth-kit/disconnect.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | BluetoothKit.disconnect -
5 |
6 |
7 |
8 | com.sirvar.bluetoothkit / BluetoothKit / disconnect
9 |
10 | disconnect
11 |
12 | fun disconnect(): Unit
13 | Closes all IO streams and terminates the socket.
14 | NOTE: does not turn off bluetooth
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/com.sirvar.bluetoothkit/-bluetooth-kit/enable.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | BluetoothKit.enable -
5 |
6 |
7 |
8 | com.sirvar.bluetoothkit / BluetoothKit / enable
9 |
10 | enable
11 |
12 | fun enable(): Boolean
13 | Enables bluetooth on device
14 |
15 |
16 |
--------------------------------------------------------------------------------
/docs/com.sirvar.bluetoothkit/-bluetooth-kit/get-bluetooth-adapter.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | BluetoothKit.getBluetoothAdapter -
5 |
6 |
7 |
8 | com.sirvar.bluetoothkit / BluetoothKit / getBluetoothAdapter
9 |
10 | getBluetoothAdapter
11 |
12 | fun getBluetoothAdapter(): <ERROR CLASS>
13 | Get the BluetoothAdapter
14 | Return
15 | BluetoothAdapter
16 | See Also
17 |
android.bluetooth.BluetoothAdapter
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/docs/com.sirvar.bluetoothkit/-bluetooth-kit/get-bluetooth-socket.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | BluetoothKit.getBluetoothSocket -
5 |
6 |
7 |
8 | com.sirvar.bluetoothkit / BluetoothKit / getBluetoothSocket
9 |
10 | getBluetoothSocket
11 |
12 | fun getBluetoothSocket(): BluetoothKitSocketInterface
13 | Get the bluetooth socket implementing BluetoothKitSocketInterface
14 | Return
15 | BluetoothKitSocketInterface
16 | See Also
17 |
BluetoothKitSocketInterface
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/docs/com.sirvar.bluetoothkit/-bluetooth-kit/get-device-by-address.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | BluetoothKit.getDeviceByAddress -
5 |
6 |
7 |
8 | com.sirvar.bluetoothkit / BluetoothKit / getDeviceByAddress
9 |
10 | getDeviceByAddress
11 |
12 | fun getDeviceByAddress(address: String): <ERROR CLASS>?
13 | Get paired BluetoothDevice by MAC address
14 | Parameters
15 |
16 |
17 | address
- MAC address of device to get
18 |
Return
19 | BluetoothDevice the device if it exists, else null
20 | See Also
21 |
android.bluetooth.BluetoothDevice
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/docs/com.sirvar.bluetoothkit/-bluetooth-kit/get-device-by-name.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | BluetoothKit.getDeviceByName -
5 |
6 |
7 |
8 | com.sirvar.bluetoothkit / BluetoothKit / getDeviceByName
9 |
10 | getDeviceByName
11 |
12 | fun getDeviceByName(name: String): <ERROR CLASS>?
13 | Get paired BluetoothDevice by name
14 | Parameters
15 |
16 |
17 | name
- paired device name to get
18 |
Return
19 | BluetoothDevice the device if it exists, else null
20 | See Also
21 |
android.bluetooth.BluetoothDevice
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/docs/com.sirvar.bluetoothkit/-bluetooth-kit/get-paired-devices.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | BluetoothKit.getPairedDevices -
5 |
6 |
7 |
8 | com.sirvar.bluetoothkit / BluetoothKit / getPairedDevices
9 |
10 | getPairedDevices
11 |
12 | fun getPairedDevices(): Set<<ERROR CLASS>>
13 | Gets Set of paired BluetoothDevice
14 | See Also
15 |
android.bluetooth.BluetoothDevice
16 | Set
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/docs/com.sirvar.bluetoothkit/-bluetooth-kit/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | BluetoothKit -
5 |
6 |
7 |
8 | com.sirvar.bluetoothkit / BluetoothKit
9 |
10 | BluetoothKit
11 | class BluetoothKit : Any
12 | BluetoothKit controller to interface with Android BluetoothAdapter and BluetoothSocket
13 | Author
14 | Rikin Katyal
15 | Constructors
16 |
17 |
18 |
19 |
20 | <init> |
21 |
22 | BluetoothKit()
23 | BluetoothKit controller to interface with Android BluetoothAdapter and BluetoothSocket
24 | |
25 |
26 |
27 |
28 | Functions
29 |
30 |
31 |
32 |
33 | connect |
34 |
35 | fun connect(device: <ERROR CLASS>): Unit
36 | Connect to BluetoothDevice with random UUID
37 | fun connect(device: <ERROR CLASS>, uuid: String): Unit
38 | Connect to BluetoothDevice with UUID as string
39 | fun connect(device: <ERROR CLASS>, uuid: <ERROR CLASS>): Unit
40 | Connect to BluetoothDevice with specific UUID
41 | |
42 |
43 |
44 |
45 | disable |
46 |
47 | fun disable(): Boolean
48 | Disable bluetooth on device
49 | |
50 |
51 |
52 |
53 | disconnect |
54 |
55 | fun disconnect(): Unit
56 | Closes all IO streams and terminates the socket.
57 | NOTE: does not turn off bluetooth
58 | |
59 |
60 |
61 |
62 | enable |
63 |
64 | fun enable(): Boolean
65 | Enables bluetooth on device
66 | |
67 |
68 |
69 |
70 | getBluetoothAdapter |
71 |
72 | fun getBluetoothAdapter(): <ERROR CLASS>
73 | Get the BluetoothAdapter
74 | |
75 |
76 |
77 |
78 | getBluetoothSocket |
79 |
80 | fun getBluetoothSocket(): BluetoothKitSocketInterface
81 | Get the bluetooth socket implementing BluetoothKitSocketInterface
82 | |
83 |
84 |
85 |
86 | getDeviceByAddress |
87 |
88 | fun getDeviceByAddress(address: String): <ERROR CLASS>?
89 | Get paired BluetoothDevice by MAC address
90 | |
91 |
92 |
93 |
94 | getDeviceByName |
95 |
96 | fun getDeviceByName(name: String): <ERROR CLASS>?
97 | Get paired BluetoothDevice by name
98 | |
99 |
100 |
101 |
102 | getPairedDevices |
103 |
104 | fun getPairedDevices(): Set<<ERROR CLASS>>
105 | Gets Set of paired BluetoothDevice
106 | |
107 |
108 |
109 |
110 | isEnabled |
111 |
112 | fun isEnabled(): Boolean
113 | Checks if bluetooth is enabled
114 | |
115 |
116 |
117 |
118 |
119 |
120 |
--------------------------------------------------------------------------------
/docs/com.sirvar.bluetoothkit/-bluetooth-kit/is-enabled.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | BluetoothKit.isEnabled -
5 |
6 |
7 |
8 | com.sirvar.bluetoothkit / BluetoothKit / isEnabled
9 |
10 | isEnabled
11 |
12 | fun isEnabled(): Boolean
13 | Checks if bluetooth is enabled
14 | Return
15 | boolean enabled status
16 |
17 |
18 |
--------------------------------------------------------------------------------
/docs/com.sirvar.bluetoothkit/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | com.sirvar.bluetoothkit -
5 |
6 |
7 |
8 | com.sirvar.bluetoothkit
9 |
10 | Package com.sirvar.bluetoothkit
11 | Types
12 |
13 |
14 |
15 |
16 | BluetoothKit |
17 |
18 | class BluetoothKit : Any
19 | BluetoothKit controller to interface with Android BluetoothAdapter and BluetoothSocket
20 | |
21 |
22 |
23 |
24 | BluetoothKitSecuredSocket |
25 |
26 | class BluetoothKitSecuredSocket : BluetoothKitSocket
27 | Secured Bluetooth Socket wrapper with low level method invocation
28 | |
29 |
30 |
31 |
32 | BluetoothKitSocket |
33 |
34 | open class BluetoothKitSocket : BluetoothKitSocketInterface
35 | Bluetooth Socket wrapper
36 | |
37 |
38 |
39 |
40 | BluetoothKitSocketInterface |
41 |
42 | interface BluetoothKitSocketInterface : Any
43 | Bluetooth Socket interface for primary functions
44 | |
45 |
46 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/docs/index-outline.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Module Contents
5 |
6 |
7 |
8 |
9 |
206 |
207 |
208 |
--------------------------------------------------------------------------------
/docs/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | Packages
11 |
21 | Index
22 | All Types
23 |
24 |
25 |
--------------------------------------------------------------------------------
/docs/style.css:
--------------------------------------------------------------------------------
1 | @import url(https://fonts.googleapis.com/css?family=Lato:300italic,700italic,300,700);
2 |
3 | body, table {
4 | padding:50px;
5 | font:14px/1.5 Lato, "Helvetica Neue", Helvetica, Arial, sans-serif;
6 | color:#555;
7 | font-weight:300;
8 | }
9 |
10 | .keyword {
11 | color:black;
12 | font-family:Monaco, Bitstream Vera Sans Mono, Lucida Console, Terminal;
13 | font-size:12px;
14 | }
15 |
16 | .symbol {
17 | font-family:Monaco, Bitstream Vera Sans Mono, Lucida Console, Terminal;
18 | font-size:12px;
19 | }
20 |
21 | .identifier {
22 | color: darkblue;
23 | font-size:12px;
24 | font-family:Monaco, Bitstream Vera Sans Mono, Lucida Console, Terminal;
25 | }
26 |
27 | h1, h2, h3, h4, h5, h6 {
28 | color:#222;
29 | margin:0 0 20px;
30 | }
31 |
32 | p, ul, ol, table, pre, dl {
33 | margin:0 0 20px;
34 | }
35 |
36 | h1, h2, h3 {
37 | line-height:1.1;
38 | }
39 |
40 | h1 {
41 | font-size:28px;
42 | }
43 |
44 | h2 {
45 | color:#393939;
46 | }
47 |
48 | h3, h4, h5, h6 {
49 | color:#494949;
50 | }
51 |
52 | a {
53 | color:#258aaf;
54 | font-weight:400;
55 | text-decoration:none;
56 | }
57 |
58 | a:hover {
59 | color: inherit;
60 | text-decoration:underline;
61 | }
62 |
63 | a small {
64 | font-size:11px;
65 | color:#555;
66 | margin-top:-0.6em;
67 | display:block;
68 | }
69 |
70 | .wrapper {
71 | width:860px;
72 | margin:0 auto;
73 | }
74 |
75 | blockquote {
76 | border-left:1px solid #e5e5e5;
77 | margin:0;
78 | padding:0 0 0 20px;
79 | font-style:italic;
80 | }
81 |
82 | code, pre {
83 | font-family:Monaco, Bitstream Vera Sans Mono, Lucida Console, Terminal;
84 | color:#333;
85 | font-size:12px;
86 | }
87 |
88 | pre {
89 | display: block;
90 | /*
91 | padding:8px 8px;
92 | background: #f8f8f8;
93 | border-radius:5px;
94 | border:1px solid #e5e5e5;
95 | */
96 | overflow-x: auto;
97 | }
98 |
99 | table {
100 | width:100%;
101 | border-collapse:collapse;
102 | }
103 |
104 | th, td {
105 | text-align:left;
106 | vertical-align: top;
107 | padding:5px 10px;
108 | }
109 |
110 | dt {
111 | color:#444;
112 | font-weight:700;
113 | }
114 |
115 | th {
116 | color:#444;
117 | }
118 |
119 | img {
120 | max-width:100%;
121 | }
122 |
123 | header {
124 | width:270px;
125 | float:left;
126 | position:fixed;
127 | }
128 |
129 | header ul {
130 | list-style:none;
131 | height:40px;
132 |
133 | padding:0;
134 |
135 | background: #eee;
136 | background: -moz-linear-gradient(top, #f8f8f8 0%, #dddddd 100%);
137 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f8f8f8), color-stop(100%,#dddddd));
138 | background: -webkit-linear-gradient(top, #f8f8f8 0%,#dddddd 100%);
139 | background: -o-linear-gradient(top, #f8f8f8 0%,#dddddd 100%);
140 | background: -ms-linear-gradient(top, #f8f8f8 0%,#dddddd 100%);
141 | background: linear-gradient(top, #f8f8f8 0%,#dddddd 100%);
142 |
143 | border-radius:5px;
144 | border:1px solid #d2d2d2;
145 | box-shadow:inset #fff 0 1px 0, inset rgba(0,0,0,0.03) 0 -1px 0;
146 | width:270px;
147 | }
148 |
149 | header li {
150 | width:89px;
151 | float:left;
152 | border-right:1px solid #d2d2d2;
153 | height:40px;
154 | }
155 |
156 | header ul a {
157 | line-height:1;
158 | font-size:11px;
159 | color:#999;
160 | display:block;
161 | text-align:center;
162 | padding-top:6px;
163 | height:40px;
164 | }
165 |
166 | strong {
167 | color:#222;
168 | font-weight:700;
169 | }
170 |
171 | header ul li + li {
172 | width:88px;
173 | border-left:1px solid #fff;
174 | }
175 |
176 | header ul li + li + li {
177 | border-right:none;
178 | width:89px;
179 | }
180 |
181 | header ul a strong {
182 | font-size:14px;
183 | display:block;
184 | color:#222;
185 | }
186 |
187 | section {
188 | width:500px;
189 | float:right;
190 | padding-bottom:50px;
191 | }
192 |
193 | small {
194 | font-size:11px;
195 | }
196 |
197 | hr {
198 | border:0;
199 | background:#e5e5e5;
200 | height:1px;
201 | margin:0 0 20px;
202 | }
203 |
204 | footer {
205 | width:270px;
206 | float:left;
207 | position:fixed;
208 | bottom:50px;
209 | }
210 |
211 | @media print, screen and (max-width: 960px) {
212 |
213 | div.wrapper {
214 | width:auto;
215 | margin:0;
216 | }
217 |
218 | header, section, footer {
219 | float:none;
220 | position:static;
221 | width:auto;
222 | }
223 |
224 | header {
225 | padding-right:320px;
226 | }
227 |
228 | section {
229 | border:1px solid #e5e5e5;
230 | border-width:1px 0;
231 | padding:20px 0;
232 | margin:0 0 20px;
233 | }
234 |
235 | header a small {
236 | display:inline;
237 | }
238 |
239 | header ul {
240 | position:absolute;
241 | right:50px;
242 | top:52px;
243 | }
244 | }
245 |
246 | @media print, screen and (max-width: 720px) {
247 | body {
248 | word-wrap:break-word;
249 | }
250 |
251 | header {
252 | padding:0;
253 | }
254 |
255 | header ul, header p.view {
256 | position:static;
257 | }
258 |
259 | pre, code {
260 | word-wrap:normal;
261 | }
262 | }
263 |
264 | @media print, screen and (max-width: 480px) {
265 | body {
266 | padding:15px;
267 | }
268 |
269 | header ul {
270 | display:none;
271 | }
272 | }
273 |
274 | @media print {
275 | body {
276 | padding:0.4in;
277 | font-size:12pt;
278 | color:#444;
279 | }
280 | }
281 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx1536m
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirvar/bluetoothkit-android/4fc8c592071bdb1d4f9369e2642785a6409df7a8/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sat Dec 29 10:09:35 EST 2018
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.1-milestone-1-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn () {
37 | echo "$*"
38 | }
39 |
40 | die () {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Escape application args
158 | save () {
159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160 | echo " "
161 | }
162 | APP_ARGS=$(save "$@")
163 |
164 | # Collect all arguments for the java command, following the shell quoting and substitution rules
165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166 |
167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169 | cd "$(dirname "$0")"
170 | fi
171 |
172 | exec "$JAVACMD" "$@"
173 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app', ':bluetoothkit'
2 |
--------------------------------------------------------------------------------