+int8_t
+ao_cmd_hexchar(char c)
+{
+ if ('0' <= c && c <= '9')
+ return (c - '0');
+ if ('a' <= c && c <= 'f')
+ return (c - 'a' + 10);
+ if ('A' <= c && c <= 'F')
+ return (c - 'A' + 10);
+ return -1;
+}
+
+void
+ao_cmd_hexbyte(void)
+{
+ uint8_t i;
+ int8_t n;
+
+ ao_cmd_lex_i = 0;
+ ao_cmd_white();
+ for (i = 0; i < 2; i++) {
+ n = ao_cmd_hexchar(ao_cmd_lex_c);
+ if (n < 0) {
+ ao_cmd_status = ao_cmd_syntax_error;
+ break;
+ }
+ ao_cmd_lex_i = (ao_cmd_lex_i << 4) | n;
+ ao_cmd_lex();
+ }
+}
+