--- /dev/null
+#include <cmd_proc.h>
+#include <cmd_bth.h>
+#include <string.h>
+
+cmd_io_t cmd_io_bth;
+
+
+int cmd_bth_processor_run(void)
+{
+ int val;
+ cmd_io_t* cmd_io;
+
+ cmd_io=&cmd_io_bth;
+ if(cmd_bth_line_out(cmd_io))
+ return 1;
+
+ if(cmd_bth_line_in(cmd_io)<=0)
+ return 0;
+
+ if(cmd_bth){
+ val=proc_cmd_line(cmd_io, cmd_bth, cmd_io->priv.ed_line.in->buf);
+ }else{
+ val=-CMDERR_BADCMD;
+ }
+
+ if(cmd_io->priv.ed_line.out->inbuf){
+ cmd_io_putc(cmd_io,'\r');
+ cmd_io_putc(cmd_io,'\n');
+
+ }else if(val<0){
+ char s[20];
+ cmd_io_write(&cmd_io_bth,"ERROR ",6);
+ i2str(s,-val,0,0);
+ cmd_io_write(cmd_io,s,strlen(s));
+ cmd_io_putc(cmd_io,'\r');
+ cmd_io_putc(cmd_io,'\n');
+ }
+ return 1;
+}
+
+