|
假设发送数组 txbuf = {'a','b'},代码如下:
uint8_t txbuf = {'a','b'};
memset(&hvx_params, 0, sizeof(hvx_params));
uint16_t len = 2;
hvx_params.handle = m_char_handles.value_handle;
hvx_params.type = BLE_GATT_HVX_NOTIFICATION;
hvx_params.offset = 0;
hvx_params.p_len = &len;
hvx_params.p_data = txbuf;
err_code = sd_ble_gatts_hvx(m_conn_handle, &hvx_params);
APP_ERROR_CHECK(err_code);
问题是:只有当 uint16_t len=1 时才能发送出txbuf[0]里的数组,只要改成其它值就不行了
|
|