GNU Radio's IEEE802 Package
stubborn_sender.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2013 Christoph Leitner <c.leitner@student.uibk.ac.at>
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17#ifndef INCLUDED_STUBBORN_SENDER_H
18#define INCLUDED_STUBBORN_SENDER_H
19
21#include <thread>
22#include <atomic>
23#include <queue>
24
25namespace gr{
26 namespace ieee802_15_4{
27 class ruc_connection;
29 private:
30 rime_stack *d_block;
31 ruc_connection *d_caller;
32 pmt::pmt_t d_mac_outport;
33 long d_retxtime;
34 int d_retxs;
35 std::atomic_bool d_stop;
36 std::queue<pmt::pmt_t> d_msg_queue;
37 gr::thread::mutex d_mutex;
38 gr::thread::condition_variable d_queue_filled;
39 gr::thread::condition_variable d_ack_received;
40 void thread_func();
41 pmt::pmt_t queue_pop();
42
43 public:
45 pmt::pmt_t mac_outport);
46 void start(long retxtime = 1000L, int retxs = 3);
47 void enqueue(pmt::pmt_t msg);
48 void stop();
49 };
50 }
51}
52
53#endif
#define IEEE802_15_4_API
Definition api.h:25
Definition rime_stack.h:28
Definition ruc_connection.h:27
Definition stubborn_sender.h:28
stubborn_sender(rime_stack *block, ruc_connection *caller, pmt::pmt_t mac_outport)
void enqueue(pmt::pmt_t msg)
void start(long retxtime=1000L, int retxs=3)
Definition access_code_prefixer.h:23