From a3ad1e62d95d54e882c78f7aa9fbdeaea8f582f1 Mon Sep 17 00:00:00 2001 From: Michael Ossmann Date: Sun, 22 Nov 2015 12:53:10 -0700 Subject: [PATCH 1/5] converters for signed chars, compatible with hackrf_transfer --- README.md | 2 ++ csdr.c | 25 +++++++++++++++++++++++++ libcsdr.c | 10 ++++++++++ libcsdr.h | 2 ++ 4 files changed, 39 insertions(+) diff --git a/README.md b/README.md index 1742454..138bf38 100644 --- a/README.md +++ b/README.md @@ -122,6 +122,8 @@ The following commands are available: - `csdr convert_u8_f` - `csdr convert_f_u8` +- `csdr convert_s8_f` +- `csdr convert_f_s8` - `csdr convert_i16_f` - `csdr convert_f_i16` diff --git a/csdr.c b/csdr.c index 0b64829..56b9deb 100644 --- a/csdr.c +++ b/csdr.c @@ -55,6 +55,8 @@ char usage[]= "list of functions:\n\n" " convert_u8_f\n" " convert_f_u8\n" +" convert_s8_f\n" +" convert_f_s8\n" " convert_f_i16\n" " convert_i16_f\n" " realpart_cf\n" @@ -204,6 +206,7 @@ int main(int argc, char *argv[]) { static float input_buffer[BIG_BUFSIZE*2]; static unsigned char buffer_u8[BIG_BUFSIZE*2]; + static signed char buffer_s8[BIG_BUFSIZE*2]; static float output_buffer[BIG_BUFSIZE*2]; static short buffer_i16[BIG_BUFSIZE*2]; static float temp_f[BIG_BUFSIZE*4]; @@ -231,6 +234,28 @@ int main(int argc, char *argv[]) TRY_YIELD; } } + if(!strcmp(argv[1],"convert_s8_f")) + { + for(;;) + { + FEOF_CHECK; + fread(buffer_s8, sizeof(signed char), BUFSIZE, stdin); + convert_s8_f(buffer_s8, output_buffer, BUFSIZE); + FWRITE_R; + TRY_YIELD; + } + } + if(!strcmp(argv[1],"convert_f_s8")) //not tested + { + for(;;) + { + FEOF_CHECK; + FREAD_R; + convert_f_s8(input_buffer, buffer_s8, BUFSIZE); + fwrite(buffer_s8, sizeof(signed char), BUFSIZE, stdout); + TRY_YIELD; + } + } if(!strcmp(argv[1],"convert_f_i16")) { for(;;) diff --git a/libcsdr.c b/libcsdr.c index 2cf5e9b..a767727 100644 --- a/libcsdr.c +++ b/libcsdr.c @@ -805,6 +805,11 @@ void convert_u8_f(unsigned char* input, float* output, int input_size) for(int i=0;i convert_u8_f } +void convert_f_s8(float* input, signed char* output, int input_size) +{ + for(int i=0;i Date: Sun, 29 Nov 2015 13:18:56 +0000 Subject: [PATCH 2/5] ICLA --- CONTRIBUTING.md | 15 ++++++ ICLA.txt | 128 ++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 1 - 3 files changed, 143 insertions(+), 1 deletion(-) create mode 100644 CONTRIBUTING.md create mode 100644 ICLA.txt diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..26a24a3 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,15 @@ +First of all, thank you for taking the time to contribute to this project! + +Before I can accept your contributions, I need a signed copy of the Individual Contributor License Agreement (ICLA) from you, which is available here. + +The ICLA is needed because it will allow me to dual license the OpenWebRX project under AGPL and a commercial license. +It also makes sense to dual license `csdr` as a part of OpenWebRX. + +However, even if there is commercial interest in the projects, I promise to keep them as open as possible, keeping my original intention to provide an open-source web-based SDR receiver software to the amateur radio operators and SDR enthusiasts. + +This contributor agreement is based on the one of Apache Software Foundation, with some modifications. +When you contribute for the first time, I will send you the ICLA. Replying with only the information requested and the text "I Agree" is sufficient. + +Thanks again for contributing, + +Andras, HA7ILM diff --git a/ICLA.txt b/ICLA.txt new file mode 100644 index 0000000..2640caa --- /dev/null +++ b/ICLA.txt @@ -0,0 +1,128 @@ + Individual Contributor License Agreement ("Agreement") + +In order to clarify the intellectual property license granted +with Contributions from any person or entity, AndrĂ¡s Retzler +(hereinafter referred to as "Project Owner") must have a +Contributor License Agreement ("CLA") on file that has +been signed by each Contributor, indicating agreement to the license +terms below. This license is for your protection as a Contributor as +well as the protection of the Project Owner; it does not change your +rights to use your own Contributions for any other purpose. +Please read this document carefully before signing and keep a copy +for your records. + + Full name: ______________________________________________________ + + (optional) Public name: _________________________________________ + + Mailing Address: ________________________________________________ + + ________________________________________________ + + Country: ______________________________________________________ + + (optional) Telephone: ___________________________________________ + + E-Mail: ______________________________________________________ + +You accept and agree to the following terms and conditions for Your +present and future Contributions submitted to the Project Owner. + +Except for the license granted herein to the Project Owner and recipients +of software distributed by the Project Owner, You reserve all right, title, +and interest in and to Your Contributions. + +1. Definitions. + + "You" (or "Your") shall mean the copyright owner or legal entity + authorized by the copyright owner that is making this Agreement + with the Project Owner. For legal entities, the entity making a + Contribution and all other entities that control, are controlled + by, or are under common control with that entity are considered to + be a single Contributor. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "Contribution" shall mean any original work of authorship, + including any modifications or additions to an existing work, that + is intentionally submitted by You to the Project Owner for inclusion + in, or documentation of, any of the products owned or managed by + the Project Owner (the "Work"). For the purposes of this definition, + "submitted" means any form of electronic, verbal, or written + communication sent to the Project Owner or its representatives, + including but not limited to communication on electronic mailing + lists, source code control systems, and issue tracking systems that + are managed by, or on behalf of, the Project Owner for the purpose of + discussing and improving the Work, but excluding communication that + is conspicuously marked or otherwise designated in writing by You + as "Not a Contribution." + +2. Grant of Copyright License. Subject to the terms and conditions of + this Agreement, You hereby grant to the Project Owner and to + recipients of software distributed by the Project Owner a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare derivative works of, + publicly display, publicly perform, sublicense, and distribute Your + Contributions and such derivative works. + +3. Grant of Patent License. Subject to the terms and conditions of + this Agreement, You hereby grant to the Project Owner and to + recipients of software distributed by the Project Owner a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have + made, use, offer to sell, sell, import, and otherwise transfer the + Work, where such license applies only to those patent claims + licensable by You that are necessarily infringed by Your + Contribution(s) alone or by combination of Your Contribution(s) + with the Work to which such Contribution(s) was submitted. If any + entity institutes patent litigation against You or any other entity + (including a cross-claim or counterclaim in a lawsuit) alleging + that your Contribution, or the Work to which you have contributed, + constitutes direct or contributory patent infringement, then any + patent licenses granted to that entity under this Agreement for + that Contribution or Work shall terminate as of the date such + litigation is filed. + +4. You represent that you are legally entitled to grant the above + license. If your employer(s) has rights to intellectual property + that you create that includes your Contributions, you represent + that you have received permission to make Contributions on behalf + of that employer, that your employer has waived such rights for + your Contributions to the Project Owner, or that your employer has + executed a separate Corporate CLA with the Project Owner. + +5. You represent that each of Your Contributions is Your original + creation (see section 7 for submissions on behalf of others). You + represent that Your Contribution submissions include complete + details of any third-party license or other restriction (including, + but not limited to, related patents and trademarks) of which you + are personally aware and which are associated with any part of Your + Contributions. + +6. You are not expected to provide support for Your Contributions, + except to the extent You desire to provide support. You may provide + support for free, for a fee, or not at all. Unless required by + applicable law or agreed to in writing, You provide Your + Contributions on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS + OF ANY KIND, either express or implied, including, without + limitation, any warranties or conditions of TITLE, NON- + INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. + +7. Should You wish to submit work that is not Your original creation, + You may submit it to the Project Owner separately from any + Contribution, identifying the complete details of its source and of + any license or other restriction (including, but not limited to, + related patents, trademarks, and license agreements) of which you + are personally aware, and conspicuously marking the work as + "Submitted on behalf of a third-party: [named here]". + +8. You agree to notify the Project Owner of any facts or circumstances of + which you become aware that would make these representations + inaccurate in any respect. + +Please sign: __________________________________ Date: ________________ + +Text derived from the Apache Individual Contributor License Agreement +("Agreement") V2.0, available at http://apache.org/licenses/icla.txt diff --git a/README.md b/README.md index 138bf38..883e0da 100644 --- a/README.md +++ b/README.md @@ -404,4 +404,3 @@ However, before the implementation of some algoritms, GPL-licensed code from oth In order to eliminate any licesing issues, these parts are placed under a different file. However, the library is still fully functional with BSD-only code, altough having only less-optimized versions of some algorithms. It should also be noted that if you compile with `-DUSE_FFTW` and `-DLIBCSDR_GPL` (as default), the GPL license would apply on the whole result. - From 8e7daf58d5d08c471ee68b38b952d033658e8463 Mon Sep 17 00:00:00 2001 From: ha7ilm Date: Sun, 29 Nov 2015 13:20:19 +0000 Subject: [PATCH 3/5] ICLA --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 26a24a3..e9b8648 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,7 +3,7 @@ First of all, thank you for taking the time to contribute to this project! Before I can accept your contributions, I need a signed copy of the Individual Contributor License Agreement (ICLA) from you, which is available here. The ICLA is needed because it will allow me to dual license the OpenWebRX project under AGPL and a commercial license. -It also makes sense to dual license `csdr` as a part of OpenWebRX. +It also makes sense to dual license *csdr* as a part of *OpenWebRX*. However, even if there is commercial interest in the projects, I promise to keep them as open as possible, keeping my original intention to provide an open-source web-based SDR receiver software to the amateur radio operators and SDR enthusiasts. From 18b9b55ae37f8453a504ec0099f359cc5ab02ef0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A1s=20Retzler?= Date: Sun, 29 Nov 2015 14:23:52 +0100 Subject: [PATCH 4/5] Update CONTRIBUTING.md --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e9b8648..6e5424c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,7 +3,7 @@ First of all, thank you for taking the time to contribute to this project! Before I can accept your contributions, I need a signed copy of the Individual Contributor License Agreement (ICLA) from you, which is available here. The ICLA is needed because it will allow me to dual license the OpenWebRX project under AGPL and a commercial license. -It also makes sense to dual license *csdr* as a part of *OpenWebRX*. +It also makes sense to dual license *csdr* as a part of OpenWebRX. However, even if there is commercial interest in the projects, I promise to keep them as open as possible, keeping my original intention to provide an open-source web-based SDR receiver software to the amateur radio operators and SDR enthusiasts. From 0fd32aabbd56d3d5d11f828b933d85dab62d5680 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A1s=20Retzler?= Date: Sun, 29 Nov 2015 16:45:33 +0100 Subject: [PATCH 5/5] Update CONTRIBUTING.md --- CONTRIBUTING.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6e5424c..bdb993b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,13 +3,13 @@ First of all, thank you for taking the time to contribute to this project! Before I can accept your contributions, I need a signed copy of the Individual Contributor License Agreement (ICLA) from you, which is available here. The ICLA is needed because it will allow me to dual license the OpenWebRX project under AGPL and a commercial license. -It also makes sense to dual license *csdr* as a part of OpenWebRX. - +I will also apply dual licensing to csdr, but only those parts that are original work (e.g. without the parts enabled by `-DUSE_IMA_ADPCM`; code taken from other projects is clearly separable). + However, even if there is commercial interest in the projects, I promise to keep them as open as possible, keeping my original intention to provide an open-source web-based SDR receiver software to the amateur radio operators and SDR enthusiasts. This contributor agreement is based on the one of Apache Software Foundation, with some modifications. When you contribute for the first time, I will send you the ICLA. Replying with only the information requested and the text "I Agree" is sufficient. -Thanks again for contributing, +Thanks, Andras, HA7ILM