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

error code: 0x08

hello, I am using S130 softdevice. While I am trying to connect with MCP I am getting one error with error code :0x08. and MCP is showing a message like "Lost connection to the device. Reason: BTLE CONNECTION TIMEOUT".

My code looks like this:

#define MIN_CONN_INTERVAL                    MSEC_TO_UNITS(500, UNIT_1_25_MS)      
#define MAX_CONN_INTERVAL                   MSEC_TO_UNITS(1000, UNIT_1_25_MS) 
#define SLAVE_LATENCY                           0                                         
#define CONN_SUP_TIMEOUT                    MSEC_TO_UNITS(4000, UNIT_10_MS)          

#define FIRST_CONN_PARAMS_UPDATE_DELAY       APP_TIMER_TICKS(5000, APP_TIMER_PRESCALER) 
#define NEXT_CONN_PARAMS_UPDATE_DELAY        APP_TIMER_TICKS(30000, APP_TIMER_PRESCALER)
#define MAX_CONN_PARAMS_UPDATE_COUNT         3        

ble_conn_params_init_t cp_init;

cp_init.p_conn_params                  = NULL;
cp_init.first_conn_params_update_delay = FIRST_CONN_PARAMS_UPDATE_DELAY;
cp_init.next_conn_params_update_delay  = NEXT_CONN_PARAMS_UPDATE_DELAY;
cp_init.max_conn_params_update_count   = MAX_CONN_PARAMS_UPDATE_COUNT;
cp_init.start_on_notify_cccd_handle    = BLE_GATT_HANDLE_INVALID;
cp_init.disconnect_on_fail             = true;
cp_init.evt_handler                    = NULL;
cp_init.error_handler                  = conn_params_error_handler;

err_code = ble_conn_params_init(&cp_init);

And the conn_params_error_handler is returning the error. I used the same connection parameters for S110 demo app and it works fine.

What could be the reason for this? Did anybody get the same error? Where should I modify my code?

edit: format

Parents
  • Error code 0x08 NRF_ERROR_INVALID_STATE indicate that you are trying to do an operation from a state that the specific operations isn't allowed. It could be that you are trying to change the connection parameters too early, for example before you have established the connection itself.

    Are you running the S130 with just one peripheral or do you have it running as a central as well? Make sure that you are updating the connection parameters for the right connection. In the S130 example they differentiate between a peripherals connection parameter request and what the central will allow.

  • I tried with peripheral only. I could figure out my mistake. Thanks for the help.

Reply Children
No Data
Related