fixup after testing on ccl
This commit is contained in:
parent
52040ea82a
commit
2b250fb46c
1 changed files with 6 additions and 6 deletions
|
@ -23,7 +23,7 @@
|
||||||
;;
|
;;
|
||||||
;; send a test message to localhost port 6668
|
;; send a test message to localhost port 6668
|
||||||
;;
|
;;
|
||||||
;; (osc-send-test "localhost" 6668)
|
;; (osc-send-test #(127 0 0 1) 6668)
|
||||||
;;
|
;;
|
||||||
;; listen on port 6667 and send to 10.0.89:6668
|
;; listen on port 6667 and send to 10.0.89:6668
|
||||||
;; (note the ip# is formatted as a vector)
|
;; (note the ip# is formatted as a vector)
|
||||||
|
@ -35,14 +35,14 @@
|
||||||
(eval-when (:compile-toplevel :load-toplevel)
|
(eval-when (:compile-toplevel :load-toplevel)
|
||||||
(ql:quickload :osc)
|
(ql:quickload :osc)
|
||||||
(ql:quickload :usocket)
|
(ql:quickload :usocket)
|
||||||
(use-package :osc)
|
(defpackage osc-examples (:use :cl :osc :usocket)))
|
||||||
(use-package :usocket))
|
(in-package :osc-examples)
|
||||||
|
|
||||||
|
(defun osc-receive-test (port)
|
||||||
(defun osc-listen-test (port)
|
|
||||||
"a basic test function which attempts to decode an osc message a given port."
|
"a basic test function which attempts to decode an osc message a given port."
|
||||||
(let ((s (socket-connect nil nil
|
(let ((s (socket-connect nil nil
|
||||||
:local-port port
|
:local-port port
|
||||||
|
:local-host #(127 0 0 1)
|
||||||
:protocol :datagram
|
:protocol :datagram
|
||||||
:element-type '(unsigned-byte 8)))
|
:element-type '(unsigned-byte 8)))
|
||||||
(buffer (make-sequence '(vector (unsigned-byte 8)) 1024)))
|
(buffer (make-sequence '(vector (unsigned-byte 8)) 1024)))
|
||||||
|
@ -60,7 +60,7 @@
|
||||||
:protocol :datagram
|
:protocol :datagram
|
||||||
:element-type '(unsigned-byte 8)))
|
:element-type '(unsigned-byte 8)))
|
||||||
(b (osc:encode-message "/foo/bar" "baz" 1 2 3 (coerce PI 'single-float))))
|
(b (osc:encode-message "/foo/bar" "baz" 1 2 3 (coerce PI 'single-float))))
|
||||||
(format t "listening on localhost port ~A~%~%" port)
|
(format t "sending to ~a on port ~A~%~%" host port)
|
||||||
(unwind-protect
|
(unwind-protect
|
||||||
(socket-send s b (length b))
|
(socket-send s b (length b))
|
||||||
(when s (socket-close s)))))
|
(when s (socket-close s)))))
|
||||||
|
|
Loading…
Reference in a new issue