Write long characteristics

Team, 

I am using nrf52810, sdk 17, sd112. 

I have setup a write characteristics, to receive some long data ( 64 bytes)

// write char
memset(&add_char_params, 0, sizeof(add_char_params));
add_char_params.uuid = LBS_UUID_WR_CHAR;
add_char_params.uuid_type = p_lbs->uuid_type;
add_char_params.init_len = 64;
add_char_params.max_len = 64;
add_char_params.char_props.read = 0;
add_char_params.char_props.write = 1;
add_char_params.is_value_user = true;

add_char_params.read_access = SEC_OPEN;
add_char_params.write_access = SEC_OPEN;

characteristic_add(p_lbs->service_handle, &add_char_params, &p_lbs->wr_char_handles);

I have set my MTU to 70

When I use NRF connect android app and issue small data (8-12 bytes), it arrives on the nrf52810. 

When I send long data anything longer than 25 bytes, it does not arrive. 

My questions are: 

1. Where is the memory for holding incoming characteristics data? 

does this flag control its location?  add_char_params.is_value_user = true;  the documentation reads :   /**< Indicate if the content of the characteristic is to be stored in the application (user) or in the stack.*/

In some examples I have seen this  attr_md.vloc = BLE_GATTS_VLOC_STACK;

how are the two related?

2. What is the purpose of  sd_ble_user_mem_reply

The documentation reads: 

p_block Pointer to a user memory block structure or NULL if memory is managed by the application.

3. who initiates the MTU exchange? is it sufficient to set the MTU on the NRF52 to 70 bytes? Does the android nrf connect request a larger MTU? 

Any step by step guidance on how to receive large data would be much appreciated. 

Regards, 

Hari 

NOTE: I WAS ABLE TO GET THIS WORKING

Upon connection from android app, I made the nrf52 request mtu of 70 to android app. After that transfer is happening properly. 

Please confirm I have done the right thing. 

Related