GNU Radio's LORA Package
message_socket_sink_impl.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2017 Pieter Robyns, William Thenaers.
4 *
5 * This is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3, or (at your option)
8 * any later version.
9 *
10 * This software is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this software; see the file COPYING. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street,
18 * Boston, MA 02110-1301, USA.
19 */
20
21#ifndef INCLUDED_LORA_MESSAGE_SOCKET_SINK_IMPL_H
22#define INCLUDED_LORA_MESSAGE_SOCKET_SINK_IMPL_H
23
24#include <string>
25#include <sys/socket.h>
26#include <arpa/inet.h>
28
29namespace gr {
30 namespace lora {
31
33 private:
34 std::string d_ip = "127.0.0.1";
35 int d_port = 40868;
36 enum lora_layer d_layer;
37
38 // socket
39 struct sockaddr_in *d_sock_addr;
40 int d_socket;
41
42 void handle(pmt::pmt_t msg);
43
44 public:
45 message_socket_sink_impl(std::string ip, int port, enum lora_layer layer);
47
48 private:
49 void msg_send_udp(const uint8_t* data, const uint32_t length);
50 };
51
52 } // namespace lora
53} // namespace gr
54
55#endif /* INCLUDED_LORA_MESSAGE_SOCKET_SINK_IMPL_H */
Definition message_socket_sink_impl.h:32
message_socket_sink_impl(std::string ip, int port, enum lora_layer layer)
Sink for messages, sent to socket.
Definition message_socket_sink.h:692
lora_layer
Definition message_socket_sink.h:695
Definition channelizer.h:28