This is Samuel and I will discuss this and provide you information in this regard. Please remember I can only answer and provide information for what you ask
You ask "Should I have walked away"?
No. Then you could have been charged with resisting arrest.
Here is the CA code for which you were charged.
11550. (a) A person shall not use, or be under the influence of any
controlled substance that is (1) specified in subdivision (b), (c),
or (e), or paragraph (1) of subdivision (f) of Section 11054,
specified in paragraph (14), (15), (21), (22), or (23) of subdivision
(d) of Section 11054, specified in subdivision (b) or (c) of Section
11055, or specified in paragraph (1) or (2) of subdivision (d) or in
paragraph (3) of subdivision (e) of Section 11055, or (2) a narcotic
drug classified in Schedule III, IV, or V, except when administered
by or under the direction of a person licensed by the state to
dispense, prescribe, or administer controlled substances. It shall be
the burden of the defense to show that it comes within the
exception. A person convicted of violating this subdivision is guilty
of a misdemeanor
and shall be sentenced to serve a term of not more
than one year in a county jail. The court
may also place a person
convicted under this subdivision on probation for a period not to
exceed five years.
And so if the officer had reasonable suspicion that you were intoxicate or under the influence, then he had probably cause to detain.
Please note that I can only provide information for what you ask. In that regard, if you have other questions or need clarification, please post them here. Otherwise, I appreciate your Positive Rating as that is how I get credit for my time and information.
If you received an invite to participate in a phone call, that is automatically generated by this site. I do not participate in phone calls offered by this site, but we can continue here.