lkml.org 
[lkml]   [2013]   [Oct]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] vsprintf: add Bluetooth UUID %pU[rR] format specifier
From
Date
On Sat, 2013-10-19 at 09:25 -0700, Marcel Holtmann wrote:
> The Bluetooth UUID is used in big endian reversed order. Add new
> modifier to print a UUID in big endian, but where the input byte
> stream is actually in reversed order.
> This is similar to %pMR that allows to print a MAC address in
> reversed order since that is how the Bluetooth BD_ADDR is
> actually represented in a byte stream.

Seems sensible. Other than print_bt_uuid, is
there another place where will it be used?

Are you going to convert print_bt_uuid to use this?

> diff --git a/lib/vsprintf.c b/lib/vsprintf.c
[]
> @@ -1106,6 +1106,7 @@ char *uuid_string(char *buf, char *end, const u8 *addr,
> static const u8 le[16] = {3,2,1,0,5,4,7,6,8,9,10,11,12,13,14,15};
> const u8 *index = be;
> bool uc = false;
> + bool reversed = false;
>
> switch (*(++fmt)) {

Could there ever be a little endian reversed UUID?

Might it be useful to change this to:

while (isalpha(*++fmt)) {
switch (*fmt) {

etc?




\
 
 \ /
  Last update: 2013-10-20 00:01    [W:0.044 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site