2015-11-14 12:28:57

by Andrzej Kaczmarek

[permalink] [raw]
Subject: [PATCH 1/2] monitor/avctp: Fix typos

---
monitor/avctp.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/monitor/avctp.c b/monitor/avctp.c
index 232365e..a024a0f 100644
--- a/monitor/avctp.c
+++ b/monitor/avctp.c
@@ -64,7 +64,7 @@
#define AVC_SUBUNIT_PRINTER 0x02
#define AVC_SUBUNIT_DISC 0x03
#define AVC_SUBUNIT_TAPE 0x04
-#define AVC_SUBUNIT_TURNER 0x05
+#define AVC_SUBUNIT_TUNER 0x05
#define AVC_SUBUNIT_CA 0x06
#define AVC_SUBUNIT_CAMERA 0x07
#define AVC_SUBUNIT_PANEL 0x09
@@ -259,8 +259,8 @@ static const char *subunit2str(uint8_t subunit)
return "Disc";
case AVC_SUBUNIT_TAPE:
return "Tape";
- case AVC_SUBUNIT_TURNER:
- return "Turner";
+ case AVC_SUBUNIT_TUNER:
+ return "Tuner";
case AVC_SUBUNIT_CA:
return "CA";
case AVC_SUBUNIT_CAMERA:
@@ -268,7 +268,7 @@ static const char *subunit2str(uint8_t subunit)
case AVC_SUBUNIT_PANEL:
return "Panel";
case AVC_SUBUNIT_BULLETIN_BOARD:
- return "Bulleting Board";
+ return "Bulletin Board";
case AVC_SUBUNIT_CAMERA_STORAGE:
return "Camera Storage";
case AVC_SUBUNIT_VENDOR_UNIQUE:
@@ -368,7 +368,7 @@ static const char *error2str(uint8_t status)
case AVRCP_STATUS_INVALID_SCOPE:
return "Invalid Scope";
case AVRCP_STATUS_OUT_OF_BOUNDS:
- return "Range Out of Bonds";
+ return "Range Out of Bounds";
case AVRCP_STATUS_MEDIA_IN_USE:
return "Media in Use";
case AVRCP_STATUS_IS_DIRECTORY:
@@ -376,7 +376,7 @@ static const char *error2str(uint8_t status)
case AVRCP_STATUS_NOW_PLAYING_LIST_FULL:
return "Now Playing List Full";
case AVRCP_STATUS_SEARCH_NOT_SUPPORTED:
- return "Seach Not Supported";
+ return "Search Not Supported";
case AVRCP_STATUS_SEARCH_IN_PROGRESS:
return "Search in Progress";
case AVRCP_STATUS_INVALID_PLAYER_ID:
@@ -520,9 +520,9 @@ static const char *value2str(uint8_t attr, uint8_t value)
case 0x01:
return "OFF";
case 0x02:
- return "All Track Suffle";
+ return "All Track Shuffle";
case 0x03:
- return "Group Suffle";
+ return "Group Shuffle";
default:
return "Reserved";
}
@@ -759,7 +759,7 @@ static const char *foldertype2str(uint8_t type)
case 0x01:
return "Titles";
case 0x02:
- return "Albuns";
+ return "Albums";
case 0x03:
return "Artists";
case 0x04:
@@ -1425,7 +1425,7 @@ response:
printf("(UNPLUGGED)\n");
break;
default:
- printf("(UNKOWN)\n");
+ printf("(UNKNOWN)\n");
break;
}
break;
--
2.6.2



2015-11-14 13:31:55

by Andrzej Kaczmarek

[permalink] [raw]
Subject: Re: [PATCH 2/2] monitor/rfcomm: Fix frame names formatting

Hi Johan,

On Sat, Nov 14, 2015 at 2:20 PM, Johan Hedberg <[email protected]> wrote:
> Hi Andrzej,
>
> On Sat, Nov 14, 2015, Andrzej Kaczmarek wrote:
>> ---
>> monitor/rfcomm.c | 8 ++++----
>> 1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/monitor/rfcomm.c b/monitor/rfcomm.c
>> index bdf4000..91f0c39 100644
>> --- a/monitor/rfcomm.c
>> +++ b/monitor/rfcomm.c
>> @@ -422,10 +422,10 @@ struct rfcomm_data {
>>
>> static const struct rfcomm_data rfcomm_table[] = {
>> { 0x2f, "Set Async Balance Mode (SABM) " },
>> - { 0x63, "Unnumbered Ack (UA)" },
>> - { 0x0f, "Disconnect Mode (DM)" },
>> - { 0x43, "Disconnect (DISC)" },
>> - { 0xef, "Unnumbered Info with Header Check (UIH)" },
>> + { 0x63, "Unnumbered Ack (UA) " },
>> + { 0x0f, "Disconnect Mode (DM) " },
>> + { 0x43, "Disconnect (DISC) " },
>> + { 0xef, "Unnumbered Info with Header Check (UIH) " },
>
> I don't see any other users of print_indent() using this kind of extra
> space at the end of the strings. Why would RFCOMM need it if the other's
> don't?
>
> In general, I think it's a bad idea to have formatting details like this
> in the lookup table since that makes it more difficult to reuse the
> string in various scenarios. Instead, the needed spacing should be done
> in the format string that's used in the printf (or similar) function.

Agree, I actually fixed one more similar formatting issue (in a good
way this time) so will send v2 with both changes together.

BR,
Andrzej

2015-11-14 13:21:14

by Johan Hedberg

[permalink] [raw]
Subject: Re: [PATCH 1/2] monitor/avctp: Fix typos

Hi Andrzej,

On Sat, Nov 14, 2015, Andrzej Kaczmarek wrote:
> ---
> monitor/avctp.c | 20 ++++++++++----------
> 1 file changed, 10 insertions(+), 10 deletions(-)

This patch has been applied. Thanks.

Johan

2015-11-14 13:20:10

by Johan Hedberg

[permalink] [raw]
Subject: Re: [PATCH 2/2] monitor/rfcomm: Fix frame names formatting

Hi Andrzej,

On Sat, Nov 14, 2015, Andrzej Kaczmarek wrote:
> ---
> monitor/rfcomm.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/monitor/rfcomm.c b/monitor/rfcomm.c
> index bdf4000..91f0c39 100644
> --- a/monitor/rfcomm.c
> +++ b/monitor/rfcomm.c
> @@ -422,10 +422,10 @@ struct rfcomm_data {
>
> static const struct rfcomm_data rfcomm_table[] = {
> { 0x2f, "Set Async Balance Mode (SABM) " },
> - { 0x63, "Unnumbered Ack (UA)" },
> - { 0x0f, "Disconnect Mode (DM)" },
> - { 0x43, "Disconnect (DISC)" },
> - { 0xef, "Unnumbered Info with Header Check (UIH)" },
> + { 0x63, "Unnumbered Ack (UA) " },
> + { 0x0f, "Disconnect Mode (DM) " },
> + { 0x43, "Disconnect (DISC) " },
> + { 0xef, "Unnumbered Info with Header Check (UIH) " },

I don't see any other users of print_indent() using this kind of extra
space at the end of the strings. Why would RFCOMM need it if the other's
don't?

In general, I think it's a bad idea to have formatting details like this
in the lookup table since that makes it more difficult to reuse the
string in various scenarios. Instead, the needed spacing should be done
in the format string that's used in the printf (or similar) function.

Johan

2015-11-14 12:28:58

by Andrzej Kaczmarek

[permalink] [raw]
Subject: [PATCH 2/2] monitor/rfcomm: Fix frame names formatting

---
monitor/rfcomm.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/monitor/rfcomm.c b/monitor/rfcomm.c
index bdf4000..91f0c39 100644
--- a/monitor/rfcomm.c
+++ b/monitor/rfcomm.c
@@ -422,10 +422,10 @@ struct rfcomm_data {

static const struct rfcomm_data rfcomm_table[] = {
{ 0x2f, "Set Async Balance Mode (SABM) " },
- { 0x63, "Unnumbered Ack (UA)" },
- { 0x0f, "Disconnect Mode (DM)" },
- { 0x43, "Disconnect (DISC)" },
- { 0xef, "Unnumbered Info with Header Check (UIH)" },
+ { 0x63, "Unnumbered Ack (UA) " },
+ { 0x0f, "Disconnect Mode (DM) " },
+ { 0x43, "Disconnect (DISC) " },
+ { 0xef, "Unnumbered Info with Header Check (UIH) " },
{ }
};

--
2.6.2