Return-Path: Content-Type: text/plain; charset=US-ASCII Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: [RFCv2 2/2] android/gatt: Add test command for database dump From: Marcel Holtmann In-Reply-To: <538D8035.5040801@tieto.com> Date: Tue, 3 Jun 2014 11:24:39 +0200 Cc: linux-bluetooth@vger.kernel.org Message-Id: <710F3208-4DE5-4204-AD43-5C8C8345841B@holtmann.org> References: <1401715171-29175-1-git-send-email-jakub.tyszkowski@tieto.com> <1401715171-29175-3-git-send-email-jakub.tyszkowski@tieto.com> <538D8035.5040801@tieto.com> To: Tyszkowski Jakub Sender: linux-bluetooth-owner@vger.kernel.org List-ID: Hi Jakub, >>> With this we can check all attributes handles, uuids, permissions etc. >>> on demand without adding to much logs. This will help to execute and >>> verify some PTS test cases and debug. >>> --- >>> android/gatt.c | 4 ++++ >>> android/hal-msg.h | 1 + >>> 2 files changed, 5 insertions(+) >>> >>> diff --git a/android/gatt.c b/android/gatt.c >>> index 429181f..83a051b 100644 >>> --- a/android/gatt.c >>> +++ b/android/gatt.c >>> @@ -3543,6 +3543,10 @@ static void handle_client_test_command(const void *buf, uint16_t len) >>> status = test_read_write(&bdaddr, &uuid, cmd->u1, cmd->u2, >>> cmd->u3, cmd->u4, cmd->u5); >>> break; >>> + case GATT_CLIENT_TEST_CMD_DB_DUMP: >>> + gatt_db_dump(gatt_db); >>> + status = HAL_STATUS_SUCCESS; >>> + break; >>> case GATT_CLIENT_TEST_CMD_PAIRING_CONFIG: >>> default: >>> status = HAL_STATUS_FAILED; >>> diff --git a/android/hal-msg.h b/android/hal-msg.h >>> index 5da62f3..ce86304 100644 >>> --- a/android/hal-msg.h >>> +++ b/android/hal-msg.h >>> @@ -753,6 +753,7 @@ struct hal_cmd_gatt_client_set_adv_data { >>> #define GATT_CLIENT_TEST_CMD_DISCOVER 0x04 >>> #define GATT_CLIENT_TEST_CMD_READ 0xe0 >>> #define GATT_CLIENT_TEST_CMD_WRITE 0xe1 >>> +#define GATT_CLIENT_TEST_CMD_DB_DUMP 0xe2 >>> #define GATT_CLIENT_TEST_CMD_PAIRING_CONFIG 0xf0 >> >> are these all defined by Bluedroid and Android Bluetooth Service or are some of these BlueZ specific? If so we need to comment that. > > Some are defined by Android, but we added our own starting from 0xe0. I wonder if README entry wouldn't be better to actually comment that and describe parameters for commands we added, so they can be used in haltest without searching through the implementation. the code should have a comment right there to distinguish BlueZ specific from generic ones. In addition a section in the README is a great idea. Regards Marcel