Hi Szymon, Yes, DRY stands for "Don't Repeat Yourself"[1]. It's referring to the deduplication of these PDUs in the testing iovecs. [1]: http://c2.com/cgi/wiki?DontRepeatYourself On Wed, Nov 12, 2014 at 12:51 PM, Szymon Janc <szymon.janc@xxxxxxxxx> wrote: > HI Michael, > > On Wednesday 12 of November 2014 12:22:56 Michael Janssen wrote: > > This "DRY/" in commit subject is intended? > >> The search service with a single service response PDUs are repeated >> multiple times throughout the testing data. Use a macro instead. >> >> Also, the final PDU was malformed on many of these (had 0x11 instead of >> 0x10 in the "request opcode in error" slot) which this fixes. >> --- >> android/tester-gatt.c | 106 >> +++++++++++++------------------------------------- 1 file changed, 26 >> insertions(+), 80 deletions(-) >> >> diff --git a/android/tester-gatt.c b/android/tester-gatt.c >> index 13e096f..b88eeff 100644 >> --- a/android/tester-gatt.c >> +++ b/android/tester-gatt.c >> @@ -832,11 +832,14 @@ static struct send_resp_data send_resp_data_2 = { >> .response = &response_2, >> }; >> >> +#define SEARCH_SERVICE_SINGLE_SUCCESS_PDUS \ >> + raw_pdu(0x10, 0x01, 0x00, 0xff, 0xff, 0x00, 0x28), \ >> + raw_pdu(0x11, 0x06, 0x01, 0x00, 0x10, 0x00, 0x00, 0x18), \ >> + raw_pdu(0x10, 0x11, 0x00, 0xff, 0xff, 0x00, 0x28), \ >> + raw_pdu(0x01, 0x10, 0x11, 0x00, 0x0a) \ >> + >> static struct iovec search_service[] = { >> - raw_pdu(0x10, 0x01, 0x00, 0xff, 0xff, 0x00, 0x28), >> - raw_pdu(0x11, 0x06, 0x01, 0x00, 0x10, 0x00, 0x00, 0x18), >> - raw_pdu(0x10, 0x11, 0x00, 0xff, 0xff, 0x00, 0x28), >> - raw_pdu(0x01, 0x10, 0x11, 0x00, 0x0a), >> + SEARCH_SERVICE_SINGLE_SUCCESS_PDUS, >> end_pdu >> }; >> >> @@ -857,10 +860,7 @@ static struct iovec search_service_3[] = { >> }; >> >> static struct iovec get_characteristic_1[] = { >> - raw_pdu(0x10, 0x01, 0x00, 0xff, 0xff, 0x00, 0x28), >> - raw_pdu(0x11, 0x06, 0x01, 0x00, 0x10, 0x00, 0x00, 0x18), >> - raw_pdu(0x10, 0x11, 0x00, 0xff, 0xff, 0x00, 0x28), >> - raw_pdu(0x01, 0x11, 0x11, 0x00, 0x0a), >> + SEARCH_SERVICE_SINGLE_SUCCESS_PDUS, >> raw_pdu(0x08, 0x01, 0x00, 0x10, 0x00, 0x03, 0x28), >> raw_pdu(0x09, 0x07, 0x02, 0x00, 0x04, 0x00, 0x00, 0x19, 0x00), >> raw_pdu(0x08, 0x03, 0x00, 0x10, 0x00, 0x03, 0x28), >> @@ -869,10 +869,7 @@ static struct iovec get_characteristic_1[] = { >> }; >> >> static struct iovec get_descriptor_1[] = { >> - raw_pdu(0x10, 0x01, 0x00, 0xff, 0xff, 0x00, 0x28), >> - raw_pdu(0x11, 0x06, 0x01, 0x00, 0x10, 0x00, 0x00, 0x18), >> - raw_pdu(0x10, 0x11, 0x00, 0xff, 0xff, 0x00, 0x28), >> - raw_pdu(0x01, 0x11, 0x11, 0x00, 0x0a), >> + SEARCH_SERVICE_SINGLE_SUCCESS_PDUS, >> raw_pdu(0x08, 0x01, 0x00, 0x10, 0x00, 0x03, 0x28), >> raw_pdu(0x09, 0x07, 0x02, 0x00, 0x04, 0x00, 0x00, 0x19, 0x00), >> raw_pdu(0x08, 0x03, 0x00, 0x10, 0x00, 0x03, 0x28), >> @@ -885,10 +882,7 @@ static struct iovec get_descriptor_1[] = { >> }; >> >> static struct iovec get_descriptor_2[] = { >> - raw_pdu(0x10, 0x01, 0x00, 0xff, 0xff, 0x00, 0x28), >> - raw_pdu(0x11, 0x06, 0x01, 0x00, 0x10, 0x00, 0x00, 0x18), >> - raw_pdu(0x10, 0x11, 0x00, 0xff, 0xff, 0x00, 0x28), >> - raw_pdu(0x01, 0x11, 0x11, 0x00, 0x0a), >> + SEARCH_SERVICE_SINGLE_SUCCESS_PDUS, >> raw_pdu(0x08, 0x01, 0x00, 0x10, 0x00, 0x03, 0x28), >> raw_pdu(0x09, 0x07, 0x02, 0x00, 0x04, 0x00, 0x00, 0x19, 0x00), >> raw_pdu(0x08, 0x03, 0x00, 0x10, 0x00, 0x03, 0x28), >> @@ -901,10 +895,7 @@ static struct iovec get_descriptor_2[] = { >> }; >> >> static struct iovec get_descriptor_3[] = { >> - raw_pdu(0x10, 0x01, 0x00, 0xff, 0xff, 0x00, 0x28), >> - raw_pdu(0x11, 0x06, 0x01, 0x00, 0x10, 0x00, 0x00, 0x18), >> - raw_pdu(0x10, 0x11, 0x00, 0xff, 0xff, 0x00, 0x28), >> - raw_pdu(0x01, 0x11, 0x11, 0x00, 0x0a), >> + SEARCH_SERVICE_SINGLE_SUCCESS_PDUS, >> raw_pdu(0x08, 0x01, 0x00, 0x10, 0x00, 0x03, 0x28), >> raw_pdu(0x09, 0x07, 0x02, 0x00, 0x04, 0x00, 0x00, 0x19, 0x00), >> raw_pdu(0x08, 0x03, 0x00, 0x10, 0x00, 0x03, 0x28), >> @@ -915,10 +906,7 @@ static struct iovec get_descriptor_3[] = { >> }; >> >> static struct iovec get_included_1[] = { >> - raw_pdu(0x10, 0x01, 0x00, 0xff, 0xff, 0x00, 0x28), >> - raw_pdu(0x11, 0x06, 0x01, 0x00, 0x10, 0x00, 0x00, 0x18), >> - raw_pdu(0x10, 0x11, 0x00, 0xff, 0xff, 0x00, 0x28), >> - raw_pdu(0x01, 0x11, 0x11, 0x00, 0x0a), >> + SEARCH_SERVICE_SINGLE_SUCCESS_PDUS, >> raw_pdu(0x08, 0x01, 0x00, 0x10, 0x00, 0x02, 0x28), >> raw_pdu(0x09, 0x08, 0x02, 0x00, 0x15, 0x00, 0x19, 0x00, 0xff, 0xfe), >> raw_pdu(0x08, 0x03, 0x00, 0x10, 0x00, 0x02, 0x28), >> @@ -927,10 +915,7 @@ static struct iovec get_included_1[] = { >> }; >> >> static struct iovec get_included_2[] = { >> - raw_pdu(0x10, 0x01, 0x00, 0xff, 0xff, 0x00, 0x28), >> - raw_pdu(0x11, 0x06, 0x01, 0x00, 0x10, 0x00, 0x00, 0x18), >> - raw_pdu(0x10, 0x11, 0x00, 0xff, 0xff, 0x00, 0x28), >> - raw_pdu(0x01, 0x11, 0x11, 0x00, 0x0a), >> + SEARCH_SERVICE_SINGLE_SUCCESS_PDUS, >> raw_pdu(0x08, 0x01, 0x00, 0x10, 0x00, 0x02, 0x28), >> raw_pdu(0x09, 0x06, 0x02, 0x00, 0x15, 0x00, 0x19, 0x00), >> raw_pdu(0x0a, 0x15, 0x00), >> @@ -942,20 +927,14 @@ static struct iovec get_included_2[] = { >> }; >> >> static struct iovec get_included_3[] = { >> - raw_pdu(0x10, 0x01, 0x00, 0xff, 0xff, 0x00, 0x28), >> - raw_pdu(0x11, 0x06, 0x01, 0x00, 0x10, 0x00, 0x00, 0x18), >> - raw_pdu(0x10, 0x11, 0x00, 0xff, 0xff, 0x00, 0x28), >> - raw_pdu(0x01, 0x11, 0x11, 0x00, 0x0a), >> + SEARCH_SERVICE_SINGLE_SUCCESS_PDUS, >> raw_pdu(0x08, 0x01, 0x00, 0x10, 0x00, 0x02, 0x28), >> raw_pdu(0x01, 0x08, 0x01, 0x00, 0x0a), >> end_pdu >> }; >> >> static struct iovec read_characteristic_1[] = { >> - raw_pdu(0x10, 0x01, 0x00, 0xff, 0xff, 0x00, 0x28), >> - raw_pdu(0x11, 0x06, 0x01, 0x00, 0x10, 0x00, 0x00, 0x18), >> - raw_pdu(0x10, 0x11, 0x00, 0xff, 0xff, 0x00, 0x28), >> - raw_pdu(0x01, 0x11, 0x11, 0x00, 0x0a), >> + SEARCH_SERVICE_SINGLE_SUCCESS_PDUS, >> raw_pdu(0x08, 0x01, 0x00, 0x10, 0x00, 0x03, 0x28), >> raw_pdu(0x09, 0x07, 0x02, 0x00, 0x04, 0x03, 0x00, 0x19, 0x00), >> raw_pdu(0x08, 0x03, 0x00, 0x10, 0x00, 0x03, 0x28), >> @@ -966,10 +945,7 @@ static struct iovec read_characteristic_1[] = { >> }; >> >> static struct iovec read_characteristic_2[] = { >> - raw_pdu(0x10, 0x01, 0x00, 0xff, 0xff, 0x00, 0x28), >> - raw_pdu(0x11, 0x06, 0x01, 0x00, 0x10, 0x00, 0x00, 0x18), >> - raw_pdu(0x10, 0x11, 0x00, 0xff, 0xff, 0x00, 0x28), >> - raw_pdu(0x01, 0x11, 0x11, 0x00, 0x0a), >> + SEARCH_SERVICE_SINGLE_SUCCESS_PDUS, >> raw_pdu(0x08, 0x01, 0x00, 0x10, 0x00, 0x03, 0x28), >> raw_pdu(0x09, 0x07, 0x02, 0x00, 0x04, 0x03, 0x00, 0x19, 0x00), >> raw_pdu(0x08, 0x03, 0x00, 0x10, 0x00, 0x03, 0x28), >> @@ -980,10 +956,7 @@ static struct iovec read_characteristic_2[] = { >> }; >> >> static struct iovec read_descriptor_1[] = { >> - raw_pdu(0x10, 0x01, 0x00, 0xff, 0xff, 0x00, 0x28), >> - raw_pdu(0x11, 0x06, 0x01, 0x00, 0x10, 0x00, 0x00, 0x18), >> - raw_pdu(0x10, 0x11, 0x00, 0xff, 0xff, 0x00, 0x28), >> - raw_pdu(0x01, 0x11, 0x11, 0x00, 0x0a), >> + SEARCH_SERVICE_SINGLE_SUCCESS_PDUS, >> raw_pdu(0x08, 0x01, 0x00, 0x10, 0x00, 0x03, 0x28), >> raw_pdu(0x09, 0x07, 0x02, 0x00, 0x04, 0x00, 0x00, 0x19, 0x00), >> raw_pdu(0x08, 0x03, 0x00, 0x10, 0x00, 0x03, 0x28), >> @@ -998,10 +971,7 @@ static struct iovec read_descriptor_1[] = { >> }; >> >> static struct iovec read_descriptor_2[] = { >> - raw_pdu(0x10, 0x01, 0x00, 0xff, 0xff, 0x00, 0x28), >> - raw_pdu(0x11, 0x06, 0x01, 0x00, 0x10, 0x00, 0x00, 0x18), >> - raw_pdu(0x10, 0x11, 0x00, 0xff, 0xff, 0x00, 0x28), >> - raw_pdu(0x01, 0x11, 0x11, 0x00, 0x0a), >> + SEARCH_SERVICE_SINGLE_SUCCESS_PDUS, >> raw_pdu(0x08, 0x01, 0x00, 0x10, 0x00, 0x03, 0x28), >> raw_pdu(0x09, 0x07, 0x02, 0x00, 0x04, 0x00, 0x00, 0x19, 0x00), >> raw_pdu(0x08, 0x03, 0x00, 0x10, 0x00, 0x03, 0x28), >> @@ -1016,10 +986,7 @@ static struct iovec read_descriptor_2[] = { >> }; >> >> static struct iovec write_characteristic_1[] = { >> - raw_pdu(0x10, 0x01, 0x00, 0xff, 0xff, 0x00, 0x28), >> - raw_pdu(0x11, 0x06, 0x01, 0x00, 0x10, 0x00, 0x00, 0x18), >> - raw_pdu(0x10, 0x11, 0x00, 0xff, 0xff, 0x00, 0x28), >> - raw_pdu(0x01, 0x11, 0x11, 0x00, 0x0a), >> + SEARCH_SERVICE_SINGLE_SUCCESS_PDUS, >> raw_pdu(0x08, 0x01, 0x00, 0x10, 0x00, 0x03, 0x28), >> raw_pdu(0x09, 0x07, 0x02, 0x00, 0x04, 0x03, 0x00, 0x19, 0x00), >> raw_pdu(0x08, 0x03, 0x00, 0x10, 0x00, 0x03, 0x28), >> @@ -1029,10 +996,7 @@ static struct iovec write_characteristic_1[] = { >> }; >> >> static struct iovec write_characteristic_2[] = { >> - raw_pdu(0x10, 0x01, 0x00, 0xff, 0xff, 0x00, 0x28), >> - raw_pdu(0x11, 0x06, 0x01, 0x00, 0x10, 0x00, 0x00, 0x18), >> - raw_pdu(0x10, 0x11, 0x00, 0xff, 0xff, 0x00, 0x28), >> - raw_pdu(0x01, 0x11, 0x11, 0x00, 0x0a), >> + SEARCH_SERVICE_SINGLE_SUCCESS_PDUS, >> raw_pdu(0x08, 0x01, 0x00, 0x10, 0x00, 0x03, 0x28), >> raw_pdu(0x09, 0x07, 0x02, 0x00, 0x04, 0x03, 0x00, 0x19, 0x00), >> raw_pdu(0x08, 0x03, 0x00, 0x10, 0x00, 0x03, 0x28), >> @@ -1043,10 +1007,7 @@ static struct iovec write_characteristic_2[] = { >> }; >> >> static struct iovec write_characteristic_3[] = { >> - raw_pdu(0x10, 0x01, 0x00, 0xff, 0xff, 0x00, 0x28), >> - raw_pdu(0x11, 0x06, 0x01, 0x00, 0x10, 0x00, 0x00, 0x18), >> - raw_pdu(0x10, 0x11, 0x00, 0xff, 0xff, 0x00, 0x28), >> - raw_pdu(0x01, 0x11, 0x11, 0x00, 0x0a), >> + SEARCH_SERVICE_SINGLE_SUCCESS_PDUS, >> raw_pdu(0x08, 0x01, 0x00, 0x10, 0x00, 0x03, 0x28), >> raw_pdu(0x09, 0x07, 0x02, 0x00, 0x04, 0x03, 0x00, 0x19, 0x00), >> raw_pdu(0x08, 0x03, 0x00, 0x10, 0x00, 0x03, 0x28), >> @@ -1057,10 +1018,7 @@ static struct iovec write_characteristic_3[] = { >> }; >> >> static struct iovec write_descriptor_1[] = { >> - raw_pdu(0x10, 0x01, 0x00, 0xff, 0xff, 0x00, 0x28), >> - raw_pdu(0x11, 0x06, 0x01, 0x00, 0x10, 0x00, 0x00, 0x18), >> - raw_pdu(0x10, 0x11, 0x00, 0xff, 0xff, 0x00, 0x28), >> - raw_pdu(0x01, 0x11, 0x11, 0x00, 0x0a), >> + SEARCH_SERVICE_SINGLE_SUCCESS_PDUS, >> raw_pdu(0x08, 0x01, 0x00, 0x10, 0x00, 0x03, 0x28), >> raw_pdu(0x09, 0x07, 0x02, 0x00, 0x04, 0x00, 0x00, 0x19, 0x00), >> raw_pdu(0x08, 0x03, 0x00, 0x10, 0x00, 0x03, 0x28), >> @@ -1075,10 +1033,7 @@ static struct iovec write_descriptor_1[] = { >> }; >> >> static struct iovec write_descriptor_2[] = { >> - raw_pdu(0x10, 0x01, 0x00, 0xff, 0xff, 0x00, 0x28), >> - raw_pdu(0x11, 0x06, 0x01, 0x00, 0x10, 0x00, 0x00, 0x18), >> - raw_pdu(0x10, 0x11, 0x00, 0xff, 0xff, 0x00, 0x28), >> - raw_pdu(0x01, 0x11, 0x11, 0x00, 0x0a), >> + SEARCH_SERVICE_SINGLE_SUCCESS_PDUS, >> raw_pdu(0x08, 0x01, 0x00, 0x10, 0x00, 0x03, 0x28), >> raw_pdu(0x09, 0x07, 0x02, 0x00, 0x04, 0x00, 0x00, 0x19, 0x00), >> raw_pdu(0x08, 0x03, 0x00, 0x10, 0x00, 0x03, 0x28), >> @@ -1093,10 +1048,7 @@ static struct iovec write_descriptor_2[] = { >> }; >> >> static struct iovec notification_1[] = { >> - raw_pdu(0x10, 0x01, 0x00, 0xff, 0xff, 0x00, 0x28), >> - raw_pdu(0x11, 0x06, 0x01, 0x00, 0x10, 0x00, 0x00, 0x18), >> - raw_pdu(0x10, 0x11, 0x00, 0xff, 0xff, 0x00, 0x28), >> - raw_pdu(0x01, 0x11, 0x11, 0x00, 0x0a), >> + SEARCH_SERVICE_SINGLE_SUCCESS_PDUS, >> raw_pdu(0x08, 0x01, 0x00, 0x10, 0x00, 0x03, 0x28), >> raw_pdu(0x09, 0x07, 0x02, 0x00, 0x04, 0x00, 0x00, 0x19, 0x00), >> raw_pdu(0x08, 0x03, 0x00, 0x10, 0x00, 0x03, 0x28), >> @@ -1105,10 +1057,7 @@ static struct iovec notification_1[] = { >> }; >> >> static struct iovec notification_2[] = { >> - raw_pdu(0x10, 0x01, 0x00, 0xff, 0xff, 0x00, 0x28), >> - raw_pdu(0x11, 0x06, 0x01, 0x00, 0x10, 0x00, 0x00, 0x18), >> - raw_pdu(0x10, 0x11, 0x00, 0xff, 0xff, 0x00, 0x28), >> - raw_pdu(0x01, 0x11, 0x11, 0x00, 0x0a), >> + SEARCH_SERVICE_SINGLE_SUCCESS_PDUS, >> raw_pdu(0x08, 0x01, 0x00, 0x10, 0x00, 0x03, 0x28), >> raw_pdu(0x09, 0x07, 0x02, 0x00, 0x04, 0x00, 0x00, 0x19, 0x00), >> raw_pdu(0x08, 0x03, 0x00, 0x10, 0x00, 0x03, 0x28), >> @@ -1119,10 +1068,7 @@ static struct iovec notification_2[] = { >> }; >> >> static struct iovec notification_3[] = { >> - raw_pdu(0x10, 0x01, 0x00, 0xff, 0xff, 0x00, 0x28), >> - raw_pdu(0x11, 0x06, 0x01, 0x00, 0x10, 0x00, 0x00, 0x18), >> - raw_pdu(0x10, 0x11, 0x00, 0xff, 0xff, 0x00, 0x28), >> - raw_pdu(0x01, 0x11, 0x11, 0x00, 0x0a), >> + SEARCH_SERVICE_SINGLE_SUCCESS_PDUS, >> raw_pdu(0x08, 0x01, 0x00, 0x10, 0x00, 0x03, 0x28), >> raw_pdu(0x09, 0x07, 0x02, 0x00, 0x04, 0x00, 0x00, 0x19, 0x00), >> raw_pdu(0x08, 0x03, 0x00, 0x10, 0x00, 0x03, 0x28), > > -- > BR > Szymon Janc Michael Janssen -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html