;;;; ;;;; ;;;; File: nxt.lisp ;;;; ;;;; License: Apache License 2.0 ;;;; ;;;; Contributors: Milan Cermak, milan.cermak@gmail.com ;;;; ;;;; Description: A general purpose file. Includes global ;;;; variables, macros, .... ;;;; ;;;; #| Copyright 2007 Milan Cermak Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. |# (in-package :nxt) (defvar *standard-nxt-io* 0 "A file designator of a BT socket opened for communication with a NXT brick. It is obtained by calling a function defined in the libbtnxtlisp.") (defvar *blocking-default* nil "Flag specifying, if sending/receiving should be blocking. nil - don't block t - block") (defvar *reply-default* nil "Flag representing, if a command reply is requested. nil - no reply requested t - reply requested") (defvar *timeout-default* 0 "How long will the program wait for the reply packet (in seconds).") (defvar *retries-default* 0 "How many times should the program try to recieve the whole packet.") (defvar *retries-interval-default* 0 "How long to pause between each retry (in seconds).") (defvar *default-answer-default* nil "The default answer in case of an error.") (defconstant +zzz+ 0.5 "Pause time between each command or sending and receving packets") (defmacro with-gensyms (vars &body body) `(let ,(mapcar #'(lambda (v) `(,v (gensym))) vars) ,@body))