commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r4852 - in gnuradio/branches/developers/eb/ibu: pmt/sr


From: eb
Subject: [Commit-gnuradio] r4852 - in gnuradio/branches/developers/eb/ibu: pmt/src/lib usrp/host/lib/inband
Date: Mon, 2 Apr 2007 23:50:07 -0600 (MDT)

Author: eb
Date: 2007-04-02 23:50:07 -0600 (Mon, 02 Apr 2007)
New Revision: 4852

Added:
   gnuradio/branches/developers/eb/ibu/pmt/src/lib/pmt-serialize.scm
Modified:
   gnuradio/branches/developers/eb/ibu/usrp/host/lib/inband/usrp_server.mbh
Log:
work-in-progress

Added: gnuradio/branches/developers/eb/ibu/pmt/src/lib/pmt-serialize.scm
===================================================================
--- gnuradio/branches/developers/eb/ibu/pmt/src/lib/pmt-serialize.scm           
                (rev 0)
+++ gnuradio/branches/developers/eb/ibu/pmt/src/lib/pmt-serialize.scm   
2007-04-03 05:50:07 UTC (rev 4852)
@@ -0,0 +1,45 @@
+;;;
+;;; Copyright 2007 Free Software Foundation, Inc.
+;;; 
+;;; This file is part of GNU Radio
+;;; 
+;;; GNU Radio is free software; you can redistribute it and/or modify
+;;; it under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 2, or (at your option)
+;;; any later version.
+;;; 
+;;; GNU Radio is distributed in the hope that it will be useful,
+;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;; 
+;;; You should have received a copy of the GNU General Public License along
+;;; with this program; if not, write to the Free Software Foundation, Inc.,
+;;; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+;;;
+
+;;; An implementation of pmt_serialize in scheme.
+;;; Currently handles only symbols and pairs.  They're all we need for now.
+
+(load "pmt-serial-tags.scm")
+
+(define (pmt-serialize obj put-byte)
+  (define (put-u16 x)
+    (put-byte (logand (ash x -8) #xff))
+    (put-byte (logand x #xff)))
+    
+  (cond ((null? obj)
+        (put-byte pst-null))
+       ((symbol? obj)
+        (let* ((sym-as-bytes (map char->integer (string->list (symbol->string 
obj))))
+               (len (length sym-as-bytes)))
+          (put-byte pst-symbol)
+          (put-u16 len)
+          (for-each put-byte sym-as-bytes)))
+       
+       ((pair? obj)
+        (put-byte pst-pair)
+        (pmt-serialize (car obj) put-byte)
+        (pmt-serialize (cdr obj) put-byte))
+       (else
+        (throw 'not-implemented "pmt-serialize" obj))))

Modified: 
gnuradio/branches/developers/eb/ibu/usrp/host/lib/inband/usrp_server.mbh
===================================================================
--- gnuradio/branches/developers/eb/ibu/usrp/host/lib/inband/usrp_server.mbh    
2007-04-03 05:47:37 UTC (rev 4851)
+++ gnuradio/branches/developers/eb/ibu/usrp/host/lib/inband/usrp_server.mbh    
2007-04-03 05:50:07 UTC (rev 4852)
@@ -53,7 +53,7 @@
 
 (define-protocol-class usrp-channel
 
-  (outgoing
+  (:outgoing
 
    (cmd-allocate-channel invocation-handle capacity-reservation)
 
@@ -70,7 +70,7 @@
 
    )
 
-  (incoming
+  (:incoming
 
 
    (response-allocate-channel invocation-handle status channel)
@@ -120,13 +120,13 @@
 
 (define-protocol-class usrp-low-level-cs
 
-  (outgoing
+  (:outgoing
 
    (cmd-to-control-channel invocation-handle list-of-subpackets)
 
    )
 
-  (incoming
+  (:incoming
 
    (response-from-control-channel invocation-handle status list-of-subpackets)
 
@@ -140,10 +140,10 @@
 ;; (The client port is unconjugated, the server port is conjugated.)
 
 (define-protocol-class usrp-tx
-  (include usrp-channel)
-  (include usrp-low-level-cs)
+  (:include usrp-channel)
+  (:include usrp-low-level-cs)
 
-  (outgoing
+  (:outgoing
 
    (cmd-xmit-raw-frame invocation-handle channel samples timestamp)
 
@@ -162,7 +162,7 @@
    ;; inband-signaling-usb
    )
 
-  (incoming
+  (:incoming
 
    (response-xmit-raw-frame invocation-handle status)
 
@@ -182,10 +182,10 @@
 ;; (The client port is unconjugated, the server port is conjugated.)
 
 (define-protocol-class usrp-rx
-  (include usrp-channel)
-  (include usrp-low-level-cs)
+  (:include usrp-channel)
+  (:include usrp-low-level-cs)
 
-  (outgoing
+  (:outgoing
 
    (cmd-start-recv-raw-samples invocation-handle channel)
 
@@ -201,7 +201,7 @@
    
    )
 
-  (incoming
+  (:incoming
 
    (response-recv-raw-samples invocation-handle status samples timestamp 
properties)
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]