[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r6659 - grc/trunk/src/SignalBlockDefs
From: |
jblum |
Subject: |
[Commit-gnuradio] r6659 - grc/trunk/src/SignalBlockDefs |
Date: |
Fri, 19 Oct 2007 16:57:46 -0600 (MDT) |
Author: jblum
Date: 2007-10-19 16:57:45 -0600 (Fri, 19 Oct 2007)
New Revision: 6659
Modified:
grc/trunk/src/SignalBlockDefs/Misc.py
Log:
serial block supports short and int
Modified: grc/trunk/src/SignalBlockDefs/Misc.py
===================================================================
--- grc/trunk/src/SignalBlockDefs/Misc.py 2007-10-19 19:34:40 UTC (rev
6658)
+++ grc/trunk/src/SignalBlockDefs/Misc.py 2007-10-19 22:57:45 UTC (rev
6659)
@@ -184,8 +184,10 @@
def Serial(sb):
import serial, os, fcntl
- sb.add_input_socket('in', Byte())
- sb.add_output_socket('out', Byte())
+ type = Enum(all_choices, 1)
+ sb.add_input_socket('in', Variable(type))
+ sb.add_output_socket('out', Variable(type))
+ sb.add_param('Type', type, False, type=True)
sb.add_param('Port', String('/dev/ttyS0'))
sb.add_param('Baud Rate', Int(9600, min=0))
sb.add_param('Byte Size', Enum([
@@ -215,7 +217,7 @@
]
)
)
- def make(fg, port, baudrate, bytesize, parity, stopbits, xonxoff):
+ def make(fg, type, port, baudrate, bytesize, parity, stopbits, xonxoff):
ser = serial.Serial(
port = port.parse(),
baudrate = baudrate.parse(),
@@ -227,7 +229,7 @@
)
fd = ser.fileno()
fcntl.fcntl(fd, fcntl.F_SETFL, os.O_SYNC | os.O_RDWR |
os.O_NOCTTY) #set blocking
- return SerialHelper(Byte().get_num_bytes(), fd)
+ return SerialHelper(type.parse().get_num_bytes(), fd)
return sb, make
\ No newline at end of file
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r6659 - grc/trunk/src/SignalBlockDefs,
jblum <=