GNU Radio's TEST Package
redpitaya_common.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2015 Pavel Demin
4 * Copyright 2015 Dimitri Stolnikov <horiz0n@gmx.net>
5 *
6 * GNU Radio is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3, or (at your option)
9 * any later version.
10 *
11 * GNU Radio is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with GNU Radio; see the file COPYING. If not, write to
18 * the Free Software Foundation, Inc., 51 Franklin Street,
19 * Boston, MA 02110-1301, USA.
20 */
21#ifndef REDPITAYA_COMMON_H
22#define REDPITAYA_COMMON_H
23
24#include <stdint.h>
25
26#if defined(_WIN32)
27#include <winsock2.h>
28#include <ws2tcpip.h>
29#pragma comment(lib, "ws2_32.lib")
30#include <windows.h>
31#define INVSOC INVALID_SOCKET
32#else
33#include <unistd.h>
34#include <fcntl.h>
35#include <sys/types.h>
36#include <sys/ioctl.h>
37#include <sys/socket.h>
38#include <sys/select.h>
39#include <netinet/in.h>
40#include <arpa/inet.h>
41#ifndef SOCKET
42#define SOCKET int
43#define INVSOC (-1)
44#endif
45#endif
46
47#if defined(__APPLE__) || defined(__MACH__)
48#ifndef MSG_NOSIGNAL
49#define MSG_NOSIGNAL SO_NOSIGPIPE
50#endif
51#endif
52
53void redpitaya_send_command( SOCKET socket, uint32_t command );
54
55#endif // REDPITAYA_COMMON_H
void redpitaya_send_command(SOCKET socket, uint32_t command)
#define SOCKET
Definition: redpitaya_common.h:42