/* Function for finding out if a characteristic discovery should be performed after the last discovered characteristic. 
This function is used during the time of database discovery to find out if there is a need to do more characteristic discoveries. The value handles of the last discovered characteristic is compared with the end handle of the service. If the service handle is greater than one of the former characteristic handles, it means that a characteristic discovery is required. */
static bool is_char_discovery_reqd(ble_db_discovery_t *const p_db_discovery, ble_gattc_char_t *p_after_char)
/* Function for finding out if a characteristic discovery should be performed after the last discovered characteristic. 
This function is used during the time of database discovery to find out if there is a need to do more characteristic discoveries. The value handles of the last discovered characteristic is compared with the end handle of the service. If the service handle is greater than one of the former characteristic handles, it means that a characteristic discovery is required. */
static bool is_char_discovery_reqd(ble_db_discovery_t *const p_db_discovery, ble_gattc_char_t *p_after_char)
{
    if (
        p_after_char->handle_value <
        p_db_discovery->services[p_db_discovery->curr_srv_ind].handle_range.end_handle
       )
    {
        return true;
    }
    return false;
}