This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Using the S130 alpha SD

I'm trying to test the throughput improvement of the S130 alpha softdevice vs S130 V1.

I notice a couple of changes in the API that I'm not sure how to handle:

First, ble_enable_params_t has changed and so has the number of arguments for sd_ble_enable. My old code looks like this:

ble_enable_params.gatts_enable_params.service_changed = false;
ble_enable_params.gap_enable_params.role              = BLE_GAP_ROLE_CENTRAL;
err_code = sd_ble_enable(&ble_enable_params);

There is no longer a "role" field and sd_ble_enable requires more arguments. Is there an example of how to call this?

Also, is there an existing define for the alpha release headers so I can protect the old code with an #ifndef S130_ALPHA or some such macro?

At this point I should also ask what other changes need to be made to the project in order to use the S130 alpha? All I've done so far is create a new folder for the new header files and changed the ble path in the project to point to that folder.

For example, is there anything I need to do to tell the SD to accept 3 packets per connection interval or is that automatic?

  • I got everything to build. It took a while because many header and c files were moved from SDK 9 to SDK 10. I also added a second NULL argument to sd_ble_enable and that fixed the build issue.

    Now I'm having trouble with notify_enable. Here's the code, which is the same in SDK 9 and SDK 10:

    static void notify_enable(void)
    {
        ble_gattc_write_params_t write_params;
        uint8_t                  buf[BLE_CCCD_VALUE_LEN];
    	
        buf[0] = BLE_GATT_HVX_NOTIFICATION;
        buf[1] = 0;
    
        write_params.write_op = BLE_GATT_OP_WRITE_REQ;
        write_params.handle   = RX_cccd_handle;
        write_params.offset   = 0;
        write_params.len      = sizeof(buf);
        write_params.p_value  = buf;
     write_params.flags    = BLE_GATT_EXEC_WRITE_FLAG_PREPARED_WRITE;
    
        APP_ERROR_CHECK( sd_ble_gattc_write(conn_handle, &write_params) );
    }
    

    On SDK 9, this code works fine. With SDK 10, sd_ble_gattc_write() returns code 8, illegal state. Has there been a change in how this function is used?

  • SDK 10 s130 examples should work with SoftDevice s130 v1.0.0 out of the box. sd_ble_enable(...) in s130 v1.0.0 takes one argument, and in s130 v2.0.0-4.alpha or v2.0.0-7.alpha it takes two arguments. If you are using v1.0.0, I suggest that you download SDK again, it seems that you have changed the ble header files.

  • I'm using the s130 alpha which came with a new set of include files. Are those files backward compatible to s130 v1.0.0?

    As you say, the SDK 10 s130 examples work with s130 v1.0.0 out of the box, but they don't work with S130alpha and the S130alpha release notes don't give a clue about how to make them work.

  • Ok, I misunderstood your first question and thought you were going from alpha release to v1.0.0. I realize now that you are going from the v1.0.0 release to v2.0.0 alpha. I have made a quick walkthrough for the s132 v2.0.0 alphas here (it will be updated with a more in depth document). The procedure is the same for s130 v2.0.0 alphas, only the ROM and RAM size is different.

Related