A method (and associated apparatus) of providing electrical
neurostimulation therapy to a patient using an implanted neurostimulator
comprises (a) delivering an electrical stimulation to a nerve and (b)
determining whether a predetermined condition has occurred as a result of
the stimulation. The method further comprises (c) if the predetermined
condition has not occurred, adjusting one or more stimulation parameters;
and (d) repeating (a), (b), and (c) until the predetermined condition
occurs.