Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs

characteristic with read & notify repeatedly update in nRF connect app with same value

Continue.

PCA100059,S140,custermize periphral Blinky.

I have changed the value transfered between peripheral & center with

uint8_t* data;

uint16_t dataLen;

The max length set to 50 bytes.

Send 10 bytes to center every time butten event triggered(down/up).

What I saw in nRF connect app:

1) 50 bytes received, including the 10 bytes from the beginning;

    20 bytes receied for few times(include the 10 bytes too). 

2) get update data nearly every 1 second,but the data is same,and I didnot change it in peripheral.

For 1), I have traced into the code,it is OK after called sd_ble_gatts_hvx() : the p_len is 10, that means SDH has sent 10 bytes, and the return code is NRF_SUCCESS.

But the log of nRF connect app showed it received 50 bytes.

For 2),I think nRF connect app should not receive same bytes, I don't know the notify mechanism, this is right or not?

The files:

6378.ble_tgoi.h

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <stdint.h>
#include <string.h>
#include "nordic_common.h"
#include "nrf.h"
#include "app_error.h"
#include "ble.h"
#include "ble_err.h"
#include "ble_hci.h"
#include "ble_srv_common.h"
#include "ble_advdata.h"
#include "ble_conn_params.h"
#include "nrf_sdh.h"
#include "nrf_sdh_ble.h"
#include "boards.h"
#include "app_timer.h"
#include "app_button.h"
#include "ble_tgoi.h"
#include "nrf_ble_gatt.h"
#include "nrf_ble_qwr.h"
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "sdk_common.h"
#if NRF_MODULE_ENABLED(BLE_TGOI)
#include "ble_tgoi.h"
#include "ble_srv_common.h"
/**@brief Function for handling the Write event.
*
* @param[in] p_lbs LED Button Service structure.
* @param[in] p_ble_evt Event received from the BLE stack.
*/
static void on_write(ble_tgoi_t * p_tgoi, ble_evt_t const * p_ble_evt)
{
ble_gatts_evt_write_t const * p_evt_write = &p_ble_evt->evt.gatts_evt.params.write;
//����server�����ݴ��������Ϊһ�����ݰ����ȣ����ݰ������DZ�ģ������ڽ��ʱ��Ҫ�����������жϼ�����
//������г��ȳ����ж�û��Ҫ
if ( (p_evt_write->handle == p_tgoi->SIMO_char_handles.value_handle)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
8015.ble_app_blinky_pca10059_s140.uvprojx