This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

pc-ble-driver 1.0 bandwidth configuration

Hello,

I work on application (written in C, compiled with GCC) which use pc-ble-driver 1.0 and nRF51822QFAC with the ble_connectivity (S130 v2.0.0) as BLE Gateway. I need to to change bandwidth configuration but unfortunately I can not do this properly (or it does not work). Every time when I try to set any options using ble_conn_bw_counts_t from ble_enable_params_t struct in sd_ble_enable() I get ERROR 0x03 (NRF_ERROR_INTERNAL).

Handler sd_rpc_status_handler_t returns following codes and messages:

  • status code: '4', message: 'Error sending packet to target. Code #3'
  • status code: '4', message: 'Error sending packet to target. Code #13'

This is procedure how I try to do this:

Initialize the SoftDevice RPC module

physical_layer = sd_rpc_physical_layer_create_uart(serial_port, baud_rate, SD_RPC_FLOW_CONTROL_NONE, SD_RPC_PARITY_NONE);
...
data_link_layer = sd_rpc_data_link_layer_create_bt_three_wire(physical_layer, 1000);
...
transport_layer = sd_rpc_transport_layer_create(data_link_layer, 100);
...
adapter = sd_rpc_adapter_create(transport_layer);
...
sd_rpc_open(adapter, sd_rpc_status_handler, ble_evt_dispatch, log_handler);
...

Enable BLE Stack

ble_enable_params_t ble_enable_params;
ble_enable_params.gatts_enable_params.attr_tab_size    = BLE_GATTS_ATTR_TAB_SIZE_DEFAULT;
ble_enable_params.gatts_enable_params.service_changed  = false;
ble_enable_params.gap_enable_params.periph_conn_count  = 1;
ble_enable_params.gap_enable_params.central_conn_count = 2;
ble_enable_params.gap_enable_params.central_sec_count  = 1;
ble_enable_params.common_enable_params.vs_uuid_count   = 3;

ble_conn_bw_counts_t ble_conn_bw_counts;
ble_conn_bw_counts.tx_counts.high_count 	= 2;
ble_conn_bw_counts.tx_counts.mid_count 		= 0;
ble_conn_bw_counts.tx_counts.low_count		= 1;
ble_conn_bw_counts.rx_counts.high_count 	= 2;
ble_conn_bw_counts.rx_counts.mid_count 		= 0;
ble_conn_bw_counts.rx_counts.low_count		= 1;
ble_enable_params.common_enable_params.p_conn_bw_counts = &ble_conn_bw_counts;


err_code = sd_ble_enable(adapter, &ble_enable_params, NULL);

The result of this code is ERROR 0x03 (NRF_ERROR_INTERNAL) on sd_ble_enable(). If I remove ble_conn_bw_counts_t structure then sd_ble_enable() returns 0x00 (NRF_SUCCESS).

So could You tell me why this does not work?

Mike


EDIT 1:

Anyone? Can somebody tell me what returned to the sd_rpc_status_handler_t messages mean:

  • status code: '4', message: 'Error sending packet to target. Code #3'
  • status code: '4', message: 'Error sending packet to target. Code #13'

?

  • Thank You Hung Bui for help. It seems to be working now. Could tell me also, how to interpret messages from a 'sd_rpc_status_handler_t' (status / error codes)?

  • Hi Mike,

    Status code 4 means PKT_SEND_ERROR as defined in sd_rpc_app_status_t in sd_rpc_types.h. Error code 3 and 13 match with NRF_ERROR_INTERNAL and NRF_ERROR_TIMEOUT as in nrf_error.h

  • Hi again, setting a bandwidth works but I am still not able to achieve maximum data throughput (128 kbit/s). I am able only to achieve around 16,8 kbit/s which is not enough for my application. Is there any limitation in ble_connectivity firmware which does not allow to achieve maximum data throughput?

    I noticed that my peripheral device can't send to me 6 packet per connection every time. Sometimes it is able to send 3 or only 1 packet. The same device has no problem to send 6 packets in every connection with Master Control Panel 3.10 and achieve maximum data throughput.

    Could You tell me if it is possible to achieve maximum data throughput with ble_connectivity and pc-ble-driver 1.0 ? If yes, what I have to do?

  • @Mike: I would suggest you to create a new question. In your question please include more information on how many peripherals you connected to the central. I assume you set high bandwidth with option API sd_ble_opt_set() before you call the connect request from central.

    A sniffer trace can help telling which side caused the low bandwidth.

  • I'va made a new question for this issue here.

Related