anchor.diff:  	(new Tree 'BASE);ԣԶִеõϢĹ
   )
   
  +(define (do_plot arg_file)	
  +	;(setq PLUGIN_NAME "voc")
  +	;; store whatever the plugin defined ,the name"test_plugin_data should be unique, because this is like a namespace, newlisp has no sub namspace except under MAIN
  +	;(setq my_sec_name "argscmd")
  +	;(setq arg_file (string "rules/" PLUGIN_NAME ".arg"))
  +	
  +	(set 'in-file (open arg_file "read"))
  +	(if (not (nil? in-file))
  +		(setq abc (read-line in-file))
  +	)
  +	(while (not (nil? abc))
  +					(if (and  (starts-with (current-line) "[") (ends-with (current-line) "]"));; means [xxx] style 
  +						(begin
  +							(setq section_name (slice (chop (current-line) 1 ) 1 ) )
  +						;	(MAIN:assert "section name " section_name "\n")
  +							(if (= section_name my_sec_name)
  +								(begin
  +									(setq data (read-line in-file))
  +									(if (nil? data) (setq data ""))
  +									
  +									(while (and (not (nil? data)) (not (starts-with  data "[" ))  )
  +										(parse_cmd data)
  +										
  +										(setq data (read-line in-file))
  +									)
  +								;	(MAIN:assert "do my_sec_name over")
  +								)
  +							)
  +						)
  +						(setq abc (read-line in-file))
  +					)					
  +		;(sleep (* 1000 10))		
  +	)
  +);;ends
  +
  +(define (parse_cmd cmd_str)
  +	(if (starts-with cmd_str "CMD")
  +		(begin
  +			(setq tmp (parse cmd_str "#"))
  +			(if (> (length tmp) 1)
  +				(begin
  +					(setq cmdstr (nth 1 tmp))
  +					(setq dblist (plugin_data))
  +				;	(MAIN:assert dblist "\n")
  +					(dolist (x dblist)
  +						(if (find (nth 0 x) cmdstr) 
  +							(begin
  +									(replace (nth 0 x) cmdstr (string (nth 1 x)));; ֮ǰѾ DEV=XXXX ֵ
  +							)
  +						)
  +					)
  +					;(MAIN:assert cmdstr)
  +					;; ʵִ֮ǰҪõִе
  +					(if (lambda? MAIN:write_string_to_serial)
  +					(begin 
  +						(assert cmdstr "\n")
  +						;(eval-string cmdstr)
  +					))
  +					
  +					(sleep 300);every time executed a serial command ,sleep 1s 
  +				)
  +			)
  +		)
  +		(find "=" cmd_str)
  +		(begin
  +			(setq tmp (parse cmd_str "="))
  +			(if (> (length tmp) 1)
  +				(begin
  +					
  +					(if (starts-with (nth 0 tmp) "DEV");; only handle DEV* 
  +							(begin
  +								(if (not (nil? (MAIN:BASE (string (nth 1 tmp) ))))
  +									(plugin_data (nth 0 tmp)  (MAIN:BASE (string (nth 1 tmp))) );; store to the Tree 
  +									(plugin_data (nth 0 tmp)  0 )
  +								)
  +							)
  +							(plugin_data (nth 0 tmp)  (nth 1 tmp))
  +					) 
  +					
  +				)
  +			)
  +		)
  +	)
  +)
  +
   (define (hextostring hex_buf); xxxxxxx to xx xx xx xx
   	(setq nr (length hex_buf))
  -	(assert "hextostring length: " nr "\n")
  +	;(assert "hextostring length: " nr "\n")
   	(setq ret nil)
   	(setq dupstr (dup "b " nr))
   	
  
positive.code: 				;; ԶݣLogger
  				;(if (> (length read_data) 0)
  					(assert "data:" (hextostring read_data ) " | " read_data "\n")
  					(hanle_serial_data  read_data)
  				;)
  				
  			)
  
negative.code: )
  
  ;;;
  (define (handle_serial_data data);; ԴڵݣϾǵõݣݿ⣬ҪĺĹ
  ;; Ҫdata,һֻݣҲǼֻճһϷģ磬¶Ȼ¶+ʪ
  ;; ÿݳΨһԵͷ֮⣬Ϸ豸Ķ̵ַĸ
  ;; ݽṹԶ ͷ+̵ַ+
  