Languages

Menu
Sites
Language
call bt_gatt_client_write_value() two more time.

Hello.

I want to send master to peripheral with BLE and I'm successed in one time send and receive with IOS.

Now, I want to sendd data from tizen to IOS two time.

 

First,

I set

bt_gatt_set_value()

bt_gatt_client_write_value(chr, __bt_gatt_client_write_complete_cb,
                                         NULL);

__bt_gatt_client_write_complete_cb() is called and successfully send data and IOS can receive.

 

Second,

I want to send other data again.  And call ..

bt_gatt_set_value()

bt_gatt_client_write_value(chr, __bt_gatt_client_write_complete_cb,
                                         NULL);

In this time, the callback __bt_gatt_client_write_complete_cb() is not called but can send data successfully.

 

Third,

One more time, try to send data.

bt_gatt_set_value()

bt_gatt_client_write_value(chr, __bt_gatt_client_write_complete_cb,
                                         NULL);

In this time, bt_gatt_client_write_value() return fail and can't send data.

It return BT_ERROR_NOW_IN_PROGRESS.

 

Isn't it some wrong logci?

Actually, third try is receive logic.  But I supecet second is wrong logic because call with same callback function.  Than, how can I send and recive one more times?

In each time, should I set write, read complete callback function is right?

 

If I don't call bt_gatt_client_write_value() in second time, it seems that tizen can't send data and IOS can't receive.

 

Edited by: An on 28 Aug, 2017

Responses

2 Replies
An

I made __bt_gatt_client_write_complete_cb_2 and call it second time.

It have same result.  As I see bt_gatt_client_write_value() only can be called one time.  Than, how can I send data two more time?

K Johnson

What's the error you're getting while calling bt_gatt_client_write_value() for the second time? Please share that. Also please share more from codes you're trying.