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

Error while building "nrf-mpu-simple" from in "ble_gap_whitelist_t" structure.

Hi, 

I am trying to send accelerometer values through bluetooth for nRF52832 and SDK 14.2. I am using "nrf-mpu-simple" program form this 'GitHub'  repository and added BLE components in this program. But while building the code in SES, it shows the following error in the "ble_gap_whitelist_t" structure:

"expected ':', ',', ';', '}' or '__attribute__' before '=' token".

Please look into it.

Parents Reply Children
  • Hi Martin,

    I cannot share my complete code with you but I can share you the structure in which the error is coming. The error is in "ble_advertising_t" structure of "ble_advertising.h". The structure is:

    typedef struct
    {
        bool                        initialized;
        bool                        advertising_start_pending;                /**< Flag to keep track of ongoing operations in flash. */
    
        ble_adv_evt_t               adv_evt;                                  /**< Advertising event propogated to the main application. The event is either a transaction to a new advertising mode, or a request for whitelist or peer address. */
    
        ble_adv_mode_t              adv_mode_current;                         /**< Variable to keep track of the current advertising mode. */
        ble_adv_modes_config_t      adv_modes_config;                         /**< Struct to keep track of disabled and enabled advertising modes, as well as time-outs and intervals.*/
        uint8_t                     conn_cfg_tag;                             /**< Variable to keep track of what connection settings will be used if the advertising results in a connection. */
    
        ble_gap_addr_t              peer_address;                             /**< Address of the most recently connected peer, used for direct advertising. */
        bool                        peer_addr_reply_expected;                 /**< Flag to verify that peer address is only set when requested. */
    
        ble_advdata_t               advdata;                                  /**< Used by the initialization function to set name, appearance, and UUIDs and advertising flags visible to peer devices. */
        ble_advdata_manuf_data_t    manuf_specific_data;                      /**< Manufacturer specific data structure*/
        uint8_t                     manuf_data_array[BLE_GAP_ADV_MAX_SIZE];   /**< Array to store the Manufacturer specific data*/
        ble_advdata_service_data_t  service_data;                             /**< Service data structure. */
        uint8_t                     service_data_array[BLE_GAP_ADV_MAX_SIZE]; /**< Array to store the service data. */
        ble_advdata_conn_int_t      slave_conn_int;                           /**< Connection interval range structure.*/
        uint16_t                    current_slave_link_conn_handle;           /**< Connection handle for the active link. */
    
        ble_adv_evt_handler_t       evt_handler;                              /**< Handler for the advertising events. Can be initialized as NULL if no handling is implemented on in the main application. */
        ble_adv_error_handler_t     error_handler;                            /**< Handler for the advertising error events. */
    
        bool                        whitelist_temporarily_disabled;           /**< Flag to keep track of temporary disabling of the whitelist. */
        bool                        whitelist_reply_expected;
    
    #if (NRF_SD_BLE_API_VERSION <= 2)
        // For SoftDevices v 2.x, this module caches a whitelist which is retrieved from the
        // application using an event, and which is passed as a parameter when calling
        // sd_ble_gap_adv_start().
        ble_gap_addr_t * p_whitelist_addrs[BLE_GAP_WHITELIST_ADDR_MAX_COUNT];
        ble_gap_irk_t  * p_whitelist_irks[BLE_GAP_WHITELIST_IRK_MAX_COUNT];
        ble_gap_addr_t   whitelist_addrs[BLE_GAP_WHITELIST_ADDR_MAX_COUNT];
        ble_gap_irk_t    whitelist_irks[BLE_GAP_WHITELIST_IRK_MAX_COUNT];
    
        struct ble_gap_whitelist_t m_whitelist =
        {
          .pp_addrs = p_whitelist_addrs,
          .pp_irks  = p_whitelist_irks
        };
    #else
        // For SoftDevices v 3.x, this module does not need to cache a whitelist, but it needs to
        // be aware of whether or not a whitelist has been set (e.g. using the Peer Manager)
        // in order to start advertising with the proper advertising params (filter policy).
        bool whitelist_in_use;
    #endif  
    } ble_advertising_t;

    I have defined the structure in this way also:

    typedef struct
    {
       ble_gap_addr_t    **pp_addrs;        /**< Pointer to an array of device address pointers, pointing to addresses to be used in whitelist. NULL if none are given. */
       uint8_t             addr_count;      /**< Count of device addresses in array, up to @ref BLE_GAP_WHITELIST_ADDR_MAX_COUNT. */
       ble_gap_irk_t     **pp_irks;         /**< Pointer to an array of Identity Resolving Key (IRK) pointers, each pointing to an IRK in the whitelist. NULL if none are given. */
       uint8_t             irk_count;       /**< Count of IRKs in array, up to @ref BLE_GAP_WHITELIST_IRK_MAX_COUNT. */
    } ble_gap_whitelist_t;

    And then assigned the values but it still shows the same error.

  • I don't think I can help you unless you share your code. We can make the case private if you want confidentiality.

Related