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?

  • For an example of how to call sd_ble_enable, take a look at ble_stack_init() in the SDK examples. For your convenience, here it is:

    #if defined(S110) || defined(S130) || defined(S132)
        // Enable BLE stack.
        ble_enable_params_t ble_enable_params;
        memset(&ble_enable_params, 0, sizeof(ble_enable_params));
    #if (defined(S130) || defined(S132))
        ble_enable_params.gatts_enable_params.attr_tab_size   = BLE_GATTS_ATTR_TAB_SIZE_DEFAULT;
    #endif
        ble_enable_params.gatts_enable_params.service_changed = IS_SRVC_CHANGED_CHARACT_PRESENT;
        err_code = sd_ble_enable(&ble_enable_params);
        APP_ERROR_CHECK(err_code);
    #endif
    

    The macro S130 is defined in the preprocessor symbols, so you can add your old code inside an #ifdef S130_ALPHA and change the macro to S130_ALPHA to use old code.

    I don't have a complete overview of the changes, but they should be in the release notes located in the SoftDevice folder (zip file downloaded).

    As far as I know, you don't need to tell the SoftDevice to accept 3 packets per connection interval, this is automatic.

  • I'm following the release notes that came with the alpha release. They mention that sd_ble_enable has changed, but not in enough detail to understand how to use it.

    I did a complete search of my 9.0.0 dev environment and I don't have a header file that defines IS_SRVC_CHANGED_CHARACT_PRESENT. And it's not in any of the new header files that came with the alpha release. I'm guessing that I'm missing a file. Can you tell me where to find the header for this macro?

    And my compiler complains that sd_ble_enable takes two arguments, not one. It looks like it takes some kind of memory base. In fact, I can't find the header where the prototype for this function is defined.

  • I installed SDK version 10 and tested the build of some sample projects. I see that IS_SRVC_CHANGED_CHARACT_PRESENT is simply defined to be 0 at the top of the main in the version 10 examples.

  • I'm now working with SDK 10 and the compiler is still complaining about sd_ble_enable. A look at ble.h reveals that the one-argument version of the function requires the macro __CC_ARM to be defined. A little more looking around shows that this macro is used all over the place so I'm reluctant to add it to the project for fear of other side effects. What is it? And if I do add it, should it be local to this file or global to the project? Or is this macro defined somewhere in a header file I need to include?

  • A little more research leads me to believe that the __CC_ARM macro identifies the ARM compiler. How do I turn that on in Keil?

Related