Add doxygen documentation for the msg source block

pull/61/head
Nikos Karamolegkos 2018-03-14 13:04:50 +02:00
rodzic 13c14c799f
commit 91a5bfa97f
3 zmienionych plików z 14 dodań i 12 usunięć

Wyświetl plik

@ -686,9 +686,13 @@ namespace gr {
namespace lora {
/*!
* \brief <+description of block+>
* \brief Message socket source block , using UDP
* \ingroup lora
*
* \details This block creates a UDP server at a specific port
* and pass received UDP datagrams as a pmt::pmt_t blob message.
* The datagrams sent to the UDP server always contain valid
* LoRaTAP header, LoRaPHY header and payload
*/
class LORA_API message_socket_source : virtual public gr::block
{
@ -696,12 +700,10 @@ namespace gr {
typedef boost::shared_ptr<message_socket_source> sptr;
/*!
* \brief Return a shared_ptr to a new instance of lora::message_socket_source.
*
* To avoid accidental use of raw pointers, lora::message_socket_source's
* constructor is in a private implementation
* class. lora::message_socket_source::make is the public interface for
* creating new instances.
* \param addr the address to bind the UDP socket
* \param port the UDP port to wait for packets
* \param mtu the maximum MTU. Used to pre-allocate a maximum packet size
* \param payload_len the payload length in bytes
*/
static sptr make(const std::string& addr, uint16_t port, size_t mtu, size_t payload_len);
};

Wyświetl plik

@ -52,8 +52,7 @@ namespace gr
d_udp_port (port),
d_mtu (mtu),
d_payload_len (payload_len),
d_running (true),
d_layer (0)
d_running (true)
{
message_port_register_out (pmt::mp ("out"));
boost::shared_ptr<boost::thread> (
@ -73,6 +72,7 @@ namespace gr
ssize_t ret;
uint8_t *buf;
uint32_t bytes_num;
pmt::pmt_t lora_tap;
if ((sock = socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1) {
perror ("opening UDP socket");
@ -104,8 +104,9 @@ namespace gr
ret = recvfrom (sock, buf, d_mtu, 0, &client_addr, &client_addr_len);
if (ret > 0) {
bytes_num = (uint32_t) ret;
if (bytes_num == (sizeof(loratap_header_t)+sizeof(loraphy_header_t)+ d_payload_len)) {
pmt::pmt_t lora_tap;
if (bytes_num
== (sizeof(loratap_header_t) + sizeof(loraphy_header_t)
+ d_payload_len)) {
lora_tap = pmt::make_blob (buf, bytes_num);
message_port_pub (pmt::mp ("out"), lora_tap);
}

Wyświetl plik

@ -39,7 +39,6 @@ namespace gr
const size_t d_mtu;
const size_t d_payload_len;
bool d_running;
int d_layer;
boost::shared_ptr<boost::thread> d_thread;