The code generated from the BDS plugin (v.1.2.4, found here: question including link to v1.2.4) is failing because of missing references to boolean_t and bds_boolean_encode().
I was following the example at www.youtube.com/watch to create a project in BDS. This is the step that produced the problem:
- Added a new characteristic called "Button" to a service
- Within this characteristic I added a field called "Button state" with the format "BOOLEAN"
- The code was generated with the v1.2.4 plugin and imported into my EWARM IAR project using experimental_bluetoothds_template (inside nRF5_SDK_11.0.0_89a8197)
Some code snippets from the generated files that the IAR compiler complains about:
ble_button_service.h:
/**@brief Button structure. */
typedef struct
{
boolean_t button_state; // Compiler error here, boolean_t not found
} ble_button_service_button_t;
ble_button_service.c:
/**@brief Function for encoding Button.
*
* @param[in] p_button Button characteristic structure to be encoded.
* @param[out] p_encoded_buffer Buffer where the encoded data will be written.
*
* @return Size of encoded data.
*/
static uint8_t button_encode(ble_button_service_button_t * p_button, uint8_t * encoded_buffer)
{
uint8_t len = 0;
// Compiler error below: bds_boolean_encode not found
len += bds_boolean_encode(&p_button->button_state, &encoded_buffer[len]);
return len;
}
Is something missing in the SDK_11.0.0? To me it seems like the file components\libraries\util\app_util_bds.h should contain this bds_boolean_encode-function?
Edit:
Added an example of a BDS project with missing boolean_t:Boolean_missing.zip