Remove unused methods and callbacks
am: 98aa0dd
* commit '98aa0ddd6c3993ea43fdac6075a6d2b8725231bc':
Remove unused methods and callbacks
diff --git a/include/hardware/bt_gatt_client.h b/include/hardware/bt_gatt_client.h
index 2a473ce..e2c8a92 100644
--- a/include/hardware/bt_gatt_client.h
+++ b/include/hardware/bt_gatt_client.h
@@ -40,9 +40,7 @@
/** Parameters for GATT read operations */
typedef struct
{
- btgatt_srvc_id_t srvc_id;
- btgatt_gatt_id_t char_id;
- btgatt_gatt_id_t descr_id;
+ uint16_t handle;
btgatt_unformatted_value_t value;
uint16_t value_type;
uint8_t status;
@@ -62,8 +60,7 @@
{
uint8_t value[BTGATT_MAX_ATTR_LEN];
bt_bdaddr_t bda;
- btgatt_srvc_id_t srvc_id;
- btgatt_gatt_id_t char_id;
+ uint16_t handle;
uint16_t len;
uint8_t is_notify;
} btgatt_notify_params_t;
@@ -139,8 +136,7 @@
/** Callback invoked in response to [de]register_for_notification */
typedef void (*register_for_notification_callback)(int conn_id,
- int registered, int status, btgatt_srvc_id_t *srvc_id,
- btgatt_gatt_id_t *char_id);
+ int registered, int status, uint16_t handle);
/**
* Remote device notification callback, invoked when a remote device sends
@@ -153,8 +149,7 @@
btgatt_read_params_t *p_data);
/** GATT write characteristic operation callback */
-typedef void (*write_characteristic_callback)(int conn_id, int status,
- btgatt_write_params_t *p_data);
+typedef void (*write_characteristic_callback)(int conn_id, int status, uint16_t handle);
/** GATT execute prepared write callback */
typedef void (*execute_write_callback)(int conn_id, int status);
@@ -164,8 +159,7 @@
btgatt_read_params_t *p_data);
/** Callback invoked in response to write_descriptor */
-typedef void (*write_descriptor_callback)(int conn_id, int status,
- btgatt_write_params_t *p_data);
+typedef void (*write_descriptor_callback)(int conn_id, int status, uint16_t handle);
/** Callback triggered in response to read_remote_rssi */
typedef void (*read_remote_rssi_callback)(int client_if, bt_bdaddr_t* bda,
@@ -305,25 +299,20 @@
bt_status_t (*search_service)(int conn_id, bt_uuid_t *filter_uuid );
/** Read a characteristic on a remote device */
- bt_status_t (*read_characteristic)( int conn_id,
- btgatt_srvc_id_t *srvc_id, btgatt_gatt_id_t *char_id,
+ bt_status_t (*read_characteristic)( int conn_id, uint16_t handle,
int auth_req );
/** Write a remote characteristic */
- bt_status_t (*write_characteristic)(int conn_id,
- btgatt_srvc_id_t *srvc_id, btgatt_gatt_id_t *char_id,
+ bt_status_t (*write_characteristic)(int conn_id, uint16_t handle,
int write_type, int len, int auth_req,
char* p_value);
/** Read the descriptor for a given characteristic */
- bt_status_t (*read_descriptor)(int conn_id,
- btgatt_srvc_id_t *srvc_id, btgatt_gatt_id_t *char_id,
- btgatt_gatt_id_t *descr_id, int auth_req);
+ bt_status_t (*read_descriptor)(int conn_id, uint16_t handle, int auth_req);
/** Write a remote descriptor for a given characteristic */
- bt_status_t (*write_descriptor)( int conn_id,
- btgatt_srvc_id_t *srvc_id, btgatt_gatt_id_t *char_id,
- btgatt_gatt_id_t *descr_id, int write_type, int len,
+ bt_status_t (*write_descriptor)( int conn_id, uint16_t handle,
+ int write_type, int len,
int auth_req, char* p_value);
/** Execute a prepared write operation */
@@ -334,13 +323,11 @@
* characteristic
*/
bt_status_t (*register_for_notification)( int client_if,
- const bt_bdaddr_t *bd_addr, btgatt_srvc_id_t *srvc_id,
- btgatt_gatt_id_t *char_id);
+ const bt_bdaddr_t *bd_addr, uint16_t handle);
/** Deregister a previous request for notifications/indications */
bt_status_t (*deregister_for_notification)( int client_if,
- const bt_bdaddr_t *bd_addr, btgatt_srvc_id_t *srvc_id,
- btgatt_gatt_id_t *char_id);
+ const bt_bdaddr_t *bd_addr, uint16_t handle);
/** Request RSSI for a given remote device */
bt_status_t (*read_remote_rssi)( int client_if, const bt_bdaddr_t *bd_addr);
diff --git a/include/hardware/nvram.h b/include/hardware/nvram.h
index a1868b5..859ea47 100644
--- a/include/hardware/nvram.h
+++ b/include/hardware/nvram.h
@@ -21,6 +21,7 @@
#include <sys/cdefs.h>
#include <hardware/hardware.h>
+#include <hardware/nvram_defs.h>
__BEGIN_DECLS
@@ -30,30 +31,7 @@
/* The version of this module. */
#define NVRAM_MODULE_API_VERSION_0_1 HARDWARE_MODULE_API_VERSION(0, 1)
-#define NVRAM_DEVICE_API_VERSION_0_1 HARDWARE_DEVICE_API_VERSION(0, 1)
-
-/* Values returned by nvram_device methods. */
-typedef uint32_t nvram_result_t;
-
-const nvram_result_t NV_RESULT_SUCCESS = 0;
-const nvram_result_t NV_RESULT_INTERNAL_ERROR = 1;
-const nvram_result_t NV_RESULT_ACCESS_DENIED = 2;
-const nvram_result_t NV_RESULT_INVALID_PARAMETER = 3;
-const nvram_result_t NV_RESULT_SPACE_DOES_NOT_EXIST = 4;
-const nvram_result_t NV_RESULT_SPACE_ALREADY_EXISTS = 5;
-const nvram_result_t NV_RESULT_OPERATION_DISABLED = 6;
-
-/* Values describing available access controls. */
-typedef uint32_t nvram_control_t;
-
-const nvram_control_t NV_CONTROL_PERSISTENT_WRITE_LOCK = 1;
-const nvram_control_t NV_CONTROL_BOOT_WRITE_LOCK = 2;
-const nvram_control_t NV_CONTROL_BOOT_READ_LOCK = 3;
-const nvram_control_t NV_CONTROL_WRITE_AUTHORIZATION = 4;
-const nvram_control_t NV_CONTROL_READ_AUTHORIZATION = 5;
-const nvram_control_t NV_CONTROL_WRITE_EXTEND = 6;
-
-const uint32_t NV_UNLIMITED_SPACES = 0xFFFFFFFF;
+#define NVRAM_DEVICE_API_VERSION_1_1 HARDWARE_DEVICE_API_VERSION(1, 1)
struct nvram_module {
/**
@@ -99,6 +77,17 @@
const struct nvram_device* device, uint64_t* available_size);
/**
+ * Outputs the maximum number of bytes that can be allocated for a single
+ * space. This will always be at least 32. If an implementation does not
+ * limit the maximum size it may provide the total size.
+ *
+ * device - The nvram_device instance.
+ * max_space_size - Receives the output. Cannot be NULL.
+ */
+ nvram_result_t (*get_max_space_size_in_bytes)(
+ const struct nvram_device* device, uint64_t* max_space_size);
+
+ /**
* Outputs the maximum total number of spaces that may be allocated.
* This will always be at least 8. Outputs NV_UNLIMITED_SPACES if any
* number of spaces are supported (limited only to available NVRAM
diff --git a/include/hardware/nvram_defs.h b/include/hardware/nvram_defs.h
new file mode 100644
index 0000000..0256a3c
--- /dev/null
+++ b/include/hardware/nvram_defs.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * This file contains data type definitions and constants that are useful to
+ * code interacting with and implementing the NVRAM HAL, even though it doesn't
+ * use the actual NVRAM HAL module interface. Keeping this in a separate file
+ * simplifies inclusion in low-level code which can't easily include the heavier
+ * hardware.h due to lacking standard headers.
+ */
+
+#ifndef ANDROID_HARDWARE_NVRAM_DEFS_H
+#define ANDROID_HARDWARE_NVRAM_DEFS_H
+
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif // __cplusplus
+
+/* Values returned by nvram_device methods. */
+typedef uint32_t nvram_result_t;
+
+const nvram_result_t NV_RESULT_SUCCESS = 0;
+const nvram_result_t NV_RESULT_INTERNAL_ERROR = 1;
+const nvram_result_t NV_RESULT_ACCESS_DENIED = 2;
+const nvram_result_t NV_RESULT_INVALID_PARAMETER = 3;
+const nvram_result_t NV_RESULT_SPACE_DOES_NOT_EXIST = 4;
+const nvram_result_t NV_RESULT_SPACE_ALREADY_EXISTS = 5;
+const nvram_result_t NV_RESULT_OPERATION_DISABLED = 6;
+
+/* Values describing available access controls. */
+typedef uint32_t nvram_control_t;
+
+const nvram_control_t NV_CONTROL_PERSISTENT_WRITE_LOCK = 1;
+const nvram_control_t NV_CONTROL_BOOT_WRITE_LOCK = 2;
+const nvram_control_t NV_CONTROL_BOOT_READ_LOCK = 3;
+const nvram_control_t NV_CONTROL_WRITE_AUTHORIZATION = 4;
+const nvram_control_t NV_CONTROL_READ_AUTHORIZATION = 5;
+const nvram_control_t NV_CONTROL_WRITE_EXTEND = 6;
+
+const uint32_t NV_UNLIMITED_SPACES = 0xFFFFFFFF;
+
+#ifdef __cplusplus
+} // extern "C"
+#endif // __cplusplus
+
+#endif // ANDROID_HARDWARE_NVRAM_DEFS_H