[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Connections.lisp & CMWrite



Has anyone ever tried out _cmwrite / _cmread in the above file ?
I'm having problems sending my data onto the serial stream. It seems that
the data is *not* written... If anyone has ever done this, could you
contact me (e-mail) ? A code fragment follows:
(defmethod CMWrite ((ob serial-connection) str &optional (timeout 1) )   
   (%stack-block ((buffer (+ (length str) 1)) ;; include space for 
null-terminator
                  (toWrite   4)
                  (flags     2))
      (%put-cstring buffer str) 
      (%put-long toWrite (length str))
      (%put-word flags 0) 
      (let ((result (traps::_cmwrite (hconn ob)
                                     buffer
                                     toWrite
                                     $cmData
                                     nil
                                     (%int-to-ptr 0)
                                     timeout
                                     flags))
            (bytesWritten (%get-long toWrite))
            (buf (%get-cstring buffer)))
            (format T "~&Buffer: ~s~&Bytes written: ~d~&Result Code: ~d" 
                      buf bytesWritten result))))
Many thanks !!!
(Replies please to my reader...)
Bela Ban