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

Error: Identifier Undefined, but keil can find

I'm getting an error which says the identifier ble_temperature_t is undefined, and it is showing as an error in the keil (unkown type name). However when I click on the variable and select go to declaration keil can find it under ble_temperature.h which is already included in main.c and in the project.

I'm guessing this is something simple but i can't see it can't find the identifier if the linking in the IDE is working fine.

From ble_temperature.h:

    // Forward declaration of the ble_temperature_t type. 
        typedef struct ble_temperature_s ble_temperature_t;

    /**@brief Battery Service event handler type. */
typedef void (*ble_temperature_evt_handler_t) (ble_temperature_t * p_bas, ble_temperature_evt_t * p_evt);

/**@brief Battery Service init structure. This contains all options and data needed for
 *        initialization of the service.*/
typedef struct
{
    ble_temperature_evt_handler_t         evt_handler;            /**< Event handler to be called for handling events in the Battery Service. */
    bool                          support_notification;           /**< TRUE if notification of Battery Level measurement is supported. */
    ble_srv_report_ref_t *        p_report_ref;                   /**< If not NULL, a Report Reference descriptor with the specified value will be added to the Battery Level characteristic */
    uint8_t                       initial_batt_level;             /**< Initial battery level */
    ble_srv_cccd_security_mode_t  temperature_char_attr_md;     /**< Initial security level for battery characteristics attribute */
    ble_gap_conn_sec_mode_t       temperature_report_read_perm; /**< Initial security level for battery report read attribute */
} ble_temperature_init_t;

/**@brief Battery Service structure. This contains various status information for the service. */
typedef struct ble_temperature_s
{
    ble_temperature_evt_handler_t         evt_handler;   
		uint16_t service_handle;
		ble_gatts_char_handles_t temperature_char_handles;
		uint8_t uuid_type;
		uint16_t conn_handle;
} ble_temperature_t;
Related