Changeset 7511
- Timestamp:
- 01/25/08 08:09:48
- Files:
-
- gnuradio/branches/releases/3.1/configure.ac (modified) (1 diff)
- gnuradio/branches/releases/3.1/gnuradio-core/src/lib/io/gr_udp_sink.cc (modified) (2 diffs)
- gnuradio/branches/releases/3.1/gnuradio-core/src/lib/io/gr_udp_sink.h (modified) (3 diffs)
- gnuradio/branches/releases/3.1/gnuradio-core/src/lib/io/gr_udp_source.cc (modified) (2 diffs)
- gnuradio/branches/releases/3.1/gnuradio-core/src/lib/io/gr_udp_source.h (modified) (3 diffs)
- gnuradio/branches/releases/3.1/gnuradio-core/src/lib/io/ppio_ppdev.cc (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
gnuradio/branches/releases/3.1/configure.ac
r7296 r7511 111 111 AC_HEADER_SYS_WAIT 112 112 AC_CHECK_HEADERS(fcntl.h limits.h strings.h time.h sys/ioctl.h sys/time.h unistd.h) 113 AC_CHECK_HEADERS(linux/ppdev.h sys/mman.h sys/select.h sys/types.h)113 AC_CHECK_HEADERS(linux/ppdev.h dev/ppbus/ppi.h sys/mman.h sys/select.h sys/types.h) 114 114 AC_CHECK_HEADERS(sys/resource.h stdint.h sched.h signal.h sys/syscall.h) 115 AC_CHECK_HEADERS(netinet/in.h) 115 116 AC_CHECK_HEADERS(windows.h) 116 117 gnuradio/branches/releases/3.1/gnuradio-core/src/lib/io/gr_udp_sink.cc
r6044 r7511 1 1 /* -*- c++ -*- */ 2 2 /* 3 * Copyright 2007 Free Software Foundation, Inc.3 * Copyright 2007,2008 Free Software Foundation, Inc. 4 4 * 5 5 * This file is part of GNU Radio … … 21 21 */ 22 22 23 #ifdef HAVE_CONFIG_H 24 #include "config.h" 25 #endif 23 26 #include <gr_udp_sink.h> 24 27 #include <gr_io_signature.h> gnuradio/branches/releases/3.1/gnuradio-core/src/lib/io/gr_udp_sink.h
r6044 r7511 1 1 /* -*- c++ -*- */ 2 2 /* 3 * Copyright 2007 Free Software Foundation, Inc.3 * Copyright 2007,2008 Free Software Foundation, Inc. 4 4 * 5 5 * This file is part of GNU Radio … … 28 28 #include <sys/socket.h> 29 29 #include <arpa/inet.h> 30 #include <sys/socket.h> 31 #if defined(HAVE_NETINET_IN_H) 32 #include <netinet/in.h> 33 #endif 30 34 31 35 class gr_udp_sink; … … 71 75 unsigned short d_port_src; // the port number to open for connections to this service 72 76 unsigned short d_port_dst; // port number of the remove system 73 s ockaddr_in d_sockaddr_src; // store the source sockaddr data (formatted IP address and port number)74 s ockaddr_in d_sockaddr_dst; // store the destination sockaddr data (formatted IP address and port number)77 struct sockaddr_in d_sockaddr_src; // store the source sockaddr data (formatted IP address and port number) 78 struct sockaddr_in d_sockaddr_dst; // store the destination sockaddr data (formatted IP address and port number) 75 79 76 80 protected: gnuradio/branches/releases/3.1/gnuradio-core/src/lib/io/gr_udp_source.cc
r6044 r7511 1 1 /* -*- c++ -*- */ 2 2 /* 3 * Copyright 2007 Free Software Foundation, Inc.3 * Copyright 2007,2008 Free Software Foundation, Inc. 4 4 * 5 5 * This file is part of GNU Radio … … 21 21 */ 22 22 23 #ifdef HAVE_CONFIG_H 24 #include "config.h" 25 #endif 23 26 #include <gr_udp_source.h> 24 27 #include <gr_io_signature.h> gnuradio/branches/releases/3.1/gnuradio-core/src/lib/io/gr_udp_source.h
r6044 r7511 1 1 /* -*- c++ -*- */ 2 2 /* 3 * Copyright 2007 Free Software Foundation, Inc.3 * Copyright 2007,2008 Free Software Foundation, Inc. 4 4 * 5 5 * This file is part of GNU Radio … … 28 28 #include <sys/socket.h> 29 29 #include <arpa/inet.h> 30 #if defined(HAVE_NETINET_IN_H) 31 #include <netinet/in.h> 32 #endif 30 33 31 34 class gr_udp_source; … … 63 66 struct in_addr d_ip_src; // store the source IP address to use 64 67 unsigned short d_port_src; // the port number to open for connections to this service 65 sockaddr_in d_sockaddr_src; // store the source sockaddr data (formatted IP address and port number) 66 68 struct sockaddr_in d_sockaddr_src; // store the source sockaddr data (formatted IP address and port number) 67 69 char *d_temp_buff; // hold buffer between calls 68 70 ssize_t d_residual; // hold information about number of bytes stored in the temp buffer gnuradio/branches/releases/3.1/gnuradio-core/src/lib/io/ppio_ppdev.cc
r6044 r7511 1 1 /* -*- c++ -*- */ 2 2 /* 3 * Copyright 2001,2003,2004 Free Software Foundation, Inc.3 * Copyright 2001,2003,2004,2008 Free Software Foundation, Inc. 4 4 * 5 5 * This file is part of GNU Radio … … 33 33 #include <stdio.h> 34 34 #include <stdexcept> 35 #if def HAVE_LINUX_PPDEV_H35 #if defined(HAVE_LINUX_PPDEV_H) 36 36 #include <sys/ioctl.h> 37 37 #include <linux/ppdev.h> 38 38 #include <linux/parport.h> 39 39 #include <sstream> 40 #elif defined(HAVE_DEV_PPBUS_PPI_H) 41 #include <sys/ioctl.h> 42 #include <dev/ppbus/ppi.h> 43 #include <dev/ppbus/ppbconf.h> 44 #include <sstream> 40 45 #else 41 46 // #warn "ppio_ppdev is not functional on this platform" … … 54 59 static int SP_ACTIVE_LOW_BITS = 0x80; 55 60 56 #ifndef HAVE_LINUX_PPDEV_H // use stubs 57 58 ppio_ppdev::ppio_ppdev (int which) 59 { 60 std::cerr << "ppio_ppdev: Not implemented on this platform\n"; 61 throw std::runtime_error ("not implmeneted"); 62 } 63 64 ppio_ppdev::~ppio_ppdev () 65 { 66 } 67 68 void 69 ppio_ppdev::write_data (unsigned char v) 70 { 71 } 72 73 unsigned char 74 ppio_ppdev::read_data () 75 { 76 return 0; 77 } 78 79 void 80 ppio_ppdev::write_control (unsigned char v) 81 { 82 } 83 84 unsigned char 85 ppio_ppdev::read_control () 86 { 87 return 0; 88 } 89 90 unsigned char 91 ppio_ppdev::read_status () 92 { 93 return 0; 94 } 95 96 void 97 ppio_ppdev::lock () 98 { 99 } 100 101 void 102 ppio_ppdev::unlock () 103 { 104 } 105 106 #else 107 108 // The real code... 61 #if defined(HAVE_LINUX_PPDEV_H) 62 63 // The real Linux code... 109 64 110 65 ppio_ppdev::ppio_ppdev (int which) … … 213 168 } 214 169 170 #elif defined(HAVE_DEV_PPBUS_PPI_H) 171 172 // The real FreeBSD code... (Could work on other BSDs as well) 173 174 ppio_ppdev::ppio_ppdev (int which) 175 { 176 std::ostringstream filename; 177 filename << "/dev/ppi" << which; 178 const char *c_filename = filename.str().c_str(); 179 if ((d_fd = open (c_filename, O_RDWR)) < 0){ 180 int my_errno = errno; 181 perror (c_filename); 182 throw std::runtime_error ("open"); 183 } 184 185 #if 0 186 int mode = IEEE1284_MODE_COMPAT; 187 if (ioctl (d_fd, PPSETMODE, &mode) != 0){ 188 perror ("ppio_ppdev: PPSETMODE"); 189 close (d_fd); 190 throw std::runtime_error ("PPSETMODE"); 191 } 192 #endif 193 } 194 195 ppio_ppdev::~ppio_ppdev () 196 { 197 close (d_fd); 198 } 199 200 201 void 202 ppio_ppdev::write_data (unsigned char v) 203 { 204 if (ioctl (d_fd, PPISDATA, &v) != 0){ 205 perror ("ppio_ppdev: PPISDATA"); 206 throw std::runtime_error ("PPISDATA"); 207 } 208 } 209 210 unsigned char 211 ppio_ppdev::read_data () 212 { 213 unsigned char v; 214 215 if (ioctl (d_fd, PPIGDATA, &v) != 0){ 216 perror ("ppio_ppdev: PPIGDATA"); 217 throw std::runtime_error ("PPIGDATA"); 218 } 219 return v; 220 } 221 222 void 223 ppio_ppdev::write_control (unsigned char v) 224 { 225 unsigned char ctrl = v ^ CP_ACTIVE_LOW_BITS; 226 if (ioctl (d_fd, PPISCTRL, &ctrl) != 0){ 227 perror ("ppio_ppdev: PPISCTRL"); 228 throw std::runtime_error ("PPISCTRL"); 229 } 230 } 231 232 unsigned char 233 ppio_ppdev::read_control () 234 { 235 unsigned char ctrl; 236 if (ioctl (d_fd, PPIGCTRL, &ctrl) != 0){ 237 perror ("ppio_ppdev: PPIGCTRL"); 238 throw std::runtime_error ("PPIGCTRL"); 239 } 240 241 return ctrl ^ CP_ACTIVE_LOW_BITS; 242 } 243 244 unsigned char 245 ppio_ppdev::read_status () 246 { 247 unsigned char status; 248 if (ioctl (d_fd, PPIGSTATUS, &status) != 0){ 249 perror ("ppio_ppdev: PPIGSTATUS"); 250 throw std::runtime_error ("PPIGSTATUS"); 251 } 252 return status ^ SP_ACTIVE_LOW_BITS; 253 } 254 255 void 256 ppio_ppdev::lock () 257 { 258 } 259 260 void 261 ppio_ppdev::unlock () 262 { 263 } 264 #else 265 /* Apparently, non real code */ 266 267 ppio_ppdev::ppio_ppdev (int which) 268 { 269 std::cerr << "ppio_ppdev: Not implemented on this platform\n"; 270 throw std::runtime_error ("not implmeneted"); 271 } 272 273 ppio_ppdev::~ppio_ppdev () 274 { 275 } 276 277 void 278 ppio_ppdev::write_data (unsigned char v) 279 { 280 } 281 282 unsigned char 283 ppio_ppdev::read_data () 284 { 285 return 0; 286 } 287 288 void 289 ppio_ppdev::write_control (unsigned char v) 290 { 291 } 292 293 unsigned char 294 ppio_ppdev::read_control () 295 { 296 return 0; 297 } 298 299 unsigned char 300 ppio_ppdev::read_status () 301 { 302 return 0; 303 } 304 305 void 306 ppio_ppdev::lock () 307 { 308 } 309 310 void 311 ppio_ppdev::unlock () 312 { 313 } 314 215 315 #endif 216 316
