Whenever any person is detained by or in the custody of an arresting officer, including an arrest on a warrant, for a violation of any provision of this title punishable as a misdemeanor, the arresting officer shall, except as otherwise provided in § 46.2-940, take the name and address of such person and the license number of his motor vehicle and issue a summons or otherwise notify him in writing to appear at a time and place to be specified in such summons or notice. Such time shall be at least five days after such arrest unless the person arrested demands an earlier hearing. Such person shall, if he so desires, have a right to an immediate hearing, or a hearing within twenty-four hours at a convenient hour, before a court having jurisdiction under this title within the county, city, or town wherein such offense was committed. Upon the giving by such person of his written promise to appear at such time and place, the officer shall forthwith release him from custody.
...
Any officer violating any of the provisions of this section shall be guilty of misconduct in office and subject to removal therefrom upon complaint filed by any person in a court of competent jurisdiction. This section shall not be construed to limit the removal of a law-enforcement officer for other misconduct in office.