HI Chaojie, On Sat, Sep 27, 2014 at 11:36 AM, Gu, Chao Jie <chao.jie.gu@xxxxxxxxx> wrote: > Hi Lukasz, >> > --- >> > src/shared/gatt-client.c | 27 ++++++++++++++++++++++----- >> > src/shared/gatt-client.h | 4 ++++ >> > 2 files changed, 26 insertions(+), 5 deletions(-) >> > >> > diff --git a/src/shared/gatt-client.c b/src/shared/gatt-client.c index >> > 6dc8e95..aee3969 100644 >> > --- a/src/shared/gatt-client.c >> > +++ b/src/shared/gatt-client.c >> > @@ -1753,19 +1753,26 @@ bool bt_gatt_client_read_long_value(struct >> > bt_gatt_client *client, bool bt_gatt_client_write_without_response(struct >> bt_gatt_client *client, >> > uint16_t value_handle, >> > bool signed_write, >> > - uint8_t *value, uint16_t length) { >> > + uint8_t *value, uint16_t >> > +length) { >> > uint8_t pdu[2 + length]; >> > >> > if (!client) >> > return 0; >> > >> > - /* TODO: Support this once bt_att_send supports signed writes. */ >> > - if (signed_write) >> > - return 0; >> > - >> > put_le16(value_handle, pdu); >> > memcpy(pdu + 2, value, length); >> > >> > + if (signed_write) { >> > + if (bt_att_local_csrk_is_valid(client->att)) >> >> In my opinion bt_att_local_csrk_is_valid API seems to be unnecessary as CSRK can >> be checked inside bt_att_send function directly. >> > > I agree with you that it is also ok to be checked inside bt_att_send function and have thought > about this problem before. > And I think there are two advantages of checking valid outside bt_att_send function > > 1. provide API to user to check CSRK status if they want. Ok, the question is why user would like to do it? Maybe I'm missing something. > 2. if the CSRK is invalid , we can just return false quickly , there is no need to go on calling > down bt_att_send then return false back. It will be more efficient I think. If bt_att_send() will check the CSRK on the beginning then there is no difference. > > What's your point about this ? > > Best Regards > Chaojie Gu > -- 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