anchor.diff:  (constant 'PORT2 8086)
   (constant 'ReadMax 138)
   (constant 'SIGINT 2)
  -(constant 'DEV0 "/dev/ttyUSB0");; 测试时用usb
  -(constant 'DEV1 "/dev/ttyATH0");; 正式版用串口
  -
  -(define (get-parent_id) (sys-info 6))
  -(define (getpid) (sys-info 7))
  -
  -(change-dir "/usr/share")
  +(constant 'dev "/dev/ttyUSB0");; 
  +d
  +;(change-dir "/usr/share")
   (define (assert)
   	
   	(setq ret  "") 
  
positive.code: 										(if (= was_find -1)
  										(begin
  											(push (list ma_string  (list "shortaddress" sa_string)) (BASE "NODES"))
  												(while (!= (length (share base_in_mem)) (length (BASE)) )
  											(share base_in_mem (BASE))
  											)
  										)
  										(> was_find -1);; 这个设备存在过了
  										(begin
  										(if (not (nil? match_ele))
  											(begin
  												(dolist (w match_ele) (if (find "shortaddress") (setq (nth $idx (nth was_find (BASE "NODES"))) (list "shortaddress" sa_string))))
  												(while (!= (length (share base_in_mem)) (length (BASE)) )
  													(share base_in_mem (BASE))
  												)
  											)
  											)
  										)
  
negative.code: 	(if (or (= ostype "Win32") (= ostype "Cygwin")) ;;串口配置指令
  		(setq serial_port_setting (string "stty -F " dev_str " cs8 " baud " -ixon -icanon  min 2 time 0") )
  		;(setq serial_port_setting (string "stty -F " dev_str " cs8 " baud " -ignbrk -brkint -igncr －ignpar -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke noflsh   min 150 time 1"))
  		(setq serial_port_setting (string "stty -F " dev_str " cs8 " baud " raw ")) ;;最少2个字节，一个肯定是长度字节，另一个肯定是数所头字节，还有数据内容字节，可能是0，时间无限一直等待
  	)
  	
  	(println serial_port_setting)
  	(exec serial_port_setting)
  )
  
  