Hi, -----Original Message----- From: linux-bluetooth-owner@xxxxxxxxxxxxxxx [mailto:linux-bluetooth-owner@xxxxxxxxxxxxxxx] On Behalf Of Johan Hedberg Sent: Tuesday, November 16, 2010 7:37 AM To: Sheldon Demario Cc: linux-bluetooth@xxxxxxxxxxxxxxx Subject: Re: [PATCH] Adding a new option to specify security level for gatttool Hi Sheldon, On Tue, Nov 16, 2010, Sheldon Demario wrote: > --- > TODO | 6 ------ > attrib/gatttool.c | 15 +++++++++++++-- > 2 files changed, 13 insertions(+), 8 deletions(-) In general the patch seems fine, but: > + if (strncmp(opt_sec_level, "medium", 6) == 0) > + sec_level = BT_IO_SEC_MEDIUM; > + else if (strncmp(opt_sec_level, "high", 4) == 0) > + sec_level = BT_IO_SEC_HIGH; > + else > + sec_level = BT_IO_SEC_LOW; Why do you use strncmp instead of strcmp (or even g_str_equal)? I don't think there's any need to map e.g. "mediumfoobar" to BT_IO_SEC_MEDIUM ;) [Mtsai] I am not sure what are the definition of "low", "medium" or "high". By the spec of Core 4.0, LE has 2 security modes and different security levels based on the method of pairing (or bonding). It may be appeal to end user with "low", "medium" and "high" definition, but it can't be reference with LE spec. I would suggest, instead, following terms, "No security", "unauthenticated encryption", "authenticated encryption", "unauthenticated data signing", "authenticated data signing, Mike Johan -- 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 -- 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