GNU Radio's IEEE802_15_4 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 <atomic>
22#include <queue>
23#include <thread>
24
25namespace gr {
26namespace ieee802_15_4 {
27class ruc_connection;
29{
30private:
31 rime_stack* d_block;
32 ruc_connection* d_caller;
33 pmt::pmt_t d_mac_outport;
34 long d_retxtime;
35 int d_retxs;
36 std::atomic_bool d_stop;
37 std::queue<pmt::pmt_t> d_msg_queue;
38 gr::thread::mutex d_mutex;
39 gr::thread::condition_variable d_queue_filled;
40 gr::thread::condition_variable d_ack_received;
41 void thread_func();
42 pmt::pmt_t queue_pop();
43
44public:
45 stubborn_sender(rime_stack* block, ruc_connection* caller, 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} // namespace ieee802_15_4
51} // namespace gr
52
53#endif
#define IEEE802_15_4_API
Definition api.h:19
Definition rime_stack.h:28
Definition ruc_connection.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:24
Definition access_code_prefixer.h:23