replace SRC and DST 6-byte identifier with string + update md5sum of Python binding
parent
04cb49377e
commit
32132356f9
|
@ -10,11 +10,11 @@ parameters:
|
||||||
- id: src_id
|
- id: src_id
|
||||||
label: Source ID
|
label: Source ID
|
||||||
dtype: string
|
dtype: string
|
||||||
default: '01.02.03.04.05.06'
|
default: 'EMITTR'
|
||||||
- id: dst_id
|
- id: dst_id
|
||||||
label: Destination ID
|
label: Destination ID
|
||||||
dtype: string
|
dtype: string
|
||||||
default: '255.255.255.255.255.255'
|
default: 'RECVER'
|
||||||
- id: type
|
- id: type
|
||||||
label: Type
|
label: Type
|
||||||
dtype: int
|
dtype: int
|
||||||
|
@ -30,7 +30,7 @@ parameters:
|
||||||
options: ['True', 'False']
|
options: ['True', 'False']
|
||||||
|
|
||||||
asserts:
|
asserts:
|
||||||
- ${type<256}
|
- ${ type < 65536 }
|
||||||
templates:
|
templates:
|
||||||
imports: from gnuradio import m17
|
imports: from gnuradio import m17
|
||||||
make: m17.m17_coder(${src_id},${dst_id},${type},${meta},${samp_rate},${debug})
|
make: m17.m17_coder(${src_id},${dst_id},${type},${meta},${samp_rate},${debug})
|
||||||
|
@ -64,7 +64,7 @@ outputs:
|
||||||
optional: 0
|
optional: 0
|
||||||
|
|
||||||
documentation: |-
|
documentation: |-
|
||||||
The m17-coder block reads a byte datastream clocked (samp_rate) at 4800 bits/s and will output a real stream at 24 times this input rate. The source and destination fields are 6-bytes separated by a dot, the type field is a 0-255 value and the meta field a free string which can be updated during transmission.
|
The m17-coder block reads a byte datastream clocked (samp_rate) at 200 bits/s and will output a real stream at 24 times this input rate. The source and destination fields are 6-character strings, the type field is a 0-255 value and the meta field a free string which can be updated during transmission.
|
||||||
|
|
||||||
# 'file_format' specifies the version of the GRC yml format used in the file
|
# 'file_format' specifies the version of the GRC yml format used in the file
|
||||||
# and should usually not be changed.
|
# and should usually not be changed.
|
||||||
|
|
|
@ -33,11 +33,20 @@ public:
|
||||||
* creating new instances.
|
* creating new instances.
|
||||||
*/
|
*/
|
||||||
static sptr make(std::string src_id,std::string dst_id,short type,std::string meta,float samp_rate,bool debug);
|
static sptr make(std::string src_id,std::string dst_id,short type,std::string meta,float samp_rate,bool debug);
|
||||||
|
/*
|
||||||
virtual void set_meta(std::string meta)=0;
|
virtual void set_meta(std::string meta)=0;
|
||||||
virtual void set_src_id(std::string src_id)=0;
|
virtual void set_src_id(std::string src_id)=0;
|
||||||
virtual void set_dst_id(std::string dst_id)=0;
|
virtual void set_dst_id(std::string dst_id)=0;
|
||||||
virtual void set_samp_rate(float samp_rate)=0;
|
virtual void set_samp_rate(float samp_rate)=0;
|
||||||
virtual void set_debug(bool debug)=0;
|
virtual void set_debug(bool debug)=0;
|
||||||
|
virtual void set_type(short type)=0;
|
||||||
|
*/
|
||||||
|
void set_meta(std::string meta);
|
||||||
|
void set_src_id(std::string src_id);
|
||||||
|
void set_dst_id(std::string dst_id);
|
||||||
|
void set_samp_rate(float samp_rate);
|
||||||
|
void set_debug(bool debug);
|
||||||
|
void set_type(short type);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace m17
|
} // namespace m17
|
||||||
|
|
|
@ -33,8 +33,12 @@ public:
|
||||||
* creating new instances.
|
* creating new instances.
|
||||||
*/
|
*/
|
||||||
static sptr make(bool debug_data,bool debug_ctrl);
|
static sptr make(bool debug_data,bool debug_ctrl);
|
||||||
|
/*
|
||||||
virtual void set_debug_data(bool debug)=0;
|
virtual void set_debug_data(bool debug)=0;
|
||||||
virtual void set_debug_ctrl(bool debug)=0;
|
virtual void set_debug_ctrl(bool debug)=0;
|
||||||
|
*/
|
||||||
|
void set_debug_data(bool debug);
|
||||||
|
void set_debug_ctrl(bool debug);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace m17
|
} // namespace m17
|
||||||
|
|
|
@ -274,7 +274,7 @@ uint16_t LSF_CRC(struct LSF *in)
|
||||||
: gr::block("m17_coder",
|
: gr::block("m17_coder",
|
||||||
gr::io_signature::make(1, 1, sizeof(char)),
|
gr::io_signature::make(1, 1, sizeof(char)),
|
||||||
gr::io_signature::make(1, 1, sizeof(float)))
|
gr::io_signature::make(1, 1, sizeof(float)))
|
||||||
,_meta(meta), _samp_rate(samp_rate), _debug(debug)
|
,_samp_rate(samp_rate), _meta(meta),_type(type), _debug(debug)
|
||||||
{ set_meta(meta);
|
{ set_meta(meta);
|
||||||
set_src_id(src_id);
|
set_src_id(src_id);
|
||||||
set_dst_id(dst_id);
|
set_dst_id(dst_id);
|
||||||
|
@ -299,31 +299,47 @@ void m17_coder_impl::set_debug(bool debug)
|
||||||
}
|
}
|
||||||
|
|
||||||
void m17_coder_impl::set_src_id(std::string src_id)
|
void m17_coder_impl::set_src_id(std::string src_id)
|
||||||
{for (int i=0;i<6;i++) {_src_id[i]=0;}
|
{int length;
|
||||||
sscanf(src_id.c_str(), "%hhu.%hhu.%hhu.%hhu.%hhu.%hhu", &_src_id[0], &_src_id[1], &_src_id[2], &_src_id[3],&_src_id[4],&_src_id[5]);
|
for (int i=0;i<6;i++) {_src_id[i]=' ';}
|
||||||
|
if (src_id.length()>6) length=6; else length=src_id.length();
|
||||||
|
for (int i=0;i<length;i++) {_src_id[i]=src_id.c_str()[i];}
|
||||||
for (int i=0;i<6;i++) {lsf.src[i]=_src_id[i];}
|
for (int i=0;i<6;i++) {lsf.src[i]=_src_id[i];}
|
||||||
printf("new SRC ID: %hhu %hhu %hhu %hhu %hhu %hhu\n",_src_id[0],_src_id[1],_src_id[2],_src_id[3],_src_id[4],_src_id[5]);fflush(stdout);
|
uint16_t ccrc=LSF_CRC(&lsf);
|
||||||
|
lsf.crc[0]=ccrc>>8;
|
||||||
|
lsf.crc[1]=ccrc&0xFF;
|
||||||
|
printf("new SRC ID: %c%c%c%c%c%c\n",_src_id[0],_src_id[1],_src_id[2],_src_id[3],_src_id[4],_src_id[5]);fflush(stdout);
|
||||||
}
|
}
|
||||||
|
|
||||||
void m17_coder_impl::set_dst_id(std::string dst_id)
|
void m17_coder_impl::set_dst_id(std::string dst_id)
|
||||||
{for (int i=0;i<6;i++) {_dst_id[i]=0;}
|
{int length;
|
||||||
sscanf(dst_id.c_str(), "%hhu.%hhu.%hhu.%hhu.%hhu.%hhu", &_dst_id[0], &_dst_id[1], &_dst_id[2], &_dst_id[3],&_dst_id[4],&_dst_id[5]);
|
for (int i=0;i<6;i++) {_dst_id[i]=0;}
|
||||||
|
if (dst_id.length()>6) length=6; else length=dst_id.length();
|
||||||
|
for (int i=0;i<length;i++) {_dst_id[i]=dst_id.c_str()[i];}
|
||||||
for (int i=0;i<6;i++) {lsf.dst[i]=_dst_id[i];}
|
for (int i=0;i<6;i++) {lsf.dst[i]=_dst_id[i];}
|
||||||
printf("new DST ID: %hhu %hhu %hhu %hhu %hhu %hhu\n",_dst_id[0],_dst_id[1],_dst_id[2],_dst_id[3],_dst_id[4],_dst_id[5]);fflush(stdout);
|
uint16_t ccrc=LSF_CRC(&lsf);
|
||||||
|
lsf.crc[0]=ccrc>>8;
|
||||||
|
lsf.crc[1]=ccrc&0xFF;
|
||||||
|
printf("new DST ID: %c%c%c%c%c%c\n",_dst_id[0],_dst_id[1],_dst_id[2],_dst_id[3],_dst_id[4],_dst_id[5]);fflush(stdout);
|
||||||
}
|
}
|
||||||
|
|
||||||
void m17_coder_impl::set_meta(std::string meta)
|
void m17_coder_impl::set_meta(std::string meta)
|
||||||
{int length;
|
{int length;
|
||||||
printf("new meta: %s\n",meta.c_str());fflush(stdout);
|
printf("new meta: %s\n",meta.c_str());fflush(stdout);
|
||||||
_meta=meta;
|
_meta.assign(meta);
|
||||||
if (meta.length()<14) length=meta.length(); else length=14;
|
if (meta.length()<14) length=meta.length(); else length=14;
|
||||||
for (int i=0;i<length;i++) {lsf.meta[i]=_meta[i];}
|
for (int i=0;i<length;i++) {lsf.meta[i]=_meta[i];}
|
||||||
|
uint16_t ccrc=LSF_CRC(&lsf);
|
||||||
|
lsf.crc[0]=ccrc>>8;
|
||||||
|
lsf.crc[1]=ccrc&0xFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
void m17_coder_impl::set_type(short type)
|
void m17_coder_impl::set_type(short type)
|
||||||
{_type=type;
|
{_type=type;
|
||||||
lsf.type[0]=_type&0xff;
|
lsf.type[0]=_type>>8; // MSB
|
||||||
lsf.type[1]=_type>>8;
|
lsf.type[1]=_type&0xff; // LSB
|
||||||
|
uint16_t ccrc=LSF_CRC(&lsf);
|
||||||
|
lsf.crc[0]=ccrc>>8;
|
||||||
|
lsf.crc[1]=ccrc&0xFF;
|
||||||
printf("new type: %hhd %hhd\n",lsf.type[1],lsf.type[0]);fflush(stdout);
|
printf("new type: %hhd %hhd\n",lsf.type[1],lsf.type[0]);fflush(stdout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,8 +26,8 @@ private:
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void set_src_id(std::string meta);
|
void set_src_id(std::string src_id);
|
||||||
void set_dst_id(std::string meta);
|
void set_dst_id(std::string dst_id);
|
||||||
void set_samp_rate(float samp_rate);
|
void set_samp_rate(float samp_rate);
|
||||||
void set_meta(std::string meta);
|
void set_meta(std::string meta);
|
||||||
void set_type(short type);
|
void set_type(short type);
|
||||||
|
|
|
@ -11,10 +11,10 @@
|
||||||
/* This file is automatically generated using bindtool and can be manually edited */
|
/* This file is automatically generated using bindtool and can be manually edited */
|
||||||
/* The following lines can be configured to regenerate this file during cmake */
|
/* The following lines can be configured to regenerate this file during cmake */
|
||||||
/* If manual edits are made, the following tags should be modified accordingly. */
|
/* If manual edits are made, the following tags should be modified accordingly. */
|
||||||
/* BINDTOOL_GEN_AUTOMATIC(0) */
|
/* BINDTOOL_GEN_AUTOMATIC(1) */
|
||||||
/* BINDTOOL_USE_PYGCCXML(0) */
|
/* BINDTOOL_USE_PYGCCXML(1) */
|
||||||
/* BINDTOOL_HEADER_FILE(m17_coder.h) */
|
/* BINDTOOL_HEADER_FILE(m17_coder.h) */
|
||||||
/* BINDTOOL_HEADER_FILE_HASH(c70d84b69c542c130371d582918a0457) */
|
/* BINDTOOL_HEADER_FILE_HASH(7c3c43fefced882d5d1e91dd86246916) */
|
||||||
/***********************************************************************************/
|
/***********************************************************************************/
|
||||||
|
|
||||||
#include <pybind11/complex.h>
|
#include <pybind11/complex.h>
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
/* BINDTOOL_GEN_AUTOMATIC(0) */
|
/* BINDTOOL_GEN_AUTOMATIC(0) */
|
||||||
/* BINDTOOL_USE_PYGCCXML(0) */
|
/* BINDTOOL_USE_PYGCCXML(0) */
|
||||||
/* BINDTOOL_HEADER_FILE(m17_decoder.h) */
|
/* BINDTOOL_HEADER_FILE(m17_decoder.h) */
|
||||||
/* BINDTOOL_HEADER_FILE_HASH(65dad00081eedbe437e95b036b53a10f) */
|
/* BINDTOOL_HEADER_FILE_HASH(1272f56a1d826511e7890e4080bcd62c) */
|
||||||
/***********************************************************************************/
|
/***********************************************************************************/
|
||||||
|
|
||||||
#include <pybind11/complex.h>
|
#include <pybind11/complex.h>
|
||||||
|
|
Loading…
Reference in New Issue