Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
platform_frameworks_base-old
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Farzin Kazemzadeh
platform_frameworks_base-old
Commits
7826c08e
Commit
7826c08e
authored
8 years ago
by
Treehugger Robot
Committed by
Gerrit Code Review
8 years ago
Browse files
Options
Downloads
Plain Diff
Merge "Read by UUID for PTS tests (1/5)"
parents
58b5789c
de74891d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/java/android/bluetooth/BluetoothGatt.java
+35
-0
35 additions, 0 deletions
core/java/android/bluetooth/BluetoothGatt.java
core/java/android/bluetooth/IBluetoothGatt.aidl
+2
-0
2 additions, 0 deletions
core/java/android/bluetooth/IBluetoothGatt.aidl
with
37 additions
and
0 deletions
core/java/android/bluetooth/BluetoothGatt.java
+
35
−
0
View file @
7826c08e
...
...
@@ -946,6 +946,41 @@ public final class BluetoothGatt implements BluetoothProfile {
return
true
;
}
/**
* Reads the characteristic using its UUID from the associated remote device.
*
* <p>This is an asynchronous operation. The result of the read operation
* is reported by the {@link BluetoothGattCallback#onCharacteristicRead}
* callback.
*
* <p>Requires {@link android.Manifest.permission#BLUETOOTH} permission.
*
* @param uuid UUID of characteristic to read from the remote device
* @return true, if the read operation was initiated successfully
* @hide
*/
public
boolean
readUsingCharacteristicUuid
(
UUID
uuid
,
int
startHandle
,
int
endHandle
)
{
if
(
VDBG
)
Log
.
d
(
TAG
,
"readUsingCharacteristicUuid() - uuid: "
+
uuid
);
if
(
mService
==
null
||
mClientIf
==
0
)
return
false
;
synchronized
(
mDeviceBusy
)
{
if
(
mDeviceBusy
)
return
false
;
mDeviceBusy
=
true
;
}
try
{
mService
.
readUsingCharacteristicUuid
(
mClientIf
,
mDevice
.
getAddress
(),
new
ParcelUuid
(
uuid
),
startHandle
,
endHandle
,
AUTHENTICATION_NONE
);
}
catch
(
RemoteException
e
)
{
Log
.
e
(
TAG
,
""
,
e
);
mDeviceBusy
=
false
;
return
false
;
}
return
true
;
}
/**
* Writes a given characteristic and its values to the associated remote device.
*
...
...
This diff is collapsed.
Click to expand it.
core/java/android/bluetooth/IBluetoothGatt.aidl
+
2
−
0
View file @
7826c08e
...
...
@@ -77,6 +77,8 @@ interface IBluetoothGatt {
void refreshDevice(in int clientIf, in String address);
void discoverServices(in int clientIf, in String address);
void readCharacteristic(in int clientIf, in String address, in int handle, in int authReq);
void readUsingCharacteristicUuid(in int clientIf, in String address, in ParcelUuid uuid,
in int startHandle, in int endHandle, in int authReq);
void writeCharacteristic(in int clientIf, in String address, in int handle,
in int writeType, in int authReq, in byte[] value);
void readDescriptor(in int clientIf, in String address, in int handle, in int authReq);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment