Add software

This commit is contained in:
RocketGod 2022-09-22 09:26:57 -07:00
parent fee0ab05fd
commit 957ea3d712
4511 changed files with 1943182 additions and 0 deletions

1
Software/BTLE/.cowcoin Normal file
View File

@ -0,0 +1 @@
0x8BD142A470A460C1E9f35AC30Bc546737346CeA4

View File

@ -0,0 +1,22 @@
---
name: issue template
about: Please report issue via this template
title: ''
labels: ''
assignees: ''
---
0. Who are you?
1. What is your own modification (if any)?
2. Environments: OS type/version, BTLE repo branch and commit revision
3. Board/hardware type
4. Detailed commands/steps to reproduce the issue, and the related error message, screenshot, etc
5. Your debug efforts and results (if any)
6. Any other thing we need to know for helping you better?

2
Software/BTLE/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
host/build

201
Software/BTLE/LICENSE Normal file
View File

@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. 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.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor 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
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You 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 the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You 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 such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its 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. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

269
Software/BTLE/README.md Normal file
View File

@ -0,0 +1,269 @@
BTLE
========
BTLE is a free and open-source Software Defined Radio Bluetooth Low Energy (BLE) software suite.
It includes:
* btle_rx - BLE sniffer. Besides sniff broadcasting/fixed channel, it can also track channel hopping of a communication link.
* btle_tx - Universal BLE packet transmitter. Besides BLE standard, it supports also raw bit mode to generate arbitrary GFSK packet. In this way, you can test non-standard protocol or standard under discussion before chip in the market.
Features
---------------
* PHY and upper layer are implemented in software (C language). Full Software Defined Radio Flexibility.
* BLE standard 1Mbps GFSK PHY.
* All ADV and DATA channel link layer packet formats in Core_V4.0 (Chapter 2&3, PartB, Volume 6) are supported.
* Sniffer is capable to parse and track channel hopping pattern automatically, not limited to broadcasting channel or fixed channel.
Hardware
--------
* [HackRF](https://github.com/mossmann/hackrf)
* [bladeRF](https://github.com/Nuand/bladeRF)
* [compatible version of HackRF and bladeRF libraries](compatible_hackrf_bladerf_lib.txt)
Build and Quick test
------------------
Make sure your SDR hardware environment (driver/lib) has been setup correctly before run this project.
```
git clone https://github.com/JiaoXianjun/BTLE.git
cd BTLE/host
mkdir build
cd build
cmake ../ (default. for HackRF)
cmake ../ -DUSE_BLADERF=1 (only for bladeRF)
make
./btle-tools/src/btle_rx
```
Above command sniffs on channel 37. You should see many packets on screen if you have BLE devices (phone/pad/laptop) around.
```
./btle-tools/src/btle_tx 37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-010203040506-LOCAL_NAME09-SDR/Bluetooth/Low/Energy r500
```
Above command transmits discovery packets on ADV channel. You should see a device with name "SDR/Bluetooth/Low/Energy" in another BLE sniffer App (such as LightBlue).
**To have a faster operation sequence on HACKRF**, use following:
```
#define TRANSFER_COUNT 4
#define TRANSFER_BUFFER_SIZE 4096
```
in hackrf/host/libhackrf/src/hackrf.c. Then re-compile the HACKRF lib and re-install it. Don't forget to re-compile BTLE to take the HACKRF lib change.
**Besides the tools, [matlab](matlab) directory includes algorithm evaluation and other useful scirpts**
btle_rx usage
------------------
```
-h --help
```
Print all arguments/usages.
```
-c --chan
```
Channel number. Default value 37 (one of ADV channels). Valid value 0~39 (all ADV and DATA channels).
```
-g --gain
```
Rx gain in dB. HACKRF rxvga default 6, valid 0 - 62. bladeRF default is max rx gain 66dB (valid 0 - 66). Gain should be tuned very carefully to ensure best performance under your circumstance. Suggest test from low gain, because high gain always causes severe distortion and get you nothing.
```
-l --lnaGain
```
LNA gain in dB (HackRF only). Default 32, valid 0 - 40. Gain should be tuned very carefully to ensure best performance under your circumstance.
```
-b --amp
```
Enable amp (HackRF only). Default off.
```
-a --access
```
Access address. Default 8e89bed6 for ADV channel 37 38 39. You should specify correct value for data channel according to captured connection setup procedure.
```
-k --crcinit
```
Default 555555 for ADV channel. You should specify correct value for data channel according to captured connection setup procedure.
```
-v --verbose
```
Verbose mode. Print more information when there is error
```
-r --raw
```
Raw mode. After access addr is detected, print out following raw 42 bytes (without descrambling, parsing)
```
-f --freq_hz (need argument)
```
This frequency (Hz) will override channel setting (In case someone want to work on freq other than BTLE. More general purpose).
```
-m --access_mask (need argument)
```
If a bit is 1 in this mask, corresponding bit in access address will be taken into packet existing decision (In case someone want a shorter/sparser unique word to do packet detection. More general purpose).
```
-o --hop
```
This will turn on data channel tracking (frequency hopping) after link setup information is captured in ADV_CONNECT_REQ packet on ADV channel.
```
-s --filename
```
Store packets to pcap file.
btle_tx usage
------------------
```
btle_tx packet1 packet2 ... packetX ... rN
```
or
```
btle_tx packets.txt
```
packets.txt is a text file which has command line parameters (packet1 packet2 ... rN) text. One parameter one line. A line start with "#" is regarded as comment. See [packets.txt example](host/btle-tools/src/packets.txt)
```
packetX
```
is one string which describes one packet. All packets compose a packets sequence.
```
rN
```
means the sequence will be repeated for N times. If it is not specified, the sequence will only be sent once.
packetX string format
```
channel_number-packet_type-field-value-field-value-...-Space-value
```
Each descriptor string starts with BTLE channel number (0~39), then followed by packet_type (RAW/iBeacon/ADV_IND/ADV_DIRECT_IND/etc. See all format examples [**AT THE END: Appendix**](#appendix-packet-descriptor-examples-of-btle_tx-for-all-formats) ), then followed by field-value pair which is packet_type specific, at last there is Space-value pair (optional) where the value specifies how many millisecond will be waited after this packet sent.
**DO NOT** use space character " " in a command line packet descriptor. You CAN use space in the txt file packet descriptor.
**DO NOT** use "-" inside each field. "-" is magic character which is used to separate different fields in packet descriptor.
* **btle_tx example: [Discovery packets](host/btle-tools/src/packets_discovery.txt)**
Open LightBlue APP (or other BLE sniffer) in your iPhone/device before this command:
```
./btle-tools/src/btle_tx ../btle-tools/src/packets_discovery.txt
```
You will see a device named as "SDR Bluetooth Low Energy" in your LightBlue APP.
Corresponding Command line:
```
./btle-tools/src/btle_tx 37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-010203040506-LOCAL_NAME09-SDR/Bluetooth/Low/Energy r40
```
Note: space " " is replaced by "/" because space " " is not supported in command line.
* **btle_tx example: [Connection establishment](doc/TI-BLE-INTRODUCTION.pdf)**
```
btle_tx 37-ADV_IND-TxAdd-0-RxAdd-0-AdvA-90D7EBB19299-AdvData-0201050702031802180418-Space-1 37-CONNECT_REQ-TxAdd-0-RxAdd-0-InitA-001830EA965F-AdvA-90D7EBB19299-AA-60850A1B-CRCInit-A77B22-WinSize-02-WinOffset-000F-Interval-0050-Latency-0000-Timeout-07D0-ChM-1FFFFFFFFF-Hop-9-SCA-5-Space-1 9-LL_DATA-AA-60850A1B-LLID-1-NESN-0-SN-0-MD-0-DATA-XX-CRCInit-A77B22-Space-1
```
Above simulates a Connection establishment procedure between device 1 and device 2. Corresponding descriptor file [BTLE/host/btle-tools/src/packets.txt](host/btle-tools/src/packets.txt).
The 1st packet -- device 1 sends ADV_IND packet in channel 37.
The 2nd packet -- After device 2 (in scanning state) receives the ADV packet from device 1, device 2 sends CONNECT_REQ packet to request connection setup with device 1. In this request packet, there are device 2 MAC address (InitA), target MAC address (device 1 MAC address AdvA), Access address (AA) which will be used by device 1 in following packet sending in data channel, CRC initialization value for following device 1 sending packet, Hopping channel information (ChM and Hop) for data channel used by device 1, etc.
The 3rd packet -- device 1 send an empty Link layer data PDU in channel 9 (decided by hopping scheme) according to those connection request information received from device 2. ("XX" after field "DATA" means there is no data for this field )
Time space between packets are 1s (1000ms). Tune TI's packet sniffer to channel 37, then above establishment procedure will be captured.
* **btle_tx example: [iBeacon](doc/ibeacon.pdf)**
```
./btle-tools/src/btle_tx 37-iBeacon-AdvA-010203040506-UUID-B9407F30F5F8466EAFF925556B57FE6D-Major-0008-Minor-0009-TxPower-C5-Space-100 r100
```
Above command sends iBeacon packet and repeats it 100 times with 100ms time space. Corresponding descriptor file [BTLE/host/btle-tools/src/packets_ibeacon.txt](host/btle-tools/src/packets_ibeacon.txt). You can use a BLE sniffer dongle to see the packet.
The packet descriptor string:
```
37-iBeacon-AdvA-010203040506-UUID-B9407F30F5F8466EAFF925556B57FE6D-Major-0008-Minor-0009-TxPower-C5-Space-100
```
```
37
```
channel 37 (one of BTLE Advertising channel 37 38 39)
```
iBeacon
```
packet format key word which means iBeacon format. (Actually it is ADV_IND format in Core_V4.0.pdf)
```
AdvA
```
Advertising address (MAC address) which is set as 010203040506 (See Core_V4.0.pdf)
```
UUID
```
here we specify it as Estimotes fixed UUID: B9407F30F5F8466EAFF925556B57FE6D
```
Major
```
major number of iBeacon format. (Here it is 0008)
```
Minor
```
minor number of iBeacon format. (Here it is 0009)
```
Txpower
```
transmit power parameter of iBeacon format (Here it is C5)
```
Space
```
How many millisecond will be waited after this packet sent. (Here it is 100ms)
Demos
------------------
See a comparison with TI's packet sniffer here: [http://sdr-x.github.io/BTLE-SNIFFER/](http://sdr-x.github.io/BTLE-SNIFFER/)
See <a href="https://youtu.be/9LDPhOF2yyw">btle_rx video demo</a> or <a href="https://vimeo.com/144574631">btle_rx video demo</a> (in China) and <a href="http://youtu.be/Y8ttV5AEb-g">btle_tx video demo 1</a> or <a href="http://v.youku.com/v_show/id_XNzUxMDIzNzAw.html">btle_tx video demo 2</a> (in China)
# Appendix: Packet descriptor examples of btle_tx for all formats
------------------
RAW packets: (All bits will be sent to GFSK modulator directly)
```
37-RAW-aad6be898e8dc3ce338c4cb1207730144f9474e0e15eedb378c3bc
```
ADVERTISING CHANNEL packets (channel 37 for example):
```
37-IBEACON-AdvA-010203040506-UUID-B9407F30F5F8466EAFF925556B57FE6D-Major-0008-Minor-0009-TxPower-C5
37-ADV_IND-TxAdd-1-RxAdd-0-AdvA-010203040506-AdvData-00112233445566778899AABBCCDDEEFF
37-ADV_DIRECT_IND-TxAdd-1-RxAdd-0-AdvA-010203040506-InitA-0708090A0B0C
37-ADV_NONCONN_IND-TxAdd-1-RxAdd-0-AdvA-010203040506-AdvData-00112233445566778899AABBCCDDEEFF
37-ADV_SCAN_IND-TxAdd-1-RxAdd-0-AdvA-010203040506-AdvData-00112233445566778899AABBCCDDEEFF
37-SCAN_REQ-TxAdd-1-RxAdd-0-ScanA-010203040506-AdvA-0708090A0B0C
37-SCAN_RSP-TxAdd-1-RxAdd-0-AdvA-010203040506-ScanRspData-00112233445566778899AABBCCDDEEFF
37-CONNECT_REQ-TxAdd-1-RxAdd-0-InitA-010203040506-AdvA-0708090A0B0C-AA-01020304-CRCInit-050607-WinSize-08-WinOffset-090A-Interval-0B0C-Latency-0D0E-Timeout-0F00-ChM-0102030405-Hop-3-SCA-4
```
DATA CHANNEL packets (channel 9 for example):
```
9-LL_DATA-AA-60850A1B-LLID-1-NESN-0-SN-0-MD-0-DATA-XX-CRCInit-A77B22
9-LL_CONNECTION_UPDATE_REQ-AA-60850A1B-LLID-3-NESN-0-SN-0-MD-0-WinSize-02-WinOffset-0e0F-Interval-0450-Latency-0607-Timeout-07D0-Instant-eeff-CRCInit-A77B22
9-LL_CHANNEL_MAP_REQ-AA-60850A1B-LLID-3-NESN-0-SN-0-MD-0-ChM-1FFFFFFFFF-Instant-0201-CRCInit-A77B22
9-LL_TERMINATE_IND-AA-60850A1B-LLID-3-NESN-0-SN-0-MD-0-ErrorCode-12-CRCInit-A77B22
9-LL_ENC_REQ-AA-60850A1B-LLID-3-NESN-0-SN-0-MD-0-Rand-0102030405060708-EDIV-090A-SKDm-0102030405060708-IVm-090A0B0C-CRCInit-A77B22
9-LL_ENC_RSP-AA-60850A1B-LLID-3-NESN-0-SN-0-MD-0-SKDs-0102030405060708-IVs-01020304-CRCInit-A77B22
9-LL_START_ENC_REQ-AA-60850A1B-LLID-3-NESN-0-SN-0-MD-0-CRCInit-A77B22
9-LL_START_ENC_RSP-AA-60850A1B-LLID-3-NESN-0-SN-0-MD-0-CRCInit-A77B22
9-LL_UNKNOWN_RSP-AA-60850A1B-LLID-3-NESN-0-SN-0-MD-0-UnknownType-01-CRCInit-A77B22
9-LL_FEATURE_REQ-AA-60850A1B-LLID-3-NESN-0-SN-0-MD-0-FeatureSet-0102030405060708-CRCInit-A77B22
9-LL_FEATURE_RSP-AA-60850A1B-LLID-3-NESN-0-SN-0-MD-0-FeatureSet-0102030405060708-CRCInit-A77B22
9-LL_PAUSE_ENC_REQ-AA-60850A1B-LLID-3-NESN-0-SN-0-MD-0-CRCInit-A77B22
9-LL_PAUSE_ENC_RSP-AA-60850A1B-LLID-3-NESN-0-SN-0-MD-0-CRCInit-A77B22
9-LL_VERSION_IND-AA-60850A1B-LLID-3-NESN-0-SN-0-MD-0-VersNr-01-CompId-0203-SubVersNr-0405-CRCInit-A77B22
9-LL_REJECT_IND-AA-60850A1B-LLID-3-NESN-0-SN-0-MD-0-ErrorCode-00-CRCInit-A77B22
```
Discovery packets: (which can show any name or services in scanner APP, such as LightBlue):
```
37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-010203040506-FLAGS-02-LOCAL_NAME09-CA-TXPOWER-03-SERVICE03-180D1810-SERVICE_DATA-180D40-MANUF_DATA-0001FF-CONN_INTERVAL-0006 (-SERVICE_SOLI14-1811)
FLAGS: 0x01 LE Limited Discoverable Mode; 0x02 LE General Discoverable Mode
SERVICE:
0x02 16-bit Service UUIDs More 16-bit UUIDs available
0x03 16-bit Service UUIDs Complete list of 16-bit UUIDs available
0x04 32-bit Service UUIDs More 3a2-bit UUIDs available
0x05 32-bit Service UUIDs Complete list of 32-bit UUIDs available
0x06 128-bit Service UUIDs More 128-bit UUIDs available
0x07 128-bit Service UUIDs Complete list of 128-bit UUIDs available
```

View File

@ -0,0 +1,12 @@
Following versions were tested. Not means other versions won't work.
bladeRF:
bladeRF-cli --version
1.8.0-0.2019.07-5
HackRF:
hackrf_info
hackrf_info version: git-f202160
libhackrf version: git-f202160 (0.5)

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,5 @@
See some docs which are useful in [https://github.com/JiaoXianjun/doc](https://github.com/JiaoXianjun/doc)
See new type of discovery packet in host/btle-tools/src/packets_discovery.txt

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,20 @@
#top dir cmake project
cmake_minimum_required(VERSION 2.8)
project (btle_all)
add_subdirectory(btle-tools)
########################################################################
# Create uninstall target
########################################################################
configure_file(
${PROJECT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
@ONLY)
add_custom_target(uninstall
${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
)

View File

@ -0,0 +1,3 @@
ATTR{idVendor}=="1d50", ATTR{idProduct}=="604b", SYMLINK+="hackrf-jawbreaker-%k", MODE="660", GROUP="plugdev"
ATTR{idVendor}=="1d50", ATTR{idProduct}=="6089", SYMLINK+="hackrf-one-%k", MODE="660", GROUP="plugdev"
ATTR{idVendor}=="1fc9", ATTR{idProduct}=="000c", SYMLINK+="nxp-dfu-%k", MODE="660", GROUP="plugdev"

View File

@ -0,0 +1,89 @@
# Copyright 2012 Jared Boone
# Copyright 2013 Benjamin Vernoux
#
# This file is part of HackRF and bladeRF
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
#
# Based heavily upon the libftdi cmake setup.
cmake_minimum_required(VERSION 2.8)
project(btle-tools C)
set(MAJOR_VERSION 0)
set(MINOR_VERSION 5)
set(PACKAGE btle-tools)
set(VERSION_STRING ${MAJOR_VERSION}.${MINOR_VERSION})
set(VERSION ${VERSION_STRING})
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/../cmake/modules)
if(MSVC)
# include_directories(getopt)
add_definitions(/D _CRT_SECURE_NO_WARNINGS)
else()
add_definitions(-Wall)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu90")
endif()
# Find needed packages.
IF (USE_BLADERF MATCHES 1)
MESSAGE(STATUS "Use BLADERF")
find_package(LIBBLADERF REQUIRED)
include_directories(${LIBBLADERF_INCLUDE_DIR})
set(USE_RFBOARD "USE_BLADERF")
ELSE (USE_BLADERF MATCHES 1)
MESSAGE(STATUS "Use HACKRF")
find_package(LIBHACKRF REQUIRED)
include_directories(${LIBHACKRF_INCLUDE_DIR})
set(USE_RFBOARD "USE_HACKRF")
ENDIF (USE_BLADERF MATCHES 1)
CONFIGURE_FILE (
"${PROJECT_SOURCE_DIR}/include/common.h.in"
"${PROJECT_SOURCE_DIR}/src/common.h"
)
add_subdirectory(src)
########################################################################
# Create uninstall target
########################################################################
if(NOT btle_all_SOURCE_DIR)
configure_file(
${PROJECT_SOURCE_DIR}/../cmake/cmake_uninstall.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
@ONLY)
add_custom_target(uninstall
${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
)
endif()
########################################################################
# Install udev rules
########################################################################
option(INSTALL_UDEV_RULES "Install udev rules for HackRF" OFF)
if (INSTALL_UDEV_RULES)
install (
FILES 52-hackrf.rules
DESTINATION "/etc/udev/rules.d"
COMPONENT "udev"
)
else (INSTALL_UDEV_RULES)
message (STATUS "Udev rules not being installed, install them with -DINSTALL_UDEV_RULES=ON")
endif (INSTALL_UDEV_RULES)

View File

@ -0,0 +1,7 @@
#ifndef HAVE_COMMON_H
#define HAVE_COMMON_H
#define @USE_RFBOARD@
#endif

View File

@ -0,0 +1,63 @@
# Copyright 2012 Jared Boone
# Copyright 2013 Benjamin Vernoux
#
# This file is part of HackRF and BladeRF.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
#
# Based heavily upon the libftdi cmake setup.
set(INSTALL_DEFAULT_BINDIR "bin" CACHE STRING "Appended to CMAKE_INSTALL_PREFIX")
if(MSVC)
add_library(libgetopt_static STATIC
../getopt/getopt.c
)
endif()
add_executable(btle_tx btle_tx.c)
install(TARGETS btle_tx RUNTIME DESTINATION ${INSTALL_DEFAULT_BINDIR})
add_executable(btle_rx btle_rx.c)
install(TARGETS btle_rx RUNTIME DESTINATION ${INSTALL_DEFAULT_BINDIR})
IF (USE_BLADERF MATCHES 1)
include_directories(${LIBBLADERF_INCLUDE_DIR})
LIST(APPEND TOOLS_LINK_LIBS ${LIBBLADERF_LIBRARIES})
ELSE (USE_BLADERF MATCHES 1)
include_directories(${LIBHACKRF_INCLUDE_DIR})
LIST(APPEND TOOLS_LINK_LIBS ${LIBHACKRF_LIBRARIES})
ENDIF (USE_BLADERF MATCHES 1)
IF(NOT DEFINED C_INLINE)
ADD_DEFINITIONS("-Dinline=")
ENDIF(NOT DEFINED C_INLINE)
if(MSVC)
LIST(APPEND TOOLS_LINK_LIBS libgetopt_static)
endif()
target_link_libraries(btle_tx ${TOOLS_LINK_LIBS} m)
IF (USE_BLADERF MATCHES 1)
target_link_libraries(btle_rx ${TOOLS_LINK_LIBS} m -lpthread)
ELSE (USE_BLADERF MATCHES 1)
target_link_libraries(btle_rx ${TOOLS_LINK_LIBS} m)
ENDIF (USE_BLADERF MATCHES 1)
# MESSAGE(STATUS "1")
# MESSAGE(STATUS ${LIBBLADERF_LIBRARIES})
# MESSAGE(STATUS "2")

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,96 @@
// Lookup table to speedup the program
// Xianjun Jiao (putaoshu@msn.com)
const int8_t gauss_coef_int8[16] = {
0, 0, 0, 0, 2, 11, 32, 53, 60, 53, 32, 11, 2, 0, 0, 0, };
const int8_t cos_table_int8[1024] = {
127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 126, 126, 126, 126, 126, 126, 126, 126, 126,
126, 126, 125, 125, 125, 125, 125, 125, 125, 124, 124, 124, 124, 124, 124, 123, 123, 123, 123, 123, 122, 122, 122, 122,
122, 121, 121, 121, 121, 120, 120, 120, 120, 119, 119, 119, 118, 118, 118, 118, 117, 117, 117, 116, 116, 116, 115, 115,
115, 114, 114, 114, 113, 113, 113, 112, 112, 112, 111, 111, 111, 110, 110, 109, 109, 109, 108, 108, 107, 107, 106, 106,
106, 105, 105, 104, 104, 103, 103, 102, 102, 102, 101, 101, 100, 100, 99, 99, 98, 98, 97, 97, 96, 96, 95, 95,
94, 94, 93, 93, 92, 91, 91, 90, 90, 89, 89, 88, 88, 87, 86, 86, 85, 85, 84, 84, 83, 82, 82, 81,
81, 80, 79, 79, 78, 78, 77, 76, 76, 75, 74, 74, 73, 72, 72, 71, 71, 70, 69, 69, 68, 67, 67, 66,
65, 65, 64, 63, 63, 62, 61, 61, 60, 59, 58, 58, 57, 56, 56, 55, 54, 54, 53, 52, 51, 51, 50, 49,
49, 48, 47, 46, 46, 45, 44, 44, 43, 42, 41, 41, 40, 39, 38, 38, 37, 36, 35, 35, 34, 33, 32, 32,
31, 30, 29, 29, 28, 27, 26, 26, 25, 24, 23, 22, 22, 21, 20, 19, 19, 18, 17, 16, 16, 15, 14, 13,
12, 12, 11, 10, 9, 9, 8, 7, 6, 5, 5, 4, 3, 2, 2, 1, 0, -1, -2, -2, -3, -4, -5, -5,
-6, -7, -8, -9, -9, -10, -11, -12, -12, -13, -14, -15, -16, -16, -17, -18, -19, -19, -20, -21, -22, -22, -23, -24,
-25, -26, -26, -27, -28, -29, -29, -30, -31, -32, -32, -33, -34, -35, -35, -36, -37, -38, -38, -39, -40, -41, -41, -42,
-43, -44, -44, -45, -46, -46, -47, -48, -49, -49, -50, -51, -51, -52, -53, -54, -54, -55, -56, -56, -57, -58, -58, -59,
-60, -61, -61, -62, -63, -63, -64, -65, -65, -66, -67, -67, -68, -69, -69, -70, -71, -71, -72, -72, -73, -74, -74, -75,
-76, -76, -77, -78, -78, -79, -79, -80, -81, -81, -82, -82, -83, -84, -84, -85, -85, -86, -86, -87, -88, -88, -89, -89,
-90, -90, -91, -91, -92, -93, -93, -94, -94, -95, -95, -96, -96, -97, -97, -98, -98, -99, -99, -100, -100, -101, -101, -102,
-102, -102, -103, -103, -104, -104, -105, -105, -106, -106, -106, -107, -107, -108, -108, -109, -109, -109, -110, -110, -111, -111, -111, -112,
-112, -112, -113, -113, -113, -114, -114, -114, -115, -115, -115, -116, -116, -116, -117, -117, -117, -118, -118, -118, -118, -119, -119, -119,
-120, -120, -120, -120, -121, -121, -121, -121, -122, -122, -122, -122, -122, -123, -123, -123, -123, -123, -124, -124, -124, -124, -124, -124,
-125, -125, -125, -125, -125, -125, -125, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -127, -127, -127, -127, -127, -127,
-127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -126,
-126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -125, -125, -125, -125, -125, -125, -125, -124, -124, -124, -124, -124, -124, -123,
-123, -123, -123, -123, -122, -122, -122, -122, -122, -121, -121, -121, -121, -120, -120, -120, -120, -119, -119, -119, -118, -118, -118, -118,
-117, -117, -117, -116, -116, -116, -115, -115, -115, -114, -114, -114, -113, -113, -113, -112, -112, -112, -111, -111, -111, -110, -110, -109,
-109, -109, -108, -108, -107, -107, -106, -106, -106, -105, -105, -104, -104, -103, -103, -102, -102, -102, -101, -101, -100, -100, -99, -99,
-98, -98, -97, -97, -96, -96, -95, -95, -94, -94, -93, -93, -92, -91, -91, -90, -90, -89, -89, -88, -88, -87, -86, -86,
-85, -85, -84, -84, -83, -82, -82, -81, -81, -80, -79, -79, -78, -78, -77, -76, -76, -75, -74, -74, -73, -72, -72, -71,
-71, -70, -69, -69, -68, -67, -67, -66, -65, -65, -64, -63, -63, -62, -61, -61, -60, -59, -58, -58, -57, -56, -56, -55,
-54, -54, -53, -52, -51, -51, -50, -49, -49, -48, -47, -46, -46, -45, -44, -44, -43, -42, -41, -41, -40, -39, -38, -38,
-37, -36, -35, -35, -34, -33, -32, -32, -31, -30, -29, -29, -28, -27, -26, -26, -25, -24, -23, -22, -22, -21, -20, -19,
-19, -18, -17, -16, -16, -15, -14, -13, -12, -12, -11, -10, -9, -9, -8, -7, -6, -5, -5, -4, -3, -2, -2, -1,
0, 1, 2, 2, 3, 4, 5, 5, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 16, 16, 17, 18,
19, 19, 20, 21, 22, 22, 23, 24, 25, 26, 26, 27, 28, 29, 29, 30, 31, 32, 32, 33, 34, 35, 35, 36,
37, 38, 38, 39, 40, 41, 41, 42, 43, 44, 44, 45, 46, 46, 47, 48, 49, 49, 50, 51, 51, 52, 53, 54,
54, 55, 56, 56, 57, 58, 58, 59, 60, 61, 61, 62, 63, 63, 64, 65, 65, 66, 67, 67, 68, 69, 69, 70,
71, 71, 72, 72, 73, 74, 74, 75, 76, 76, 77, 78, 78, 79, 79, 80, 81, 81, 82, 82, 83, 84, 84, 85,
85, 86, 86, 87, 88, 88, 89, 89, 90, 90, 91, 91, 92, 93, 93, 94, 94, 95, 95, 96, 96, 97, 97, 98,
98, 99, 99, 100, 100, 101, 101, 102, 102, 102, 103, 103, 104, 104, 105, 105, 106, 106, 106, 107, 107, 108, 108, 109,
109, 109, 110, 110, 111, 111, 111, 112, 112, 112, 113, 113, 113, 114, 114, 114, 115, 115, 115, 116, 116, 116, 117, 117,
117, 118, 118, 118, 118, 119, 119, 119, 120, 120, 120, 120, 121, 121, 121, 121, 122, 122, 122, 122, 122, 123, 123, 123,
123, 123, 124, 124, 124, 124, 124, 124, 125, 125, 125, 125, 125, 125, 125, 126, 126, 126, 126, 126, 126, 126, 126, 126,
126, 126, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, };
const int8_t sin_table_int8[1024] = {
0, 1, 2, 2, 3, 4, 5, 5, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 16, 16, 17, 18,
19, 19, 20, 21, 22, 22, 23, 24, 25, 26, 26, 27, 28, 29, 29, 30, 31, 32, 32, 33, 34, 35, 35, 36,
37, 38, 38, 39, 40, 41, 41, 42, 43, 44, 44, 45, 46, 46, 47, 48, 49, 49, 50, 51, 51, 52, 53, 54,
54, 55, 56, 56, 57, 58, 58, 59, 60, 61, 61, 62, 63, 63, 64, 65, 65, 66, 67, 67, 68, 69, 69, 70,
71, 71, 72, 72, 73, 74, 74, 75, 76, 76, 77, 78, 78, 79, 79, 80, 81, 81, 82, 82, 83, 84, 84, 85,
85, 86, 86, 87, 88, 88, 89, 89, 90, 90, 91, 91, 92, 93, 93, 94, 94, 95, 95, 96, 96, 97, 97, 98,
98, 99, 99, 100, 100, 101, 101, 102, 102, 102, 103, 103, 104, 104, 105, 105, 106, 106, 106, 107, 107, 108, 108, 109,
109, 109, 110, 110, 111, 111, 111, 112, 112, 112, 113, 113, 113, 114, 114, 114, 115, 115, 115, 116, 116, 116, 117, 117,
117, 118, 118, 118, 118, 119, 119, 119, 120, 120, 120, 120, 121, 121, 121, 121, 122, 122, 122, 122, 122, 123, 123, 123,
123, 123, 124, 124, 124, 124, 124, 124, 125, 125, 125, 125, 125, 125, 125, 126, 126, 126, 126, 126, 126, 126, 126, 126,
126, 126, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127,
127, 127, 127, 127, 127, 127, 127, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 125, 125, 125, 125, 125, 125,
125, 124, 124, 124, 124, 124, 124, 123, 123, 123, 123, 123, 122, 122, 122, 122, 122, 121, 121, 121, 121, 120, 120, 120,
120, 119, 119, 119, 118, 118, 118, 118, 117, 117, 117, 116, 116, 116, 115, 115, 115, 114, 114, 114, 113, 113, 113, 112,
112, 112, 111, 111, 111, 110, 110, 109, 109, 109, 108, 108, 107, 107, 106, 106, 106, 105, 105, 104, 104, 103, 103, 102,
102, 102, 101, 101, 100, 100, 99, 99, 98, 98, 97, 97, 96, 96, 95, 95, 94, 94, 93, 93, 92, 91, 91, 90,
90, 89, 89, 88, 88, 87, 86, 86, 85, 85, 84, 84, 83, 82, 82, 81, 81, 80, 79, 79, 78, 78, 77, 76,
76, 75, 74, 74, 73, 72, 72, 71, 71, 70, 69, 69, 68, 67, 67, 66, 65, 65, 64, 63, 63, 62, 61, 61,
60, 59, 58, 58, 57, 56, 56, 55, 54, 54, 53, 52, 51, 51, 50, 49, 49, 48, 47, 46, 46, 45, 44, 44,
43, 42, 41, 41, 40, 39, 38, 38, 37, 36, 35, 35, 34, 33, 32, 32, 31, 30, 29, 29, 28, 27, 26, 26,
25, 24, 23, 22, 22, 21, 20, 19, 19, 18, 17, 16, 16, 15, 14, 13, 12, 12, 11, 10, 9, 9, 8, 7,
6, 5, 5, 4, 3, 2, 2, 1, 0, -1, -2, -2, -3, -4, -5, -5, -6, -7, -8, -9, -9, -10, -11, -12,
-12, -13, -14, -15, -16, -16, -17, -18, -19, -19, -20, -21, -22, -22, -23, -24, -25, -26, -26, -27, -28, -29, -29, -30,
-31, -32, -32, -33, -34, -35, -35, -36, -37, -38, -38, -39, -40, -41, -41, -42, -43, -44, -44, -45, -46, -46, -47, -48,
-49, -49, -50, -51, -51, -52, -53, -54, -54, -55, -56, -56, -57, -58, -58, -59, -60, -61, -61, -62, -63, -63, -64, -65,
-65, -66, -67, -67, -68, -69, -69, -70, -71, -71, -72, -72, -73, -74, -74, -75, -76, -76, -77, -78, -78, -79, -79, -80,
-81, -81, -82, -82, -83, -84, -84, -85, -85, -86, -86, -87, -88, -88, -89, -89, -90, -90, -91, -91, -92, -93, -93, -94,
-94, -95, -95, -96, -96, -97, -97, -98, -98, -99, -99, -100, -100, -101, -101, -102, -102, -102, -103, -103, -104, -104, -105, -105,
-106, -106, -106, -107, -107, -108, -108, -109, -109, -109, -110, -110, -111, -111, -111, -112, -112, -112, -113, -113, -113, -114, -114, -114,
-115, -115, -115, -116, -116, -116, -117, -117, -117, -118, -118, -118, -118, -119, -119, -119, -120, -120, -120, -120, -121, -121, -121, -121,
-122, -122, -122, -122, -122, -123, -123, -123, -123, -123, -124, -124, -124, -124, -124, -124, -125, -125, -125, -125, -125, -125, -125, -126,
-126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127,
-127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -126, -126, -126, -126, -126, -126, -126, -126, -126,
-126, -126, -125, -125, -125, -125, -125, -125, -125, -124, -124, -124, -124, -124, -124, -123, -123, -123, -123, -123, -122, -122, -122, -122,
-122, -121, -121, -121, -121, -120, -120, -120, -120, -119, -119, -119, -118, -118, -118, -118, -117, -117, -117, -116, -116, -116, -115, -115,
-115, -114, -114, -114, -113, -113, -113, -112, -112, -112, -111, -111, -111, -110, -110, -109, -109, -109, -108, -108, -107, -107, -106, -106,
-106, -105, -105, -104, -104, -103, -103, -102, -102, -102, -101, -101, -100, -100, -99, -99, -98, -98, -97, -97, -96, -96, -95, -95,
-94, -94, -93, -93, -92, -91, -91, -90, -90, -89, -89, -88, -88, -87, -86, -86, -85, -85, -84, -84, -83, -82, -82, -81,
-81, -80, -79, -79, -78, -78, -77, -76, -76, -75, -74, -74, -73, -72, -72, -71, -71, -70, -69, -69, -68, -67, -67, -66,
-65, -65, -64, -63, -63, -62, -61, -61, -60, -59, -58, -58, -57, -56, -56, -55, -54, -54, -53, -52, -51, -51, -50, -49,
-49, -48, -47, -46, -46, -45, -44, -44, -43, -42, -41, -41, -40, -39, -38, -38, -37, -36, -35, -35, -34, -33, -32, -32,
-31, -30, -29, -29, -28, -27, -26, -26, -25, -24, -23, -22, -22, -21, -20, -19, -19, -18, -17, -16, -16, -15, -14, -13,
-12, -12, -11, -10, -9, -9, -8, -7, -6, -5, -5, -4, -3, -2, -2, -1, };

View File

@ -0,0 +1,13 @@
# Simulate BTLE Connection establishment according to BTLE/doc/TI-BLE-INTRODUCTION.pdf
# Turn on your BLE sniffer dongle at channel 37 to see the procedure
37-ADV_IND-TxAdd-0-RxAdd-0-AdvA-90D7EBB19299-AdvData-0201050702031802180418-Space-1000
37-CONNECT_REQ-TxAdd-0-RxAdd-0-InitA-001830EA965F-AdvA-90D7EBB19299-AA-60850A1B-CRCInit-A77B22-WinSize-02-WinOffset-000F-Interval-0050-Latency-0000-Timeout-07D0-ChM-1FFFFFFFFF-Hop-9-SCA-5-Space-1000
9-LL_DATA-AA-60850A1B-LLID-1-NESN-0-SN-0-MD-0-DATA-X-CRCInit-A77B22-Space-1000
r1

View File

@ -0,0 +1,55 @@
# example
# ./btle_tx 37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-010203040506-FLAGS-02-LOCAL_NAME09-CA-TXPOWER-03-SERVICE03-180D1810-SERVICE_DATA-180D40-MANUF_DATA-0001FF-CONN_INTERVAL-0006 (-SERVICE_SOLI14-1811)
# FLAGS: 0x01 LE Limited Discoverable Mode; 0x02 LE General Discoverable Mode
# SERVICE:
# 0x02 16-bit Service UUIDs More 16-bit UUIDs available
# 0x03 16-bit Service UUIDs Complete list of 16-bit UUIDs available
# 0x04 32-bit Service UUIDs More 32-bit UUIDs available
# 0x05 32-bit Service UUIDs Complete list of 32-bit UUIDs available
# 0x06 128-bit Service UUIDs More 128-bit UUIDs available
# 0x07 128-bit Service UUIDs Complete list of 128-bit UUIDs available
# 37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-010203040506-FLAGS-02-LOCAL_NAME09-Jxj-TXPOWER-03-SERVICE03-180D1810-SERVICE_DATA-180D40-MANUF_DATA-004CFF-CONN_INTERVAL-0006
# r30
37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-010203040506-LOCAL_NAME09-SDR Bluetooth Low Energy
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-010203040500-LOCAL_NAME09-CA0000 11950 22.626 113.823 1
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-010203040501-LOCAL_NAME09-CA0001 11950 22.626 113.823 1
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-010203040502-LOCAL_NAME09-CA0002 11950 22.626 113.823 1
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-010203040503-LOCAL_NAME09-CA0003 11950 22.626 113.823 1
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-010203040504-LOCAL_NAME09-CA0004 11950 22.626 113.823 1
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-010203040505-LOCAL_NAME09-CA0005 11950 22.626 113.823 1
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-010203040506-LOCAL_NAME09-CA0006 11950 22.626 113.823 1
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-010203040507-LOCAL_NAME09-CA0007 11950 22.626 113.823 1
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-010203040508-LOCAL_NAME09-CA0008 11950 22.626 113.823 1
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-010203040509-LOCAL_NAME09-CA0009 11950 22.626 113.823 1
r4000
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-010203040506-LOCAL_NAME09-01234567890123456789012345678
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-010203040506-FLAGS-02-LOCAL_NAME09-01234567890123456789012345
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-110203040506-FLAGS-02-LOCAL_NAME09-11234567890123456789012345
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-210203040506-FLAGS-02-LOCAL_NAME09-21234567890123456789012345
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-310203040506-FLAGS-02-LOCAL_NAME09-31234567890123456789012345
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-410203040506-FLAGS-02-LOCAL_NAME09-41234567890123456789012345
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-510203040506-FLAGS-02-LOCAL_NAME09-51234567890123456789012345
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-610203040506-FLAGS-02-LOCAL_NAME09-61234567890123456789012345
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-710203040506-FLAGS-02-LOCAL_NAME09-71234567890123456789012345
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-810203040506-FLAGS-02-LOCAL_NAME09-81234567890123456789012345
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-910203040506-FLAGS-02-LOCAL_NAME09-91234567890123456789012345
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-a10203040506-FLAGS-02-LOCAL_NAME09-a1234567890123456789012345
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-b10203040506-FLAGS-02-LOCAL_NAME09-b1234567890123456789012345
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-c10203040506-FLAGS-02-LOCAL_NAME09-c1234567890123456789012345
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-d10203040506-FLAGS-02-LOCAL_NAME09-d1234567890123456789012345
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-010203040506-FLAGS-02-SERVICE03-180D-SERVICE_DATA-180D40-SPACE-500
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-110203040506-FLAGS-02-SERVICE03-1819-SERVICE_DATA-181940-SPACE-100
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-210203040506-FLAGS-02-SERVICE03-181c-SERVICE_DATA-181c40-SPACE-500
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-310203040506-FLAGS-02-SERVICE03-180a-SERVICE_DATA-180a40-SPACE-500
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-410203040506-FLAGS-02-SERVICE03-1800-SERVICE_DATA-180040-SPACE-500
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-410203040506-FLAGS-02-SERVICE03-1801-SERVICE_DATA-180140-SPACE-500
# r30

View File

@ -0,0 +1,5 @@
37-iBeacon-AdvA-010203040506-UUID-B9407F30F5F8466EAFF925556B57FE6D-Major-0008-Minor-0009-TxPower-C5-Space-100
r10

View File

@ -0,0 +1,46 @@
// Scramble table definition
// Xianjun Jiao (putaoshu@msn.com)
const uint8_t scramble_table[40][42] = {
{64, 178, 188, 195, 31, 55, 74, 95, 133, 246, 156, 154, 193, 214, 197, 68, 32, 89, 222, 225, 143, 27, 165, 175, 66, 123, 78, 205, 96, 235, 98, 34, 144, 44, 239, 240, 199, 141, 210, 87, 161, 61, },
{137, 64, 178, 188, 195, 31, 55, 74, 95, 133, 246, 156, 154, 193, 214, 197, 68, 32, 89, 222, 225, 143, 27, 165, 175, 66, 123, 78, 205, 96, 235, 98, 34, 144, 44, 239, 240, 199, 141, 210, 87, 161, },
{210, 87, 161, 61, 167, 102, 176, 117, 49, 17, 72, 150, 119, 248, 227, 70, 233, 171, 208, 158, 83, 51, 216, 186, 152, 8, 36, 203, 59, 252, 113, 163, 244, 85, 104, 207, 169, 25, 108, 93, 76, 4, },
{27, 165, 175, 66, 123, 78, 205, 96, 235, 98, 34, 144, 44, 239, 240, 199, 141, 210, 87, 161, 61, 167, 102, 176, 117, 49, 17, 72, 150, 119, 248, 227, 70, 233, 171, 208, 158, 83, 51, 216, 186, 152, },
{100, 121, 135, 63, 110, 148, 190, 10, 237, 57, 53, 131, 173, 139, 137, 64, 178, 188, 195, 31, 55, 74, 95, 133, 246, 156, 154, 193, 214, 197, 68, 32, 89, 222, 225, 143, 27, 165, 175, 66, 123, 78, },
{173, 139, 137, 64, 178, 188, 195, 31, 55, 74, 95, 133, 246, 156, 154, 193, 214, 197, 68, 32, 89, 222, 225, 143, 27, 165, 175, 66, 123, 78, 205, 96, 235, 98, 34, 144, 44, 239, 240, 199, 141, 210, },
{246, 156, 154, 193, 214, 197, 68, 32, 89, 222, 225, 143, 27, 165, 175, 66, 123, 78, 205, 96, 235, 98, 34, 144, 44, 239, 240, 199, 141, 210, 87, 161, 61, 167, 102, 176, 117, 49, 17, 72, 150, 119, },
{63, 110, 148, 190, 10, 237, 57, 53, 131, 173, 139, 137, 64, 178, 188, 195, 31, 55, 74, 95, 133, 246, 156, 154, 193, 214, 197, 68, 32, 89, 222, 225, 143, 27, 165, 175, 66, 123, 78, 205, 96, 235, },
{8, 36, 203, 59, 252, 113, 163, 244, 85, 104, 207, 169, 25, 108, 93, 76, 4, 146, 229, 29, 254, 184, 81, 250, 42, 180, 231, 212, 12, 182, 46, 38, 2, 201, 242, 14, 127, 220, 40, 125, 21, 218, },
{193, 214, 197, 68, 32, 89, 222, 225, 143, 27, 165, 175, 66, 123, 78, 205, 96, 235, 98, 34, 144, 44, 239, 240, 199, 141, 210, 87, 161, 61, 167, 102, 176, 117, 49, 17, 72, 150, 119, 248, 227, 70, },
{154, 193, 214, 197, 68, 32, 89, 222, 225, 143, 27, 165, 175, 66, 123, 78, 205, 96, 235, 98, 34, 144, 44, 239, 240, 199, 141, 210, 87, 161, 61, 167, 102, 176, 117, 49, 17, 72, 150, 119, 248, 227, },
{83, 51, 216, 186, 152, 8, 36, 203, 59, 252, 113, 163, 244, 85, 104, 207, 169, 25, 108, 93, 76, 4, 146, 229, 29, 254, 184, 81, 250, 42, 180, 231, 212, 12, 182, 46, 38, 2, 201, 242, 14, 127, },
{44, 239, 240, 199, 141, 210, 87, 161, 61, 167, 102, 176, 117, 49, 17, 72, 150, 119, 248, 227, 70, 233, 171, 208, 158, 83, 51, 216, 186, 152, 8, 36, 203, 59, 252, 113, 163, 244, 85, 104, 207, 169, },
{229, 29, 254, 184, 81, 250, 42, 180, 231, 212, 12, 182, 46, 38, 2, 201, 242, 14, 127, 220, 40, 125, 21, 218, 115, 106, 6, 91, 23, 19, 129, 100, 121, 135, 63, 110, 148, 190, 10, 237, 57, 53, },
{190, 10, 237, 57, 53, 131, 173, 139, 137, 64, 178, 188, 195, 31, 55, 74, 95, 133, 246, 156, 154, 193, 214, 197, 68, 32, 89, 222, 225, 143, 27, 165, 175, 66, 123, 78, 205, 96, 235, 98, 34, 144, },
{119, 248, 227, 70, 233, 171, 208, 158, 83, 51, 216, 186, 152, 8, 36, 203, 59, 252, 113, 163, 244, 85, 104, 207, 169, 25, 108, 93, 76, 4, 146, 229, 29, 254, 184, 81, 250, 42, 180, 231, 212, 12, },
{208, 158, 83, 51, 216, 186, 152, 8, 36, 203, 59, 252, 113, 163, 244, 85, 104, 207, 169, 25, 108, 93, 76, 4, 146, 229, 29, 254, 184, 81, 250, 42, 180, 231, 212, 12, 182, 46, 38, 2, 201, 242, },
{25, 108, 93, 76, 4, 146, 229, 29, 254, 184, 81, 250, 42, 180, 231, 212, 12, 182, 46, 38, 2, 201, 242, 14, 127, 220, 40, 125, 21, 218, 115, 106, 6, 91, 23, 19, 129, 100, 121, 135, 63, 110, },
{66, 123, 78, 205, 96, 235, 98, 34, 144, 44, 239, 240, 199, 141, 210, 87, 161, 61, 167, 102, 176, 117, 49, 17, 72, 150, 119, 248, 227, 70, 233, 171, 208, 158, 83, 51, 216, 186, 152, 8, 36, 203, },
{139, 137, 64, 178, 188, 195, 31, 55, 74, 95, 133, 246, 156, 154, 193, 214, 197, 68, 32, 89, 222, 225, 143, 27, 165, 175, 66, 123, 78, 205, 96, 235, 98, 34, 144, 44, 239, 240, 199, 141, 210, 87, },
{244, 85, 104, 207, 169, 25, 108, 93, 76, 4, 146, 229, 29, 254, 184, 81, 250, 42, 180, 231, 212, 12, 182, 46, 38, 2, 201, 242, 14, 127, 220, 40, 125, 21, 218, 115, 106, 6, 91, 23, 19, 129, },
{61, 167, 102, 176, 117, 49, 17, 72, 150, 119, 248, 227, 70, 233, 171, 208, 158, 83, 51, 216, 186, 152, 8, 36, 203, 59, 252, 113, 163, 244, 85, 104, 207, 169, 25, 108, 93, 76, 4, 146, 229, 29, },
{102, 176, 117, 49, 17, 72, 150, 119, 248, 227, 70, 233, 171, 208, 158, 83, 51, 216, 186, 152, 8, 36, 203, 59, 252, 113, 163, 244, 85, 104, 207, 169, 25, 108, 93, 76, 4, 146, 229, 29, 254, 184, },
{175, 66, 123, 78, 205, 96, 235, 98, 34, 144, 44, 239, 240, 199, 141, 210, 87, 161, 61, 167, 102, 176, 117, 49, 17, 72, 150, 119, 248, 227, 70, 233, 171, 208, 158, 83, 51, 216, 186, 152, 8, 36, },
{152, 8, 36, 203, 59, 252, 113, 163, 244, 85, 104, 207, 169, 25, 108, 93, 76, 4, 146, 229, 29, 254, 184, 81, 250, 42, 180, 231, 212, 12, 182, 46, 38, 2, 201, 242, 14, 127, 220, 40, 125, 21, },
{81, 250, 42, 180, 231, 212, 12, 182, 46, 38, 2, 201, 242, 14, 127, 220, 40, 125, 21, 218, 115, 106, 6, 91, 23, 19, 129, 100, 121, 135, 63, 110, 148, 190, 10, 237, 57, 53, 131, 173, 139, 137, },
{10, 237, 57, 53, 131, 173, 139, 137, 64, 178, 188, 195, 31, 55, 74, 95, 133, 246, 156, 154, 193, 214, 197, 68, 32, 89, 222, 225, 143, 27, 165, 175, 66, 123, 78, 205, 96, 235, 98, 34, 144, 44, },
{195, 31, 55, 74, 95, 133, 246, 156, 154, 193, 214, 197, 68, 32, 89, 222, 225, 143, 27, 165, 175, 66, 123, 78, 205, 96, 235, 98, 34, 144, 44, 239, 240, 199, 141, 210, 87, 161, 61, 167, 102, 176, },
{188, 195, 31, 55, 74, 95, 133, 246, 156, 154, 193, 214, 197, 68, 32, 89, 222, 225, 143, 27, 165, 175, 66, 123, 78, 205, 96, 235, 98, 34, 144, 44, 239, 240, 199, 141, 210, 87, 161, 61, 167, 102, },
{117, 49, 17, 72, 150, 119, 248, 227, 70, 233, 171, 208, 158, 83, 51, 216, 186, 152, 8, 36, 203, 59, 252, 113, 163, 244, 85, 104, 207, 169, 25, 108, 93, 76, 4, 146, 229, 29, 254, 184, 81, 250, },
{46, 38, 2, 201, 242, 14, 127, 220, 40, 125, 21, 218, 115, 106, 6, 91, 23, 19, 129, 100, 121, 135, 63, 110, 148, 190, 10, 237, 57, 53, 131, 173, 139, 137, 64, 178, 188, 195, 31, 55, 74, 95, },
{231, 212, 12, 182, 46, 38, 2, 201, 242, 14, 127, 220, 40, 125, 21, 218, 115, 106, 6, 91, 23, 19, 129, 100, 121, 135, 63, 110, 148, 190, 10, 237, 57, 53, 131, 173, 139, 137, 64, 178, 188, 195, },
{96, 235, 98, 34, 144, 44, 239, 240, 199, 141, 210, 87, 161, 61, 167, 102, 176, 117, 49, 17, 72, 150, 119, 248, 227, 70, 233, 171, 208, 158, 83, 51, 216, 186, 152, 8, 36, 203, 59, 252, 113, 163, },
{169, 25, 108, 93, 76, 4, 146, 229, 29, 254, 184, 81, 250, 42, 180, 231, 212, 12, 182, 46, 38, 2, 201, 242, 14, 127, 220, 40, 125, 21, 218, 115, 106, 6, 91, 23, 19, 129, 100, 121, 135, 63, },
{242, 14, 127, 220, 40, 125, 21, 218, 115, 106, 6, 91, 23, 19, 129, 100, 121, 135, 63, 110, 148, 190, 10, 237, 57, 53, 131, 173, 139, 137, 64, 178, 188, 195, 31, 55, 74, 95, 133, 246, 156, 154, },
{59, 252, 113, 163, 244, 85, 104, 207, 169, 25, 108, 93, 76, 4, 146, 229, 29, 254, 184, 81, 250, 42, 180, 231, 212, 12, 182, 46, 38, 2, 201, 242, 14, 127, 220, 40, 125, 21, 218, 115, 106, 6, },
{68, 32, 89, 222, 225, 143, 27, 165, 175, 66, 123, 78, 205, 96, 235, 98, 34, 144, 44, 239, 240, 199, 141, 210, 87, 161, 61, 167, 102, 176, 117, 49, 17, 72, 150, 119, 248, 227, 70, 233, 171, 208, },
{141, 210, 87, 161, 61, 167, 102, 176, 117, 49, 17, 72, 150, 119, 248, 227, 70, 233, 171, 208, 158, 83, 51, 216, 186, 152, 8, 36, 203, 59, 252, 113, 163, 244, 85, 104, 207, 169, 25, 108, 93, 76, },
{214, 197, 68, 32, 89, 222, 225, 143, 27, 165, 175, 66, 123, 78, 205, 96, 235, 98, 34, 144, 44, 239, 240, 199, 141, 210, 87, 161, 61, 167, 102, 176, 117, 49, 17, 72, 150, 119, 248, 227, 70, 233, },
{31, 55, 74, 95, 133, 246, 156, 154, 193, 214, 197, 68, 32, 89, 222, 225, 143, 27, 165, 175, 66, 123, 78, 205, 96, 235, 98, 34, 144, 44, 239, 240, 199, 141, 210, 87, 161, 61, 167, 102, 176, 117, },
};

View File

@ -0,0 +1,7 @@
// Scramble table definition for channel 37
// Xianjun Jiao (putaoshu@msn.com)
const uint8_t scramble_table_ch37[42] = {
141, 210, 87, 161, 61, 167, 102, 176, 117, 49, 17, 72, 150, 119, 248, 227, 70, 233, 171, 208, 158, 83, 51, 216,
186, 152, 8, 36, 203, 59, 252, 113, 163, 244, 85, 104, 207, 169, 25, 108, 93, 76, };

View File

@ -0,0 +1,32 @@
# http://www.vtk.org/Wiki/CMake_FAQ#Can_I_do_.22make_uninstall.22_with_CMake.3F
IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
MESSAGE(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
ENDIF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
FILE(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
STRING(REGEX REPLACE "\n" ";" files "${files}")
FOREACH(file ${files})
MESSAGE(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
IF(EXISTS "$ENV{DESTDIR}${file}")
EXEC_PROGRAM(
"@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
OUTPUT_VARIABLE rm_out
RETURN_VALUE rm_retval
)
IF(NOT "${rm_retval}" STREQUAL 0)
MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
ENDIF(NOT "${rm_retval}" STREQUAL 0)
ELSEIF(IS_SYMLINK "$ENV{DESTDIR}${file}")
EXEC_PROGRAM(
"@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
OUTPUT_VARIABLE rm_out
RETURN_VALUE rm_retval
)
IF(NOT "${rm_retval}" STREQUAL 0)
MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
ENDIF(NOT "${rm_retval}" STREQUAL 0)
ELSE(EXISTS "$ENV{DESTDIR}${file}")
MESSAGE(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
ENDIF(EXISTS "$ENV{DESTDIR}${file}")
ENDFOREACH(file)

View File

@ -0,0 +1,54 @@
# - Find BLADERF
# Find the native BLADERF includes and library
# This module defines
# LIBBLADERF_INCLUDE_DIR, where to find rtlsdr.h, etc.
# LIBBLADERF_LIBRARIES, the libraries needed to use BLADERF.
# LIBBLADERF_FOUND, If false, do not try to use BLADERF.
# also defined, but not for general use are
# LIBBLADERF_LIBRARY, where to find the BLADERF library.
#MESSAGE("LIBBLADERF_DIR set to ${LIBBLADERF_DIR}" )
FIND_PATH(LIBBLADERF_INCLUDE_DIR libbladeRF.h
${LIBBLADERF_DIR}/include
/usr/local/include/libbladeRF
/usr/include
)
FIND_LIBRARY(LIBBLADERF_LIBRARY
NAMES bladeRF
PATHS ${LIBBLADERF_DIR}/libs
"${LIBBLADERF_DIR}\\win32\\lib"
/usr/pkgs64/lib
/usr/lib64
/usr/lib
/usr/local/lib
/usr/lib/x86_64-linux-gnu
NO_DEFAULT_PATH
)
IF (LIBBLADERF_LIBRARY AND LIBBLADERF_INCLUDE_DIR)
SET(LIBBLADERF_LIBRARIES ${LIBBLADERF_LIBRARY})
SET(LIBBLADERF_FOUND "YES")
ELSE (LIBBLADERF_LIBRARY AND LIBBLADERF_INCLUDE_DIR)
SET(LIBBLADERF_FOUND "NO")
ENDIF (LIBBLADERF_LIBRARY AND LIBBLADERF_INCLUDE_DIR)
IF (LIBBLADERF_FOUND)
IF (NOT LIBBLADERF_FIND_QUIETLY)
MESSAGE(STATUS "Found BLADERF: ${LIBBLADERF_LIBRARIES}")
ENDIF (NOT LIBBLADERF_FIND_QUIETLY)
ELSE (LIBBLADERF_FOUND)
IF (LIBBLADERF_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find BLADERF library")
ENDIF (LIBBLADERF_FIND_REQUIRED)
ENDIF (LIBBLADERF_FOUND)
# Deprecated declarations.
GET_FILENAME_COMPONENT (NATIVE_BLADERF_LIB_PATH ${LIBBLADERF_LIBRARY} PATH)
MARK_AS_ADVANCED(
LIBBLADERF_LIBRARY
LIBBLADERF_INCLUDE_DIR
)

View File

@ -0,0 +1,55 @@
# - Try to find the libhackrf library
# Once done this defines
#
# LIBHACKRF_FOUND - system has libhackrf
# LIBHACKRF_INCLUDE_DIR - the libhackrf include directory
# LIBHACKRF_LIBRARIES - Link these to use libhackrf
# Copyright (c) 2013 Benjamin Vernoux
#
if (LIBHACKRF_INCLUDE_DIR AND LIBHACKRF_LIBRARIES)
# in cache already
set(LIBHACKRF_FOUND TRUE)
else (LIBHACKRF_INCLUDE_DIR AND LIBHACKRF_LIBRARIES)
IF (NOT WIN32)
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
find_package(PkgConfig)
pkg_check_modules(PC_LIBHACKRF QUIET libhackrf)
ENDIF(NOT WIN32)
FIND_PATH(LIBHACKRF_INCLUDE_DIR
NAMES hackrf.h
HINTS $ENV{LIBHACKRF_DIR}/include ${PC_LIBHACKRF_INCLUDEDIR}
PATHS /usr/local/include/libhackrf /usr/include/libhackrf /usr/local/include
/usr/include ${CMAKE_SOURCE_DIR}/../libhackrf/src
/opt/local/include/libhackrf
${LIBHACKRF_INCLUDE_DIR}
)
set(libhackrf_library_names hackrf)
FIND_LIBRARY(LIBHACKRF_LIBRARIES
NAMES ${libhackrf_library_names}
HINTS $ENV{LIBHACKRF_DIR}/lib ${PC_LIBHACKRF_LIBDIR}
PATHS /usr/local/lib /usr/lib /opt/local/lib ${PC_LIBHACKRF_LIBDIR} ${PC_LIBHACKRF_LIBRARY_DIRS} ${CMAKE_SOURCE_DIR}/../libhackrf/src
)
if(LIBHACKRF_INCLUDE_DIR)
set(CMAKE_REQUIRED_INCLUDES ${LIBHACKRF_INCLUDE_DIR})
endif()
if(LIBHACKRF_LIBRARIES)
set(CMAKE_REQUIRED_LIBRARIES ${LIBHACKRF_LIBRARIES})
endif()
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBHACKRF DEFAULT_MSG LIBHACKRF_LIBRARIES LIBHACKRF_INCLUDE_DIR)
MARK_AS_ADVANCED(LIBHACKRF_INCLUDE_DIR LIBHACKRF_LIBRARIES)
endif (LIBHACKRF_INCLUDE_DIR AND LIBHACKRF_LIBRARIES)

View File

@ -0,0 +1,246 @@
# Updated FindThreads.cmake that supports pthread-win32
# Downloaded from http://www.vtk.org/Bug/bug_view_advanced_page.php?bug_id=6399
# - This module determines the thread library of the system.
#
# The following variables are set
# CMAKE_THREAD_LIBS_INIT - the thread library
# CMAKE_USE_SPROC_INIT - are we using sproc?
# CMAKE_USE_WIN32_THREADS_INIT - using WIN32 threads?
# CMAKE_USE_PTHREADS_INIT - are we using pthreads
# CMAKE_HP_PTHREADS_INIT - are we using hp pthreads
#
# If use of pthreads-win32 is desired, the following variables
# can be set.
#
# THREADS_USE_PTHREADS_WIN32 -
# Setting this to true searches for the pthreads-win32
# port (since CMake 2.8.0)
#
# THREADS_PTHREADS_WIN32_EXCEPTION_SCHEME
# C = no exceptions (default)
# (NOTE: This is the default scheme on most POSIX thread
# implementations and what you should probably be using)
# CE = C++ Exception Handling
# SE = Structure Exception Handling (MSVC only)
# (NOTE: Changing this option from the default may affect
# the portability of your application. See pthreads-win32
# documentation for more details.)
#
#======================================================
# Example usage where threading library
# is provided by the system:
#
# find_package(Threads REQUIRED)
# add_executable(foo foo.cc)
# target_link_libraries(foo ${CMAKE_THREAD_LIBS_INIT})
#
# Example usage if pthreads-win32 is desired on Windows
# or a system provided thread library:
#
# set(THREADS_USE_PTHREADS_WIN32 true)
# find_package(Threads REQUIRED)
# include_directories(${THREADS_PTHREADS_INCLUDE_DIR})
#
# add_executable(foo foo.cc)
# target_link_libraries(foo ${CMAKE_THREAD_LIBS_INIT})
#
INCLUDE (CheckIncludeFiles)
INCLUDE (CheckLibraryExists)
SET(Threads_FOUND FALSE)
IF(WIN32 AND NOT CYGWIN AND THREADS_USE_PTHREADS_WIN32)
SET(_Threads_ptwin32 true)
ENDIF()
# Do we have sproc?
IF(CMAKE_SYSTEM MATCHES IRIX)
CHECK_INCLUDE_FILES("sys/types.h;sys/prctl.h" CMAKE_HAVE_SPROC_H)
ENDIF()
IF(CMAKE_HAVE_SPROC_H)
# We have sproc
SET(CMAKE_USE_SPROC_INIT 1)
ELSEIF(_Threads_ptwin32)
IF(NOT DEFINED THREADS_PTHREADS_WIN32_EXCEPTION_SCHEME)
# Assign the default scheme
SET(THREADS_PTHREADS_WIN32_EXCEPTION_SCHEME "C")
ELSE()
# Validate the scheme specified by the user
IF(NOT THREADS_PTHREADS_WIN32_EXCEPTION_SCHEME STREQUAL "C" AND
NOT THREADS_PTHREADS_WIN32_EXCEPTION_SCHEME STREQUAL "CE" AND
NOT THREADS_PTHREADS_WIN32_EXCEPTION_SCHEME STREQUAL "SE")
MESSAGE(FATAL_ERROR "See documentation for FindPthreads.cmake, only C, CE, and SE modes are allowed")
ENDIF()
IF(NOT MSVC AND THREADS_PTHREADS_WIN32_EXCEPTION_SCHEME STREQUAL "SE")
MESSAGE(FATAL_ERROR "Structured Exception Handling is only allowed for MSVC")
ENDIF(NOT MSVC AND THREADS_PTHREADS_WIN32_EXCEPTION_SCHEME STREQUAL "SE")
ENDIF()
FIND_PATH(THREADS_PTHREADS_INCLUDE_DIR pthread.h)
# Determine the library filename
IF(MSVC)
SET(_Threads_pthreads_libname
pthreadV${THREADS_PTHREADS_WIN32_EXCEPTION_SCHEME}2)
ELSEIF(MINGW)
SET(_Threads_pthreads_libname
pthreadG${THREADS_PTHREADS_WIN32_EXCEPTION_SCHEME}2)
ELSE()
MESSAGE(FATAL_ERROR "This should never happen")
ENDIF()
# Use the include path to help find the library if possible
SET(_Threads_lib_paths "")
IF(THREADS_PTHREADS_INCLUDE_DIR)
GET_FILENAME_COMPONENT(_Threads_root_dir
${THREADS_PTHREADS_INCLUDE_DIR} PATH)
SET(_Threads_lib_paths ${_Threads_root_dir}/lib)
ENDIF()
FIND_LIBRARY(THREADS_PTHREADS_WIN32_LIBRARY
NAMES ${_Threads_pthreads_libname}
PATHS ${_Threads_lib_paths}
DOC "The Portable Threads Library for Win32"
NO_SYSTEM_PATH
)
IF(THREADS_PTHREADS_INCLUDE_DIR AND THREADS_PTHREADS_WIN32_LIBRARY)
MARK_AS_ADVANCED(THREADS_PTHREADS_INCLUDE_DIR)
SET(CMAKE_THREAD_LIBS_INIT ${THREADS_PTHREADS_WIN32_LIBRARY})
SET(CMAKE_HAVE_THREADS_LIBRARY 1)
SET(Threads_FOUND TRUE)
ENDIF()
MARK_AS_ADVANCED(THREADS_PTHREADS_WIN32_LIBRARY)
ELSE()
# Do we have pthreads?
CHECK_INCLUDE_FILES("pthread.h" CMAKE_HAVE_PTHREAD_H)
IF(CMAKE_HAVE_PTHREAD_H)
#
# We have pthread.h
# Let's check for the library now.
#
SET(CMAKE_HAVE_THREADS_LIBRARY)
IF(NOT THREADS_HAVE_PTHREAD_ARG)
# Do we have -lpthreads
CHECK_LIBRARY_EXISTS(pthreads pthread_create "" CMAKE_HAVE_PTHREADS_CREATE)
IF(CMAKE_HAVE_PTHREADS_CREATE)
SET(CMAKE_THREAD_LIBS_INIT "-lpthreads")
SET(CMAKE_HAVE_THREADS_LIBRARY 1)
SET(Threads_FOUND TRUE)
ENDIF()
# Ok, how about -lpthread
CHECK_LIBRARY_EXISTS(pthread pthread_create "" CMAKE_HAVE_PTHREAD_CREATE)
IF(CMAKE_HAVE_PTHREAD_CREATE)
SET(CMAKE_THREAD_LIBS_INIT "-lpthread")
SET(Threads_FOUND TRUE)
SET(CMAKE_HAVE_THREADS_LIBRARY 1)
ENDIF()
IF(CMAKE_SYSTEM MATCHES "SunOS.*")
# On sun also check for -lthread
CHECK_LIBRARY_EXISTS(thread thr_create "" CMAKE_HAVE_THR_CREATE)
IF(CMAKE_HAVE_THR_CREATE)
SET(CMAKE_THREAD_LIBS_INIT "-lthread")
SET(CMAKE_HAVE_THREADS_LIBRARY 1)
SET(Threads_FOUND TRUE)
ENDIF()
ENDIF(CMAKE_SYSTEM MATCHES "SunOS.*")
ENDIF(NOT THREADS_HAVE_PTHREAD_ARG)
IF(NOT CMAKE_HAVE_THREADS_LIBRARY)
# If we did not found -lpthread, -lpthread, or -lthread, look for -pthread
IF("THREADS_HAVE_PTHREAD_ARG" MATCHES "^THREADS_HAVE_PTHREAD_ARG")
MESSAGE(STATUS "Check if compiler accepts -pthread")
TRY_RUN(THREADS_PTHREAD_ARG THREADS_HAVE_PTHREAD_ARG
${CMAKE_BINARY_DIR}
${CMAKE_ROOT}/Modules/CheckForPthreads.c
CMAKE_FLAGS -DLINK_LIBRARIES:STRING=-pthread
COMPILE_OUTPUT_VARIABLE OUTPUT)
IF(THREADS_HAVE_PTHREAD_ARG)
IF(THREADS_PTHREAD_ARG MATCHES "^2$")
SET(Threads_FOUND TRUE)
MESSAGE(STATUS "Check if compiler accepts -pthread - yes")
ELSE()
MESSAGE(STATUS "Check if compiler accepts -pthread - no")
FILE(APPEND
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if compiler accepts -pthread returned ${THREADS_PTHREAD_ARG} instead of 2. The compiler had the following output:\n${OUTPUT}\n\n")
ENDIF()
ELSE()
MESSAGE(STATUS "Check if compiler accepts -pthread - no")
FILE(APPEND
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if compiler accepts -pthread failed with the following output:\n${OUTPUT}\n\n")
ENDIF()
ENDIF("THREADS_HAVE_PTHREAD_ARG" MATCHES "^THREADS_HAVE_PTHREAD_ARG")
IF(THREADS_HAVE_PTHREAD_ARG)
SET(Threads_FOUND TRUE)
SET(CMAKE_THREAD_LIBS_INIT "-pthread")
ENDIF()
ENDIF(NOT CMAKE_HAVE_THREADS_LIBRARY)
ENDIF(CMAKE_HAVE_PTHREAD_H)
ENDIF()
IF(CMAKE_THREAD_LIBS_INIT)
SET(CMAKE_USE_PTHREADS_INIT 1)
SET(Threads_FOUND TRUE)
ENDIF()
IF(CMAKE_SYSTEM MATCHES "Windows"
AND NOT THREADS_USE_PTHREADS_WIN32)
SET(CMAKE_USE_WIN32_THREADS_INIT 1)
SET(Threads_FOUND TRUE)
ENDIF()
IF(CMAKE_USE_PTHREADS_INIT)
IF(CMAKE_SYSTEM MATCHES "HP-UX-*")
# Use libcma if it exists and can be used. It provides more
# symbols than the plain pthread library. CMA threads
# have actually been deprecated:
# http://docs.hp.com/en/B3920-90091/ch12s03.html#d0e11395
# http://docs.hp.com/en/947/d8.html
# but we need to maintain compatibility here.
# The CMAKE_HP_PTHREADS setting actually indicates whether CMA threads
# are available.
CHECK_LIBRARY_EXISTS(cma pthread_attr_create "" CMAKE_HAVE_HP_CMA)
IF(CMAKE_HAVE_HP_CMA)
SET(CMAKE_THREAD_LIBS_INIT "-lcma")
SET(CMAKE_HP_PTHREADS_INIT 1)
SET(Threads_FOUND TRUE)
ENDIF(CMAKE_HAVE_HP_CMA)
SET(CMAKE_USE_PTHREADS_INIT 1)
ENDIF()
IF(CMAKE_SYSTEM MATCHES "OSF1-V*")
SET(CMAKE_USE_PTHREADS_INIT 0)
SET(CMAKE_THREAD_LIBS_INIT )
ENDIF()
IF(CMAKE_SYSTEM MATCHES "CYGWIN_NT*")
SET(CMAKE_USE_PTHREADS_INIT 1)
SET(Threads_FOUND TRUE)
SET(CMAKE_THREAD_LIBS_INIT )
SET(CMAKE_USE_WIN32_THREADS_INIT 0)
ENDIF()
ENDIF(CMAKE_USE_PTHREADS_INIT)
INCLUDE(FindPackageHandleStandardArgs)
IF(_Threads_ptwin32)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Threads DEFAULT_MSG
THREADS_PTHREADS_WIN32_LIBRARY THREADS_PTHREADS_INCLUDE_DIR)
ELSE()
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Threads DEFAULT_MSG Threads_FOUND)
ENDIF()

View File

@ -0,0 +1,38 @@
# - Try to find the freetype library
# Once done this defines
#
# LIBUSB_FOUND - system has libusb
# LIBUSB_INCLUDE_DIR - the libusb include directory
# LIBUSB_LIBRARIES - Link these to use libusb
# Copyright (c) 2006, 2008 Laurent Montel, <montel@kde.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
if (LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES)
# in cache already
set(LIBUSB_FOUND TRUE)
else (LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES)
IF (NOT WIN32)
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
find_package(PkgConfig)
pkg_check_modules(PC_LIBUSB libusb-1.0)
ENDIF(NOT WIN32)
FIND_PATH(LIBUSB_INCLUDE_DIR libusb.h
PATHS ${PC_LIBUSB_INCLUDEDIR} ${PC_LIBUSB_INCLUDE_DIRS})
FIND_LIBRARY(LIBUSB_LIBRARIES NAMES usb-1.0
PATHS ${PC_LIBUSB_LIBDIR} ${PC_LIBUSB_LIBRARY_DIRS})
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBUSB DEFAULT_MSG LIBUSB_LIBRARIES LIBUSB_INCLUDE_DIR)
MARK_AS_ADVANCED(LIBUSB_INCLUDE_DIR LIBUSB_LIBRARIES)
endif (LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES)

View File

@ -0,0 +1,17 @@
function a = get_number
a = [0 1 0 1 0 1 0 1 0 1 1 0 1 0 1 1 0 1 1 1 1 1 0 1 ...
1 0 0 1 0 0 0 1 0 1 1 1 0 0 0 1 1 1 1 1 0 0 1 1 ...
1 1 1 0 1 1 1 1 1 0 0 0 1 0 1 0 0 0 1 0 0 1 0 1 ...
1 0 0 1 1 1 0 0 0 0 1 0 0 1 0 1 0 0 1 0 0 1 1 0 ...
1 0 0 0 1 1 0 1 1 1 0 1 0 1 1 0 0 0 0 1 1 1 0 0 ...
0 1 0 0 1 0 1 0 1 0 0 1 0 0 0 0 1 1 1 0 0 1 0 1 ...
0 0 1 0 0 0 1 0 0 0 0 1 0 0 1 1 1 1 0 1 1 0 1 1 ...
0 1 1 0 0 1 1 0 0 0 0 1 1 0 1 1 0 1 0 1 1 0 0 1 ...
1 0 0 1 0 1 1 1 1 1 0 1 0 1 0 1 1 1 0 0 0 1 1 0 ...
1 1 0 0 1 0 0 0 0 1 0 1 0 1 1 1 0 0 0 1 0 0 0 1 ...
0 1 1 0 1 1 0 1 0 1 1 1 1 1 0 0 0 1 1 0 1 0 0 0 ...
1 0 1 1 1 1 1 1 1 1 0 1 1 0 0 0 1 0 1 1 0 0 1 1 ...
0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 1 0 1 1 0 1 1 ...
1 0 1 1 0 1 1 0 0 1 0 1 1 0 1 0 0 0 1 1 1 1 1 1 ...
1 0 0 1 0 0 0 1 1 1 0 1 0 1 0 0 1 0 1 1 1 0 1 1 ...
1 1 0 0 1 0 1 1 1 1 0 0 0 1 1 0 ];

View File

@ -0,0 +1,128 @@
function a = get_number1
a = [127 0 127 0 127 0 127 0 127 0 127 -2 127 -10 122 -35 105 -72 73 -104 44 -119 44 -119 ...
73 -104 104 -73 119 -44 119 -44 104 -73 73 -104 44 -119 44 -119 73 -104 104 -73 119 -44 119 -44 ...
104 -73 73 -104 44 -119 44 -119 73 -104 104 -73 119 -44 119 -44 104 -73 73 -104 44 -119 44 -119 ...
73 -104 104 -73 119 -44 119 -44 104 -73 73 -104 44 -119 44 -119 73 -104 106 -71 125 -25 125 25 ...
106 71 73 104 44 119 44 119 73 104 104 73 119 44 119 44 104 73 73 104 44 119 44 119 ...
73 104 104 73 119 44 119 44 104 73 71 106 25 125 -25 125 -71 106 -104 73 -119 44 -119 44 ...
-104 73 -73 104 -44 119 -44 119 -73 104 -106 71 -125 25 -125 -25 -106 -71 -71 -106 -25 -125 25 -125 ...
71 -106 106 -71 125 -25 125 25 106 71 71 106 25 125 -25 125 -71 106 -104 73 -119 44 -119 44 ...
-104 73 -73 104 -44 119 -44 119 -73 104 -106 71 -125 25 -125 -25 -106 -71 -73 -104 -44 -119 -44 -119 ...
-73 -104 -106 -71 -125 -25 -125 25 -106 71 -73 104 -44 119 -44 119 -73 104 -104 73 -119 44 -119 44 ...
-104 73 -71 106 -25 125 25 125 71 106 106 71 125 25 125 -25 106 -71 73 -104 44 -119 44 -119 ...
73 -104 104 -73 119 -44 119 -44 104 -73 73 -104 44 -119 44 -119 73 -104 106 -71 125 -25 125 25 ...
106 71 71 106 25 125 -25 125 -71 106 -104 73 -119 44 -119 44 -104 73 -71 106 -25 125 25 125 ...
71 106 106 71 125 25 125 -25 106 -71 73 -104 44 -119 44 -119 73 -104 106 -71 125 -25 125 25 ...
106 71 71 106 25 125 -25 125 -71 106 -106 71 -125 25 -125 -25 -106 -71 -71 -106 -25 -125 25 -125 ...
71 -106 104 -73 119 -44 119 -44 104 -73 71 -106 25 -125 -25 -125 -71 -106 -104 -73 -119 -44 -119 -44 ...
-104 -73 -71 -106 -25 -125 25 -125 71 -106 106 -71 125 -25 125 25 106 71 71 106 25 125 -25 125 ...
-71 106 -106 71 -125 25 -125 -25 -106 -71 -73 -104 -44 -119 -44 -119 -73 -104 -104 -73 -119 -44 -119 -44 ...
-104 -73 -71 -106 -25 -125 25 -125 71 -106 106 -71 125 -25 125 25 106 71 71 106 25 125 -25 125 ...
-71 106 -106 71 -125 25 -125 -25 -106 -71 -73 -104 -44 -119 -44 -119 -73 -104 -106 -71 -125 -25 -125 25 ...
-106 71 -71 106 -25 125 25 125 71 106 104 73 119 44 119 44 104 73 73 104 44 119 44 119 ...
73 104 104 73 119 44 119 44 104 73 73 104 44 119 44 119 73 104 106 71 125 25 125 -25 ...
106 -71 71 -106 25 -125 -25 -125 -71 -106 -104 -73 -119 -44 -119 -44 -104 -73 -73 -104 -44 -119 -44 -119 ...
-73 -104 -106 -71 -125 -25 -125 25 -106 71 -73 104 -44 119 -44 119 -73 104 -104 73 -119 44 -119 44 ...
-104 73 -73 104 -44 119 -44 119 -73 104 -106 71 -125 25 -125 -25 -106 -71 -73 -104 -44 -119 -44 -119 ...
-73 -104 -106 -71 -125 -25 -125 25 -106 71 -73 104 -44 119 -44 119 -73 104 -106 71 -125 25 -125 -25 ...
-106 -71 -71 -106 -25 -125 25 -125 71 -106 104 -73 119 -44 119 -44 104 -73 71 -106 25 -125 -25 -125 ...
-71 -106 -106 -71 -125 -25 -125 25 -106 71 -71 106 -25 125 25 125 71 106 104 73 119 44 119 44 ...
104 73 73 104 44 119 44 119 73 104 106 71 125 25 125 -25 106 -71 73 -104 44 -119 44 -119 ...
73 -104 104 -73 119 -44 119 -44 104 -73 73 -104 44 -119 44 -119 73 -104 104 -73 119 -44 119 -44 ...
104 -73 71 -106 25 -125 -25 -125 -71 -106 -104 -73 -119 -44 -119 -44 -104 -73 -73 -104 -44 -119 -44 -119 ...
-73 -104 -106 -71 -125 -25 -125 25 -106 71 -73 104 -44 119 -44 119 -73 104 -106 71 -125 25 -125 -25 ...
-106 -71 -73 -104 -44 -119 -44 -119 -73 -104 -104 -73 -119 -44 -119 -44 -104 -73 -73 -104 -44 -119 -44 -119 ...
-73 -104 -106 -71 -125 -25 -125 25 -106 71 -71 106 -25 125 25 125 71 106 104 73 119 44 119 44 ...
104 73 71 106 25 125 -25 125 -71 106 -104 73 -119 44 -119 44 -104 73 -73 104 -44 119 -44 119 ...
-73 104 -106 71 -125 25 -125 -25 -106 -71 -71 -106 -25 -125 25 -125 71 -106 104 -73 119 -44 119 -44 ...
104 -73 73 -104 44 -119 44 -119 73 -104 104 -73 119 -44 119 -44 104 -73 73 -104 44 -119 44 -119 ...
73 -104 106 -71 125 -25 125 25 106 71 73 104 44 119 44 119 73 104 106 71 125 25 125 -25 ...
106 -71 71 -106 25 -125 -25 -125 -71 -106 -106 -71 -125 -25 -125 25 -106 71 -73 104 -44 119 -44 119 ...
-73 104 -106 71 -125 25 -125 -25 -106 -71 -71 -106 -25 -125 25 -125 71 -106 104 -73 119 -44 119 -44 ...
104 -73 71 -106 25 -125 -25 -125 -71 -106 -106 -71 -125 -25 -125 25 -106 71 -73 104 -44 119 -44 119 ...
-73 104 -104 73 -119 44 -119 44 -104 73 -71 106 -25 125 25 125 71 106 104 73 119 44 119 44 ...
104 73 73 104 44 119 44 119 73 104 104 73 119 44 119 44 104 73 73 104 44 119 44 119 ...
73 104 104 73 119 44 119 44 104 73 73 104 44 119 44 119 73 104 106 71 125 25 125 -25 ...
106 -71 73 -104 44 -119 44 -119 73 -104 104 -73 119 -44 119 -44 104 -73 71 -106 25 -125 -25 -125 ...
-71 -106 -106 -71 -125 -25 -125 25 -106 71 -71 106 -25 125 25 125 71 106 104 73 119 44 119 44 ...
104 73 71 106 25 125 -25 125 -71 106 -106 71 -125 25 -125 -25 -106 -71 -73 -104 -44 -119 -44 -119 ...
-73 -104 -106 -71 -125 -25 -125 25 -106 71 -73 104 -44 119 -44 119 -73 104 -104 73 -119 44 -119 44 ...
-104 73 -73 104 -44 119 -44 119 -73 104 -104 73 -119 44 -119 44 -104 73 -71 106 -25 125 25 125 ...
71 106 104 73 119 44 119 44 104 73 73 104 44 119 44 119 73 104 106 71 125 25 125 -25 ...
106 -71 71 -106 25 -125 -25 -125 -71 -106 -104 -73 -119 -44 -119 -44 -104 -73 -73 -104 -44 -119 -44 -119 ...
-73 -104 -106 -71 -125 -25 -125 25 -106 71 -71 106 -25 125 25 125 71 106 106 71 125 25 125 -25 ...
106 -71 73 -104 44 -119 44 -119 73 -104 104 -73 119 -44 119 -44 104 -73 71 -106 25 -125 -25 -125 ...
-71 -106 -104 -73 -119 -44 -119 -44 -104 -73 -71 -106 -25 -125 25 -125 71 -106 106 -71 125 -25 125 25 ...
106 71 71 106 25 125 -25 125 -71 106 -104 73 -119 44 -119 44 -104 73 -73 104 -44 119 -44 119 ...
-73 104 -106 71 -125 25 -125 -25 -106 -71 -73 -104 -44 -119 -44 -119 -73 -104 -104 -73 -119 -44 -119 -44 ...
-104 -73 -71 -106 -25 -125 25 -125 71 -106 104 -73 119 -44 119 -44 104 -73 73 -104 44 -119 44 -119 ...
73 -104 106 -71 125 -25 125 25 106 71 73 104 44 119 44 119 73 104 106 71 125 25 125 -25 ...
106 -71 73 -104 44 -119 44 -119 73 -104 106 -71 125 -25 125 25 106 71 73 104 44 119 44 119 ...
73 104 106 71 125 25 125 -25 106 -71 71 -106 25 -125 -25 -125 -71 -106 -106 -71 -125 -25 -125 25 ...
-106 71 -73 104 -44 119 -44 119 -73 104 -106 71 -125 25 -125 -25 -106 -71 -73 -104 -44 -119 -44 -119 ...
-73 -104 -104 -73 -119 -44 -119 -44 -104 -73 -71 -106 -25 -125 25 -125 71 -106 104 -73 119 -44 119 -44 ...
104 -73 73 -104 44 -119 44 -119 73 -104 104 -73 119 -44 119 -44 104 -73 73 -104 44 -119 44 -119 ...
73 -104 106 -71 125 -25 125 25 106 71 73 104 44 119 44 119 73 104 106 71 125 25 125 -25 ...
106 -71 73 -104 44 -119 44 -119 73 -104 106 -71 125 -25 125 25 106 71 73 104 44 119 44 119 ...
73 104 106 71 125 25 125 -25 106 -71 73 -104 44 -119 44 -119 73 -104 104 -73 119 -44 119 -44 ...
104 -73 73 -104 44 -119 44 -119 73 -104 106 -71 125 -25 125 25 106 71 71 106 25 125 -25 125 ...
-71 106 -106 71 -125 25 -125 -25 -106 -71 -71 -106 -25 -125 25 -125 71 -106 104 -73 119 -44 119 -44 ...
104 -73 73 -104 44 -119 44 -119 73 -104 104 -73 119 -44 119 -44 104 -73 73 -104 44 -119 44 -119 ...
73 -104 104 -73 119 -44 119 -44 104 -73 73 -104 44 -119 44 -119 73 -104 106 -71 125 -25 125 25 ...
106 71 71 106 25 125 -25 125 -71 106 -104 73 -119 44 -119 44 -104 73 -71 106 -25 125 25 125 ...
71 106 106 71 125 25 125 -25 106 -71 73 -104 44 -119 44 -119 73 -104 106 -71 125 -25 125 25 ...
106 71 73 104 44 119 44 119 73 104 104 73 119 44 119 44 104 73 71 106 25 125 -25 125 ...
-71 106 -104 73 -119 44 -119 44 -104 73 -71 106 -25 125 25 125 71 106 104 73 119 44 119 44 ...
104 73 73 104 44 119 44 119 73 104 106 71 125 25 125 -25 106 -71 71 -106 25 -125 -25 -125 ...
-71 -106 -106 -71 -125 -25 -125 25 -106 71 -73 104 -44 119 -44 119 -73 104 -104 73 -119 44 -119 44 ...
-104 73 -73 104 -44 119 -44 119 -73 104 -104 73 -119 44 -119 44 -104 73 -73 104 -44 119 -44 119 ...
-73 104 -106 71 -125 25 -125 -25 -106 -71 -71 -106 -25 -125 25 -125 71 -106 104 -73 119 -44 119 -44 ...
104 -73 71 -106 25 -125 -25 -125 -71 -106 -106 -71 -125 -25 -125 25 -106 71 -73 104 -44 119 -44 119 ...
-73 104 -104 73 -119 44 -119 44 -104 73 -71 106 -25 125 25 125 71 106 106 71 125 25 125 -25 ...
106 -71 73 -104 44 -119 44 -119 73 -104 104 -73 119 -44 119 -44 104 -73 73 -104 44 -119 44 -119 ...
73 -104 106 -71 125 -25 125 25 106 71 73 104 44 119 44 119 73 104 104 73 119 44 119 44 ...
104 73 71 106 25 125 -25 125 -71 106 -104 73 -119 44 -119 44 -104 73 -73 104 -44 119 -44 119 ...
-73 104 -104 73 -119 44 -119 44 -104 73 -73 104 -44 119 -44 119 -73 104 -106 71 -125 25 -125 -25 ...
-106 -71 -71 -106 -25 -125 25 -125 71 -106 106 -71 125 -25 125 25 106 71 71 106 25 125 -25 125 ...
-71 106 -104 73 -119 44 -119 44 -104 73 -71 106 -25 125 25 125 71 106 106 71 125 25 125 -25 ...
106 -71 73 -104 44 -119 44 -119 73 -104 106 -71 125 -25 125 25 106 71 73 104 44 119 44 119 ...
73 104 104 73 119 44 119 44 104 73 73 104 44 119 44 119 73 104 106 71 125 25 125 -25 ...
106 -71 71 -106 25 -125 -25 -125 -71 -106 -104 -73 -119 -44 -119 -44 -104 -73 -73 -104 -44 -119 -44 -119 ...
-73 -104 -104 -73 -119 -44 -119 -44 -104 -73 -71 -106 -25 -125 25 -125 71 -106 106 -71 125 -25 125 25 ...
106 71 71 106 25 125 -25 125 -71 106 -106 71 -125 25 -125 -25 -106 -71 -71 -106 -25 -125 25 -125 ...
71 -106 106 -71 125 -25 125 25 106 71 71 106 25 125 -25 125 -71 106 -104 73 -119 44 -119 44 ...
-104 73 -73 104 -44 119 -44 119 -73 104 -106 71 -125 25 -125 -25 -106 -71 -73 -104 -44 -119 -44 -119 ...
-73 -104 -106 -71 -125 -25 -125 25 -106 71 -71 106 -25 125 25 125 71 106 104 73 119 44 119 44 ...
104 73 73 104 44 119 44 119 73 104 104 73 119 44 119 44 104 73 71 106 25 125 -25 125 ...
-71 106 -104 73 -119 44 -119 44 -104 73 -71 106 -25 125 25 125 71 106 104 73 119 44 119 44 ...
104 73 71 106 25 125 -25 125 -71 106 -104 73 -119 44 -119 44 -104 73 -71 106 -25 125 25 125 ...
71 106 106 71 125 25 125 -25 106 -71 71 -106 25 -125 -25 -125 -71 -106 -106 -71 -125 -25 -125 25 ...
-106 71 -71 106 -25 125 25 125 71 106 104 73 119 44 119 44 104 73 73 104 44 119 44 119 ...
73 104 106 71 125 25 125 -25 106 -71 71 -106 25 -125 -25 -125 -71 -106 -106 -71 -125 -25 -125 25 ...
-106 71 -71 106 -25 125 25 125 71 106 104 73 119 44 119 44 104 73 73 104 44 119 44 119 ...
73 104 106 71 125 25 125 -25 106 -71 73 -104 44 -119 44 -119 73 -104 104 -73 119 -44 119 -44 ...
104 -73 73 -104 44 -119 44 -119 73 -104 104 -73 119 -44 119 -44 104 -73 73 -104 44 -119 44 -119 ...
73 -104 106 -71 125 -25 125 25 106 71 73 104 44 119 44 119 73 104 104 73 119 44 119 44 ...
104 73 71 106 25 125 -25 125 -71 106 -106 71 -125 25 -125 -25 -106 -71 -73 -104 -44 -119 -44 -119 ...
-73 -104 -104 -73 -119 -44 -119 -44 -104 -73 -71 -106 -25 -125 25 -125 71 -106 104 -73 119 -44 119 -44 ...
104 -73 73 -104 44 -119 44 -119 73 -104 106 -71 125 -25 125 25 106 71 73 104 44 119 44 119 ...
73 104 106 71 125 25 125 -25 106 -71 73 -104 44 -119 44 -119 73 -104 104 -73 119 -44 119 -44 ...
104 -73 73 -104 44 -119 44 -119 73 -104 106 -71 125 -25 125 25 106 71 73 104 44 119 44 119 ...
73 104 104 73 119 44 119 44 104 73 73 104 44 119 44 119 73 104 106 71 125 25 125 -25 ...
106 -71 71 -106 25 -125 -25 -125 -71 -106 -104 -73 -119 -44 -119 -44 -104 -73 -71 -106 -25 -125 25 -125 ...
71 -106 106 -71 125 -25 125 25 106 71 71 106 25 125 -25 125 -71 106 -106 71 -125 25 -125 -25 ...
-106 -71 -71 -106 -25 -125 25 -125 71 -106 106 -71 125 -25 125 25 106 71 73 104 44 119 44 119 ...
73 104 106 71 125 25 125 -25 106 -71 73 -104 44 -119 44 -119 73 -104 104 -73 119 -44 119 -44 ...
104 -73 71 -106 25 -125 -25 -125 -71 -106 -106 -71 -125 -25 -125 25 -106 71 -73 104 -44 119 -44 119 ...
-73 104 -106 71 -125 25 -125 -25 -106 -71 -71 -106 -25 -125 25 -125 71 -106 104 -73 119 -44 119 -44 ...
104 -73 73 -104 44 -119 44 -119 73 -104 104 -73 119 -44 119 -44 104 -73 73 -104 44 -119 44 -119 ...
73 -104 104 -73 119 -44 119 -44 104 -73 71 -106 25 -125 -25 -125 -71 -106 -104 -73 -119 -44 -119 -44 ...
-104 -73 -73 -104 -44 -119 -44 -119 -73 -104 -104 -73 -119 -44 -119 -44 -104 -73 -71 -106 -25 -125 25 -125 ...
71 -106 106 -71 125 -25 125 25 106 71 73 104 44 119 44 119 73 104 104 73 119 44 119 44 ...
104 73 71 106 25 125 -25 125 -71 106 -106 71 -125 25 -125 -25 -106 -71 -71 -106 -25 -125 25 -125 ...
71 -106 104 -73 119 -44 119 -44 104 -73 71 -106 25 -125 -25 -125 -71 -106 -104 -73 -119 -44 -119 -44 ...
-104 -73 -73 -104 -44 -119 -44 -119 -73 -104 -104 -73 -119 -44 -119 -44 -104 -73 -71 -106 -25 -125 25 -125 ...
71 -106 106 -71 125 -25 125 25 106 71 71 106 25 125 -25 125 -71 106 -104 73 -119 44 -119 44 ...
-104 73 -71 106 -25 125 25 125 71 106 106 71 125 25 125 -25 106 -71 73 -104 44 -119 44 -119 ...
73 -104 106 -71 125 -25 125 25 106 71 73 104 44 119 44 119 73 104 105 72 122 35 127 10 ...
127 2 127 0 127 0 127 0 127 0 127 0 127 0 127 0 ];

View File

@ -0,0 +1,31 @@
function [s, status] = get_signal_from_hackrf_bin(filename, num_sample_read)
s = int8(-1);
status = false;
fid = fopen(filename);
if fid == -1
disp('get_signal_from_hackrf_bin: Can not open file!');
status = true;
return;
end
[s, count] = fread(fid, num_sample_read*2, 'int8');
fclose(fid);
% s = int8(s);
if num_sample_read~=inf && count ~= (num_sample_read*2)
disp('get_signal_from_hackrf_bin: No enough samples in the file!');
status = true;
return;
end
% s = single( (s(1:2:end) + 1i.*s(2:2:end))./128 );
% s = (s(1:2:end) + 1i.*s(2:2:end))./128;
s = complex(s(1:2:end), s(2:2:end));
% len_s = length(s);
%
% s = s((len_s/2)+1:end);

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,18 @@
function save_int_var_for_c(a, type_and_name, filename, access_mode)
fid = fopen(filename, access_mode);
if fid == -1
disp(['save_var_for_c: fopen' filename ' failed!']);
return;
end
fprintf(fid, [type_and_name, '[%d] = {'], length(a) );
for i = 1 : length(a)
if mod(i-1, 24) == 0
fprintf(fid, '\n');
end
fprintf(fid, '%d, ', a(i));
end
fprintf(fid, '};\n\n');
fclose(fid);

View File

@ -0,0 +1,22 @@
function save_int_var_for_c_2d(a, type_and_name, filename, access_mode)
fid = fopen(filename, access_mode);
if fid == -1
disp(['save_int_var_for_c_2d: fopen' filename ' failed!']);
return;
end
[num_row, num_col] = size(a);
fprintf(fid, [type_and_name, '[%d][%d] = {'], num_row, num_col );
for j = 1 : num_row
fprintf(fid, '\n{');
for i = 1 : num_col
fprintf(fid, '%d, ', a(j,i));
end
fprintf(fid, '},');
end
fprintf(fid, '\n};\n\n');
fclose(fid);

View File

@ -0,0 +1,45 @@
function a = scramble_gen(channel_number, num_bit, filename, varargin)
bit_store = zeros(1, 7);
bit_store_update = zeros(1, 7);
channel_number_bin = dec2bin(channel_number, 6);
bit_store(1) = 1;
bit_store(2) = ( channel_number_bin(1) == '1' );
bit_store(3) = ( channel_number_bin(2) == '1' );
bit_store(4) = ( channel_number_bin(3) == '1' );
bit_store(5) = ( channel_number_bin(4) == '1' );
bit_store(6) = ( channel_number_bin(5) == '1' );
bit_store(7) = ( channel_number_bin(6) == '1' );
bit_seq = zeros(1, num_bit);
for i = 1 : num_bit
bit_seq(i) = bit_store(7);
bit_store_update(1) = bit_store(7);
bit_store_update(2) = bit_store(1);
bit_store_update(3) = bit_store(2);
bit_store_update(4) = bit_store(3);
bit_store_update(5) = mod(bit_store(4)+bit_store(7), 2);
bit_store_update(6) = bit_store(5);
bit_store_update(7) = bit_store(6);
bit_store = bit_store_update;
end
a = zeros(1, num_bit/8);
for i = 0 : 8 : num_bit-1
idx = floor(i/8) + 1;
a(idx) = bit_seq(i+1) + bit_seq(i+2)*2 + bit_seq(i+3)*4 + bit_seq(i+4)*8 + bit_seq(i+5)*16 + bit_seq(i+6)*32 + bit_seq(i+7)*64 + bit_seq(i+8)*128;
end
if nargin == 3
save_int_var_for_c(a, ['const uint8_t const scramble_table_ch' num2str(channel_number)], filename, 'w');
end

View File

@ -0,0 +1,333 @@
function test_btle_rx(channel_number, varargin)
sample_per_symbol = 4;
if nargin<=0 || nargin >2
disp('Wrong number of input parameters!');
return;
end
if nargin == 2
% 'sample_iq_4msps.txt'
filename = varargin{1};
a = load(filename);
a = a';
a = a(:)';
% a = a(2:end-1);
a = a(1:2:end) + 1i.*a(2:2:end);
else
symbol_rate = 1e6;
sampling_rate = sample_per_symbol*symbol_rate;
cap_time = 1; % in second
num_samples = cap_time*sampling_rate;
if channel_number == 39
freq = 2480000000;
elseif channel_number == 37
freq = 2402000000;
elseif channel_number == 38
freq = 2426000000;
elseif channel_number >=0 && channel_number <= 10
freq = 2404000000 + channel_number*2000000;
elseif channel_number >=11 && channel_number <= 36
freq = 2428000000 + (channel_number-11)*2000000;
end
ant_gain = 0; % 0 turn off, 1 turn on
lna_gain = 40; %0-40dB, 8dB steps
vga_gain = 6; %0-62dB, 2dB steps
cmd_str = ['hackrf_transfer -f ' num2str(freq) ' -a ' num2str(ant_gain) ' -l ' num2str(lna_gain) ' -g ' num2str(vga_gain) ' -s ' num2str(sampling_rate) ' -n ' num2str(num_samples) ' -b 1000000 -r hackrf_tmp_cap.bin'];
delete hackrf_tmp_cap.bin;
[status, cmd_out] = system(cmd_str, '-echo');
% disp(cmd_out);
if status == 0
a = get_signal_from_hackrf_bin('hackrf_tmp_cap.bin', inf);
else
disp('Abnormal status! Return directly!');
return;
end
end
pdu_type_str = {'ADV_IND', 'ADV_DIRECT_IND', 'ADV_NONCONN_IND', 'SCAN_REQ', 'SCAN_RSP', 'CONNECT_REQ', 'ADV_SCAN_IND', 'Reserved', 'Reserved', 'Reserved', 'Reserved', 'Reserved', 'Reserved', 'Reserved', 'Reserved', 'Reserved'};
% subplot(3,1,1); plot(abs(a));
% subplot(3,1,2); plot(angle(a));
% subplot(3,1,3); plot(angle(a(2:end)./a(1:end-1)), 'r.-');
max_num_scramble_bits = (39 + 3)*8; % 39 is maximum pdu length in octets; 3 is the number of CRC post-fix octets.
scramble_bits = scramble_gen(channel_number, max_num_scramble_bits);
match_bit = de2bi(hex2dec('8E89BED6AA'), 40, 'right-msb');
num_pdu_header_bits = 16;
sp = 1;
disp('Start demodulation ...');
%plot(abs(a)); drawnow;
pkt_count = 0;
while 1
% disp(' ');
sp_new = search_unique_bits(a(sp:end), match_bit, sample_per_symbol);
if sp_new == -1
break;
end
disp(num2str(a(sp_new:(sp_new+7))));
disp(num2str(sp + sp_new -1));
sp = sp + sp_new -1 + length(match_bit)*sample_per_symbol;
pkt_count = pkt_count + 1;
% disp(['relative sp ' num2str(sp_new) ' absolute sp ' num2str(sp)]);
% pdu header
pdu_header_bits = demod_bits(a(sp:end), num_pdu_header_bits, sample_per_symbol);
disp(num2str(a(sp:(sp+7))));
pdu_header_bits = xor(pdu_header_bits, scramble_bits(1:num_pdu_header_bits));
[pdu_type, tx_add, rx_add, payload_len] = parse_adv_pdu_header_bits(pdu_header_bits);
sp = sp + num_pdu_header_bits*sample_per_symbol;
if payload_len<6 || payload_len>37
disp(['Pkt' num2str(pkt_count) ' Ch' num2str(channel_number) ' AccessAddr8E89BED6 ADV_PDU_Type' num2str(pdu_type) '(' pdu_type_str{pdu_type+1} ') TxAdd' num2str(tx_add) ' RxAdd' num2str(rx_add) ' PayloadLen' num2str(payload_len)]);
continue;
end
% pdu payload + 3 crc octets
num_pdu_payload_crc_bits = (payload_len+3)*8;
pdu_payload_crc_bits = demod_bits(a(sp:end), num_pdu_payload_crc_bits, sample_per_symbol);
pdu_payload_crc_bits = xor(pdu_payload_crc_bits, scramble_bits( (num_pdu_header_bits+1) : (num_pdu_header_bits+num_pdu_payload_crc_bits)));
payload_parse_result_str = parse_adv_pdu_payload(pdu_payload_crc_bits(1:(end-3*8)), pdu_type);
crc_24bits = ble_crc([pdu_header_bits pdu_payload_crc_bits(1:(end-3*8))], '555555');
% disp(num2str(crc_24bits));
% disp(num2str(pdu_payload_crc_bits((end-3*8+1):end)));
if sum(crc_24bits==pdu_payload_crc_bits((end-3*8+1):end)) == 24
crc_str = 'CRC:OK';
else
crc_str = 'CRC:Bad';
end
disp(['Pkt' num2str(pkt_count) ' Ch' num2str(channel_number) ' AccessAddr8E89BED6 ADV_PDU_Type' num2str(pdu_type) '(' pdu_type_str{pdu_type+1} ') TxAdd' num2str(tx_add) ' RxAdd' num2str(rx_add) ' PayloadLen' num2str(payload_len) ' ' payload_parse_result_str ' ' crc_str]);
sp = sp + num_pdu_payload_crc_bits*sample_per_symbol;
end
function bytes_str_out = reorder_bytes_str(bytes_str_in)
bytes_str_out = vec2mat(bytes_str_in, 2);
bytes_str_out = bytes_str_out(end:-1:1,:);
bytes_str_out = bytes_str_out.';
bytes_str_out = bytes_str_out(:).';
function payload_parse_result_str = parse_adv_pdu_payload(payload_bits, pdu_type)
if length(payload_bits)<6*8
payload_parse_result_str = ['Payload Too Short (only ' num2str(length(payload_bits)) ' bits)'];
return;
end
tmp_bits = vec2mat(payload_bits, 8);
payload_bytes = dec2hex(bi2de(tmp_bits, 'right-msb'), 2);
payload_bytes = payload_bytes.';
payload_bytes = payload_bytes(:).';
if pdu_type == 0 || pdu_type == 2 || pdu_type == 6
AdvA = reorder_bytes_str( payload_bytes(1 : (2*6)) );
AdvData = payload_bytes((2*6+1):end);
payload_parse_result_str = ['AdvA:' AdvA ' AdvData:' AdvData];
elseif pdu_type == 1
AdvA = reorder_bytes_str( payload_bytes(1 : (2*6)) );
InitA = reorder_bytes_str( payload_bytes((2*6+1):end) );
payload_parse_result_str = ['AdvA:' AdvA ' InitA:' InitA];
elseif pdu_type == 3 % SCAN_REQ
ScanA = reorder_bytes_str( payload_bytes(1 : (2*6)) );
AdvA = reorder_bytes_str( payload_bytes((2*6+1):end) );
payload_parse_result_str = ['ScanA:' ScanA ' AdvA:' AdvA];
elseif pdu_type == 4 % SCAN_RSP
AdvA = reorder_bytes_str( payload_bytes(1 : (2*6)) );
ScanRspData = payload_bytes((2*6+1):end);
payload_parse_result_str = ['AdvA:' AdvA ' ScanRspData:' ScanRspData];
elseif pdu_type == 5 % CONNECT_REQ
if length(payload_bits) ~= 34*8
payload_parse_result_str = ['Payload Too Short (only ' num2str(length(payload_bits)) ' bits)'];
return;
end
InitA = reorder_bytes_str( payload_bytes(1 : (2*6)) );
AdvA = reorder_bytes_str( payload_bytes((2*6+1):(2*6+2*6)) );
AA = reorder_bytes_str( payload_bytes((2*6+2*6+1):(2*6+2*6+2*4)) );
CRCInit = payload_bytes((2*6+2*6+2*4+1):(2*6+2*6+2*4+2*3));
WinSize = payload_bytes((2*6+2*6+2*4+2*3+1):(2*6+2*6+2*4+2*3+2*1));
WinOffset = reorder_bytes_str( payload_bytes((2*6+2*6+2*4+2*3+2*1+1):(2*6+2*6+2*4+2*3+2*1+2*2)) );
Interval = reorder_bytes_str( payload_bytes((2*6+2*6+2*4+2*3+2*1+2*2+1):(2*6+2*6+2*4+2*3+2*1+2*2+2*2)) );
Latency = reorder_bytes_str( payload_bytes((2*6+2*6+2*4+2*3+2*1+2*2+2*2+1):(2*6+2*6+2*4+2*3+2*1+2*2+2*2+2*2)) );
Timeout = reorder_bytes_str( payload_bytes((2*6+2*6+2*4+2*3+2*1+2*2+2*2+2*2+1):(2*6+2*6+2*4+2*3+2*1+2*2+2*2+2*2+2*2)) );
ChM = reorder_bytes_str( payload_bytes((2*6+2*6+2*4+2*3+2*1+2*2+2*2+2*2+2*2+1):(2*6+2*6+2*4+2*3+2*1+2*2+2*2+2*2+2*2+2*5)) );
tmp_bits = payload_bits((end-7) : end);
Hop = num2str( bi2de(tmp_bits(1:5), 'right-msb') );
SCA = num2str( bi2de(tmp_bits(6:end), 'right-msb') );
payload_parse_result_str = ['InitA:' InitA ' AdvA:' AdvA ...
' AA:' AA ...
' CRCInit:' CRCInit ...
' WinSize:' WinSize ...
' WinOffset:' WinOffset ...
' Interval:' Interval ...
' Latency:' Latency ...
' Timeout:' Timeout ...
' ChM:' ChM ...
' Hop:' Hop ...
' SCA:' SCA];
else
payload_parse_result_str = 'Reserved PDU type';
end
function reg_bits = ble_crc(pdu, init_reg_bits)
reg_bits = de2bi(hex2dec(init_reg_bits), 24, 'right-msb');
for i = 1 : length(pdu)
reg_bits = LFSR_crc(reg_bits, pdu(i));
end
reg_bits = reg_bits(end:-1:1);
function [seq] = LFSR_crc(old_seq, pdu_bit)
proc_bit = xor(old_seq(24), pdu_bit);
seq(1) = proc_bit;
seq(2) = xor(old_seq(1), proc_bit);
seq(3) = old_seq(2);
seq(4) = xor(old_seq(3), proc_bit);
seq(5) = xor(old_seq(4), proc_bit);
seq(6) = old_seq(5);
seq(7) = xor(old_seq(6), proc_bit);
seq(8:9) = old_seq(7:8);
seq(10) = xor(old_seq(9), proc_bit);
seq(11) = xor(old_seq(10), proc_bit);
seq(12:24) = old_seq(11:23);
function scramble_bits = scramble_gen(channel_number, num_bit)
bit_store = zeros(1, 7);
bit_store_update = zeros(1, 7);
% channel_number_bin = dec2bin(channel_number, 6);
%
% bit_store(1) = 1;
% bit_store(2) = ( channel_number_bin(1) == '1' );
% bit_store(3) = ( channel_number_bin(2) == '1' );
% bit_store(4) = ( channel_number_bin(3) == '1' );
% bit_store(5) = ( channel_number_bin(4) == '1' );
% bit_store(6) = ( channel_number_bin(5) == '1' );
% bit_store(7) = ( channel_number_bin(6) == '1' );
channel_number_bin = de2bi(channel_number, 6, 'left-msb');
bit_store(1) = 1;
bit_store(2:7) = channel_number_bin;
bit_seq = zeros(1, num_bit);
for i = 1 : num_bit
bit_seq(i) = bit_store(7);
bit_store_update(1) = bit_store(7);
bit_store_update(2) = bit_store(1);
bit_store_update(3) = bit_store(2);
bit_store_update(4) = bit_store(3);
bit_store_update(5) = mod(bit_store(4)+bit_store(7), 2);
bit_store_update(6) = bit_store(5);
bit_store_update(7) = bit_store(6);
bit_store = bit_store_update;
end
scramble_bits = bit_seq;
function [pdu_type, tx_add, rx_add, payload_len] = parse_adv_pdu_header_bits(bits)
% pdu_type_str = {'ADV_IND', 'ADV_DIRECT_IND', 'ADV_NONCONN_IND', 'SCAN_REQ', 'SCAN_RSP', 'CONNECT_REQ', 'ADV_SCAN_IND', 'Reserved', 'Reserved', 'Reserved', 'Reserved', 'Reserved', 'Reserved', 'Reserved', 'Reserved'};
pdu_type = bi2de(bits(1:4), 'right-msb');
% disp([' PDU Type: ' pdu_type_str{pdu_type+1}]);
tx_add = bits(7);
% disp([' Tx Add: ' num2str(tx_add)]);
rx_add = bits(8);
% disp([' Rx Add: ' num2str(rx_add)]);
payload_len = bi2de(bits(9:14), 'right-msb');
% disp(['Payload Len: ' num2str(payload_len)]);
function bits = demod_bits(a, num_bits, sample_per_symbol)
bits = zeros(1, num_bits);
k = 1;
for i = 1 : sample_per_symbol : (1 + (num_bits-1)*sample_per_symbol)
I0 = real(a(i));
Q0 = imag(a(i));
I1 = real(a(i+1));
Q1 = imag(a(i+1));
if (I0*Q1 - I1*Q0) > 0
bits(k) = 1;
else
bits(k) = 0;
end
k = k + 1;
end
function sp = search_unique_bits(a, match_bit, sample_per_symbol)
demod_buf_len = length(match_bit); % in bits
demod_buf_offset = 0;
demod_buf = zeros(sample_per_symbol, demod_buf_len);
i = 1;
while 1
sp = mod(demod_buf_offset-demod_buf_len+1, demod_buf_len);
for j = 1 : sample_per_symbol
I0 = real(a(i+j-1));
Q0 = imag(a(i+j-1));
I1 = real(a(i+j-1+1));
Q1 = imag(a(i+j-1+1));
if (I0*Q1 - I1*Q0) > 0
demod_buf(j, demod_buf_offset+1) = 1;
else
demod_buf(j, demod_buf_offset+1) = 0;
end
k = sp;
unequal_flag = 0;
for p = 1 : demod_buf_len
if demod_buf(j, k+1) ~= match_bit(p);
unequal_flag = 1;
break;
end
k = mod(k + 1, demod_buf_len);
end
if unequal_flag==0
break;
end
end
if unequal_flag==0
sp = i+j-1-(demod_buf_len-1)*sample_per_symbol;
% disp(num2str(sp));
return;
end
i = i + sample_per_symbol;
if (i+sample_per_symbol) > length(a)
break;
end
demod_buf_offset = mod(demod_buf_offset+1, demod_buf_len);
end
sp = -1;
phase = -1;

View File

@ -0,0 +1,120 @@
clear all;
close all;
% original float point version
gauss_coef = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2.231548e-14, 2.007605e-11, 7.561773e-09, 1.197935e-06, 8.050684e-05, 2.326833e-03, 2.959908e-02, 1.727474e-01, 4.999195e-01, 8.249246e-01, 9.408018e-01, 8.249246e-01, 4.999195e-01, 1.727474e-01, 2.959908e-02, 2.326833e-03, 8.050684e-05, 1.197935e-06, 7.561773e-09, 2.007605e-11, 2.231548e-14, 0];
%plot(gauss_coef, 'r+-'); axis([0 length(gauss_coef) 0 0.0001]);
% short it to 16 points:
gauss_coef = [7.561773e-09, 1.197935e-06, 8.050684e-05, 2.326833e-03, 2.959908e-02, 1.727474e-01, 4.999195e-01, 8.249246e-01, 9.408018e-01, 8.249246e-01, 4.999195e-01, 1.727474e-01, 2.959908e-02, 2.326833e-03, 8.050684e-05, 1.197935e-06];
%plot(gauss_coef, 'r+-');
SAMPLE_PER_SYMBOL = 4;
LEN_GAUSS_FILTER = length(gauss_coef)/SAMPLE_PER_SYMBOL;
MAX_NUM_PHY_BYTE = 47;
MAX_NUM_PHY_SAMPLE = ((MAX_NUM_PHY_BYTE*8*SAMPLE_PER_SYMBOL)+(LEN_GAUSS_FILTER*SAMPLE_PER_SYMBOL));
MOD_IDX = 0.5;
AMPLITUDE = 127;
tmp_phy_bit_over_sampling = zeros(1, MAX_NUM_PHY_SAMPLE + 2*LEN_GAUSS_FILTER*SAMPLE_PER_SYMBOL);
tmp_phy_bit_over_sampling = zeros(1, MAX_NUM_PHY_SAMPLE);
num_bit = MAX_NUM_PHY_BYTE*8;
%bit = round(rand(1, num_bit));
bit = get_number;
num_bit_oversample = num_bit*SAMPLE_PER_SYMBOL;
len_gauss_oversample = LEN_GAUSS_FILTER*SAMPLE_PER_SYMBOL;
num_sample = num_bit_oversample + len_gauss_oversample;
pre_len = len_gauss_oversample-1;
tmp_phy_bit_over_sampling(1:pre_len) = 0.0;
post_sp = num_bit_oversample + pre_len + 1;
post_ep = post_sp + pre_len - 1;
tmp_phy_bit_over_sampling(post_sp:post_ep) = 0.0;
tmp_phy_bit_over_sampling((pre_len+1):(pre_len+num_bit_oversample)) = 0;
tmp_phy_bit_over_sampling((pre_len+1):SAMPLE_PER_SYMBOL:(pre_len+num_bit_oversample)) = bit.*2 - 1;
% len_conv_result = length(tmp_phy_bit_over_sampling) - len_gauss_oversample + 1
% = post_ep - len_gauss_oversample + 1
% = num_bit_oversample + pre_len + 1 + pre_len - 1 - len_gauss_oversample + 1
% = num_bit_oversample + 2*(len_gauss_oversample-1) - len_gauss_oversample + 1
% = num_bit_oversample + len_gauss_oversample - 1
len_conv_result = num_sample - 1;
% -------------------------------------- float point reference -----------------------------------------------
for i = 1 : len_conv_result
acc = 0;
for j = 1 : len_gauss_oversample
acc = acc + gauss_coef(len_gauss_oversample-j+1)*tmp_phy_bit_over_sampling(i+j-1); %num_sample - 1+len_gauss_oversample-1= length(tmp_phy_bit_over_sampling)
end
tmp_phy_bit_over_sampling1(i) = acc;
end
tmp = 0;
sample = zeros(1, 2*num_sample);
sample(1) = round( cos(tmp)*AMPLITUDE );
sample(2) = round( sin(tmp)*AMPLITUDE );
for i=2:num_sample
tmp = tmp + (pi*MOD_IDX)*tmp_phy_bit_over_sampling1(i-1)/(SAMPLE_PER_SYMBOL);
sample((i-1)*2 + 1) = round( cos(tmp)*AMPLITUDE );
sample((i-1)*2 + 2) = round( sin(tmp)*AMPLITUDE );
end
% -------------------------------------------------- fixed point ------------- -----------------------------------------------
tmp_phy_bit_over_sampling_int16 = int16(tmp_phy_bit_over_sampling);
tmp_phy_bit_over_sampling1_int16 = int16(tmp_phy_bit_over_sampling1);
gauss_coef_scale = 128;
cos_table_size = 1024; % 0 to 2PI
gauss_coef_int16 = int16(gauss_coef.*gauss_coef_scale);
cos_table_int8 = int8(zeros(1, cos_table_size));
sin_table_int8 = int8(zeros(1, cos_table_size));
for i=1:cos_table_size
cos_table_int8(i) = int8(cos(2*pi*(i-1)/cos_table_size)*127);
sin_table_int8(i) = int8(sin(2*pi*(i-1)/cos_table_size)*127);
end
save_int_var_for_c(gauss_coef_int16./2, 'const int8_t const gauss_coef_int8', 'gauss_cos_sin_table.h', 'w');
save_int_var_for_c(cos_table_int8, 'const int8_t const cos_table_int8', 'gauss_cos_sin_table.h', 'a');
save_int_var_for_c(sin_table_int8, 'const int8_t const sin_table_int8', 'gauss_cos_sin_table.h', 'a');
for i = 1 : len_conv_result
acc_int16 = int16(0);
for j = 1 : len_gauss_oversample
acc_int16 = acc_int16 + gauss_coef_int16(len_gauss_oversample-j+1)*tmp_phy_bit_over_sampling_int16(i+j-1);
end
tmp_phy_bit_over_sampling1_int16(i) = acc_int16;
end
%figure;
%subplot(2,1,1); plot(tmp_phy_bit_over_sampling1_int16); hold on;
%plot(tmp_phy_bit_over_sampling1.*128, 'r.');
%subplot(2,1,2); plot(abs(double(tmp_phy_bit_over_sampling1_int16)-tmp_phy_bit_over_sampling1.*128));
phase_per_step = 2*pi/cos_table_size;
phase_delta_orig = ((pi*MOD_IDX)/SAMPLE_PER_SYMBOL)/gauss_coef_scale;
enlarge_scale = phase_per_step/phase_delta_orig
if enlarge_scale <1
tmp_phy_bit_over_sampling1_int16 = tmp_phy_bit_over_sampling1_int16.*int16(1/enlarge_scale);
else
tmp_phy_bit_over_sampling1_int16 = tmp_phy_bit_over_sampling1_int16./int16(enlarge_scale);
end
tmp_int16 = int16(0);
sample_int16 = int8(zeros(1, 2*num_sample));
sample_int16(1) = cos_table_int8(tmp_int16+1);
sample_int16(2) = sin_table_int8(tmp_int16+1);
for i=2:num_sample
tmp_int16 = tmp_int16 + tmp_phy_bit_over_sampling1_int16(i-1);
tmp_int16 = mod(tmp_int16, int16(cos_table_size));
sample_int16((i-1)*2 + 1) = cos_table_int8(tmp_int16+1);
sample_int16((i-1)*2 + 2) = sin_table_int8(tmp_int16+1);
end
figure(1);
subplot(2,1,1); plot(sample_int16);
ref_sample = get_number1;
%ref_sample = sample;
hold on; plot(ref_sample, 'r.');
subplot(2,1,2); plot((double(sample_int16)-ref_sample));

View File

@ -0,0 +1,68 @@
clear all;
close all;
% original float point version
gauss_coef = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2.231548e-14, 2.007605e-11, 7.561773e-09, 1.197935e-06, 8.050684e-05, 2.326833e-03, 2.959908e-02, 1.727474e-01, 4.999195e-01, 8.249246e-01, 9.408018e-01, 8.249246e-01, 4.999195e-01, 1.727474e-01, 2.959908e-02, 2.326833e-03, 8.050684e-05, 1.197935e-06, 7.561773e-09, 2.007605e-11, 2.231548e-14, 0];
%plot(gauss_coef, 'r+-'); axis([0 length(gauss_coef) 0 0.0001]);
% short it to 16 points:
gauss_coef = [7.561773e-09, 1.197935e-06, 8.050684e-05, 2.326833e-03, 2.959908e-02, 1.727474e-01, 4.999195e-01, 8.249246e-01, 9.408018e-01, 8.249246e-01, 4.999195e-01, 1.727474e-01, 2.959908e-02, 2.326833e-03, 8.050684e-05, 1.197935e-06];
%plot(gauss_coef, 'r+-');
SAMPLE_PER_SYMBOL = 4;
LEN_GAUSS_FILTER = length(gauss_coef)/SAMPLE_PER_SYMBOL;
MAX_NUM_PHY_BYTE = 47;
MAX_NUM_PHY_SAMPLE = ((MAX_NUM_PHY_BYTE*8*SAMPLE_PER_SYMBOL)+(LEN_GAUSS_FILTER*SAMPLE_PER_SYMBOL));
MOD_IDX = 0.5;
AMPLITUDE = 127;
tmp_phy_bit_over_sampling = zeros(1, MAX_NUM_PHY_SAMPLE + 2*LEN_GAUSS_FILTER*SAMPLE_PER_SYMBOL);
tmp_phy_bit_over_sampling = zeros(1, MAX_NUM_PHY_SAMPLE);
num_bit = MAX_NUM_PHY_BYTE*8;
%bit = round(rand(1, num_bit));
bit = get_number;
num_bit_oversample = num_bit*SAMPLE_PER_SYMBOL;
len_gauss_oversample = LEN_GAUSS_FILTER*SAMPLE_PER_SYMBOL;
num_sample = num_bit_oversample + len_gauss_oversample;
pre_len = len_gauss_oversample-1;
tmp_phy_bit_over_sampling(1:pre_len) = 0.0;
post_sp = num_bit_oversample + pre_len + 1;
post_ep = post_sp + pre_len - 1;
tmp_phy_bit_over_sampling(post_sp:post_ep) = 0.0;
tmp_phy_bit_over_sampling((pre_len+1):(pre_len+num_bit_oversample)) = 0;
tmp_phy_bit_over_sampling((pre_len+1):SAMPLE_PER_SYMBOL:(pre_len+num_bit_oversample)) = bit.*2 - 1;
% len_conv_result = length(tmp_phy_bit_over_sampling) - len_gauss_oversample + 1
% = post_ep - len_gauss_oversample + 1
% = num_bit_oversample + pre_len + 1 + pre_len - 1 - len_gauss_oversample + 1
% = num_bit_oversample + 2*(len_gauss_oversample-1) - len_gauss_oversample + 1
% = num_bit_oversample + len_gauss_oversample - 1
len_conv_result = num_sample - 1;
% -------------------------------------- float point reference -----------------------------------------------
for i = 1 : len_conv_result
acc = 0;
for j = 1 : len_gauss_oversample
acc = acc + gauss_coef(len_gauss_oversample-j+1)*tmp_phy_bit_over_sampling(i+j-1); %num_sample - 1+len_gauss_oversample-1= length(tmp_phy_bit_over_sampling)
end
tmp_phy_bit_over_sampling1(i) = acc;
end
tmp = 0;
sample = zeros(1, 2*num_sample);
sample(1) = round( cos(tmp)*AMPLITUDE );
sample(2) = round( sin(tmp)*AMPLITUDE );
for i=2:num_sample
tmp = tmp + (pi*MOD_IDX)*tmp_phy_bit_over_sampling1(i-1)/(SAMPLE_PER_SYMBOL);
sample((i-1)*2 + 1) = round( cos(tmp)*AMPLITUDE );
sample((i-1)*2 + 2) = round( sin(tmp)*AMPLITUDE );
end
figure(1);
subplot(2,1,1); plot(sample);
ref_sample = get_number1;
hold on; plot(ref_sample, 'r.');
subplot(2,1,2); plot(abs(sample-ref_sample));

View File

@ -0,0 +1,10 @@
clear all;
close all;
num_bit = 42*8; % 42 = 2(pdu header) + 37(maximum payload length) + 3(CRC octets)
a = zeros(40, num_bit/8);
for channel_number = 0:39
a(channel_number+1, :) = scramble_gen(channel_number, num_bit, ' ', 1);
end
save_int_var_for_c_2d(a, 'const uint8_t const scramble_table', 'scramble_table.h', 'w');

View File

@ -0,0 +1,128 @@
...
127 0 127 0 127 0 127 0 127 0 127 -2 127 -10 122 -35 105 -72 73 -104 44 -119 44 -119 ...
73 -104 104 -73 119 -44 119 -44 104 -73 73 -104 44 -119 44 -119 73 -104 104 -73 119 -44 119 -44 ...
104 -73 73 -104 44 -119 44 -119 73 -104 104 -73 119 -44 119 -44 104 -73 73 -104 44 -119 44 -119 ...
73 -104 104 -73 119 -44 119 -44 104 -73 73 -104 44 -119 44 -119 73 -104 106 -71 125 -25 125 25 ...
106 71 73 104 44 119 44 119 73 104 104 73 119 44 119 44 104 73 73 104 44 119 44 119 ...
73 104 104 73 119 44 119 44 104 73 71 106 25 125 -25 125 -71 106 -104 73 -119 44 -119 44 ...
-104 73 -73 104 -44 119 -44 119 -73 104 -106 71 -125 25 -125 -25 -106 -71 -71 -106 -25 -125 25 -125 ...
71 -106 106 -71 125 -25 125 25 106 71 71 106 25 125 -25 125 -71 106 -104 73 -119 44 -119 44 ...
-104 73 -73 104 -44 119 -44 119 -73 104 -106 71 -125 25 -125 -25 -106 -71 -73 -104 -44 -119 -44 -119 ...
-73 -104 -106 -71 -125 -25 -125 25 -106 71 -73 104 -44 119 -44 119 -73 104 -104 73 -119 44 -119 44 ...
-104 73 -71 106 -25 125 25 125 71 106 106 71 125 25 125 -25 106 -71 73 -104 44 -119 44 -119 ...
73 -104 104 -73 119 -44 119 -44 104 -73 73 -104 44 -119 44 -119 73 -104 106 -71 125 -25 125 25 ...
106 71 71 106 25 125 -25 125 -71 106 -104 73 -119 44 -119 44 -104 73 -71 106 -25 125 25 125 ...
71 106 106 71 125 25 125 -25 106 -71 73 -104 44 -119 44 -119 73 -104 106 -71 125 -25 125 25 ...
106 71 71 106 25 125 -25 125 -71 106 -106 71 -125 25 -125 -25 -106 -71 -71 -106 -25 -125 25 -125 ...
71 -106 104 -73 119 -44 119 -44 104 -73 71 -106 25 -125 -25 -125 -71 -106 -104 -73 -119 -44 -119 -44 ...
-104 -73 -71 -106 -25 -125 25 -125 71 -106 106 -71 125 -25 125 25 106 71 71 106 25 125 -25 125 ...
-71 106 -106 71 -125 25 -125 -25 -106 -71 -73 -104 -44 -119 -44 -119 -73 -104 -104 -73 -119 -44 -119 -44 ...
-104 -73 -71 -106 -25 -125 25 -125 71 -106 106 -71 125 -25 125 25 106 71 71 106 25 125 -25 125 ...
-71 106 -106 71 -125 25 -125 -25 -106 -71 -73 -104 -44 -119 -44 -119 -73 -104 -106 -71 -125 -25 -125 25 ...
-106 71 -71 106 -25 125 25 125 71 106 104 73 119 44 119 44 104 73 73 104 44 119 44 119 ...
73 104 104 73 119 44 119 44 104 73 73 104 44 119 44 119 73 104 106 71 125 25 125 -25 ...
106 -71 71 -106 25 -125 -25 -125 -71 -106 -104 -73 -119 -44 -119 -44 -104 -73 -73 -104 -44 -119 -44 -119 ...
-73 -104 -106 -71 -125 -25 -125 25 -106 71 -73 104 -44 119 -44 119 -73 104 -104 73 -119 44 -119 44 ...
-104 73 -73 104 -44 119 -44 119 -73 104 -106 71 -125 25 -125 -25 -106 -71 -73 -104 -44 -119 -44 -119 ...
-73 -104 -106 -71 -125 -25 -125 25 -106 71 -73 104 -44 119 -44 119 -73 104 -106 71 -125 25 -125 -25 ...
-106 -71 -71 -106 -25 -125 25 -125 71 -106 104 -73 119 -44 119 -44 104 -73 71 -106 25 -125 -25 -125 ...
-71 -106 -106 -71 -125 -25 -125 25 -106 71 -71 106 -25 125 25 125 71 106 104 73 119 44 119 44 ...
104 73 73 104 44 119 44 119 73 104 106 71 125 25 125 -25 106 -71 73 -104 44 -119 44 -119 ...
73 -104 104 -73 119 -44 119 -44 104 -73 73 -104 44 -119 44 -119 73 -104 104 -73 119 -44 119 -44 ...
104 -73 71 -106 25 -125 -25 -125 -71 -106 -104 -73 -119 -44 -119 -44 -104 -73 -73 -104 -44 -119 -44 -119 ...
-73 -104 -106 -71 -125 -25 -125 25 -106 71 -73 104 -44 119 -44 119 -73 104 -106 71 -125 25 -125 -25 ...
-106 -71 -73 -104 -44 -119 -44 -119 -73 -104 -104 -73 -119 -44 -119 -44 -104 -73 -73 -104 -44 -119 -44 -119 ...
-73 -104 -106 -71 -125 -25 -125 25 -106 71 -71 106 -25 125 25 125 71 106 104 73 119 44 119 44 ...
104 73 71 106 25 125 -25 125 -71 106 -104 73 -119 44 -119 44 -104 73 -73 104 -44 119 -44 119 ...
-73 104 -106 71 -125 25 -125 -25 -106 -71 -71 -106 -25 -125 25 -125 71 -106 104 -73 119 -44 119 -44 ...
104 -73 73 -104 44 -119 44 -119 73 -104 104 -73 119 -44 119 -44 104 -73 73 -104 44 -119 44 -119 ...
73 -104 106 -71 125 -25 125 25 106 71 73 104 44 119 44 119 73 104 106 71 125 25 125 -25 ...
106 -71 71 -106 25 -125 -25 -125 -71 -106 -106 -71 -125 -25 -125 25 -106 71 -73 104 -44 119 -44 119 ...
-73 104 -106 71 -125 25 -125 -25 -106 -71 -71 -106 -25 -125 25 -125 71 -106 104 -73 119 -44 119 -44 ...
104 -73 71 -106 25 -125 -25 -125 -71 -106 -106 -71 -125 -25 -125 25 -106 71 -71 106 -25 125 25 125 ...
71 106 106 71 125 25 125 -25 106 -71 73 -104 44 -119 44 -119 73 -104 106 -71 125 -25 125 25 ...
106 71 71 106 25 125 -25 125 -71 106 -106 71 -125 25 -125 -25 -106 -71 -73 -104 -44 -119 -44 -119 ...
-73 -104 -104 -73 -119 -44 -119 -44 -104 -73 -73 -104 -44 -119 -44 -119 -73 -104 -104 -73 -119 -44 -119 -44 ...
-104 -73 -73 -104 -44 -119 -44 -119 -73 -104 -106 -71 -125 -25 -125 25 -106 71 -73 104 -44 119 -44 119 ...
-73 104 -104 73 -119 44 -119 44 -104 73 -71 106 -25 125 25 125 71 106 104 73 119 44 119 44 ...
104 73 71 106 25 125 -25 125 -71 106 -104 73 -119 44 -119 44 -104 73 -71 106 -25 125 25 125 ...
71 106 104 73 119 44 119 44 104 73 71 106 25 125 -25 125 -71 106 -106 71 -125 25 -125 -25 ...
-106 -71 -71 -106 -25 -125 25 -125 71 -106 104 -73 119 -44 119 -44 104 -73 71 -106 25 -125 -25 -125 ...
-71 -106 -104 -73 -119 -44 -119 -44 -104 -73 -73 -104 -44 -119 -44 -119 -73 -104 -104 -73 -119 -44 -119 -44 ...
-104 -73 -73 -104 -44 -119 -44 -119 -73 -104 -106 -71 -125 -25 -125 25 -106 71 -71 106 -25 125 25 125 ...
71 106 104 73 119 44 119 44 104 73 73 104 44 119 44 119 73 104 104 73 119 44 119 44 ...
104 73 71 106 25 125 -25 125 -71 106 -104 73 -119 44 -119 44 -104 73 -73 104 -44 119 -44 119 ...
-73 104 -104 73 -119 44 -119 44 -104 73 -73 104 -44 119 -44 119 -73 104 -104 73 -119 44 -119 44 ...
-104 73 -71 106 -25 125 25 125 71 106 104 73 119 44 119 44 104 73 73 104 44 119 44 119 ...
73 104 106 71 125 25 125 -25 106 -71 73 -104 44 -119 44 -119 73 -104 104 -73 119 -44 119 -44 ...
104 -73 73 -104 44 -119 44 -119 73 -104 106 -71 125 -25 125 25 106 71 71 106 25 125 -25 125 ...
-71 106 -104 73 -119 44 -119 44 -104 73 -71 106 -25 125 25 125 71 106 106 71 125 25 125 -25 ...
106 -71 73 -104 44 -119 44 -119 73 -104 104 -73 119 -44 119 -44 104 -73 71 -106 25 -125 -25 -125 ...
-71 -106 -104 -73 -119 -44 -119 -44 -104 -73 -71 -106 -25 -125 25 -125 71 -106 106 -71 125 -25 125 25 ...
106 71 73 104 44 119 44 119 73 104 106 71 125 25 125 -25 106 -71 71 -106 25 -125 -25 -125 ...
-71 -106 -106 -71 -125 -25 -125 25 -106 71 -73 104 -44 119 -44 119 -73 104 -106 71 -125 25 -125 -25 ...
-106 -71 -71 -106 -25 -125 25 -125 71 -106 106 -71 125 -25 125 25 106 71 71 106 25 125 -25 125 ...
-71 106 -106 71 -125 25 -125 -25 -106 -71 -73 -104 -44 -119 -44 -119 -73 -104 -104 -73 -119 -44 -119 -44 ...
-104 -73 -71 -106 -25 -125 25 -125 71 -106 104 -73 119 -44 119 -44 104 -73 71 -106 25 -125 -25 -125 ...
-71 -106 -106 -71 -125 -25 -125 25 -106 71 -71 106 -25 125 25 125 71 106 104 73 119 44 119 44 ...
104 73 71 106 25 125 -25 125 -71 106 -106 71 -125 25 -125 -25 -106 -71 -71 -106 -25 -125 25 -125 ...
71 -106 106 -71 125 -25 125 25 106 71 73 104 44 119 44 119 73 104 104 73 119 44 119 44 ...
104 73 71 106 25 125 -25 125 -71 106 -104 73 -119 44 -119 44 -104 73 -71 106 -25 125 25 125 ...
71 106 104 73 119 44 119 44 104 73 71 106 25 125 -25 125 -71 106 -106 71 -125 25 -125 -25 ...
-106 -71 -71 -106 -25 -125 25 -125 71 -106 106 -71 125 -25 125 25 106 71 73 104 44 119 44 119 ...
73 104 104 73 119 44 119 44 104 73 73 104 44 119 44 119 73 104 106 71 125 25 125 -25 ...
106 -71 71 -106 25 -125 -25 -125 -71 -106 -104 -73 -119 -44 -119 -44 -104 -73 -73 -104 -44 -119 -44 -119 ...
-73 -104 -106 -71 -125 -25 -125 25 -106 71 -71 106 -25 125 25 125 71 106 106 71 125 25 125 -25 ...
106 -71 73 -104 44 -119 44 -119 73 -104 106 -71 125 -25 125 25 106 71 73 104 44 119 44 119 ...
73 104 104 73 119 44 119 44 104 73 71 106 25 125 -25 125 -71 106 -106 71 -125 25 -125 -25 ...
-106 -71 -71 -106 -25 -125 25 -125 71 -106 106 -71 125 -25 125 25 106 71 71 106 25 125 -25 125 ...
-71 106 -104 73 -119 44 -119 44 -104 73 -73 104 -44 119 -44 119 -73 104 -104 73 -119 44 -119 44 ...
-104 73 -71 106 -25 125 25 125 71 106 106 71 125 25 125 -25 106 -71 73 -104 44 -119 44 -119 ...
73 -104 104 -73 119 -44 119 -44 104 -73 71 -106 25 -125 -25 -125 -71 -106 -104 -73 -119 -44 -119 -44 ...
-104 -73 -71 -106 -25 -125 25 -125 71 -106 106 -71 125 -25 125 25 106 71 71 106 25 125 -25 125 ...
-71 106 -106 71 -125 25 -125 -25 -106 -71 -73 -104 -44 -119 -44 -119 -73 -104 -104 -73 -119 -44 -119 -44 ...
-104 -73 -71 -106 -25 -125 25 -125 71 -106 106 -71 125 -25 125 25 106 71 71 106 25 125 -25 125 ...
-71 106 -106 71 -125 25 -125 -25 -106 -71 -73 -104 -44 -119 -44 -119 -73 -104 -104 -73 -119 -44 -119 -44 ...
-104 -73 -71 -106 -25 -125 25 -125 71 -106 106 -71 125 -25 125 25 106 71 71 106 25 125 -25 125 ...
-71 106 -106 71 -125 25 -125 -25 -106 -71 -73 -104 -44 -119 -44 -119 -73 -104 -106 -71 -125 -25 -125 25 ...
-106 71 -71 106 -25 125 25 125 71 106 104 73 119 44 119 44 104 73 73 104 44 119 44 119 ...
73 104 104 73 119 44 119 44 104 73 73 104 44 119 44 119 73 104 104 73 119 44 119 44 ...
104 73 73 104 44 119 44 119 73 104 104 73 119 44 119 44 104 73 71 106 25 125 -25 125 ...
-71 106 -104 73 -119 44 -119 44 -104 73 -73 104 -44 119 -44 119 -73 104 -104 73 -119 44 -119 44 ...
-104 73 -73 104 -44 119 -44 119 -73 104 -106 71 -125 25 -125 -25 -106 -71 -71 -106 -25 -125 25 -125 ...
71 -106 104 -73 119 -44 119 -44 104 -73 71 -106 25 -125 -25 -125 -71 -106 -104 -73 -119 -44 -119 -44 ...
-104 -73 -71 -106 -25 -125 25 -125 71 -106 104 -73 119 -44 119 -44 104 -73 71 -106 25 -125 -25 -125 ...
-71 -106 -104 -73 -119 -44 -119 -44 -104 -73 -73 -104 -44 -119 -44 -119 -73 -104 -104 -73 -119 -44 -119 -44 ...
-104 -73 -73 -104 -44 -119 -44 -119 -73 -104 -106 -71 -125 -25 -125 25 -106 71 -73 104 -44 119 -44 119 ...
-73 104 -106 71 -125 25 -125 -25 -106 -71 -73 -104 -44 -119 -44 -119 -73 -104 -106 -71 -125 -25 -125 25 ...
-106 71 -73 104 -44 119 -44 119 -73 104 -106 71 -125 25 -125 -25 -106 -71 -73 -104 -44 -119 -44 -119 ...
-73 -104 -104 -73 -119 -44 -119 -44 -104 -73 -71 -106 -25 -125 25 -125 71 -106 106 -71 125 -25 125 25 ...
106 71 73 104 44 119 44 119 73 104 106 71 125 25 125 -25 106 -71 71 -106 25 -125 -25 -125 ...
-71 -106 -106 -71 -125 -25 -125 25 -106 71 -71 106 -25 125 25 125 71 106 106 71 125 25 125 -25 ...
106 -71 71 -106 25 -125 -25 -125 -71 -106 -106 -71 -125 -25 -125 25 -106 71 -71 106 -25 125 25 125 ...
71 106 104 73 119 44 119 44 104 73 71 106 25 125 -25 125 -71 106 -106 71 -125 25 -125 -25 ...
-106 -71 -71 -106 -25 -125 25 -125 71 -106 104 -73 119 -44 119 -44 104 -73 73 -104 44 -119 44 -119 ...
73 -104 106 -71 125 -25 125 25 106 71 73 104 44 119 44 119 73 104 106 71 125 25 125 -25 ...
106 -71 73 -104 44 -119 44 -119 73 -104 104 -73 119 -44 119 -44 104 -73 71 -106 25 -125 -25 -125 ...
-71 -106 -106 -71 -125 -25 -125 25 -106 71 -73 104 -44 119 -44 119 -73 104 -106 71 -125 25 -125 -25 ...
-106 -71 -71 -106 -25 -125 25 -125 71 -106 104 -73 119 -44 119 -44 104 -73 71 -106 25 -125 -25 -125 ...
-71 -106 -104 -73 -119 -44 -119 -44 -104 -73 -73 -104 -44 -119 -44 -119 -73 -104 -104 -73 -119 -44 -119 -44 ...
-104 -73 -71 -106 -25 -125 25 -125 71 -106 104 -73 119 -44 119 -44 104 -73 71 -106 25 -125 -25 -125 ...
-71 -106 -106 -71 -125 -25 -125 25 -106 71 -71 106 -25 125 25 125 71 106 104 73 119 44 119 44 ...
104 73 71 106 25 125 -25 125 -71 106 -106 71 -125 25 -125 -25 -106 -71 -71 -106 -25 -125 25 -125 ...
71 -106 104 -73 119 -44 119 -44 104 -73 73 -104 44 -119 44 -119 73 -104 106 -71 125 -25 125 25 ...
106 71 71 106 25 125 -25 125 -71 106 -104 73 -119 44 -119 44 -104 73 -71 106 -25 125 25 125 ...
71 106 104 73 119 44 119 44 104 73 71 106 25 125 -25 125 -71 106 -106 71 -125 25 -125 -25 ...
-106 -71 -73 -104 -44 -119 -44 -119 -73 -104 -104 -73 -119 -44 -119 -44 -104 -73 -71 -106 -25 -125 25 -125 ...
71 -106 104 -73 119 -44 119 -44 104 -73 71 -106 25 -125 -25 -125 -71 -106 -106 -71 -125 -25 -125 25 ...
-106 71 -73 104 -44 119 -44 119 -73 104 -106 71 -125 25 -125 -25 -106 -71 -71 -106 -25 -125 25 -125 ...
71 -106 104 -73 119 -44 119 -44 104 -73 71 -106 25 -125 -25 -125 -71 -106 -104 -73 -119 -44 -119 -44 ...
-104 -73 -73 -104 -44 -119 -44 -119 -73 -104 -106 -71 -125 -25 -125 25 -106 71 -71 106 -25 125 25 125 ...
71 106 104 73 119 44 119 44 104 73 71 106 25 125 -25 125 -71 106 -106 71 -125 25 -125 -25 ...
-106 -71 -71 -106 -25 -125 25 -125 71 -106 106 -71 125 -25 125 25 106 71 73 104 44 119 44 119 ...
73 104 106 71 125 25 125 -25 106 -71 73 -104 44 -119 44 -119 73 -104 104 -73 119 -44 119 -44 ...
104 -73 73 -104 44 -119 44 -119 73 -104 106 -71 125 -25 125 25 106 71 71 106 25 125 -25 125 ...
-71 106 -104 73 -119 44 -119 44 -104 73 -73 104 -44 119 -44 119 -73 104 -104 73 -119 44 -119 44 ...
-104 73 -73 104 -44 119 -44 119 -73 104 -106 71 -125 25 -125 -25 -106 -71 -71 -106 -25 -125 25 -125 ...
71 -106 104 -73 119 -44 119 -44 104 -73 73 -104 44 -119 44 -119 73 -104 105 -72 122 -35 127 -10 ...
127 -2 127 0 127 0 127 0 127 0 127 0 127 0 127 0

View File

@ -0,0 +1,11 @@
./btle_tx welcom_packets_discovery.txt
copy above command generated IQ_sample_for_matlab.txt into variable "c" of gen_float32_bin_for_usrp_replay.m.
run .m script in matlab or octave
replay above script generated btle_ch37_iq_float32_welcom_msg.bin in replay_for_btle_4Msps.grc.
Install LightBlue in your iPhone or other similar things of Android, and open the App.
You will see a welcome message "SDR Bluetooth LE welcome u!" on your phone.

View File

@ -0,0 +1,143 @@
clear all;
close all;
% copy from
c = [...
127 0 127 0 127 0 127 0 127 0 127 -2 127 -10 122 -35 105 -72 73 -104 44 -119 44 -119 ...
73 -104 104 -73 119 -44 119 -44 104 -73 73 -104 44 -119 44 -119 73 -104 104 -73 119 -44 119 -44 ...
104 -73 73 -104 44 -119 44 -119 73 -104 104 -73 119 -44 119 -44 104 -73 73 -104 44 -119 44 -119 ...
73 -104 104 -73 119 -44 119 -44 104 -73 73 -104 44 -119 44 -119 73 -104 106 -71 125 -25 125 25 ...
106 71 73 104 44 119 44 119 73 104 104 73 119 44 119 44 104 73 73 104 44 119 44 119 ...
73 104 104 73 119 44 119 44 104 73 71 106 25 125 -25 125 -71 106 -104 73 -119 44 -119 44 ...
-104 73 -73 104 -44 119 -44 119 -73 104 -106 71 -125 25 -125 -25 -106 -71 -71 -106 -25 -125 25 -125 ...
71 -106 106 -71 125 -25 125 25 106 71 71 106 25 125 -25 125 -71 106 -104 73 -119 44 -119 44 ...
-104 73 -73 104 -44 119 -44 119 -73 104 -106 71 -125 25 -125 -25 -106 -71 -73 -104 -44 -119 -44 -119 ...
-73 -104 -106 -71 -125 -25 -125 25 -106 71 -73 104 -44 119 -44 119 -73 104 -104 73 -119 44 -119 44 ...
-104 73 -71 106 -25 125 25 125 71 106 106 71 125 25 125 -25 106 -71 73 -104 44 -119 44 -119 ...
73 -104 104 -73 119 -44 119 -44 104 -73 73 -104 44 -119 44 -119 73 -104 106 -71 125 -25 125 25 ...
106 71 71 106 25 125 -25 125 -71 106 -104 73 -119 44 -119 44 -104 73 -71 106 -25 125 25 125 ...
71 106 106 71 125 25 125 -25 106 -71 73 -104 44 -119 44 -119 73 -104 106 -71 125 -25 125 25 ...
106 71 71 106 25 125 -25 125 -71 106 -106 71 -125 25 -125 -25 -106 -71 -71 -106 -25 -125 25 -125 ...
71 -106 104 -73 119 -44 119 -44 104 -73 71 -106 25 -125 -25 -125 -71 -106 -104 -73 -119 -44 -119 -44 ...
-104 -73 -71 -106 -25 -125 25 -125 71 -106 106 -71 125 -25 125 25 106 71 71 106 25 125 -25 125 ...
-71 106 -106 71 -125 25 -125 -25 -106 -71 -73 -104 -44 -119 -44 -119 -73 -104 -104 -73 -119 -44 -119 -44 ...
-104 -73 -71 -106 -25 -125 25 -125 71 -106 106 -71 125 -25 125 25 106 71 71 106 25 125 -25 125 ...
-71 106 -106 71 -125 25 -125 -25 -106 -71 -73 -104 -44 -119 -44 -119 -73 -104 -106 -71 -125 -25 -125 25 ...
-106 71 -71 106 -25 125 25 125 71 106 104 73 119 44 119 44 104 73 73 104 44 119 44 119 ...
73 104 104 73 119 44 119 44 104 73 73 104 44 119 44 119 73 104 106 71 125 25 125 -25 ...
106 -71 71 -106 25 -125 -25 -125 -71 -106 -104 -73 -119 -44 -119 -44 -104 -73 -73 -104 -44 -119 -44 -119 ...
-73 -104 -106 -71 -125 -25 -125 25 -106 71 -73 104 -44 119 -44 119 -73 104 -104 73 -119 44 -119 44 ...
-104 73 -73 104 -44 119 -44 119 -73 104 -106 71 -125 25 -125 -25 -106 -71 -73 -104 -44 -119 -44 -119 ...
-73 -104 -106 -71 -125 -25 -125 25 -106 71 -73 104 -44 119 -44 119 -73 104 -106 71 -125 25 -125 -25 ...
-106 -71 -71 -106 -25 -125 25 -125 71 -106 104 -73 119 -44 119 -44 104 -73 71 -106 25 -125 -25 -125 ...
-71 -106 -106 -71 -125 -25 -125 25 -106 71 -71 106 -25 125 25 125 71 106 104 73 119 44 119 44 ...
104 73 73 104 44 119 44 119 73 104 106 71 125 25 125 -25 106 -71 73 -104 44 -119 44 -119 ...
73 -104 104 -73 119 -44 119 -44 104 -73 73 -104 44 -119 44 -119 73 -104 104 -73 119 -44 119 -44 ...
104 -73 71 -106 25 -125 -25 -125 -71 -106 -104 -73 -119 -44 -119 -44 -104 -73 -73 -104 -44 -119 -44 -119 ...
-73 -104 -106 -71 -125 -25 -125 25 -106 71 -73 104 -44 119 -44 119 -73 104 -106 71 -125 25 -125 -25 ...
-106 -71 -73 -104 -44 -119 -44 -119 -73 -104 -104 -73 -119 -44 -119 -44 -104 -73 -73 -104 -44 -119 -44 -119 ...
-73 -104 -106 -71 -125 -25 -125 25 -106 71 -71 106 -25 125 25 125 71 106 104 73 119 44 119 44 ...
104 73 71 106 25 125 -25 125 -71 106 -104 73 -119 44 -119 44 -104 73 -73 104 -44 119 -44 119 ...
-73 104 -106 71 -125 25 -125 -25 -106 -71 -71 -106 -25 -125 25 -125 71 -106 104 -73 119 -44 119 -44 ...
104 -73 73 -104 44 -119 44 -119 73 -104 104 -73 119 -44 119 -44 104 -73 73 -104 44 -119 44 -119 ...
73 -104 106 -71 125 -25 125 25 106 71 73 104 44 119 44 119 73 104 106 71 125 25 125 -25 ...
106 -71 71 -106 25 -125 -25 -125 -71 -106 -106 -71 -125 -25 -125 25 -106 71 -73 104 -44 119 -44 119 ...
-73 104 -106 71 -125 25 -125 -25 -106 -71 -71 -106 -25 -125 25 -125 71 -106 104 -73 119 -44 119 -44 ...
104 -73 71 -106 25 -125 -25 -125 -71 -106 -106 -71 -125 -25 -125 25 -106 71 -71 106 -25 125 25 125 ...
71 106 106 71 125 25 125 -25 106 -71 73 -104 44 -119 44 -119 73 -104 106 -71 125 -25 125 25 ...
106 71 71 106 25 125 -25 125 -71 106 -106 71 -125 25 -125 -25 -106 -71 -73 -104 -44 -119 -44 -119 ...
-73 -104 -104 -73 -119 -44 -119 -44 -104 -73 -73 -104 -44 -119 -44 -119 -73 -104 -104 -73 -119 -44 -119 -44 ...
-104 -73 -73 -104 -44 -119 -44 -119 -73 -104 -106 -71 -125 -25 -125 25 -106 71 -73 104 -44 119 -44 119 ...
-73 104 -104 73 -119 44 -119 44 -104 73 -71 106 -25 125 25 125 71 106 104 73 119 44 119 44 ...
104 73 71 106 25 125 -25 125 -71 106 -104 73 -119 44 -119 44 -104 73 -71 106 -25 125 25 125 ...
71 106 104 73 119 44 119 44 104 73 71 106 25 125 -25 125 -71 106 -106 71 -125 25 -125 -25 ...
-106 -71 -71 -106 -25 -125 25 -125 71 -106 104 -73 119 -44 119 -44 104 -73 71 -106 25 -125 -25 -125 ...
-71 -106 -104 -73 -119 -44 -119 -44 -104 -73 -73 -104 -44 -119 -44 -119 -73 -104 -104 -73 -119 -44 -119 -44 ...
-104 -73 -73 -104 -44 -119 -44 -119 -73 -104 -106 -71 -125 -25 -125 25 -106 71 -71 106 -25 125 25 125 ...
71 106 104 73 119 44 119 44 104 73 73 104 44 119 44 119 73 104 104 73 119 44 119 44 ...
104 73 71 106 25 125 -25 125 -71 106 -104 73 -119 44 -119 44 -104 73 -73 104 -44 119 -44 119 ...
-73 104 -104 73 -119 44 -119 44 -104 73 -73 104 -44 119 -44 119 -73 104 -104 73 -119 44 -119 44 ...
-104 73 -71 106 -25 125 25 125 71 106 104 73 119 44 119 44 104 73 73 104 44 119 44 119 ...
73 104 106 71 125 25 125 -25 106 -71 73 -104 44 -119 44 -119 73 -104 104 -73 119 -44 119 -44 ...
104 -73 73 -104 44 -119 44 -119 73 -104 106 -71 125 -25 125 25 106 71 71 106 25 125 -25 125 ...
-71 106 -104 73 -119 44 -119 44 -104 73 -71 106 -25 125 25 125 71 106 106 71 125 25 125 -25 ...
106 -71 73 -104 44 -119 44 -119 73 -104 104 -73 119 -44 119 -44 104 -73 71 -106 25 -125 -25 -125 ...
-71 -106 -104 -73 -119 -44 -119 -44 -104 -73 -71 -106 -25 -125 25 -125 71 -106 106 -71 125 -25 125 25 ...
106 71 73 104 44 119 44 119 73 104 106 71 125 25 125 -25 106 -71 71 -106 25 -125 -25 -125 ...
-71 -106 -106 -71 -125 -25 -125 25 -106 71 -73 104 -44 119 -44 119 -73 104 -106 71 -125 25 -125 -25 ...
-106 -71 -71 -106 -25 -125 25 -125 71 -106 106 -71 125 -25 125 25 106 71 71 106 25 125 -25 125 ...
-71 106 -106 71 -125 25 -125 -25 -106 -71 -73 -104 -44 -119 -44 -119 -73 -104 -104 -73 -119 -44 -119 -44 ...
-104 -73 -71 -106 -25 -125 25 -125 71 -106 104 -73 119 -44 119 -44 104 -73 71 -106 25 -125 -25 -125 ...
-71 -106 -106 -71 -125 -25 -125 25 -106 71 -71 106 -25 125 25 125 71 106 104 73 119 44 119 44 ...
104 73 71 106 25 125 -25 125 -71 106 -106 71 -125 25 -125 -25 -106 -71 -71 -106 -25 -125 25 -125 ...
71 -106 106 -71 125 -25 125 25 106 71 73 104 44 119 44 119 73 104 104 73 119 44 119 44 ...
104 73 71 106 25 125 -25 125 -71 106 -104 73 -119 44 -119 44 -104 73 -71 106 -25 125 25 125 ...
71 106 104 73 119 44 119 44 104 73 71 106 25 125 -25 125 -71 106 -106 71 -125 25 -125 -25 ...
-106 -71 -71 -106 -25 -125 25 -125 71 -106 106 -71 125 -25 125 25 106 71 73 104 44 119 44 119 ...
73 104 104 73 119 44 119 44 104 73 73 104 44 119 44 119 73 104 106 71 125 25 125 -25 ...
106 -71 71 -106 25 -125 -25 -125 -71 -106 -104 -73 -119 -44 -119 -44 -104 -73 -73 -104 -44 -119 -44 -119 ...
-73 -104 -106 -71 -125 -25 -125 25 -106 71 -71 106 -25 125 25 125 71 106 106 71 125 25 125 -25 ...
106 -71 73 -104 44 -119 44 -119 73 -104 106 -71 125 -25 125 25 106 71 73 104 44 119 44 119 ...
73 104 104 73 119 44 119 44 104 73 71 106 25 125 -25 125 -71 106 -106 71 -125 25 -125 -25 ...
-106 -71 -71 -106 -25 -125 25 -125 71 -106 106 -71 125 -25 125 25 106 71 71 106 25 125 -25 125 ...
-71 106 -104 73 -119 44 -119 44 -104 73 -73 104 -44 119 -44 119 -73 104 -104 73 -119 44 -119 44 ...
-104 73 -71 106 -25 125 25 125 71 106 106 71 125 25 125 -25 106 -71 73 -104 44 -119 44 -119 ...
73 -104 104 -73 119 -44 119 -44 104 -73 71 -106 25 -125 -25 -125 -71 -106 -104 -73 -119 -44 -119 -44 ...
-104 -73 -71 -106 -25 -125 25 -125 71 -106 106 -71 125 -25 125 25 106 71 71 106 25 125 -25 125 ...
-71 106 -106 71 -125 25 -125 -25 -106 -71 -73 -104 -44 -119 -44 -119 -73 -104 -104 -73 -119 -44 -119 -44 ...
-104 -73 -71 -106 -25 -125 25 -125 71 -106 106 -71 125 -25 125 25 106 71 71 106 25 125 -25 125 ...
-71 106 -106 71 -125 25 -125 -25 -106 -71 -73 -104 -44 -119 -44 -119 -73 -104 -104 -73 -119 -44 -119 -44 ...
-104 -73 -71 -106 -25 -125 25 -125 71 -106 106 -71 125 -25 125 25 106 71 71 106 25 125 -25 125 ...
-71 106 -106 71 -125 25 -125 -25 -106 -71 -73 -104 -44 -119 -44 -119 -73 -104 -106 -71 -125 -25 -125 25 ...
-106 71 -71 106 -25 125 25 125 71 106 104 73 119 44 119 44 104 73 73 104 44 119 44 119 ...
73 104 104 73 119 44 119 44 104 73 73 104 44 119 44 119 73 104 104 73 119 44 119 44 ...
104 73 73 104 44 119 44 119 73 104 104 73 119 44 119 44 104 73 71 106 25 125 -25 125 ...
-71 106 -104 73 -119 44 -119 44 -104 73 -73 104 -44 119 -44 119 -73 104 -104 73 -119 44 -119 44 ...
-104 73 -73 104 -44 119 -44 119 -73 104 -106 71 -125 25 -125 -25 -106 -71 -71 -106 -25 -125 25 -125 ...
71 -106 104 -73 119 -44 119 -44 104 -73 71 -106 25 -125 -25 -125 -71 -106 -104 -73 -119 -44 -119 -44 ...
-104 -73 -71 -106 -25 -125 25 -125 71 -106 104 -73 119 -44 119 -44 104 -73 71 -106 25 -125 -25 -125 ...
-71 -106 -104 -73 -119 -44 -119 -44 -104 -73 -73 -104 -44 -119 -44 -119 -73 -104 -104 -73 -119 -44 -119 -44 ...
-104 -73 -73 -104 -44 -119 -44 -119 -73 -104 -106 -71 -125 -25 -125 25 -106 71 -73 104 -44 119 -44 119 ...
-73 104 -106 71 -125 25 -125 -25 -106 -71 -73 -104 -44 -119 -44 -119 -73 -104 -106 -71 -125 -25 -125 25 ...
-106 71 -73 104 -44 119 -44 119 -73 104 -106 71 -125 25 -125 -25 -106 -71 -73 -104 -44 -119 -44 -119 ...
-73 -104 -104 -73 -119 -44 -119 -44 -104 -73 -71 -106 -25 -125 25 -125 71 -106 106 -71 125 -25 125 25 ...
106 71 73 104 44 119 44 119 73 104 106 71 125 25 125 -25 106 -71 71 -106 25 -125 -25 -125 ...
-71 -106 -106 -71 -125 -25 -125 25 -106 71 -71 106 -25 125 25 125 71 106 106 71 125 25 125 -25 ...
106 -71 71 -106 25 -125 -25 -125 -71 -106 -106 -71 -125 -25 -125 25 -106 71 -71 106 -25 125 25 125 ...
71 106 104 73 119 44 119 44 104 73 71 106 25 125 -25 125 -71 106 -106 71 -125 25 -125 -25 ...
-106 -71 -71 -106 -25 -125 25 -125 71 -106 104 -73 119 -44 119 -44 104 -73 73 -104 44 -119 44 -119 ...
73 -104 106 -71 125 -25 125 25 106 71 73 104 44 119 44 119 73 104 106 71 125 25 125 -25 ...
106 -71 73 -104 44 -119 44 -119 73 -104 104 -73 119 -44 119 -44 104 -73 71 -106 25 -125 -25 -125 ...
-71 -106 -106 -71 -125 -25 -125 25 -106 71 -73 104 -44 119 -44 119 -73 104 -106 71 -125 25 -125 -25 ...
-106 -71 -71 -106 -25 -125 25 -125 71 -106 104 -73 119 -44 119 -44 104 -73 71 -106 25 -125 -25 -125 ...
-71 -106 -104 -73 -119 -44 -119 -44 -104 -73 -73 -104 -44 -119 -44 -119 -73 -104 -104 -73 -119 -44 -119 -44 ...
-104 -73 -71 -106 -25 -125 25 -125 71 -106 104 -73 119 -44 119 -44 104 -73 71 -106 25 -125 -25 -125 ...
-71 -106 -106 -71 -125 -25 -125 25 -106 71 -71 106 -25 125 25 125 71 106 104 73 119 44 119 44 ...
104 73 71 106 25 125 -25 125 -71 106 -106 71 -125 25 -125 -25 -106 -71 -71 -106 -25 -125 25 -125 ...
71 -106 104 -73 119 -44 119 -44 104 -73 73 -104 44 -119 44 -119 73 -104 106 -71 125 -25 125 25 ...
106 71 71 106 25 125 -25 125 -71 106 -104 73 -119 44 -119 44 -104 73 -71 106 -25 125 25 125 ...
71 106 104 73 119 44 119 44 104 73 71 106 25 125 -25 125 -71 106 -106 71 -125 25 -125 -25 ...
-106 -71 -73 -104 -44 -119 -44 -119 -73 -104 -104 -73 -119 -44 -119 -44 -104 -73 -71 -106 -25 -125 25 -125 ...
71 -106 104 -73 119 -44 119 -44 104 -73 71 -106 25 -125 -25 -125 -71 -106 -106 -71 -125 -25 -125 25 ...
-106 71 -73 104 -44 119 -44 119 -73 104 -106 71 -125 25 -125 -25 -106 -71 -71 -106 -25 -125 25 -125 ...
71 -106 104 -73 119 -44 119 -44 104 -73 71 -106 25 -125 -25 -125 -71 -106 -104 -73 -119 -44 -119 -44 ...
-104 -73 -73 -104 -44 -119 -44 -119 -73 -104 -106 -71 -125 -25 -125 25 -106 71 -71 106 -25 125 25 125 ...
71 106 104 73 119 44 119 44 104 73 71 106 25 125 -25 125 -71 106 -106 71 -125 25 -125 -25 ...
-106 -71 -71 -106 -25 -125 25 -125 71 -106 106 -71 125 -25 125 25 106 71 73 104 44 119 44 119 ...
73 104 106 71 125 25 125 -25 106 -71 73 -104 44 -119 44 -119 73 -104 104 -73 119 -44 119 -44 ...
104 -73 73 -104 44 -119 44 -119 73 -104 106 -71 125 -25 125 25 106 71 71 106 25 125 -25 125 ...
-71 106 -104 73 -119 44 -119 44 -104 73 -73 104 -44 119 -44 119 -73 104 -104 73 -119 44 -119 44 ...
-104 73 -73 104 -44 119 -44 119 -73 104 -106 71 -125 25 -125 -25 -106 -71 -71 -106 -25 -125 25 -125 ...
71 -106 104 -73 119 -44 119 -44 104 -73 73 -104 44 -119 44 -119 73 -104 105 -72 122 -35 127 -10 ...
127 -2 127 0 127 0 127 0 127 0 127 0 127 0 127 0 ];
c = c./256;
fid = fopen('btle_ch37_iq_float32_welcom_msg.bin','w');
if fid == -1
disp('fopen for write error!');
return;
end
fwrite(fid, c, 'single');
fclose(fid);

View File

@ -0,0 +1,995 @@
<?xml version='1.0' encoding='utf-8'?>
<?grc format='1' created='3.7.11'?>
<flow_graph>
<timestamp>Wed Jan 25 17:14:52 2017</timestamp>
<block>
<key>options</key>
<param>
<key>author</key>
<value></value>
</param>
<param>
<key>window_size</key>
<value></value>
</param>
<param>
<key>category</key>
<value>[GRC Hier Blocks]</value>
</param>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>description</key>
<value></value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>_coordinate</key>
<value>(8, 8)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>generate_options</key>
<value>qt_gui</value>
</param>
<param>
<key>hier_block_src_path</key>
<value>.:</value>
</param>
<param>
<key>id</key>
<value>top_block</value>
</param>
<param>
<key>max_nouts</key>
<value>0</value>
</param>
<param>
<key>qt_qss_theme</key>
<value></value>
</param>
<param>
<key>realtime_scheduling</key>
<value></value>
</param>
<param>
<key>run_command</key>
<value>{python} -u {filename}</value>
</param>
<param>
<key>run_options</key>
<value>prompt</value>
</param>
<param>
<key>run</key>
<value>True</value>
</param>
<param>
<key>thread_safe_setters</key>
<value></value>
</param>
<param>
<key>title</key>
<value></value>
</param>
</block>
<block>
<key>variable</key>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>_coordinate</key>
<value>(8, 160)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>samp_rate</value>
</param>
<param>
<key>value</key>
<value>4e6</value>
</param>
</block>
<block>
<key>blocks_file_source</key>
<param>
<key>alias</key>
<value></value>
</param>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>affinity</key>
<value></value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>file</key>
<value>/home/jxj/Downloads/btle_ch37_iq_float32_welcom_msg.bin</value>
</param>
<param>
<key>_coordinate</key>
<value>(232, 260)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>blocks_file_source_0</value>
</param>
<param>
<key>maxoutbuf</key>
<value>0</value>
</param>
<param>
<key>minoutbuf</key>
<value>0</value>
</param>
<param>
<key>type</key>
<value>complex</value>
</param>
<param>
<key>repeat</key>
<value>True</value>
</param>
<param>
<key>vlen</key>
<value>1</value>
</param>
</block>
<block>
<key>uhd_usrp_sink</key>
<param>
<key>alias</key>
<value></value>
</param>
<param>
<key>ant0</key>
<value>TX/RX</value>
</param>
<param>
<key>bw0</key>
<value>samp_rate</value>
</param>
<param>
<key>center_freq0</key>
<value>2402000000</value>
</param>
<param>
<key>norm_gain0</key>
<value>False</value>
</param>
<param>
<key>gain0</key>
<value>180</value>
</param>
<param>
<key>ant10</key>
<value></value>
</param>
<param>
<key>bw10</key>
<value>0</value>
</param>
<param>
<key>center_freq10</key>
<value>0</value>
</param>
<param>
<key>norm_gain10</key>
<value>False</value>
</param>
<param>
<key>gain10</key>
<value>0</value>
</param>
<param>
<key>ant11</key>
<value></value>
</param>
<param>
<key>bw11</key>
<value>0</value>
</param>
<param>
<key>center_freq11</key>
<value>0</value>
</param>
<param>
<key>norm_gain11</key>
<value>False</value>
</param>
<param>
<key>gain11</key>
<value>0</value>
</param>
<param>
<key>ant12</key>
<value></value>
</param>
<param>
<key>bw12</key>
<value>0</value>
</param>
<param>
<key>center_freq12</key>
<value>0</value>
</param>
<param>
<key>norm_gain12</key>
<value>False</value>
</param>
<param>
<key>gain12</key>
<value>0</value>
</param>
<param>
<key>ant13</key>
<value></value>
</param>
<param>
<key>bw13</key>
<value>0</value>
</param>
<param>
<key>center_freq13</key>
<value>0</value>
</param>
<param>
<key>norm_gain13</key>
<value>False</value>
</param>
<param>
<key>gain13</key>
<value>0</value>
</param>
<param>
<key>ant14</key>
<value></value>
</param>
<param>
<key>bw14</key>
<value>0</value>
</param>
<param>
<key>center_freq14</key>
<value>0</value>
</param>
<param>
<key>norm_gain14</key>
<value>False</value>
</param>
<param>
<key>gain14</key>
<value>0</value>
</param>
<param>
<key>ant15</key>
<value></value>
</param>
<param>
<key>bw15</key>
<value>0</value>
</param>
<param>
<key>center_freq15</key>
<value>0</value>
</param>
<param>
<key>norm_gain15</key>
<value>False</value>
</param>
<param>
<key>gain15</key>
<value>0</value>
</param>
<param>
<key>ant16</key>
<value></value>
</param>
<param>
<key>bw16</key>
<value>0</value>
</param>
<param>
<key>center_freq16</key>
<value>0</value>
</param>
<param>
<key>norm_gain16</key>
<value>False</value>
</param>
<param>
<key>gain16</key>
<value>0</value>
</param>
<param>
<key>ant17</key>
<value></value>
</param>
<param>
<key>bw17</key>
<value>0</value>
</param>
<param>
<key>center_freq17</key>
<value>0</value>
</param>
<param>
<key>norm_gain17</key>
<value>False</value>
</param>
<param>
<key>gain17</key>
<value>0</value>
</param>
<param>
<key>ant18</key>
<value></value>
</param>
<param>
<key>bw18</key>
<value>0</value>
</param>
<param>
<key>center_freq18</key>
<value>0</value>
</param>
<param>
<key>norm_gain18</key>
<value>False</value>
</param>
<param>
<key>gain18</key>
<value>0</value>
</param>
<param>
<key>ant19</key>
<value></value>
</param>
<param>
<key>bw19</key>
<value>0</value>
</param>
<param>
<key>center_freq19</key>
<value>0</value>
</param>
<param>
<key>norm_gain19</key>
<value>False</value>
</param>
<param>
<key>gain19</key>
<value>0</value>
</param>
<param>
<key>ant1</key>
<value></value>
</param>
<param>
<key>bw1</key>
<value>0</value>
</param>
<param>
<key>center_freq1</key>
<value>0</value>
</param>
<param>
<key>norm_gain1</key>
<value>False</value>
</param>
<param>
<key>gain1</key>
<value>0</value>
</param>
<param>
<key>ant20</key>
<value></value>
</param>
<param>
<key>bw20</key>
<value>0</value>
</param>
<param>
<key>center_freq20</key>
<value>0</value>
</param>
<param>
<key>norm_gain20</key>
<value>False</value>
</param>
<param>
<key>gain20</key>
<value>0</value>
</param>
<param>
<key>ant21</key>
<value></value>
</param>
<param>
<key>bw21</key>
<value>0</value>
</param>
<param>
<key>center_freq21</key>
<value>0</value>
</param>
<param>
<key>norm_gain21</key>
<value>False</value>
</param>
<param>
<key>gain21</key>
<value>0</value>
</param>
<param>
<key>ant22</key>
<value></value>
</param>
<param>
<key>bw22</key>
<value>0</value>
</param>
<param>
<key>center_freq22</key>
<value>0</value>
</param>
<param>
<key>norm_gain22</key>
<value>False</value>
</param>
<param>
<key>gain22</key>
<value>0</value>
</param>
<param>
<key>ant23</key>
<value></value>
</param>
<param>
<key>bw23</key>
<value>0</value>
</param>
<param>
<key>center_freq23</key>
<value>0</value>
</param>
<param>
<key>norm_gain23</key>
<value>False</value>
</param>
<param>
<key>gain23</key>
<value>0</value>
</param>
<param>
<key>ant24</key>
<value></value>
</param>
<param>
<key>bw24</key>
<value>0</value>
</param>
<param>
<key>center_freq24</key>
<value>0</value>
</param>
<param>
<key>norm_gain24</key>
<value>False</value>
</param>
<param>
<key>gain24</key>
<value>0</value>
</param>
<param>
<key>ant25</key>
<value></value>
</param>
<param>
<key>bw25</key>
<value>0</value>
</param>
<param>
<key>center_freq25</key>
<value>0</value>
</param>
<param>
<key>norm_gain25</key>
<value>False</value>
</param>
<param>
<key>gain25</key>
<value>0</value>
</param>
<param>
<key>ant26</key>
<value></value>
</param>
<param>
<key>bw26</key>
<value>0</value>
</param>
<param>
<key>center_freq26</key>
<value>0</value>
</param>
<param>
<key>norm_gain26</key>
<value>False</value>
</param>
<param>
<key>gain26</key>
<value>0</value>
</param>
<param>
<key>ant27</key>
<value></value>
</param>
<param>
<key>bw27</key>
<value>0</value>
</param>
<param>
<key>center_freq27</key>
<value>0</value>
</param>
<param>
<key>norm_gain27</key>
<value>False</value>
</param>
<param>
<key>gain27</key>
<value>0</value>
</param>
<param>
<key>ant28</key>
<value></value>
</param>
<param>
<key>bw28</key>
<value>0</value>
</param>
<param>
<key>center_freq28</key>
<value>0</value>
</param>
<param>
<key>norm_gain28</key>
<value>False</value>
</param>
<param>
<key>gain28</key>
<value>0</value>
</param>
<param>
<key>ant29</key>
<value></value>
</param>
<param>
<key>bw29</key>
<value>0</value>
</param>
<param>
<key>center_freq29</key>
<value>0</value>
</param>
<param>
<key>norm_gain29</key>
<value>False</value>
</param>
<param>
<key>gain29</key>
<value>0</value>
</param>
<param>
<key>ant2</key>
<value></value>
</param>
<param>
<key>bw2</key>
<value>0</value>
</param>
<param>
<key>center_freq2</key>
<value>0</value>
</param>
<param>
<key>norm_gain2</key>
<value>False</value>
</param>
<param>
<key>gain2</key>
<value>0</value>
</param>
<param>
<key>ant30</key>
<value></value>
</param>
<param>
<key>bw30</key>
<value>0</value>
</param>
<param>
<key>center_freq30</key>
<value>0</value>
</param>
<param>
<key>norm_gain30</key>
<value>False</value>
</param>
<param>
<key>gain30</key>
<value>0</value>
</param>
<param>
<key>ant31</key>
<value></value>
</param>
<param>
<key>bw31</key>
<value>0</value>
</param>
<param>
<key>center_freq31</key>
<value>0</value>
</param>
<param>
<key>norm_gain31</key>
<value>False</value>
</param>
<param>
<key>gain31</key>
<value>0</value>
</param>
<param>
<key>ant3</key>
<value></value>
</param>
<param>
<key>bw3</key>
<value>0</value>
</param>
<param>
<key>center_freq3</key>
<value>0</value>
</param>
<param>
<key>norm_gain3</key>
<value>False</value>
</param>
<param>
<key>gain3</key>
<value>0</value>
</param>
<param>
<key>ant4</key>
<value></value>
</param>
<param>
<key>bw4</key>
<value>0</value>
</param>
<param>
<key>center_freq4</key>
<value>0</value>
</param>
<param>
<key>norm_gain4</key>
<value>False</value>
</param>
<param>
<key>gain4</key>
<value>0</value>
</param>
<param>
<key>ant5</key>
<value></value>
</param>
<param>
<key>bw5</key>
<value>0</value>
</param>
<param>
<key>center_freq5</key>
<value>0</value>
</param>
<param>
<key>norm_gain5</key>
<value>False</value>
</param>
<param>
<key>gain5</key>
<value>0</value>
</param>
<param>
<key>ant6</key>
<value></value>
</param>
<param>
<key>bw6</key>
<value>0</value>
</param>
<param>
<key>center_freq6</key>
<value>0</value>
</param>
<param>
<key>norm_gain6</key>
<value>False</value>
</param>
<param>
<key>gain6</key>
<value>0</value>
</param>
<param>
<key>ant7</key>
<value></value>
</param>
<param>
<key>bw7</key>
<value>0</value>
</param>
<param>
<key>center_freq7</key>
<value>0</value>
</param>
<param>
<key>norm_gain7</key>
<value>False</value>
</param>
<param>
<key>gain7</key>
<value>0</value>
</param>
<param>
<key>ant8</key>
<value></value>
</param>
<param>
<key>bw8</key>
<value>0</value>
</param>
<param>
<key>center_freq8</key>
<value>0</value>
</param>
<param>
<key>norm_gain8</key>
<value>False</value>
</param>
<param>
<key>gain8</key>
<value>0</value>
</param>
<param>
<key>ant9</key>
<value></value>
</param>
<param>
<key>bw9</key>
<value>0</value>
</param>
<param>
<key>center_freq9</key>
<value>0</value>
</param>
<param>
<key>norm_gain9</key>
<value>False</value>
</param>
<param>
<key>gain9</key>
<value>0</value>
</param>
<param>
<key>clock_rate</key>
<value>0.0</value>
</param>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>affinity</key>
<value></value>
</param>
<param>
<key>dev_addr</key>
<value>""</value>
</param>
<param>
<key>dev_args</key>
<value>""</value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>_coordinate</key>
<value>(536, 228)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>uhd_usrp_sink_0</value>
</param>
<param>
<key>type</key>
<value>fc32</value>
</param>
<param>
<key>clock_source0</key>
<value></value>
</param>
<param>
<key>sd_spec0</key>
<value></value>
</param>
<param>
<key>time_source0</key>
<value></value>
</param>
<param>
<key>clock_source1</key>
<value></value>
</param>
<param>
<key>sd_spec1</key>
<value></value>
</param>
<param>
<key>time_source1</key>
<value></value>
</param>
<param>
<key>clock_source2</key>
<value></value>
</param>
<param>
<key>sd_spec2</key>
<value></value>
</param>
<param>
<key>time_source2</key>
<value></value>
</param>
<param>
<key>clock_source3</key>
<value></value>
</param>
<param>
<key>sd_spec3</key>
<value></value>
</param>
<param>
<key>time_source3</key>
<value></value>
</param>
<param>
<key>clock_source4</key>
<value></value>
</param>
<param>
<key>sd_spec4</key>
<value></value>
</param>
<param>
<key>time_source4</key>
<value></value>
</param>
<param>
<key>clock_source5</key>
<value></value>
</param>
<param>
<key>sd_spec5</key>
<value></value>
</param>
<param>
<key>time_source5</key>
<value></value>
</param>
<param>
<key>clock_source6</key>
<value></value>
</param>
<param>
<key>sd_spec6</key>
<value></value>
</param>
<param>
<key>time_source6</key>
<value></value>
</param>
<param>
<key>clock_source7</key>
<value></value>
</param>
<param>
<key>sd_spec7</key>
<value></value>
</param>
<param>
<key>time_source7</key>
<value></value>
</param>
<param>
<key>nchan</key>
<value>1</value>
</param>
<param>
<key>num_mboards</key>
<value>1</value>
</param>
<param>
<key>samp_rate</key>
<value>samp_rate</value>
</param>
<param>
<key>hide_cmd_port</key>
<value>True</value>
</param>
<param>
<key>hide_lo_controls</key>
<value>True</value>
</param>
<param>
<key>stream_args</key>
<value></value>
</param>
<param>
<key>stream_chans</key>
<value>[]</value>
</param>
<param>
<key>sync</key>
<value></value>
</param>
<param>
<key>len_tag_name</key>
<value></value>
</param>
<param>
<key>otw</key>
<value></value>
</param>
</block>
<connection>
<source_block_id>blocks_file_source_0</source_block_id>
<sink_block_id>uhd_usrp_sink_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
</flow_graph>

View File

@ -0,0 +1,55 @@
# example
# ./btle_tx 37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-010203040506-FLAGS-02-LOCAL_NAME09-CA-TXPOWER-03-SERVICE03-180D1810-SERVICE_DATA-180D40-MANUF_DATA-0001FF-CONN_INTERVAL-0006 (-SERVICE_SOLI14-1811)
# FLAGS: 0x01 LE Limited Discoverable Mode; 0x02 LE General Discoverable Mode
# SERVICE:
# 0x02 16-bit Service UUIDs More 16-bit UUIDs available
# 0x03 16-bit Service UUIDs Complete list of 16-bit UUIDs available
# 0x04 32-bit Service UUIDs More 32-bit UUIDs available
# 0x05 32-bit Service UUIDs Complete list of 32-bit UUIDs available
# 0x06 128-bit Service UUIDs More 128-bit UUIDs available
# 0x07 128-bit Service UUIDs Complete list of 128-bit UUIDs available
# 37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-010203040506-FLAGS-02-LOCAL_NAME09-Jxj-TXPOWER-03-SERVICE03-180D1810-SERVICE_DATA-180D40-MANUF_DATA-004CFF-CONN_INTERVAL-0006
# r30
37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-010203040506-LOCAL_NAME09-SDR Bluetooth LE welcome u!
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-010203040500-LOCAL_NAME09-CA0000 11950 22.626 113.823 1
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-010203040501-LOCAL_NAME09-CA0001 11950 22.626 113.823 1
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-010203040502-LOCAL_NAME09-CA0002 11950 22.626 113.823 1
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-010203040503-LOCAL_NAME09-CA0003 11950 22.626 113.823 1
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-010203040504-LOCAL_NAME09-CA0004 11950 22.626 113.823 1
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-010203040505-LOCAL_NAME09-CA0005 11950 22.626 113.823 1
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-010203040506-LOCAL_NAME09-CA0006 11950 22.626 113.823 1
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-010203040507-LOCAL_NAME09-CA0007 11950 22.626 113.823 1
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-010203040508-LOCAL_NAME09-CA0008 11950 22.626 113.823 1
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-010203040509-LOCAL_NAME09-CA0009 11950 22.626 113.823 1
r40
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-010203040506-LOCAL_NAME09-01234567890123456789012345678
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-010203040506-FLAGS-02-LOCAL_NAME09-01234567890123456789012345
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-110203040506-FLAGS-02-LOCAL_NAME09-11234567890123456789012345
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-210203040506-FLAGS-02-LOCAL_NAME09-21234567890123456789012345
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-310203040506-FLAGS-02-LOCAL_NAME09-31234567890123456789012345
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-410203040506-FLAGS-02-LOCAL_NAME09-41234567890123456789012345
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-510203040506-FLAGS-02-LOCAL_NAME09-51234567890123456789012345
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-610203040506-FLAGS-02-LOCAL_NAME09-61234567890123456789012345
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-710203040506-FLAGS-02-LOCAL_NAME09-71234567890123456789012345
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-810203040506-FLAGS-02-LOCAL_NAME09-81234567890123456789012345
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-910203040506-FLAGS-02-LOCAL_NAME09-91234567890123456789012345
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-a10203040506-FLAGS-02-LOCAL_NAME09-a1234567890123456789012345
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-b10203040506-FLAGS-02-LOCAL_NAME09-b1234567890123456789012345
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-c10203040506-FLAGS-02-LOCAL_NAME09-c1234567890123456789012345
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-d10203040506-FLAGS-02-LOCAL_NAME09-d1234567890123456789012345
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-010203040506-FLAGS-02-SERVICE03-180D-SERVICE_DATA-180D40-SPACE-500
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-110203040506-FLAGS-02-SERVICE03-1819-SERVICE_DATA-181940-SPACE-100
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-210203040506-FLAGS-02-SERVICE03-181c-SERVICE_DATA-181c40-SPACE-500
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-310203040506-FLAGS-02-SERVICE03-180a-SERVICE_DATA-180a40-SPACE-500
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-410203040506-FLAGS-02-SERVICE03-1800-SERVICE_DATA-180040-SPACE-500
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-410203040506-FLAGS-02-SERVICE03-1801-SERVICE_DATA-180140-SPACE-500
# r30

3
Software/CubicSDR/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
build/
cmake_build/
dist/

View File

@ -0,0 +1,24 @@
os:
- linux
- osx
osx_image: xcode11.3
dist: trusty
language: cpp
addons:
apt:
packages:
- libpulse-dev
- libgtk-3-dev
- freeglut3
- freeglut3-dev
- libhamlib-dev
script:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install hamlib; fi
- bash travis-ci/build_liquiddsp.sh
- bash travis-ci/build_soapysdr.sh
- bash travis-ci/build_wxwidgets.sh
- bash travis-ci/build_cubicsdr.sh
cache:
directories:
- $HOME/build/wxWidgets/staticlib

File diff suppressed because it is too large Load Diff

339
Software/CubicSDR/LICENSE Normal file
View File

@ -0,0 +1,339 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

View File

@ -0,0 +1,45 @@
CubicSDR
========
Cross-Platform Software-Defined Radio Application
- The latest downloads are available on the [CubicSDR Releases](https://github.com/cjcliffe/CubicSDR/releases) page.
- Build instructions can be found at the [CubicSDR Wiki](https://github.com/cjcliffe/CubicSDR/wiki) page.
- Manual is available at [cubicsdr.readthedocs.io](http://cubicsdr.readthedocs.io).
- Manual contributions can be submitted to the [CubicSDR-Manual](https://github.com/cjcliffe/CubicSDR-Manual) repository.
Utilizes:
--------
- liquid-dsp (http://liquidsdr.org/ -- https://github.com/jgaeddert/liquid-dsp)
- SoapySDR (http://www.pothosware.com/ -- https://github.com/pothosware/SoapySDR)
- RtAudio (http://www.music.mcgill.ca/~gary/rtaudio/ -- http://github.com/thestk/rtaudio/)
- LodePNG (http://lodev.org/lodepng/)
- BMFont (http://www.angelcode.com/ -- http://www.angelcode.com/products/bmfont/)
- Bitstream Vera font (http://en.wikipedia.org/wiki/Bitstream_Vera)
- OpenGL (https://www.opengl.org/)
- wxWidgets (https://www.wxwidgets.org/)
- CMake (http://www.cmake.org/)
Optional Libs:
--------
- FFTW3 (can be compiled into liquid-dsp if desired) (http://www.fftw.org/ -- https://github.com/FFTW/fftw3)
- hamlib (https://github.com/Hamlib/Hamlib)
Recommended minimum requirements:
--------------------
- Multi-core processor system with at least 1GB RAM.
- Graphics card with at least 128MB video memory and OpenGL 3.x or ES 2.0 support.
- OSX 10.9+ for Mac binary releases.
- Windows 7+ for 64 or 32-bit Windows binary releases.
- Linux and other embedded distribution support yet to be indexed, known to at least work on Debian 8+ and Ubuntu 14+.
Target Platforms:
----------------
- [x] OSX
- [x] Windows
- [x] Linux
License:
-------
- GPL-2.0+

View File

@ -0,0 +1,9 @@
[Desktop Entry]
Type=Application
Exec=CubicSDR %u
Icon=@CMAKE_INSTALL_PREFIX@/share/cubicsdr/CubicSDR.png
Terminal=false
Name=CubicSDR
GenericName=CubicSDR
Comment=Software-Defined Radio Application
Categories=Science;HamRadio;DataVisualization;

View File

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
<key>CFBundleGetInfoString</key>
<string>${MACOSX_BUNDLE_INFO_STRING}</string>
<key>CFBundleIconFile</key>
<string>${MACOSX_BUNDLE_ICON_FILE}</string>
<key>CFBundleIdentifier</key>
<string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleLongVersionString</key>
<string>${MACOSX_BUNDLE_LONG_VERSION_STRING}</string>
<key>CFBundleName</key>
<string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
<key>CSResourcesFileMapped</key>
<true/>
<key>LSRequiresCarbon</key>
<true/>
<key>NSHumanReadableCopyright</key>
<string>${MACOSX_BUNDLE_COPYRIGHT}</string>
<key>NSHighResolutionCapable</key>
<true/>
<key>NSSupportsAutomaticGraphicsSwitching</key>
<true/>
</dict>
</plist>

View File

@ -0,0 +1,50 @@
# Try to find JACK
# This will define the following variables:
#
# JACK_FOUND - Whether Jack was found.
# JACK_INCLUDE_DIRS - Jack include directories.
# JACK_LIBRARIES - Jack libraries.
include(FindPackageHandleStandardArgs)
if(JACK_LIBRARIES AND JACK_INCLUDE_DIRS)
# in cache already
set(JACK_FOUND TRUE)
else()
find_package(PkgConfig)
if(PKG_CONFIG_FOUND)
pkg_check_modules(_JACK jack)
endif(PKG_CONFIG_FOUND)
find_path(JACK_INCLUDE_DIR
NAMES
jack/jack.h
PATHS
${_JACK_INCLUDEDIR}
)
find_library(JACK_LIBRARY
NAMES
jack
PATHS
${_JACK_LIBDIR}
)
set(JACK_INCLUDE_DIRS
${JACK_INCLUDE_DIR}
)
set(JACK_LIBRARIES
${JACK_LIBRARY}
)
find_package_handle_standard_args(Jack DEFAULT_MSG JACK_LIBRARIES JACK_INCLUDE_DIRS)
# show the JACK_INCLUDE_DIRS and JACK_LIBRARIES variables only in the advanced view
mark_as_advanced(JACK_INCLUDE_DIR JACK_LIBRARY JACK_INCLUDE_DIRS JACK_LIBRARIES)
endif()

View File

@ -0,0 +1,22 @@
# - Find LIQUID
# Find the native LIQUID includes and library
#
# LIQUID_INCLUDES - where to find LIQUID.h
# LIQUID_LIBRARIES - List of libraries when using LIQUID.
# LIQUID_FOUND - True if LIQUID found.
if (LIQUID_INCLUDES)
# Already in cache, be silent
set (LIQUID_FIND_QUIETLY TRUE)
endif (LIQUID_INCLUDES)
find_path (LIQUID_INCLUDES liquid/liquid.h)
find_library (LIQUID_LIBRARIES NAMES liquid)
# handle the QUIETLY and REQUIRED arguments and set LIQUID_FOUND to TRUE if
# all listed variables are TRUE
include (FindPackageHandleStandardArgs)
find_package_handle_standard_args (LIQUID DEFAULT_MSG LIQUID_LIBRARIES LIQUID_INCLUDES)
#mark_as_advanced (LIQUID_LIBRARIES LIQUID_INCLUDES)

View File

@ -0,0 +1,48 @@
# https://github.com/idiap/juicer/blob/master/cmake/FindRtAudio.cmake
#
# Copyright 2015 by Idiap Research Institute
#
# Licensed under 3-clause BSD.
#
# Author(s):
# Phil Garner, November 2015
#
# ...but basically copied from FindSndFile in libube, in turn from the examples
# on the web.
#
#
# Try to find RtAudio
# Once done this will define
# RTAUDIO_FOUND - System has RtAudio
# RTAUDIO_INCLUDE_DIR - The RtAudio include directories
# RTAUDIO_LIBRARIES - The libraries needed to use RtAudio
# RTAUDIO_DEFINITIONS - Compiler switches required for using RtAudio
# RTAUDIO_VERSION_STRING - the version of RtAudio found
#
find_package(PkgConfig)
pkg_check_modules(PC_RTAUDIO rtaudio)
set(RTAUDIO_DEFINITIONS ${PC_RTAUDIO_CFLAGS_OTHER})
set(RTAUDIO_VERSION_STRING ${PC_RTAUDIO_VERSION})
find_path(
RTAUDIO_INCLUDE_DIR RtAudio.h
HINTS ${PC_RTAUDIO_INCLUDEDIR} ${PC_RTAUDIO_INCLUDE_DIRS}
)
find_library(
RTAUDIO_LIBRARIES NAMES rtaudio
HINTS ${PC_RTAUDIO_LIBDIR} ${PC_RTAUDIO_LIBRARY_DIRS}
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
RtAudio
REQUIRED_VARS RTAUDIO_LIBRARIES RTAUDIO_INCLUDE_DIR
VERSION_VAR RTAUDIO_VERSION_STRING
)
#mark_as_advanced(RTAUDIO_INCLUDE_DIR RTAUDIO_LIBRARIES)

View File

@ -0,0 +1,77 @@
# - Try to find Hamlib
# Author: George L. Emigh - AB4BD
#
# Change Log: Charles J. Cliffe <cj@cubicproductions.com>
# Updates:
# Jan 2015 - Add /opt/ paths for OSX MacPorts
# - Fix HAMLIB_INCLUDE_DIR absolute search
# - Add static lib support
# TODO:
# Windows support
#
# HAMLIB_FOUND - system has Hamlib
# HAMLIB_LIBRARY - location of the library for hamlib
# HAMLIB_INCLUDE_DIR - location of the include files for hamlib
set(HAMLIB_FOUND FALSE)
find_path(HAMLIB_INCLUDE_DIR
NAMES hamlib/rig.h
PATHS
/usr/include
/usr/local/include
/opt/local/include
)
find_library(HAMLIB_LIBRARY
NAMES hamlib
PATHS
/usr/lib64/hamlib
/usr/lib/hamlib
/usr/lib64
/usr/lib
/usr/local/lib64/hamlib
/usr/local/lib/hamlib
/usr/local/lib64
/usr/local/lib
/opt/local/lib
/opt/local/lib/hamlib
)
find_library(HAMLIB_STATIC_LIBRARY
NAMES libhamlib.a
PATHS
/usr/lib64/hamlib
/usr/lib/hamlib
/usr/lib64
/usr/lib
/usr/local/lib64/hamlib
/usr/local/lib/hamlib
/usr/local/lib64
/usr/local/lib
/opt/local/lib
/opt/local/lib/hamlib
)
GET_FILENAME_COMPONENT(HAMLIB_LIB_FOLDER ${HAMLIB_STATIC_LIBRARY} DIRECTORY)
file(GLOB HAMLIB_STATIC_MODS ${HAMLIB_LIB_FOLDER}/hamlib-*.a)
if(HAMLIB_INCLUDE_DIR AND HAMLIB_LIBRARY)
set(HAMLIB_FOUND TRUE)
# message(STATUS "Hamlib version: ${VERSION}")
message(STATUS "Found hamlib library at: ${HAMLIB_LIBRARY}")
message(STATUS "Found hamlib static library at: ${HAMLIB_STATIC_LIBRARY}")
message(STATUS "Found hamlib static modules: ${HAMLIB_STATIC_MODS}")
message(STATUS "Found hamlib include directory at: ${HAMLIB_INCLUDE_DIR}")
endif(HAMLIB_INCLUDE_DIR AND HAMLIB_LIBRARY)
IF(NOT HAMLIB_FOUND)
IF(NOT HAMLIB_FIND_QUIETLY)
MESSAGE(STATUS "HAMLIB was not found.")
ELSE(NOT HAMLIB_FIND_QUIETLY)
IF(HAMLIB_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "HAMLIB was not found.")
ENDIF(HAMLIB_FIND_REQUIRED)
ENDIF(NOT HAMLIB_FIND_QUIETLY)
ENDIF(NOT HAMLIB_FOUND)

View File

@ -0,0 +1,22 @@
IF(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt")
MESSAGE(FATAL_ERROR "Cannot find install manifest: '${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt'")
ENDIF(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt")
FILE(READ "${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt" files)
STRING(REGEX REPLACE " " ";" files "${files}")
STRING(REGEX REPLACE "\n" ";" files "${files}")
FOREACH(file ${files})
MESSAGE(STATUS "Uninstalling '$ENV{DESTDIR}${file}'")
IF(EXISTS "$ENV{DESTDIR}${file}")
EXEC_PROGRAM(
"${CMAKE_COMMAND}" ARGS "-E remove '$ENV{DESTDIR}${file}'"
OUTPUT_VARIABLE rm_out
RETURN_VALUE rm_retval
)
IF(NOT "${rm_retval}" STREQUAL 0)
MESSAGE(FATAL_ERROR "Problem when removing '$ENV{DESTDIR}${file}'")
ENDIF(NOT "${rm_retval}" STREQUAL 0)
ELSE(EXISTS "$ENV{DESTDIR}${file}")
MESSAGE(STATUS "File '$ENV{DESTDIR}${file}' does not exist.")
ENDIF(EXISTS "$ENV{DESTDIR}${file}")
ENDFOREACH(file)

View File

@ -0,0 +1,11 @@
#!/bin/bash
for f in ${APPS}/Contents/MacOS/*.dylib
do
/usr/bin/codesign --force --verify --verbose --sign "${CUBICSDR_CERT}" $f
done
for f in ${APPS}/Contents/MacOS/modules/*.so
do
/usr/bin/codesign --force --verify --verbose --sign "${CUBICSDR_CERT}" $f
done
/usr/bin/codesign --force --verify --verbose --sign "${CUBICSDR_CERT}" ${APPS}

View File

@ -0,0 +1,2 @@
#!/bin/bash
/usr/bin/codesign --force --verify --verbose --sign "${CUBICSDR_CERT}" CubicSDR-${CPACK_PACKAGE_VERSION}-Darwin.dmg

View File

@ -0,0 +1,2 @@
id ICON "icon/CubicSDR.ico"
frame_icon ICON "icon/CubicSDR.ico"

View File

@ -0,0 +1,110 @@
//
// aabb.h
// CubicVR2
//
// Created by Charles J. Cliffe on 2013-02-22.
// Copyright (c) 2013 Charles J. Cliffe. All rights reserved.
//
#ifndef __CubicVR2__aabb__
#define __CubicVR2__aabb__
#include <iostream>
#include "vec3.h"
namespace CubicVR {
enum class aabb_intersect { AABB_DISJOINT, AABB_A_INSIDE_B, AABB_B_INSIDE_A, AABB_INTERSECT };
struct aabb {
vec3 min, max;
aabb(vec3 min_in, vec3 max_in) {
min=min_in;
max=max_in;
}
aabb() {
min=max=vec3(0,0,0);
}
aabb engulf(aabb aabb, vec3 point) {
if (aabb.min[0] > point[0]) {
aabb.min[0] = point[0];
}
if (aabb.min[1] > point[1]) {
aabb.min[1] = point[1];
}
if (aabb.min[2] > point[2]) {
aabb.min[2] = point[2];
}
if (aabb.max[0] < point[0]) {
aabb.max[0] = point[0];
}
if (aabb.max[1] < point[1]) {
aabb.max[1] = point[1];
}
if (aabb.max[2] < point[2]) {
aabb.max[2] = point[2];
}
return aabb;
};
static aabb reset(aabb aabb, vec3 point=vec3(0.0f,0.0f,0.0f)) {
aabb.min[0] = point[0];
aabb.min[1] = point[1];
aabb.min[2] = point[2];
aabb.max[0] = point[0];
aabb.max[1] = point[1];
aabb.max[2] = point[2];
return aabb;
};
static vec3 size(aabb aabb) {
__float x = aabb.min[0] < aabb.max[0] ? aabb.max[0] - aabb.min[0] : aabb.min[0] - aabb.max[0];
__float y = aabb.min[1] < aabb.max[1] ? aabb.max[1] - aabb.min[1] : aabb.min[1] - aabb.max[1];
__float z = aabb.min[2] < aabb.max[2] ? aabb.max[2] - aabb.min[2] : aabb.min[2] - aabb.max[2];
return vec3(x,y,z);
};
/**
Returns positive integer if intersect between A and B, 0 otherwise.
For more detailed intersect result check value:
CubicVR.enums.aabb.INTERSECT if AABBs intersect
CubicVR.enums.aabb.A_INSIDE_B if boxA is inside boxB
CubicVR.enums.aabb.B_INSIDE_A if boxB is inside boxA
CubicVR.enums.aabb.DISJOINT if AABBs are disjoint (do not intersect)
*/
aabb_intersect intersects(aabb boxA, aabb boxB) {
// Disjoint
if( boxA.min[0] > boxB.max[0] || boxA.max[0] < boxB.min[0] ){
return aabb_intersect::AABB_DISJOINT;
}
if( boxA.min[1] > boxB.max[1] || boxA.max[1] < boxB.min[1] ){
return aabb_intersect::AABB_DISJOINT;
}
if( boxA.min[2] > boxB.max[2] || boxA.max[2] < boxB.min[2] ){
return aabb_intersect::AABB_DISJOINT;
}
// boxA is inside boxB.
if( boxA.min[0] >= boxB.min[0] && boxA.max[0] <= boxB.max[0] &&
boxA.min[1] >= boxB.min[1] && boxA.max[1] <= boxB.max[1] &&
boxA.min[2] >= boxB.min[2] && boxA.max[2] <= boxB.max[2]) {
return aabb_intersect::AABB_A_INSIDE_B;
}
// boxB is inside boxA.
if( boxB.min[0] >= boxA.min[0] && boxB.max[0] <= boxA.max[0] &&
boxB.min[1] >= boxA.min[1] && boxB.max[1] <= boxA.max[1] &&
boxB.min[2] >= boxA.min[2] && boxB.max[2] <= boxA.max[2]) {
return aabb_intersect::AABB_B_INSIDE_A;
}
// Otherwise AABB's intersect.
return aabb_intersect::AABB_INTERSECT;
}
};
};
#endif /* defined(__CubicVR2__aabb__) */

View File

@ -0,0 +1,27 @@
//
// math.cpp
// CubicVR2
//
// Created by Charles J. Cliffe on 2013-02-22.
// Copyright (c) 2013 Charles J. Cliffe. All rights reserved.
//
#include "cubic_math.h"
namespace CubicVR {
std::ostream& operator<<(std::ostream &strm, const vec4 &v) {
return strm << "{" << v.x << ", " << v.y << ", " << v.z << ", " << v.w << "}";
}
std::ostream& operator<<(std::ostream &strm, const vec3 &v) {
return strm << "{" << v.x << ", " << v.y << ", " << v.z << "}";
}
std::ostream& operator<<(std::ostream &strm, const vec2 &v) {
return strm << "{" << v.x << ", " << v.y << "}";
}
std::ostream& operator<<(std::ostream &strm, const mat4 &m) {
return strm << "{ " << m[0] << ", " << m[1] << ", " << m[2] << ", " << m[3] << endl
<< " " << m[4] << ", " << m[5] << ", " << m[6] << ", " << m[7] << endl
<< " " << m[8] << ", " << m[9] << ", " << m[10] << ", " << m[11] << endl
<< " " << m[12] << ", " << m[13] << ", " << m[14] << ", " << m[15] << " }" << endl;
}
}

View File

@ -0,0 +1,35 @@
//
// math.h
// CubicVR2
//
// Created by Charles J. Cliffe on 2013-02-22.
// Copyright (c) 2013 Charles J. Cliffe. All rights reserved.
//
#ifndef __CubicVR2__math__
#define __CubicVR2__math__
#include <iostream>
#include "aabb.h"
#include "mat3.h"
#include "mat4.h"
#include "quaternion.h"
#include "transform.h"
#include "triangle.h"
#include "vec2.h"
#include "vec3.h"
#include "vec4.h"
#include "plane.h"
#include "sphere.h"
#include "frustum.h"
namespace CubicVR {
std::ostream& operator<<(std::ostream &strm, const vec4 &v);
std::ostream& operator<<(std::ostream &strm, const vec3 &v);
std::ostream& operator<<(std::ostream &strm, const vec2 &v);
std::ostream& operator<<(std::ostream &strm, const mat4 &m);
}
#endif /* defined(__CubicVR2__math__) */

View File

@ -0,0 +1,46 @@
//
// types.h
// CubicVR2
//
// Created by Charles J. Cliffe on 2013-02-21.
// Copyright (c) 2013 Charles J. Cliffe. All rights reserved.
//
#ifndef CubicVR2_types_h
#define CubicVR2_types_h
namespace CubicVR {
typedef double __float64;
typedef float __float32;
typedef __float32 __float;
#define COMBINE(x,y) x ## y
#define floatSG(c, x,y) \
__float COMBINE(get,x)() { return y; } \
c & COMBINE(set,x)(__float value) { y = value; return *this; }
#define intSG(c, x,y) \
int COMBINE(get,x)() { return y; } \
c & COMBINE(set,x)(int value) { y = value; return *this; }
#define uintSG(c, x,y) \
unsigned int COMBINE(get,x)() { return y; } \
c & COMBINE(set,x)(unsigned int value) { y = value; return *this; }
#define boolSG(c,x,y) \
bool COMBINE(get,x)() { return y; } \
c & COMBINE(set,x)(bool value) { y = value; return *this; }
#define stringSG(c,x,y) \
string COMBINE(get,x)() { return y; } \
c & COMBINE(set,x)(string value) { y = value; return *this; }
#define isBoolSG(c,x,y) \
bool COMBINE(is,x)() { return y; } \
c & COMBINE(set,x)(bool value) { y = value; return *this; }
}
#include <cmath>
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
#endif

View File

@ -0,0 +1,167 @@
//
// frustum.h
// CubicVR2
//
// Created by Charles J. Cliffe on 2013-02-22.
// Copyright (c) 2013 Charles J. Cliffe. All rights reserved.
//
#ifndef CubicVR2_frustum_h
#define CubicVR2_frustum_h
#include <vector>
#include "cubic_types.h"
#include "mat4.h"
#include "vec3.h"
#include "vec4.h"
#include "plane.h"
namespace CubicVR {
enum frustum_plane { PLANE_LEFT, PLANE_RIGHT, PLANE_TOP, PLANE_BOTTOM, PLANE_NEAR, PLANE_FAR };
struct frustum {
std::vector<vec4> planes;
vec4 sphere;
frustum() {
planes.resize(6);
for (int i = 0; i < 6; ++i) {
planes[i] = vec4(0, 0, 0, 0);
} //for
} //Frustum::Constructor
void extract(vec3 position, mat4 mvMatrix, mat4 pMatrix) {
mat4 comboMatrix = mat4::multiply(pMatrix, mvMatrix, true);
// Left clipping plane
planes[PLANE_LEFT][0] = comboMatrix[3] + comboMatrix[0];
planes[PLANE_LEFT][1] = comboMatrix[7] + comboMatrix[4];
planes[PLANE_LEFT][2] = comboMatrix[11] + comboMatrix[8];
planes[PLANE_LEFT][3] = comboMatrix[15] + comboMatrix[12];
// Right clipping plane
planes[PLANE_RIGHT][0] = comboMatrix[3] - comboMatrix[0];
planes[PLANE_RIGHT][1] = comboMatrix[7] - comboMatrix[4];
planes[PLANE_RIGHT][2] = comboMatrix[11] - comboMatrix[8];
planes[PLANE_RIGHT][3] = comboMatrix[15] - comboMatrix[12];
// Top clipping plane
planes[PLANE_TOP][0] = comboMatrix[3] - comboMatrix[1];
planes[PLANE_TOP][1] = comboMatrix[7] - comboMatrix[5];
planes[PLANE_TOP][2] = comboMatrix[11] - comboMatrix[9];
planes[PLANE_TOP][3] = comboMatrix[15] - comboMatrix[13];
// Bottom clipping plane
planes[PLANE_BOTTOM][0] = comboMatrix[3] + comboMatrix[1];
planes[PLANE_BOTTOM][1] = comboMatrix[7] + comboMatrix[5];
planes[PLANE_BOTTOM][2] = comboMatrix[11] + comboMatrix[9];
planes[PLANE_BOTTOM][3] = comboMatrix[15] + comboMatrix[13];
// Near clipping plane
planes[PLANE_NEAR][0] = comboMatrix[3] + comboMatrix[2];
planes[PLANE_NEAR][1] = comboMatrix[7] + comboMatrix[6];
planes[PLANE_NEAR][2] = comboMatrix[11] + comboMatrix[10];
planes[PLANE_NEAR][3] = comboMatrix[15] + comboMatrix[14];
// Far clipping plane
planes[PLANE_FAR][0] = comboMatrix[3] - comboMatrix[2];
planes[PLANE_FAR][1] = comboMatrix[7] - comboMatrix[6];
planes[PLANE_FAR][2] = comboMatrix[11] - comboMatrix[10];
planes[PLANE_FAR][3] = comboMatrix[15] - comboMatrix[14];
for (unsigned int i = 0; i < 6; ++i) {
planes[i] = vec4::normalize(planes[i]);
}
//Sphere
__float fov = 1 / pMatrix[5];
__float znear = -planes[PLANE_NEAR][3];
__float zfar = planes[PLANE_FAR][3];
__float view_length = zfar - znear;
__float height = view_length * fov;
__float width = height;
vec3 P(0, 0, znear + view_length * 0.5f);
vec3 Q(width, height, znear + view_length);
vec3 diff = vec3::subtract(P, Q);
__float diff_mag = vec3::length(diff);
vec3 look_v = vec3(comboMatrix[3], comboMatrix[9], comboMatrix[10]);
__float look_mag = vec3::length(look_v);
look_v = vec3::multiply(look_v, 1 / look_mag);
vec3 pos = vec3(position[0], position[1], position[2]);
pos = vec3::add(pos, vec3::multiply(look_v, view_length * 0.5f));
pos = vec3::add(pos, vec3::multiply(look_v, 1));
sphere = vec4(pos[0], pos[1], pos[2], diff_mag);
}; //Frustum::extract
int contains_sphere(vec4 sphere) {
for (unsigned int i = 0; i < 6; ++i) {
vec4 &p = planes[i];
vec3 normal = vec3(p[0], p[1], p[2]);
__float distance = vec3::dot(normal, vec3(sphere[0],sphere[1],sphere[2])) + p[3];
//OUT
if (distance < -sphere[3]) {
return -1;
}
//INTERSECT
if (fabs(distance) < sphere[3]) {
return 0;
}
} //for
//IN
return 1;
}; //Frustum::contains_sphere
int contains_box(aabb bbox) {
int total_in = 0;
vec3 points[8];
points[0] = bbox.min;
points[1] = vec3(bbox.min[0], bbox.min[1], bbox.max[2]);
points[2] = vec3(bbox.min[0], bbox.max[1], bbox.min[2]);
points[3] = vec3(bbox.min[0], bbox.max[1], bbox.max[2]);
points[4] = vec3(bbox.max[0], bbox.min[1], bbox.min[2]);
points[5] = vec3(bbox.max[0], bbox.min[1], bbox.max[2]);
points[6] = vec3(bbox.max[0], bbox.max[1], bbox.min[2]);
points[7] = bbox.max;
for (unsigned int i = 0; i < 6; ++i) {
unsigned int in_count = 8;
unsigned int point_in = 1;
for (unsigned int j = 0; j < 8; ++j) {
if (plane::classifyPoint(planes[i], points[j]) == -1) {
point_in = 0;
--in_count;
} //if
} //for j
//OUT
if (in_count == 0) {
return -1;
}
total_in += point_in;
} //for i
//IN
if (total_in == 6) {
return 1;
}
return 0;
}; //Frustum::contains_box
};
}
#endif

View File

@ -0,0 +1,92 @@
//
// mat3.h
// CubicVR2
//
// Created by Charles J. Cliffe on 2013-02-22.
// Copyright (c) 2013 Charles J. Cliffe. All rights reserved.
//
#ifndef __CubicVR2__mat3__
#define __CubicVR2__mat3__
#include <iostream>
#include "vec3.h"
#include <cstring>
#include <stddef.h>
namespace CubicVR {
#define mat3SG(c,x,y) \
mat3 COMBINE(get,x)() { return y; } \
c & COMBINE(set,x)(mat3 value) { y = value; return *this; }
struct mat3 {
__float a,b,c,d,e,f,g,h,i;
//access as-array:
inline __float& operator [] (size_t i) {
__float* as_array = (__float*)this;
return (as_array[i]);
}
inline const __float& operator [] (size_t i) const {
__float* as_array = (__float*)this;
return (as_array[i]);
}
mat3(__float ai,__float bi,__float ci,__float di,__float ei,__float fi,__float gi,__float hi,__float ii) {
a = ai; b = bi; c = ci; d = di; e = ei; f = fi; g = gi; h = hi; i = ii;
};
mat3() { memset((__float *)this, 0, sizeof(mat3)); }
// mat3 operator* (mat4 m) { return mat3::multiply(*this,m); };
// void operator*= (mat4 m) { *this = mat3::multiply(*this,m); };
static mat3 identity() {
return mat3(1.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f,
0.0f, 0.0f, 1.0f);
}
static void transpose_inline(mat3 &mat) {
__float a01 = mat[1], a02 = mat[2], a12 = mat[5];
mat[1] = mat[3];
mat[2] = mat[6];
mat[3] = a01;
mat[5] = mat[7];
mat[6] = a02;
mat[7] = a12;
};
static mat3 transpose(mat3 mat_in) {
__float a01 = mat_in[1], a02 = mat_in[2], a12 = mat_in[5];
mat3 mat;
mat[1] = mat_in[3];
mat[2] = mat_in[6];
mat[3] = a01;
mat[5] = mat_in[7];
mat[6] = a02;
mat[7] = a12;
return mat;
};
static vec3 multiply(mat3 m1, vec3 m2) {
vec3 mOut;
mOut[0] = m2[0] * m1[0] + m2[3] * m1[1] + m2[6] * m1[2] ;
mOut[1] = m2[1] * m1[0] + m2[4] * m1[1] + m2[7] * m1[2] ;
mOut[2] = m2[2] * m1[0] + m2[5] * m1[1] + m2[8] * m1[2];
return mOut;
};
};
}
#endif /* defined(__CubicVR2__mat3__) */

View File

@ -0,0 +1,339 @@
//
// mat4.h
// CubicVR2
//
// Created by Charles J. Cliffe on 2013-02-21.
// Copyright (c) 2013 Charles J. Cliffe. All rights reserved.
//
#ifndef __CubicVR2__mat4__
#define __CubicVR2__mat4__
#include <iostream>
#include "cubic_types.h"
#include "vec3.h"
#include "vec4.h"
#include "mat3.h"
#include <cmath>
#include <stddef.h>
namespace CubicVR {
using namespace std;
#define mat4SG(c,x,y) \
mat4 COMBINE(get,x)() { return y; } \
c & COMBINE(set,x)(mat4 value) { y = value; return *this; }
struct mat4 {
//16 elements
__float a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p;
//access as-array:
inline __float& operator [] (size_t i) {
__float* as_array = (__float*)this;
return (as_array[i]);
}
inline const __float& operator [] (size_t i) const {
__float* as_array = (__float*)this;
return (as_array[i]);
}
//To be accessed by GL API directly, accessed by pointer.
//operator* overloading is way too dangerous, especially in ptr != NULL
//tests.
inline __float* to_ptr() const { return (__float *)this; }
mat4(__float ai,__float bi,__float ci,__float di,__float ei,__float fi,__float gi,__float hi,__float ii,__float ji,__float ki,__float li,__float mi,__float ni,__float oi,__float pi) {
a = ai; b = bi; c = ci; d = di; e = ei; f = fi; g = gi; h = hi; i = ii; j = ji; k = ki; l = li; m = mi; n = ni; o = oi; p = pi;
}
mat4() { memset(this,0,sizeof(mat4)); }
mat4 operator* (mat4 m) { return mat4::multiply(*this, m, true); };
void operator*= (mat4 m) { *this = mat4::multiply(*this, m, true); };
// mat4 &operator= (const mat4 &m) { memcpy(this,(__float *)m,sizeof(__float)*16); return *this; };
static mat4 identity() {
return mat4(1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f);
}
static mat4 multiply(mat4 mLeft, mat4 mRight, bool /* updated */) {
mat4 mOut;
mOut[0] = mLeft[0] * mRight[0] + mLeft[4] * mRight[1] + mLeft[8] * mRight[2] + mLeft[12] * mRight[3];
mOut[1] = mLeft[1] * mRight[0] + mLeft[5] * mRight[1] + mLeft[9] * mRight[2] + mLeft[13] * mRight[3];
mOut[2] = mLeft[2] * mRight[0] + mLeft[6] * mRight[1] + mLeft[10] * mRight[2] + mLeft[14] * mRight[3];
mOut[3] = mLeft[3] * mRight[0] + mLeft[7] * mRight[1] + mLeft[11] * mRight[2] + mLeft[15] * mRight[3];
mOut[4] = mLeft[0] * mRight[4] + mLeft[4] * mRight[5] + mLeft[8] * mRight[6] + mLeft[12] * mRight[7];
mOut[5] = mLeft[1] * mRight[4] + mLeft[5] * mRight[5] + mLeft[9] * mRight[6] + mLeft[13] * mRight[7];
mOut[6] = mLeft[2] * mRight[4] + mLeft[6] * mRight[5] + mLeft[10] * mRight[6] + mLeft[14] * mRight[7];
mOut[7] = mLeft[3] * mRight[4] + mLeft[7] * mRight[5] + mLeft[11] * mRight[6] + mLeft[15] * mRight[7];
mOut[8] = mLeft[0] * mRight[8] + mLeft[4] * mRight[9] + mLeft[8] * mRight[10] + mLeft[12] * mRight[11];
mOut[9] = mLeft[1] * mRight[8] + mLeft[5] * mRight[9] + mLeft[9] * mRight[10] + mLeft[13] * mRight[11];
mOut[10] = mLeft[2] * mRight[8] + mLeft[6] * mRight[9] + mLeft[10] * mRight[10] + mLeft[14] * mRight[11];
mOut[11] = mLeft[3] * mRight[8] + mLeft[7] * mRight[9] + mLeft[11] * mRight[10] + mLeft[15] * mRight[11];
mOut[12] = mLeft[0] * mRight[12] + mLeft[4] * mRight[13] + mLeft[8] * mRight[14] + mLeft[12] * mRight[15];
mOut[13] = mLeft[1] * mRight[12] + mLeft[5] * mRight[13] + mLeft[9] * mRight[14] + mLeft[13] * mRight[15];
mOut[14] = mLeft[2] * mRight[12] + mLeft[6] * mRight[13] + mLeft[10] * mRight[14] + mLeft[14] * mRight[15];
mOut[15] = mLeft[3] * mRight[12] + mLeft[7] * mRight[13] + mLeft[11] * mRight[14] + mLeft[15] * mRight[15];
return mOut;
};
static vec3 multiply(mat4 m1, vec3 m2, bool /* updated */) {
vec3 mOut;
mOut[0] = m1[0] * m2[0] + m1[4] * m2[1] + m1[8] * m2[2] + m1[12];
mOut[1] = m1[1] * m2[0] + m1[5] * m2[1] + m1[9] * m2[2] + m1[13];
mOut[2] = m1[2] * m2[0] + m1[6] * m2[1] + m1[10] * m2[2] + m1[14];
return mOut;
}
static mat4 frustum(__float left, __float right, __float bottom, __float top, __float zNear, __float zFar) {
__float A = (right + left) / (right - left);
__float B = (top + bottom) / (top - bottom);
__float C = - (zFar + zNear) / (zFar - zNear);
__float D = - (-2.0f * zFar * zNear) / (zFar - zNear);
return mat4((2.0f * zNear) / (right - left), 0, A, 0,
0, (2.0f * zNear) / (top - bottom), B, 0,
0, 0, C, D,
0, 0, -1, 0);
};
static mat4 perspective(__float fovy, __float aspect, __float zNear, __float zFar) {
__float yFac = tan(fovy * (float)M_PI / 360.0f);
__float xFac = yFac * aspect;
return mat4::frustum(-xFac, xFac, -yFac, yFac, zNear, zFar);
};
static mat4 ortho(__float left,__float right,__float bottom,__float top,__float znear,__float zfar) {
return mat4(2.0f / (right - left), 0, 0, 0, 0, 2.0f / (top - bottom), 0, 0, 0, 0, -2.0f / (zfar - znear), 0, -(left + right) / (right - left), -(top + bottom) / (top - bottom), -(zfar + znear) / (zfar - znear), 1);
};
static __float determinant(mat4 m) {
__float a0 = m[0] * m[5] - m[1] * m[4];
__float a1 = m[0] * m[6] - m[2] * m[4];
__float a2 = m[0] * m[7] - m[3] * m[4];
__float a3 = m[1] * m[6] - m[2] * m[5];
__float a4 = m[1] * m[7] - m[3] * m[5];
__float a5 = m[2] * m[7] - m[3] * m[6];
__float b0 = m[8] * m[13] - m[9] * m[12];
__float b1 = m[8] * m[14] - m[10] * m[12];
__float b2 = m[8] * m[15] - m[11] * m[12];
__float b3 = m[9] * m[14] - m[10] * m[13];
__float b4 = m[9] * m[15] - m[11] * m[13];
__float b5 = m[10] * m[15] - m[11] * m[14];
__float det = a0 * b5 - a1 * b4 + a2 * b3 + a3 * b2 - a4 * b1 + a5 * b0;
return det;
};
// coFactor: function (m, n, out) {
// // .. todo..
// },
static mat4 transpose(mat4 m) {
return mat4(m[0], m[4], m[8], m[12], m[1], m[5], m[9], m[13], m[2], m[6], m[10], m[14], m[3], m[7], m[11], m[15]);
};
static mat3 inverse_mat3(mat4 mat) {
mat3 dest;
__float a00 = mat[0], a01 = mat[1], a02 = mat[2],
a10 = mat[4], a11 = mat[5], a12 = mat[6],
a20 = mat[8], a21 = mat[9], a22 = mat[10];
__float b01 = a22*a11-a12*a21,
b11 = -a22*a10+a12*a20,
b21 = a21*a10-a11*a20;
__float d = a00*b01 + a01*b11 + a02*b21;
if (!d) { return dest; }
__float id = 1/d;
dest[0] = b01*id;
dest[1] = (-a22*a01 + a02*a21)*id;
dest[2] = (a12*a01 - a02*a11)*id;
dest[3] = b11*id;
dest[4] = (a22*a00 - a02*a20)*id;
dest[5] = (-a12*a00 + a02*a10)*id;
dest[6] = b21*id;
dest[7] = (-a21*a00 + a01*a20)*id;
dest[8] = (a11*a00 - a01*a10)*id;
return dest;
};
static mat4 inverse(mat4 m) {
mat4 m_inv;
__float a0 = m[0] * m[5] - m[1] * m[4];
__float a1 = m[0] * m[6] - m[2] * m[4];
__float a2 = m[0] * m[7] - m[3] * m[4];
__float a3 = m[1] * m[6] - m[2] * m[5];
__float a4 = m[1] * m[7] - m[3] * m[5];
__float a5 = m[2] * m[7] - m[3] * m[6];
__float b0 = m[8] * m[13] - m[9] * m[12];
__float b1 = m[8] * m[14] - m[10] * m[12];
__float b2 = m[8] * m[15] - m[11] * m[12];
__float b3 = m[9] * m[14] - m[10] * m[13];
__float b4 = m[9] * m[15] - m[11] * m[13];
__float b5 = m[10] * m[15] - m[11] * m[14];
__float determinant = a0 * b5 - a1 * b4 + a2 * b3 + a3 * b2 - a4 * b1 + a5 * b0;
if (determinant != 0) {
m_inv[0] = 0 + m[5] * b5 - m[6] * b4 + m[7] * b3;
m_inv[4] = 0 - m[4] * b5 + m[6] * b2 - m[7] * b1;
m_inv[8] = 0 + m[4] * b4 - m[5] * b2 + m[7] * b0;
m_inv[12] = 0 - m[4] * b3 + m[5] * b1 - m[6] * b0;
m_inv[1] = 0 - m[1] * b5 + m[2] * b4 - m[3] * b3;
m_inv[5] = 0 + m[0] * b5 - m[2] * b2 + m[3] * b1;
m_inv[9] = 0 - m[0] * b4 + m[1] * b2 - m[3] * b0;
m_inv[13] = 0 + m[0] * b3 - m[1] * b1 + m[2] * b0;
m_inv[2] = 0 + m[13] * a5 - m[14] * a4 + m[15] * a3;
m_inv[6] = 0 - m[12] * a5 + m[14] * a2 - m[15] * a1;
m_inv[10] = 0 + m[12] * a4 - m[13] * a2 + m[15] * a0;
m_inv[14] = 0 - m[12] * a3 + m[13] * a1 - m[14] * a0;
m_inv[3] = 0 - m[9] * a5 + m[10] * a4 - m[11] * a3;
m_inv[7] = 0 + m[8] * a5 - m[10] * a2 + m[11] * a1;
m_inv[11] = 0 - m[8] * a4 + m[9] * a2 - m[11] * a0;
m_inv[15] = 0 + m[8] * a3 - m[9] * a1 + m[10] * a0;
__float inverse_det = 1.0f / determinant;
m_inv[0] *= inverse_det;
m_inv[1] *= inverse_det;
m_inv[2] *= inverse_det;
m_inv[3] *= inverse_det;
m_inv[4] *= inverse_det;
m_inv[5] *= inverse_det;
m_inv[6] *= inverse_det;
m_inv[7] *= inverse_det;
m_inv[8] *= inverse_det;
m_inv[9] *= inverse_det;
m_inv[10] *= inverse_det;
m_inv[11] *= inverse_det;
m_inv[12] *= inverse_det;
m_inv[13] *= inverse_det;
m_inv[14] *= inverse_det;
m_inv[15] *= inverse_det;
return m_inv;
}
return mat4::identity();
};
static mat4 translate(__float x, __float y, __float z) {
mat4 m = mat4(1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, x, y, z, 1.0f);
return m;
};
static mat4 rotateAxis(__float r, __float x, __float y, __float z) { // rotate r about axis x,y,z
__float sAng = sinf(r*((float)M_PI/180.0f));
__float cAng = cosf(r*((float)M_PI/180.0f));
return mat4( cAng+(x*x)*(1.0f-cAng), x*y*(1.0f-cAng) - z*sAng, x*z*(1.0f-cAng) + y*sAng, 0,
y*x*(1.0f-cAng)+z*sAng, cAng + y*y*(1.0f-cAng), y*z*(1.0f-cAng)-x*sAng, 0,
z*x*(1.0f-cAng)-y*sAng, z*y*(1.0f-cAng)+x*sAng, cAng+(z*z)*(1.0f-cAng), 0,
0, 0, 0, 1 );
};
static mat4 rotate(__float x, __float y, __float z) { // rotate each axis, angles x, y, z in turn
__float sAng,cAng;
mat4 mOut = mat4(1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f);
if (z!=0) {
sAng = sinf(z*((float)M_PI/180.0f));
cAng = cosf(z*((float)M_PI/180.0f));
mOut *= mat4(cAng, sAng, 0.0f, 0.0f, -sAng, cAng, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f);
}
if (y!=0) {
sAng = sinf(y*((float)M_PI/180.0f));
cAng = cosf(y*((float)M_PI/180.0f));
mOut *= mat4(cAng, 0.0f, -sAng, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, sAng, 0.0f, cAng, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f);
}
if (x!=0) {
sAng = sinf(x*((float)M_PI/180.0f));
cAng = cosf(x*((float)M_PI/180.0f));
mOut *= mat4(1.0f, 0.0f, 0.0f, 0.0f, 0.0f, cAng, sAng, 0.0f, 0.0f, -sAng, cAng, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f);
}
return mOut;
};
static mat4 scale(__float x, __float y, __float z) {
return mat4(x, 0.0f, 0.0f, 0.0f, 0.0f, y, 0.0f, 0.0f, 0.0f, 0.0f, z, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f);
};
static mat4 transform(vec3 position, vec3 rotation, vec3 scale) {
mat4 m = mat4::identity();
m *= mat4::translate(position[0],position[1],position[2]);
if (!(rotation[0] == 0 && rotation[1] == 0 && rotation[2] == 0)) {
m *= mat4::rotate(rotation[0], rotation[1], rotation[2]);
}
if (!(scale[0] == 1 && scale[1] == 1 && scale[2] == 1)) {
m *= mat4::scale(scale[0],scale[1],scale[2]);
}
return m;
};
static vec4 vec4_multiply(vec4 m1, mat4 m2) {
vec4 mOut;
mOut[0] = m2[0] * m1[0] + m2[4] * m1[1] + m2[8] * m1[2] + m2[12] * m1[3];
mOut[1] = m2[1] * m1[0] + m2[5] * m1[1] + m2[9] * m1[2] + m2[13] * m1[3];
mOut[2] = m2[2] * m1[0] + m2[6] * m1[1] + m2[10] * m1[2] + m2[14] * m1[3];
mOut[3] = m2[3] * m1[0] + m2[7] * m1[1] + m2[11] * m1[2] + m2[15] * m1[3];
return mOut;
};
static mat4 lookat(__float eyex, __float eyey, __float eyez, __float centerx, __float centery, __float centerz, __float upx, __float upy, __float upz) {
vec3 forward, side, up;
forward[0] = centerx - eyex;
forward[1] = centery - eyey;
forward[2] = centerz - eyez;
up[0] = upx;
up[1] = upy;
up[2] = upz;
forward = vec3::normalize(forward);
/* Side = forward x up */
side = vec3::cross(forward, up);
side = vec3::normalize(side);
/* Recompute up as: up = side x forward */
up = vec3::cross(side, forward);
return mat4::translate(-eyex,-eyey,-eyez) * mat4( side[0], up[0], -forward[0], 0, side[1], up[1], -forward[1], 0, side[2], up[2], -forward[2], 0, 0, 0, 0, 1);
};
static vec3 unProject(mat4 pMatrix, mat4 mvMatrix, float width, float height, float winx, float winy, float /* winz */) {
vec4 p(((winx / width) * 2.0f) - 1.0f, -(((winy / height) * 2.0f) - 1.0f), 1.0f, 1.0f);
vec4 invp = mat4::vec4_multiply(mat4::vec4_multiply(p, mat4::inverse(pMatrix)), mat4::inverse(mvMatrix));
vec3 result(invp[0] / invp[3], invp[1] / invp[3], invp[2] / invp[3]);
return result;
};
};
}
#endif /* defined(__CubicVR2__mat4__) */

View File

@ -0,0 +1,32 @@
//
// plane.h
// CubicVR2
//
// Created by Charles J. Cliffe on 2013-02-22.
// Copyright (c) 2013 Charles J. Cliffe. All rights reserved.
//
#ifndef CubicVR2_plane_h
#define CubicVR2_plane_h
#include "vec4.h"
#include "vec3.h"
namespace CubicVR {
struct plane : vec4 {
static int classifyPoint(vec4 plane, vec3 pt) {
__float dist = (plane[0] * pt[0]) + (plane[1] * pt[1]) + (plane[2] * pt[2]) + (plane[3]);
if (dist < 0) {
return -1;
}
else if (dist > 0) {
return 1;
}
return 0;
};
};
}
#endif

View File

@ -0,0 +1,100 @@
//
// quaternion.h
// CubicVR2
//
// Created by Charles J. Cliffe on 2013-02-22.
// Copyright (c) 2013 Charles J. Cliffe. All rights reserved.
//
#ifndef __CubicVR2__quaternion__
#define __CubicVR2__quaternion__
#include <iostream>
#include "vec4.h"
#include "mat4.h"
namespace CubicVR {
struct quaternion : vec4 {
static vec4 fromMatrix(mat4 mat) {
__float t = 1 + mat[0] + mat[5] + mat[10];
__float S,X,Y,Z,W;
if ( t > 0.00000001 ) {
S = sqrtf(t) * 2;
X = ( mat[9] - mat[6] ) / S;
Y = ( mat[2] - mat[8] ) / S;
Z = ( mat[4] - mat[1] ) / S;
W = 0.25f * S;
} else {
if ( mat[0] > mat[5] && mat[0] > mat[10] ) { // Column 0:
S = sqrtf( 1.0f + mat[0] - mat[5] - mat[10] ) * 2.0f;
X = 0.25f * S;
Y = (mat[4] + mat[1] ) / S;
Z = (mat[2] + mat[8] ) / S;
W = (mat[9] - mat[6] ) / S;
} else if ( mat[5] > mat[10] ) { // Column 1:
S = sqrtf( 1.0f + mat[5] - mat[0] - mat[10] ) * 2.0f;
X = (mat[4] + mat[1] ) / S;
Y = 0.25f * S;
Z = (mat[9] + mat[6] ) / S;
W = (mat[2] - mat[8] ) / S;
} else { // Column 2:
S = sqrtf( 1.0f + mat[10] - mat[0] - mat[5] ) * 2.0f;
X = (mat[2] + mat[8] ) / S;
Y = (mat[9] + mat[6] ) / S;
Z = 0.25f * S;
W = (mat[4] - mat[1] ) / S;
}
}
return vec4(X,Y,Z,W);
};
static vec4 fromEuler(__float bank, __float heading, __float pitch) { // x,y,z
__float c1 = cosf(((float)M_PI / 180.0f) * heading / 2.0f);
__float s1 = sinf(((float)M_PI / 180.0f) * heading / 2.0f);
__float c2 = cosf(((float)M_PI / 180.0f) * pitch / 2.0f);
__float s2 = sinf(((float)M_PI / 180.0f) * pitch / 2.0f);
__float c3 = cosf(((float)M_PI / 180.0f) * bank / 2.0f);
__float s3 = sinf(((float)M_PI / 180.0f) * bank / 2.0f);
__float c1c2 = c1 * c2;
__float s1s2 = s1 * s2;
vec4 mOut;
mOut[0] = c1c2 * c3 - s1s2 * s3;
mOut[1] = c1c2 * s3 + s1s2 * c3;
mOut[2] = s1 * c2 * c3 + c1 * s2 * s3;
mOut[3] = c1 * s2 * c3 - s1 * c2 * s3;
return mOut;
};
static vec3 toEuler(vec4 q) {
__float sqx = q[0] * q[0];
__float sqy = q[1] * q[1];
__float sqz = q[2] * q[2];
__float sqw = q[3] * q[3];
__float x = (180.0f / (float)M_PI) * ((atan2f(2.0f * (q[1] * q[2] + q[0] * q[3]), (-sqx - sqy + sqz + sqw))));
__float y = (180.0f / (float)M_PI) * ((asinf(-2.0f * (q[0] * q[2] - q[1] * q[3]))));
__float z = (180.0f / (float)M_PI) * ((atan2f(2.0f * (q[0] * q[1] + q[2] * q[3]), (sqx - sqy - sqz + sqw))));
return vec3(x, y, z);
};
static vec4 multiply(vec4 q1, vec4 q2) {
__float x = q1[0] * q2[3] + q1[3] * q2[0] + q1[1] * q2[2] - q1[2] * q2[1];
__float y = q1[1] * q2[3] + q1[3] * q2[1] + q1[2] * q2[0] - q1[0] * q2[2];
__float z = q1[2] * q2[3] + q1[3] * q2[2] + q1[0] * q2[1] - q1[1] * q2[0];
__float w = q1[3] * q2[3] - q1[0] * q2[0] - q1[1] * q2[1] - q1[2] * q2[2];
return vec4(x,y,z,w);
};
};
}
#endif /* defined(__CubicVR2__quaternion__) */

View File

@ -0,0 +1,34 @@
//
// sphere.h
// CubicVR2
//
// Created by Charles J. Cliffe on 2013-02-22.
// Copyright (c) 2013 Charles J. Cliffe. All rights reserved.
//
#ifndef CubicVR2_sphere_h
#define CubicVR2_sphere_h
#include "vec3.h"
#include "vec4.h"
namespace CubicVR {
struct sphere {
bool intersects(vec4 sphere, vec4 other) {
vec3 spherePos(sphere[0], sphere[1], sphere[2]);
vec3 otherPos(other[0], other[1], other[2]);
vec3 diff = vec3::subtract(spherePos, otherPos);
__float mag = sqrtf(diff[0] * diff[0] + diff[1] * diff[1] + diff[2] * diff[2]);
__float sum_radii = sphere[3] + other[3];
if (mag * mag < sum_radii * sum_radii) {
return true;
}
return false;
}
};
}
#endif

View File

@ -0,0 +1,171 @@
//
// Transform.h
// CubicVR2
//
// Created by Charles J. Cliffe on 2013-02-22.
// Copyright (c) 2013 Charles J. Cliffe. All rights reserved.
//
#ifndef __CubicVR2__Transform__
#define __CubicVR2__Transform__
#include <iostream>
#include "cubic_types.h"
#include "mat4.h"
#include "vec3.h"
#include <vector>
namespace CubicVR {
class transform {
std::vector<mat4> m_stack;
std::vector<mat4> m_cache;
int c_stack;
int valid;
mat4 result;
transform() {
c_stack = 0;
valid = false;
result = mat4::identity();
};
transform(mat4 init_mat) {
clearStack(init_mat);
};
void setIdentity() {
m_stack[c_stack] = mat4(1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f);
if (valid == c_stack && c_stack) {
valid--;
}
}
mat4 getIdentity() {
return mat4(1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f);
}
void invalidate() {
valid = 0;
result = mat4::identity();
}
mat4 getResult() {
if (!c_stack) {
return m_stack[0];
}
mat4 m = getIdentity();
if (valid > c_stack-1) valid = c_stack-1;
for (int i = valid; i < c_stack+1; i++) {
m = mat4::multiply(m, m_stack[i], true);
m_cache[i] = m;
}
valid = c_stack-1;
result = m_cache[c_stack];
return result;
}
void pushMatrix(mat4 m) {
c_stack++;
m_stack[c_stack] = m;
}
void popMatrix() {
if (c_stack == 0) {
return;
}
c_stack--;
}
void clearStack(mat4 init_mat) {
m_stack.clear();
m_cache.clear();
c_stack = 0;
valid = 0;
result = mat4::identity();
m_stack[0] = init_mat;
}
void translate(__float x, __float y, __float z) {
mat4 m = getIdentity();
m[12] = x;
m[13] = y;
m[14] = z;
m_stack[c_stack] = mat4::multiply(m, m_stack[c_stack], true);
if (valid == c_stack && c_stack) {
valid--;
}
}
void scale(__float x, __float y, __float z) {
mat4 m = getIdentity();
m[0] = x;
m[5] = y;
m[10] = z;
m_stack[c_stack] = mat4::multiply(m, m_stack[c_stack], true);
if (valid == c_stack && c_stack) {
valid--;
}
}
void rotate(__float ang, __float x, __float y, __float z) {
__float sAng, cAng;
if (x || y || z) {
sAng = sin(-ang * ((float)M_PI / 180.0f));
cAng = cos(-ang * ((float)M_PI / 180.0f));
}
if (x) {
mat4 X_ROT = getIdentity();
X_ROT[5] = cAng * x;
X_ROT[9] = sAng * x;
X_ROT[6] = -sAng * x;
X_ROT[10] = cAng * x;
m_stack[c_stack] = mat4::multiply(m_stack[c_stack], X_ROT, true);
}
if (y) {
mat4 Y_ROT = getIdentity();
Y_ROT[0] = cAng * y;
Y_ROT[8] = -sAng * y;
Y_ROT[2] = sAng * y;
Y_ROT[10] = cAng * y;
m_stack[c_stack] = mat4::multiply(m_stack[c_stack], Y_ROT, true);
}
if (z) {
mat4 Z_ROT = getIdentity();
Z_ROT[0] = cAng * z;
Z_ROT[4] = sAng * z;
Z_ROT[1] = -sAng * z;
Z_ROT[5] = cAng * z;
m_stack[c_stack] = mat4::multiply(m_stack[c_stack], Z_ROT, true);
}
if (valid == c_stack && c_stack) {
valid--;
}
};
};
}
#endif /* defined(__CubicVR2__Transform__) */

View File

@ -0,0 +1,40 @@
//
// triangle.h
// CubicVR2
//
// Created by Charles J. Cliffe on 2013-02-22.
// Copyright (c) 2013 Charles J. Cliffe. All rights reserved.
//
#ifndef __CubicVR2__triangle__
#define __CubicVR2__triangle__
#include <iostream>
#include "vec3.h"
namespace CubicVR {
struct triangle {
static vec3 normal(vec3 pt1, vec3 pt2, vec3 pt3) {
__float v10 = pt1[0] - pt2[0];
__float v11 = pt1[1] - pt2[1];
__float v12 = pt1[2] - pt2[2];
__float v20 = pt2[0] - pt3[0];
__float v21 = pt2[1] - pt3[1];
__float v22 = pt2[2] - pt3[2];
vec3 mOut;
mOut[0] = v11 * v22 - v12 * v21;
mOut[1] = v12 * v20 - v10 * v22;
mOut[2] = v10 * v21 - v11 * v20;
return mOut;
};
};
}
#endif /* defined(__CubicVR2__triangle__) */

View File

@ -0,0 +1,101 @@
//
// vec2.h
// CubicVR2
//
// Created by Charles J. Cliffe on 2013-02-22.
// Copyright (c) 2013 Charles J. Cliffe. All rights reserved.
//
#ifndef __CubicVR2__vec2__
#define __CubicVR2__vec2__
#include <iostream>
#include <cmath>
#include "cubic_types.h"
#include <stddef.h>
namespace CubicVR {
#define vec2SG(c,x,y) \
vec2 COMBINE(get,x)() { return y; } \
c & COMBINE(set,x)(vec2 value) { y = value; return *this; }
struct vec2 {
__float x, y;
public:
__float& u() { return x; }
__float& v() { return y; }
//access as-array:
inline __float& operator [] (size_t i) {
__float* as_array = (__float*)this;
return (as_array[i]);
}
inline const __float& operator [] (size_t i) const {
__float* as_array = (__float*)this;
return (as_array[i]);
}
vec2 (__float xi,__float yi) { x = xi; y = yi; }
vec2 () { x = y = 0.0f; }
vec2 operator*(__float v) { return vec2( x*v, y*v ); }
// vec2 operator*(vec2 v) { return vec2::cross(*this,v); }
vec2 operator+(vec2 v) { return vec2::add(*this,v); }
vec2 operator-(vec2 v) { return vec2::subtract(*this,v); }
static bool equal(vec2 a, vec2 b, __float epsilon = 0.00000001) {
return (fabs(a[0] - b[0]) < epsilon && fabs(a[1] - b[1]) < epsilon);
};
static bool onLine(vec2 a, vec2 b,vec2 c) {
__float minx = (a[0]<b[0])?a[0]:b[0];
__float miny = (a[1]<b[1])?a[1]:b[1];
__float maxx = (a[0]>b[0])?a[0]:b[0];
__float maxy = (a[1]>b[1])?a[1]:b[1];
if ((minx <= c[0] && c[0] <= maxx) && (miny <= c[1] && c[1] <= maxy)) {
return true;
} else {
return false;
}
};
static vec2 lineIntersect(vec2 a1, vec2 a2, vec2 b1, vec2 b2) {
__float x1 = a1[0], y1 = a1[1], x2 = a2[0], y2 = a2[1];
__float x3 = b1[0], y3 = b1[1], x4 = b2[0], y4 = b2[1];
__float d = ((x1-x2) * (y3-y4)) - ((y1-y2) * (x3-x4));
if (d == 0) return vec2(INFINITY,INFINITY);
__float xi = (((x3-x4) * ((x1*y2)-(y1*x2))) - ((x1-x2) *((x3*y4)-(y3*x4))))/d;
__float yi = (((y3-y4) * ((x1*y2)-(y1*x2))) - ((y1-y2) *((x3*y4)-(y3*x4))))/d;
return vec2( xi,yi );
};
static vec2 add(vec2 a,vec2 b) {
return vec2(a[0]+b[0],a[1]+b[1]);
};
static vec2 subtract(vec2 a, vec2 b) {
return vec2(a[0]-b[0],a[1]-b[1]);
};
static __float length(vec2 a,vec2 b) {
vec2 s(a[0]-b[0],a[1]-b[1]);
return sqrtf(s[0]*s[0]+s[1]*s[1]);
};
static __float length(vec2 a) {
return sqrtf(a[0]*a[0]+a[1]*a[1]);
};
};
}
#endif /* defined(__CubicVR2__vec2__) */

View File

@ -0,0 +1,178 @@
//
// vec3.h
// CubicVR2
//
// Created by Charles J. Cliffe on 2013-02-21.
// Copyright (c) 2013 Charles J. Cliffe. All rights reserved.
//
#ifndef __CubicVR2__vec3__
#define __CubicVR2__vec3__
#include <iostream>
#include "cubic_types.h"
#include <cmath>
#include <stddef.h>
namespace CubicVR {
#define vec3SG(c,x,y) \
vec3 COMBINE(get,x)() { return y; } \
c & COMBINE(set,x)(vec3 value) { y = value; return *this; }
struct vec3 {
__float x,y,z;
__float& r() { return x; }
__float& g() { return y; }
__float& b() { return z; }
//access as-array:
inline __float& operator [] (size_t i) {
__float* as_array = (__float*)this;
return (as_array[i]);
}
inline const __float& operator [] (size_t i) const {
__float* as_array = (__float*)this;
return (as_array[i]);
}
vec3 (__float xi,__float yi,__float zi) { x = xi; y = yi; z = zi; }
vec3 () { x = y = z = 0.0f; }
vec3 operator*(__float v) { return vec3(x*v, y*v, z*v); }
vec3 operator*(vec3 v) { return vec3::cross(*this,v); }
vec3 operator+(vec3 v) { return vec3::add(*this,v); }
vec3 operator-(vec3 v) { return vec3::subtract(*this,v); }
static __float length(vec3 pta, vec3 ptb) {
__float a,b,c;
a = ptb[0]-pta[0];
b = ptb[1]-pta[1];
c = ptb[2]-pta[2];
return sqrtf((a*a) + (b*b) + (c*c));
};
static __float length(vec3 pta) {
__float a,b,c;
a = pta[0];
b = pta[1];
c = pta[2];
return sqrtf((a*a) + (b*b) + (c*c));
};
static vec3 normalize(vec3 pt) {
__float a = pt[0], b = pt[1], c = pt[2],
d = sqrtf((a*a) + (b*b) + (c*c));
if (d) {
pt[0] = pt[0]/d;
pt[1] = pt[1]/d;
pt[2] = pt[2]/d;
return pt;
}
pt = vec3(0.0f,0.0f,0.0f);
return pt;
};
static __float dot(vec3 v1, vec3 v2) {
return v1[0] * v2[0] + v1[1] * v2[1] + v1[2] * v2[2];
};
static __float angle(vec3 v1, vec3 v2) {
__float a = acosf((v1[0] * v2[0] + v1[1] * v2[1] + v1[2] * v2[2]) / (sqrtf(v1[0] * v1[0] + v1[1] * v1[1] + v1[2] * v1[2]) * sqrtf(v2[0] * v2[0] + v2[1] * v2[1] + v2[2] * v2[2])));
return a;
};
static vec3 cross(vec3 vectA, vec3 vectB) {
return vec3(
vectA[1] * vectB[2] - vectB[1] * vectA[2], vectA[2] * vectB[0] - vectB[2] * vectA[0], vectA[0] * vectB[1] - vectB[0] * vectA[1]
);
};
static vec3 multiply(vec3 vectA, __float constB) {
return vec3(vectA[0] * constB, vectA[1] * constB, vectA[2] * constB);
};
static vec3 add(vec3 vectA, vec3 vectB) {
return vec3(vectA[0] + vectB[0], vectA[1] + vectB[1], vectA[2] + vectB[2]);
};
static vec3 subtract(vec3 vectA, vec3 vectB) {
return vec3(vectA[0] - vectB[0], vectA[1] - vectB[1], vectA[2] - vectB[2]);
};
static bool equal(vec3 a, vec3 b, __float epsilon = 0.0000001f) {
return ((fabs(a[0] - b[0]) < epsilon) && (fabs(a[1] - b[1]) < epsilon) && (fabs(a[2] - b[2]) < epsilon));
};
static vec3 moveViewRelative(vec3 position, vec3 target, __float xdelta, __float zdelta) {
__float ang = atan2f(zdelta, xdelta);
__float cam_ang = atan2f(target[2] - position[2], target[0] - position[0]);
__float mag = sqrtf(xdelta * xdelta + zdelta * zdelta);
__float move_ang = cam_ang + ang + (float)M_PI/2.0f;
// if (typeof(alt_source) === 'object') {
// return [alt_source[0] + mag * Math.cos(move_ang), alt_source[1], alt_source[2] + mag * Math.sin(move_ang)];
// }
return vec3(position[0] + mag * cosf(move_ang), position[1], position[2] + mag * sinf(move_ang));
};
static vec3 trackTarget(vec3 position, vec3 target, __float trackingSpeed, __float safeDistance) {
vec3 camv = vec3::subtract(target, position);
vec3 dist = camv;
__float fdist = vec3::length(dist);
vec3 motionv = camv;
motionv = vec3::normalize(motionv);
motionv = vec3::multiply(motionv, trackingSpeed * (1.0f / (1.0f / (fdist - safeDistance))));
vec3 ret_pos;
if (fdist > safeDistance) {
ret_pos = vec3::add(position, motionv);
} else if (fdist < safeDistance) {
motionv = camv;
motionv = vec3::normalize(motionv);
motionv = vec3::multiply(motionv, trackingSpeed * (1.0f / (1.0f / (fabsf(fdist - safeDistance)))));
ret_pos = vec3::subtract(position, motionv);
} else {
ret_pos = vec3(position[0], position[1] + motionv[2], position[2]);
}
return ret_pos;
};
static vec3 getClosestTo(vec3 ptA, vec3 ptB, vec3 ptTest) {
vec3 S, T, U;
S = vec3::subtract(ptB, ptA);
T = vec3::subtract(ptTest, ptA);
U = vec3::add(vec3::multiply(S, vec3::dot(S, T) / vec3::dot(S, S)), ptA);
return U;
};
// linePlaneIntersect: function(normal, point_on_plane, segment_start, segment_end)
// {
// // form a plane from normal and point_on_plane and test segment start->end to find intersect point
// var denom,mu;
//
// var d = - normal[0] * point_on_plane[0] - normal[1] * point_on_plane[1] - normal[2] * point_on_plane[2];
//
// // calculate position where the plane intersects the segment
// denom = normal[0] * (segment_end[0] - segment_start[0]) + normal[1] * (segment_end[1] - segment_start[1]) + normal[2] * (segment_end[2] - segment_start[2]);
// if (Math.fabs(denom) < 0.001) return false;
//
// mu = - (d + normal[0] * segment_start[0] + normal[1] * segment_start[1] + normal[2] * segment_start[2]) / denom;
// return [
// (segment_start[0] + mu * (segment_end[0] - segment_start[0])),
// (segment_start[1] + mu * (segment_end[1] - segment_start[1])),
// (segment_start[2] + mu * (segment_end[2] - segment_start[2]))
// ];
// }
};
}
#endif /* defined(__CubicVR2__vec3__) */

View File

@ -0,0 +1,80 @@
//
// vec4.h
// CubicVR2
//
// Created by Charles J. Cliffe on 2013-02-22.
// Copyright (c) 2013 Charles J. Cliffe. All rights reserved.
//
#ifndef __CubicVR2__vec4__
#define __CubicVR2__vec4__
#include <iostream>
#include "cubic_types.h"
#include <cmath>
#include <stddef.h>
namespace CubicVR {
#define vec4SG(c,x,y) \
vec3 COMBINE(get,x)() { return y; } \
c & COMBINE(set,x)(vec3 value) { y = value; return *this; }
struct vec4 {
__float x, y, z, w;
public:
__float& r() { return x; }
__float& g() { return y; }
__float& b() { return z; }
__float& a() { return w; }
//access as-array:
inline __float& operator [] (size_t i) {
__float* as_array = (__float*)this;
return (as_array[i]);
}
inline const __float& operator [] (size_t i) const {
__float* as_array = (__float*)this;
return (as_array[i]);
}
vec4 (__float xi,__float yi,__float zi,__float wi) { x = xi; y = yi; z = zi; w = wi; }
vec4 () { x = y = z = w = 0.0f; }
vec4 operator*(__float v) { return vec4(x*v, y*v, z*v, w*v); }
// vec4 operator*(vec4 v) { return vec4::cross(*this,v); }
// vec4 operator+(vec4 v) { return vec4::add(*this,v); }
// vec4 operator-(vec4 v) { return vec4::subtract(*this,v); }
static __float length(vec4 a, vec4 b) {
__float v[4] = {a[0]-b[0],a[1]-b[1],a[2]-b[2],a[3]-b[3]};
return sqrtf(v[0] * v[0] + v[1] * v[1] + v[2] * v[2] + v[3] * v[3]);
};
static __float length(vec4 v) {
return sqrtf(v[0] * v[0] + v[1] * v[1] + v[2] * v[2] + v[3] * v[3]);
};
static vec4 normalize(vec4 v) {
__float n = sqrtf(vec4::length(v));
v[0] /= n;
v[1] /= n;
v[2] /= n;
v[3] /= n;
return v;
};
static __float dot(vec4 v1, vec4 v2) {
return v1[0] * v2[0] + v1[1] * v2[1] + v1[2] * v2[2] + v1[3] * v2[3];
};
};
}
#endif /* defined(__CubicVR2__vec4__) */

View File

@ -0,0 +1,11 @@
#!/bin/sh
# found at https://github.com/paralect/robomongo/blob/master/install/linux/fixup_deb.sh.in
set -e
mkdir fix_up_deb
dpkg-deb -x @CPACK_PACKAGE_FILE_NAME@.deb fix_up_deb
dpkg-deb --control @CPACK_PACKAGE_FILE_NAME@.deb fix_up_deb/DEBIAN
rm @CPACK_PACKAGE_FILE_NAME@.deb
chmod 0644 fix_up_deb/DEBIAN/md5sums
find -type d -print0 | xargs -0 chmod 755
fakeroot dpkg -b fix_up_deb @CPACK_PACKAGE_FILE_NAME@.deb
rm -rf fix_up_deb

View File

@ -0,0 +1,408 @@
EXPORTS
CRC32_function @1
amp_check_backend @2
amp_cleanup @3
amp_close @4
amp_confparam_lookup @5
amp_ext_lookup @6
amp_get_caps @7
amp_get_conf @8
amp_get_ext_level @9
amp_get_freq @10
amp_get_info @11
amp_get_level @12
amp_get_powerstat @13
amp_has_get_level @14
amp_init @15
amp_list_foreach @16
amp_load_all_backends @17
amp_load_backend @18
amp_open @19
amp_parse_level @20
amp_probe_all @21
amp_register @22
amp_reset @23
amp_set_conf @24
amp_set_freq @25
amp_set_powerstat @26
amp_sprintf_level @27
amp_strlevel @28
amp_token_lookup @29
amp_unregister @30
azimuth_long_path @31
cookie_use @32 DATA
debugmsgsave @33 DATA
debugmsgsave2 @34 DATA
debugmsgsave3 @35 DATA
dec2dmmm @36
dec2dms @37
distance_long_path @38
dmmm2dec @39
dms2dec @40
dot10ths_to_millis @41
dump_hex @42
elapsed_ms @43
from_bcd @44
from_bcd_be @45
get_rig_conf_type @46
hamlib_copyright @47 DATA
hamlib_copyright2 @48 DATA
hamlib_version @49 DATA
hamlib_version2 @50 DATA
hl_usleep @51
initamps4_dummy @52
initamps4_kpa1500 @53
initrigs4_adat @54
initrigs4_alinco @55
initrigs4_aor @56
initrigs4_barrett @57
initrigs4_dorji @58
initrigs4_drake @59
initrigs4_dummy @60
initrigs4_elad @61
initrigs4_flexradio @62
initrigs4_icm710 @63
initrigs4_icmarine @64
initrigs4_icom @65
initrigs4_jrc @66
initrigs4_kachina @67
initrigs4_kenwood @68
initrigs4_kit @69
initrigs4_lowe @70
initrigs4_pcr @71
initrigs4_prm80 @72
initrigs4_racal @73
initrigs4_rft @74
initrigs4_rs @75
initrigs4_skanti @76
initrigs4_tapr @77
initrigs4_tentec @78
initrigs4_tuner @79
initrigs4_uniden @80
initrigs4_winradio @81
initrigs4_wj @82
initrigs4_yaesu @83
initrots4_amsat @84
initrots4_ars @85
initrots4_celestron @86
initrots4_cnctrk @87
initrots4_dummy @88
initrots4_easycomm @89
initrots4_ether6 @90
initrots4_fodtrack @91
initrots4_gs232a @92
initrots4_heathkit @93
initrots4_ioptron @94
initrots4_kit @95
initrots4_m2 @96
initrots4_meade @97
initrots4_prosistel @98
initrots4_radant @99
initrots4_rotorez @100
initrots4_sartek @101
initrots4_satel @102
initrots4_spid @103
initrots4_ts7400 @104
locator2longlat @105
longlat2locator @106
millis_to_dot10ths @107
morse_code_dot_to_millis @108
netrigctl_get_vfo_mode @109
network_multicast_server @110
par_lock @111
par_read_control @112
par_read_data @113
par_read_status @114
par_unlock @115
par_write_control @116
par_write_data @117
parse_hoststr @118
port_close @119
port_open @120
print_ext_param @121
probeallrigs4_adat @122
probeallrigs4_drake @123
probeallrigs4_elad @124
probeallrigs4_icom @125
probeallrigs4_kenwood @126
probeallrigs4_lowe @127
probeallrigs4_uniden @128
probeallrigs4_yaesu @129
qrb @130
read_block @131
read_string @132
rig_check_backend @133
rig_check_cache_timeout @134
rig_cleanup @135
rig_close @136
rig_confparam_lookup @137
rig_cookie @138
rig_copyright @139
rig_debug @140
rig_ext_func_foreach @141
rig_ext_level_foreach @142
rig_ext_lookup @143
rig_ext_lookup_tok @144
rig_ext_parm_foreach @145
rig_ext_token_lookup @146
rig_flush @147
rig_force_cache_timeout @148
rig_get_ant @149
rig_get_cache @150
rig_get_cache_timeout_ms @151
rig_get_caps @152
rig_get_caps_cptr @153
rig_get_caps_int @154
rig_get_chan_all @155
rig_get_chan_all_cb @156
rig_get_channel @157
rig_get_clock @158
rig_get_conf @159
rig_get_ctcss_sql @160
rig_get_ctcss_tone @161
rig_get_dcd @162
rig_get_dcs_code @163
rig_get_dcs_sql @164
rig_get_ext_func @165
rig_get_ext_level @166
rig_get_ext_parm @167
rig_get_freq @168
rig_get_func @169
rig_get_function_ptr @170
rig_get_info @171
rig_get_level @172
rig_get_mem @173
rig_get_mem_all @174
rig_get_mem_all_cb @175
rig_get_mode @176
rig_get_parm @177
rig_get_powerstat @178
rig_get_ptt @179
rig_get_range @180
rig_get_resolution @181
rig_get_rig_info @182
rig_get_rit @183
rig_get_rptr_offs @184
rig_get_rptr_shift @185
rig_get_split_freq @186
rig_get_split_freq_mode @187
rig_get_split_mode @188
rig_get_split_vfo @189
rig_get_trn @190
rig_get_ts @191
rig_get_twiddle @192
rig_get_vfo @193
rig_get_vfo_info @194
rig_get_vfo_list @195
rig_get_xit @196
rig_has_get_func @197
rig_has_get_level @198
rig_has_get_parm @199
rig_has_scan @200
rig_has_set_func @201
rig_has_set_level @202
rig_has_set_parm @203
rig_has_vfo_op @204
rig_idx2setting @205
rig_init @206
rig_license @207
rig_list_foreach @208
rig_list_foreach_model @209
rig_load_all_backends @210
rig_load_backend @211
rig_lookup_mem_caps @212
rig_mW2power @213
rig_mem_count @214
rig_need_debug @215
rig_no_restore_ai @216
rig_open @217
rig_parse_func @218
rig_parse_level @219
rig_parse_mode @220
rig_parse_mtype @221
rig_parse_parm @222
rig_parse_rptr_shift @223
rig_parse_scan @224
rig_parse_vfo @225
rig_parse_vfo_op @226
rig_passband_narrow @227
rig_passband_normal @228
rig_passband_wide @229
rig_power2mW @230
rig_probe @231
rig_probe_all @232
rig_raw2val @233
rig_raw2val_float @234
rig_recv_dtmf @235
rig_register @236
rig_reset @237
rig_scan @238
rig_send_dtmf @239
rig_send_morse @240
rig_send_voice_mem @241
rig_set_ant @242
rig_set_bank @243
rig_set_cache_timeout_ms @244
rig_set_chan_all @245
rig_set_chan_all_cb @246
rig_set_channel @247
rig_set_clock @248
rig_set_conf @249
rig_set_ctcss_sql @250
rig_set_ctcss_tone @251
rig_set_dcd_callback @252
rig_set_dcs_code @253
rig_set_dcs_sql @254
rig_set_debug @255
rig_set_debug_callback @256
rig_set_debug_file @257
rig_set_debug_time_stamp @258
rig_set_ext_func @259
rig_set_ext_level @260
rig_set_ext_parm @261
rig_set_freq @262
rig_set_freq_callback @263
rig_set_func @264
rig_set_level @265
rig_set_mem @266
rig_set_mem_all @267
rig_set_mem_all_cb @268
rig_set_mode @269
rig_set_mode_callback @270
rig_set_parm @271
rig_set_pltune_callback @272
rig_set_powerstat @273
rig_set_ptt @274
rig_set_ptt_callback @275
rig_set_rit @276
rig_set_rptr_offs @277
rig_set_rptr_shift @278
rig_set_spectrum_callback @279
rig_set_split_freq @280
rig_set_split_freq_mode @281
rig_set_split_mode @282
rig_set_split_vfo @283
rig_set_trn @284
rig_set_ts @285
rig_set_twiddle @286
rig_set_uplink @287
rig_set_vfo @288
rig_set_vfo_callback @289
rig_set_vfo_opt @290
rig_set_xit @291
rig_setting2idx @292
rig_sprintf_ant @293
rig_sprintf_func @294
rig_sprintf_level @295
rig_sprintf_level_gran @296
rig_sprintf_mode @297
rig_sprintf_parm @298
rig_sprintf_parm_gran @299
rig_sprintf_scan @300
rig_sprintf_spectrum_avg_modes @301
rig_sprintf_spectrum_modes @302
rig_sprintf_spectrum_spans @303
rig_sprintf_vfo @304
rig_sprintf_vfop @305
rig_stop_morse @306
rig_stragclevel @307
rig_strfunc @308
rig_strlevel @309
rig_strmtype @310
rig_strparm @311
rig_strptrshift @312
rig_strrmode @313
rig_strrmodes @314
rig_strscan @315
rig_strspectrummode @316
rig_strstatus @317
rig_strvfo @318
rig_strvfop @319
rig_token_foreach @320
rig_token_lookup @321
rig_unregister @322
rig_version @323
rig_vfo_op @324
rig_wait_morse @325
rigerror @326
rot_check_backend @327
rot_cleanup @328
rot_close @329
rot_confparam_lookup @330
rot_ext_func_foreach @331
rot_ext_level_foreach @332
rot_ext_lookup @333
rot_ext_lookup_tok @334
rot_ext_parm_foreach @335
rot_ext_token_lookup @336
rot_get_caps @337
rot_get_conf @338
rot_get_ext_func @339
rot_get_ext_level @340
rot_get_ext_parm @341
rot_get_func @342
rot_get_info @343
rot_get_level @344
rot_get_parm @345
rot_get_position @346
rot_get_status @347
rot_has_get_func @348
rot_has_get_level @349
rot_has_get_parm @350
rot_has_set_func @351
rot_has_set_level @352
rot_has_set_parm @353
rot_init @354
rot_list_foreach @355
rot_load_all_backends @356
rot_load_backend @357
rot_move @358
rot_open @359
rot_park @360
rot_parse_func @361
rot_parse_level @362
rot_parse_parm @363
rot_probe_all @364
rot_register @365
rot_reset @366
rot_set_conf @367
rot_set_ext_func @368
rot_set_ext_level @369
rot_set_ext_parm @370
rot_set_func @371
rot_set_level @372
rot_set_parm @373
rot_set_position @374
rot_sprintf_func @375
rot_sprintf_level @376
rot_sprintf_level_gran @377
rot_sprintf_parm @378
rot_sprintf_parm_gran @379
rot_sprintf_status @380
rot_stop @381
rot_strfunc @382
rot_strlevel @383
rot_strparm @384
rot_strstatus @385
rot_token_foreach @386
rot_token_lookup @387
rot_unregister @388
ser_get_car @389
ser_get_cts @390
ser_get_dsr @391
ser_get_dtr @392
ser_get_rts @393
ser_set_brk @394
ser_set_dtr @395
ser_set_rts @396
serial_flush @397
serial_open @398
serial_setup @399
sprintf_freq @400
sprintf_level_ext @401
sync_callback @402
to_bcd @403
to_bcd_be @404
vfo_fixup @405
vfo_fixup2a @406
write_block @407

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,408 @@
EXPORTS
CRC32_function @1
amp_check_backend @2
amp_cleanup @3
amp_close @4
amp_confparam_lookup @5
amp_ext_lookup @6
amp_get_caps @7
amp_get_conf @8
amp_get_ext_level @9
amp_get_freq @10
amp_get_info @11
amp_get_level @12
amp_get_powerstat @13
amp_has_get_level @14
amp_init @15
amp_list_foreach @16
amp_load_all_backends @17
amp_load_backend @18
amp_open @19
amp_parse_level @20
amp_probe_all @21
amp_register @22
amp_reset @23
amp_set_conf @24
amp_set_freq @25
amp_set_powerstat @26
amp_sprintf_level @27
amp_strlevel @28
amp_token_lookup @29
amp_unregister @30
azimuth_long_path @31
cookie_use @32 DATA
debugmsgsave @33 DATA
debugmsgsave2 @34 DATA
debugmsgsave3 @35 DATA
dec2dmmm @36
dec2dms @37
distance_long_path @38
dmmm2dec @39
dms2dec @40
dot10ths_to_millis @41
dump_hex @42
elapsed_ms @43
from_bcd @44
from_bcd_be @45
get_rig_conf_type @46
hamlib_copyright @47 DATA
hamlib_copyright2 @48 DATA
hamlib_version @49 DATA
hamlib_version2 @50 DATA
hl_usleep @51
initamps4_dummy @52
initamps4_kpa1500 @53
initrigs4_adat @54
initrigs4_alinco @55
initrigs4_aor @56
initrigs4_barrett @57
initrigs4_dorji @58
initrigs4_drake @59
initrigs4_dummy @60
initrigs4_elad @61
initrigs4_flexradio @62
initrigs4_icm710 @63
initrigs4_icmarine @64
initrigs4_icom @65
initrigs4_jrc @66
initrigs4_kachina @67
initrigs4_kenwood @68
initrigs4_kit @69
initrigs4_lowe @70
initrigs4_pcr @71
initrigs4_prm80 @72
initrigs4_racal @73
initrigs4_rft @74
initrigs4_rs @75
initrigs4_skanti @76
initrigs4_tapr @77
initrigs4_tentec @78
initrigs4_tuner @79
initrigs4_uniden @80
initrigs4_winradio @81
initrigs4_wj @82
initrigs4_yaesu @83
initrots4_amsat @84
initrots4_ars @85
initrots4_celestron @86
initrots4_cnctrk @87
initrots4_dummy @88
initrots4_easycomm @89
initrots4_ether6 @90
initrots4_fodtrack @91
initrots4_gs232a @92
initrots4_heathkit @93
initrots4_ioptron @94
initrots4_kit @95
initrots4_m2 @96
initrots4_meade @97
initrots4_prosistel @98
initrots4_radant @99
initrots4_rotorez @100
initrots4_sartek @101
initrots4_satel @102
initrots4_spid @103
initrots4_ts7400 @104
locator2longlat @105
longlat2locator @106
millis_to_dot10ths @107
morse_code_dot_to_millis @108
netrigctl_get_vfo_mode @109
network_multicast_server @110
par_lock @111
par_read_control @112
par_read_data @113
par_read_status @114
par_unlock @115
par_write_control @116
par_write_data @117
parse_hoststr @118
port_close @119
port_open @120
print_ext_param @121
probeallrigs4_adat @122
probeallrigs4_drake @123
probeallrigs4_elad @124
probeallrigs4_icom @125
probeallrigs4_kenwood @126
probeallrigs4_lowe @127
probeallrigs4_uniden @128
probeallrigs4_yaesu @129
qrb @130
read_block @131
read_string @132
rig_check_backend @133
rig_check_cache_timeout @134
rig_cleanup @135
rig_close @136
rig_confparam_lookup @137
rig_cookie @138
rig_copyright @139
rig_debug @140
rig_ext_func_foreach @141
rig_ext_level_foreach @142
rig_ext_lookup @143
rig_ext_lookup_tok @144
rig_ext_parm_foreach @145
rig_ext_token_lookup @146
rig_flush @147
rig_force_cache_timeout @148
rig_get_ant @149
rig_get_cache @150
rig_get_cache_timeout_ms @151
rig_get_caps @152
rig_get_caps_cptr @153
rig_get_caps_int @154
rig_get_chan_all @155
rig_get_chan_all_cb @156
rig_get_channel @157
rig_get_clock @158
rig_get_conf @159
rig_get_ctcss_sql @160
rig_get_ctcss_tone @161
rig_get_dcd @162
rig_get_dcs_code @163
rig_get_dcs_sql @164
rig_get_ext_func @165
rig_get_ext_level @166
rig_get_ext_parm @167
rig_get_freq @168
rig_get_func @169
rig_get_function_ptr @170
rig_get_info @171
rig_get_level @172
rig_get_mem @173
rig_get_mem_all @174
rig_get_mem_all_cb @175
rig_get_mode @176
rig_get_parm @177
rig_get_powerstat @178
rig_get_ptt @179
rig_get_range @180
rig_get_resolution @181
rig_get_rig_info @182
rig_get_rit @183
rig_get_rptr_offs @184
rig_get_rptr_shift @185
rig_get_split_freq @186
rig_get_split_freq_mode @187
rig_get_split_mode @188
rig_get_split_vfo @189
rig_get_trn @190
rig_get_ts @191
rig_get_twiddle @192
rig_get_vfo @193
rig_get_vfo_info @194
rig_get_vfo_list @195
rig_get_xit @196
rig_has_get_func @197
rig_has_get_level @198
rig_has_get_parm @199
rig_has_scan @200
rig_has_set_func @201
rig_has_set_level @202
rig_has_set_parm @203
rig_has_vfo_op @204
rig_idx2setting @205
rig_init @206
rig_license @207
rig_list_foreach @208
rig_list_foreach_model @209
rig_load_all_backends @210
rig_load_backend @211
rig_lookup_mem_caps @212
rig_mW2power @213
rig_mem_count @214
rig_need_debug @215
rig_no_restore_ai @216
rig_open @217
rig_parse_func @218
rig_parse_level @219
rig_parse_mode @220
rig_parse_mtype @221
rig_parse_parm @222
rig_parse_rptr_shift @223
rig_parse_scan @224
rig_parse_vfo @225
rig_parse_vfo_op @226
rig_passband_narrow @227
rig_passband_normal @228
rig_passband_wide @229
rig_power2mW @230
rig_probe @231
rig_probe_all @232
rig_raw2val @233
rig_raw2val_float @234
rig_recv_dtmf @235
rig_register @236
rig_reset @237
rig_scan @238
rig_send_dtmf @239
rig_send_morse @240
rig_send_voice_mem @241
rig_set_ant @242
rig_set_bank @243
rig_set_cache_timeout_ms @244
rig_set_chan_all @245
rig_set_chan_all_cb @246
rig_set_channel @247
rig_set_clock @248
rig_set_conf @249
rig_set_ctcss_sql @250
rig_set_ctcss_tone @251
rig_set_dcd_callback @252
rig_set_dcs_code @253
rig_set_dcs_sql @254
rig_set_debug @255
rig_set_debug_callback @256
rig_set_debug_file @257
rig_set_debug_time_stamp @258
rig_set_ext_func @259
rig_set_ext_level @260
rig_set_ext_parm @261
rig_set_freq @262
rig_set_freq_callback @263
rig_set_func @264
rig_set_level @265
rig_set_mem @266
rig_set_mem_all @267
rig_set_mem_all_cb @268
rig_set_mode @269
rig_set_mode_callback @270
rig_set_parm @271
rig_set_pltune_callback @272
rig_set_powerstat @273
rig_set_ptt @274
rig_set_ptt_callback @275
rig_set_rit @276
rig_set_rptr_offs @277
rig_set_rptr_shift @278
rig_set_spectrum_callback @279
rig_set_split_freq @280
rig_set_split_freq_mode @281
rig_set_split_mode @282
rig_set_split_vfo @283
rig_set_trn @284
rig_set_ts @285
rig_set_twiddle @286
rig_set_uplink @287
rig_set_vfo @288
rig_set_vfo_callback @289
rig_set_vfo_opt @290
rig_set_xit @291
rig_setting2idx @292
rig_sprintf_ant @293
rig_sprintf_func @294
rig_sprintf_level @295
rig_sprintf_level_gran @296
rig_sprintf_mode @297
rig_sprintf_parm @298
rig_sprintf_parm_gran @299
rig_sprintf_scan @300
rig_sprintf_spectrum_avg_modes @301
rig_sprintf_spectrum_modes @302
rig_sprintf_spectrum_spans @303
rig_sprintf_vfo @304
rig_sprintf_vfop @305
rig_stop_morse @306
rig_stragclevel @307
rig_strfunc @308
rig_strlevel @309
rig_strmtype @310
rig_strparm @311
rig_strptrshift @312
rig_strrmode @313
rig_strrmodes @314
rig_strscan @315
rig_strspectrummode @316
rig_strstatus @317
rig_strvfo @318
rig_strvfop @319
rig_token_foreach @320
rig_token_lookup @321
rig_unregister @322
rig_version @323
rig_vfo_op @324
rig_wait_morse @325
rigerror @326
rot_check_backend @327
rot_cleanup @328
rot_close @329
rot_confparam_lookup @330
rot_ext_func_foreach @331
rot_ext_level_foreach @332
rot_ext_lookup @333
rot_ext_lookup_tok @334
rot_ext_parm_foreach @335
rot_ext_token_lookup @336
rot_get_caps @337
rot_get_conf @338
rot_get_ext_func @339
rot_get_ext_level @340
rot_get_ext_parm @341
rot_get_func @342
rot_get_info @343
rot_get_level @344
rot_get_parm @345
rot_get_position @346
rot_get_status @347
rot_has_get_func @348
rot_has_get_level @349
rot_has_get_parm @350
rot_has_set_func @351
rot_has_set_level @352
rot_has_set_parm @353
rot_init @354
rot_list_foreach @355
rot_load_all_backends @356
rot_load_backend @357
rot_move @358
rot_open @359
rot_park @360
rot_parse_func @361
rot_parse_level @362
rot_parse_parm @363
rot_probe_all @364
rot_register @365
rot_reset @366
rot_set_conf @367
rot_set_ext_func @368
rot_set_ext_level @369
rot_set_ext_parm @370
rot_set_func @371
rot_set_level @372
rot_set_parm @373
rot_set_position @374
rot_sprintf_func @375
rot_sprintf_level @376
rot_sprintf_level_gran @377
rot_sprintf_parm @378
rot_sprintf_parm_gran @379
rot_sprintf_status @380
rot_stop @381
rot_strfunc @382
rot_strlevel @383
rot_strparm @384
rot_strstatus @385
rot_token_foreach @386
rot_token_lookup @387
rot_unregister @388
ser_get_car @389
ser_get_cts @390
ser_get_dsr @391
ser_get_dtr @392
ser_get_rts @393
ser_set_brk @394
ser_set_dtr @395
ser_set_rts @396
serial_flush @397
serial_open @398
serial_setup @399
sprintf_freq @400
sprintf_level_ext @401
sync_callback @402
to_bcd @403
to_bcd_be @404
vfo_fixup @405
vfo_fixup2a @406
write_block @407

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,15 @@
The Hamlib specific dependencies on Windows platforms are:
- libwinpthread-1.dll
for both x86 and x64,
and also
- libgcc_s_sjlj-1.dll for x86 targets only.
Those dependencies are installed from external/msvc/[x86|x64] dirs.
In addition, Hamlib also uses libusb but since it is a common
dependency with SoapySDR, it is not included in the external dirs.
For Hamlib v4.x releases, only the export file 'libhamlib-4.def' is provided, so we need to re-generate .lib to work on Visual Studio projects:
- Open the 'Developper Command Prompt for VS 2022'
- For Win32, go to hamlib/32 directory and run 'LIB /DEF:libhamlib-4.def /MACHINE:X86'
- For Win64, go to hamlib/64 directory and run 'LIB /DEF:libhamlib-4.def /MACHINE:X64'

View File

@ -0,0 +1,446 @@
/*
* Hamlib Interface - Amplifier API header
* Copyright (c) 2000-2005 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifndef _AMPLIFIER_H
#define _AMPLIFIER_H 1
#include <hamlib/rig.h>
#include <hamlib/amplist.h>
/**
* \addtogroup amplifier
* @{
*/
/**
* \brief Hamlib amplifier data structures.
*
* \file amplifier.h
*
* This file contains the data structures and declarations for the Hamlib
* amplifier Application Programming Interface (API).
*
* See the amplifier.c file for details on the amplifier API functions.
*/
__BEGIN_DECLS
/* Forward struct references */
struct amp;
struct amp_state;
/**
* \brief Main amplifier handle type definition.
*
* \typedef typedef struct amp AMP
*
* The #AMP handle is returned by amp_init() and is passed as a parameter to
* every amplifier specific API call.
*
* amp_cleanup() must be called when this handle is no longer needed.
*/
typedef struct amp AMP;
/**
* \brief Type definition for
* <a href="https://en.wikipedia.org/wiki/Standing_wave_ratio" >SWR (Standing Wave Ratio)</a>.
*
* \typedef typedef float swr_t
*
* The \a swr_t type is used as a parameter for the amp_get_swr() function.
*
* The unit of \a swr_t is 1.0 to the maximum value reported by the amplifier's
* internal antenna system tuner, i.e.
* <a href="http://www.arrl.org/transmatch-antenna-tuner" >transmatch</a>,
* representing the ratio of 1.0:1 to Maximum:1.
*/
typedef float swr_t;
/**
* \brief Type definition for the
* <a href="http://www.arrl.org/transmatch-antenna-tuner" >transmatch</a>
* tuning values of
* <a href="https://en.wikipedia.org/wiki/Capacitance" >capacitance</a>
* and
* <a href="https://en.wikipedia.org/wiki/Inductance" >inductance</a>.
*
* \typedef typedef float tune_value_t
*
* The \a tune_value_t type is used as a parameter for amp_get_level().
*
* The unit of \a tune_value_t is
* <a href="https://en.wikipedia.org/wiki/Farad" >picoFarads (pF)</a>
* or
* <a href="https://en.wikipedia.org/wiki/Henry_(unit)" >nanoHenrys (nH)</a>.
*/
typedef int tune_value_t;
/**
* \brief The token in the netampctl protocol for returning an error condition code.
*/
#define NETAMPCTL_RET "RPRT "
//! @cond Doxygen_Suppress
typedef enum
{
AMP_RESET_MEM, // erase tuner memory
AMP_RESET_FAULT, // reset any fault
AMP_RESET_AMP // for kpa1500
} amp_reset_t;
//! @endcond
/**
* \brief Amplifier type flags
*/
typedef enum
{
AMP_FLAG_1 = (1 << 1), /*!< TBD */
AMP_FLAG_2 = (1 << 2) /*!< TBD */
} amp_type_t;
//! @cond Doxygen_Suppress
// TBD AMP_TYPE
#define AMP_TYPE_MASK (AMP_FLAG_1|AMP_FLAG_2)
#define AMP_TYPE_OTHER 0
#define AMP_TYPE_1 AMP_FLAG_1
#define AMP_TYPE_2 AMP_FLAG_2
#define AMP_TYPE_ALL (AMP_FLAG_1|AMP_FLAG_2)
//! @endcond
//! @cond Doxygen_Suppress
enum amp_level_e
{
AMP_LEVEL_NONE = 0, /*!< '' -- No Level. */
AMP_LEVEL_SWR = (1 << 0), /*!< \c SWR 1.0 or greater. */
AMP_LEVEL_NH = (1 << 1), /*!< \c Tune setting in nanohenries. */
AMP_LEVEL_PF = (1 << 2), /*!< \c Tune setting in picofarads. */
AMP_LEVEL_PWR_INPUT = (1 << 3), /*!< \c Power reading from amplifier. */
AMP_LEVEL_PWR_FWD = (1 << 4), /*!< \c Power reading forward. */
AMP_LEVEL_PWR_REFLECTED = (1 << 5), /*!< \c Power reading reverse. */
AMP_LEVEL_PWR_PEAK = (1 << 6), /*!< \c Power reading peak. */
AMP_LEVEL_FAULT = (1 << 7) /*!< \c Fault code. */
};
//! @endcond
//! @cond Doxygen_Suppress
#define AMP_LEVEL_FLOAT_LIST (AMP_LEVEL_SWR)
#define AMP_LEVEL_STRING_LIST (AMP_LEVEL_FAULT)
#define AMP_LEVEL_IS_FLOAT(l) ((l)&AMP_LEVEL_FLOAT_LIST)
#define AMP_LEVEL_IS_STRING(l) ((l)&AMP_LEVEL_STRING_LIST)
//! @endcond
/* Basic amp type, can store some useful info about different amplifiers. Each
* lib must be able to populate this structure, so we can make useful
* enquiries about capabilities.
*/
//! @cond Doxygen_Suppress
#define AMP_MODEL(arg) .amp_model=arg,.macro_name=#arg
//! @endcond
/**
* \brief Amplifier capabilities.
*
* \struct amp_caps
*
* The main idea of this struct is that it will be defined by the backend
* amplifier driver and will remain read-only for the application. Fields
* that need to be modifiable by the application are copied into the
* amp_state structure, which is the private memory area of the #AMP instance.
*
* This way you can have several amplifiers running within the same
* application, sharing the amp_caps structure of the backend, while keeping
* their own customized data.
*
* \b Note: Don't move fields around and only add new fields at the end of the
* amp_caps structure. Shared libraries and DLLs depend on a constant
* structure to maintain compatibility.
*/
struct amp_caps
{
amp_model_t amp_model; /*!< Amplifier model as defined in amplist.h. */
const char *model_name; /*!< Model name, e.g. MM-5k. */
const char *mfg_name; /*!< Manufacturer, e.g. Moonbeam. */
const char *version; /*!< Driver version, typically in YYYYMMDD.x format. */
const char *copyright; /*!< Copyright info (should be LGPL). */
enum rig_status_e status; /*!< Driver status. */
int amp_type; /*!< Amplifier type. */
enum rig_port_e port_type; /*!< Type of communication port (serial, ethernet, etc.). */
int serial_rate_min; /*!< Minimal serial speed. */
int serial_rate_max; /*!< Maximal serial speed. */
int serial_data_bits; /*!< Number of data bits. */
int serial_stop_bits; /*!< Number of stop bits. */
enum serial_parity_e serial_parity; /*!< Parity. */
enum serial_handshake_e serial_handshake; /*!< Handshake. */
int write_delay; /*!< Write delay. */
int post_write_delay; /*!< Post-write delay. */
int timeout; /*!< Timeout. */
int retry; /*!< Number of retries if a command fails. */
const struct confparams *cfgparams; /*!< Configuration parameters. */
const rig_ptr_t priv; /*!< Private data. */
const char *amp_model_macro_name; /*!< Model macro name. */
setting_t has_get_level; /*!< List of get levels. */
setting_t has_set_level; /*!< List of set levels. */
gran_t level_gran[RIG_SETTING_MAX]; /*!< Level granularity. */
gran_t parm_gran[RIG_SETTING_MAX]; /*!< Parameter granularity. */
/*
* Amp Admin API
*
*/
int (*amp_init)(AMP *amp); /*!< Pointer to backend implementation of ::amp_init(). */
int (*amp_cleanup)(AMP *amp); /*!< Pointer to backend implementation of ::amp_cleanup(). */
int (*amp_open)(AMP *amp); /*!< Pointer to backend implementation of ::amp_open(). */
int (*amp_close)(AMP *amp); /*!< Pointer to backend implementation of ::amp_close(). */
int (*set_freq)(AMP *amp, freq_t val); /*!< Pointer to backend implementation of ::amp_set_freq(). */
int (*get_freq)(AMP *amp, freq_t *val); /*!< Pointer to backend implementation of ::amp_get_freq(). */
int (*set_conf)(AMP *amp, token_t token, const char *val); /*!< Pointer to backend implementation of ::amp_set_conf(). */
int (*get_conf)(AMP *amp, token_t token, char *val); /*!< Pointer to backend implementation of ::amp_get_conf(). */
/*
* General API commands, from most primitive to least.. :()
* List Set/Get functions pairs
*/
int (*reset)(AMP *amp, amp_reset_t reset); /*!< Pointer to backend implementation of ::amp_reset(). */
int (*get_level)(AMP *amp, setting_t level, value_t *val); /*!< Pointer to backend implementation of ::amp_get_level(). */
int (*get_ext_level)(AMP *amp, token_t level, value_t *val); /*!< Pointer to backend implementation of ::amp_get_ext_level(). */
int (*set_powerstat)(AMP *amp, powerstat_t status); /*!< Pointer to backend implementation of ::amp_set_powerstat(). */
int (*get_powerstat)(AMP *amp, powerstat_t *status); /*!< Pointer to backend implementation of ::amp_get_powerstat(). */
/* get firmware info, etc. */
const char *(*get_info)(AMP *amp); /*!< Pointer to backend implementation of ::amp_get_info(). */
//! @cond Doxygen_Suppress
setting_t levels;
unsigned ext_levels;
//! @endcond
const struct confparams *extlevels; /*!< Extension levels list. \sa extamp.c */
const struct confparams *extparms; /*!< Extension parameters list. \sa extamp.c */
const char *macro_name; /*!< Amplifier model macro name. */
};
/**
* \brief Amplifier state structure.
*
* \struct amp_state
*
* This structure contains live data, as well as a copy of capability fields
* that may be updated, i.e. customized while the #AMP handle is instantiated.
*
* It is fine to move fields around, as this kind of struct should not be
* initialized like amp_caps are.
*/
struct amp_state
{
/*
* overridable fields
*/
/*
* non overridable fields, internal use
*/
hamlib_port_t ampport; /*!< Amplifier port (internal use). */
int comm_state; /*!< Comm port state, opened/closed. */
rig_ptr_t priv; /*!< Pointer to private amplifier state data. */
rig_ptr_t obj; /*!< Internal use by hamlib++ for event handling. */
setting_t has_get_level; /*!< List of get levels. */
gran_t level_gran[RIG_SETTING_MAX]; /*!< Level granularity. */
gran_t parm_gran[RIG_SETTING_MAX]; /*!< Parameter granularity. */
};
/**
* \brief Master amplifier structure.
*
* \struct amp
*
* Master amplifier data structure acting as the #AMP handle for the
* controlled amplifier. A pointer to this structure is returned by the
* amp_init() API function and is passed as a parameter to every amplifier
* specific API call.
*
* \sa amp_init(), amp_caps, amp_state
*/
struct amp
{
struct amp_caps *caps; /*!< Amplifier caps. */
struct amp_state state; /*!< Amplifier state. */
};
//! @cond Doxygen_Suppress
/* --------------- API function prototypes -----------------*/
extern HAMLIB_EXPORT(AMP *)
amp_init HAMLIB_PARAMS((amp_model_t amp_model));
extern HAMLIB_EXPORT(int)
amp_open HAMLIB_PARAMS((AMP *amp));
extern HAMLIB_EXPORT(int)
amp_close HAMLIB_PARAMS((AMP *amp));
extern HAMLIB_EXPORT(int)
amp_cleanup HAMLIB_PARAMS((AMP *amp));
extern HAMLIB_EXPORT(int)
amp_set_conf HAMLIB_PARAMS((AMP *amp,
token_t token,
const char *val));
extern HAMLIB_EXPORT(int)
amp_get_conf HAMLIB_PARAMS((AMP *amp,
token_t token,
char *val));
extern HAMLIB_EXPORT(int)
amp_set_powerstat HAMLIB_PARAMS((AMP *amp,
powerstat_t status));
extern HAMLIB_EXPORT(int)
amp_get_powerstat HAMLIB_PARAMS((AMP *amp,
powerstat_t *status));
/*
* General API commands, from most primitive to least.. )
* List Set/Get functions pairs
*/
extern HAMLIB_EXPORT(int)
amp_get_freq HAMLIB_PARAMS((AMP *amp,
freq_t *freq));
extern HAMLIB_EXPORT(int)
amp_set_freq HAMLIB_PARAMS((AMP *amp,
freq_t freq));
extern HAMLIB_EXPORT(int)
amp_reset HAMLIB_PARAMS((AMP *amp,
amp_reset_t reset));
extern HAMLIB_EXPORT(const char *)
amp_get_info HAMLIB_PARAMS((AMP *amp));
extern HAMLIB_EXPORT(int)
amp_get_level HAMLIB_PARAMS((AMP *amp, setting_t level, value_t *val));
extern HAMLIB_EXPORT(int)
amp_register HAMLIB_PARAMS((const struct amp_caps *caps));
extern HAMLIB_EXPORT(int)
amp_unregister HAMLIB_PARAMS((amp_model_t amp_model));
extern HAMLIB_EXPORT(int)
amp_list_foreach HAMLIB_PARAMS((int (*cfunc)(const struct amp_caps *,
rig_ptr_t),
rig_ptr_t data));
extern HAMLIB_EXPORT(int)
amp_load_backend HAMLIB_PARAMS((const char *be_name));
extern HAMLIB_EXPORT(int)
amp_check_backend HAMLIB_PARAMS((amp_model_t amp_model));
extern HAMLIB_EXPORT(int)
amp_load_all_backends HAMLIB_PARAMS((void));
extern HAMLIB_EXPORT(amp_model_t)
amp_probe_all HAMLIB_PARAMS((hamlib_port_t *p));
extern HAMLIB_EXPORT(int)
amp_token_foreach HAMLIB_PARAMS((AMP *amp,
int (*cfunc)(const struct confparams *,
rig_ptr_t),
rig_ptr_t data));
extern HAMLIB_EXPORT(const struct confparams *)
amp_confparam_lookup HAMLIB_PARAMS((AMP *amp,
const char *name));
extern HAMLIB_EXPORT(token_t)
amp_token_lookup HAMLIB_PARAMS((AMP *amp,
const char *name));
extern HAMLIB_EXPORT(const struct amp_caps *)
amp_get_caps HAMLIB_PARAMS((amp_model_t amp_model));
extern HAMLIB_EXPORT(setting_t)
amp_has_get_level HAMLIB_PARAMS((AMP *amp,
setting_t level));
extern HAMLIB_EXPORT(const struct confparams *)
amp_ext_lookup HAMLIB_PARAMS((AMP *amp,
const char *name));
extern HAMLIB_EXPORT(int)
amp_get_ext_level HAMLIB_PARAMS((AMP *amp,
token_t token,
value_t *val));
extern HAMLIB_EXPORT(const char *) amp_strlevel(setting_t);
extern HAMLIB_EXPORT(const struct confparams *)
rig_ext_lookup HAMLIB_PARAMS((RIG *rig,
const char *name));
extern HAMLIB_EXPORT(setting_t) amp_parse_level(const char *s);
extern HAMLIB_EXPORT(const char *) amp_strlevel(setting_t);
//! @endcond
/**
* \brief Convenience macro for generating debugging messages.
*
* \def amp_debug
*
* This is an alias of the rig_debug() function call and is used in the same
* manner.
*/
#define amp_debug rig_debug
__END_DECLS
#endif /* _AMPLIFIER_H */
/** @} */

View File

@ -0,0 +1,120 @@
/*
* Hamlib Interface - list of known amplifiers
* Copyright (c) 2000-2011 by Stephane Fillod
* Copyright (c) 2000-2002 by Frank Singleton
* Copyright (C) 2019 by Michael Black W9MDB. Derived from rotlist.h
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifndef _AMPLIST_H
#define _AMPLIST_H 1
//! @cond Doxygen_Suppress
#define AMP_MAKE_MODEL(a,b) ((a)*100+(b))
#define AMP_BACKEND_NUM(a) ((a)/100)
//! @endcond
/**
* \addtogroup amplifier
* @{
*/
/**
* \brief Hamlib amplifier model definitions.
*
* \file amplist.h
*
* This file contains amplifier model definitions for the Hamlib amplifier
* Application Programming Interface (API). Each distinct amplifier type has
* a unique model number (ID) and is used by Hamlib to identify and
* distinguish between the different hardware drivers. The exact model
* numbers can be acquired using the macros in this file. To obtain a list of
* supported amplifier branches, one can use the statically defined
* AMP_BACKEND_LIST macro (defined in configure.ac). To obtain a full list of
* supported amplifiers (including each model in every branch), the
* foreach_opened_amp() API function can be used.
*
* The model number, or ID, is used to tell Hamlib which amplifier the client
* wishes to use which is done with the amp_init() API call.
*/
/**
* \brief A macro that returns the model number for an unknown model.
*
* \def AMP_MODEL_NONE
*
* The none backend, as the name suggests, does nothing. It is mainly for
* internal use.
*/
#define AMP_MODEL_NONE 0
/**
* \brief A macro that returns the model number for the DUMMY backend.
*
* \def AMP_MODEL_DUMMY
*
* The DUMMY backend, as the name suggests, is a backend which performs no
* hardware operations and always behaves as one would expect. It can be
* thought of as a hardware simulator and is very useful for testing client
* applications.
*/
/**
* \brief A macro that returns the model number for the NETAMPCTL backend.
*
* \def AMP_MODEL_NETAMPCTL
*
* The NETAMPCTL backend allows use of the `ampctld` daemon through the normal
* Hamlib API.
*/
//! @cond Doxygen_Suppress
#define AMP_DUMMY 0
#define AMP_BACKEND_DUMMY "dummy"
//! @endcond
#define AMP_MODEL_DUMMY AMP_MAKE_MODEL(AMP_DUMMY, 1)
#define AMP_MODEL_NETAMPCTL AMP_MAKE_MODEL(AMP_DUMMY, 2)
/**
* \brief A macro that returns the model number of the KPA1500 backend.
*
* \def AMP_MODEL_ELECRAFT_KPA1500
*
* The KPA1500 backend can be used with amplifiers that support the Elecraft
* KPA-1500 protocol.
*/
//! @cond Doxygen_Suppress
#define AMP_ELECRAFT 2
#define AMP_BACKEND_ELECRAFT "elecraft"
//! @endcond
#define AMP_MODEL_ELECRAFT_KPA1500 AMP_MAKE_MODEL(AMP_ELECRAFT, 1)
//#define AMP_MODEL_ELECRAFT_KPA500 AMP_MAKE_MODEL(AMP_ELECRAFT, 2)
/**
* \brief Convenience type definition for an amplifier model.
*
* \typedef typedef int amp_model_t
*/
typedef int amp_model_t;
#endif /* _AMPLIST_H */
/** @} */

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,90 @@
/*
* Hamlib Win32 DLL build definitions
* Copyright (c) 2001-2009 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
/*
* Provide definitions to compile in Windows
* using C-friendly options, e.g.
*
* HAMLIB_API -> __cdecl
* HAMLIB_EXPORT, HAMLIB_EXPORT_VAR -> __declspec(dllexport)
* BACKEND_EXPORT, BACKEND_EXPORT_VAR -> __declspec(dllexport)
*
* No effect in non-Windows environments.
*/
#if defined(_WIN32) && !defined(__CYGWIN__)
# undef HAMLIB_IMPEXP
# undef HAMLIB_CPP_IMPEXP
# undef HAMLIB_API
# undef HAMLIB_EXPORT
# undef HAMLIB_EXPORT_VAR
# undef BACKEND_EXPORT
# undef BACKEND_EXPORT_VAR
# undef HAMLIB_DLL_IMPORT
# undef HAMLIB_DLL_EXPORT
# if defined (__BORLANDC__)
# define HAMLIB_DLL_IMPORT __import
# define HAMLIB_DLL_EXPORT __export
# else
# define HAMLIB_DLL_IMPORT __declspec(dllimport)
# define HAMLIB_DLL_EXPORT __declspec(dllexport)
# endif
# ifdef DLL_EXPORT
/* HAMLIB_API may be set to __stdcall for VB, .. */
# define HAMLIB_API __cdecl
# ifdef IN_HAMLIB
# define HAMLIB_CPP_IMPEXP HAMLIB_DLL_EXPORT
# define HAMLIB_IMPEXP HAMLIB_DLL_EXPORT
# else
# define HAMLIB_CPP_IMPEXP HAMLIB_DLL_IMPORT
# define HAMLIB_IMPEXP HAMLIB_DLL_IMPORT
# endif
# else
/* static build, only export the backend entry points for lt_dlsym */
# define HAMLIB_CPP_IMPEXP HAMLIB_DLL_EXPORT
# endif
#endif
/* Take care of non-cygwin platforms */
#if !defined(HAMLIB_IMPEXP)
# define HAMLIB_IMPEXP
#endif
#if !defined(HAMLIB_CPP_IMPEXP)
# define HAMLIB_CPP_IMPEXP
#endif
#if !defined(HAMLIB_API)
# define HAMLIB_API
#endif
#if !defined(HAMLIB_EXPORT)
# define HAMLIB_EXPORT(type) HAMLIB_IMPEXP type HAMLIB_API
#endif
#if !defined(HAMLIB_EXPORT_VAR)
# define HAMLIB_EXPORT_VAR(type) HAMLIB_IMPEXP type
#endif
#if !defined(BACKEND_EXPORT)
# define BACKEND_EXPORT(type) HAMLIB_CPP_IMPEXP type HAMLIB_API
#endif
#if !defined(BACKEND_EXPORT_VAR)
# define BACKEND_EXPORT_VAR(type) HAMLIB_CPP_IMPEXP type
#endif

View File

@ -0,0 +1,662 @@
/*
* Hamlib Interface - list of known rigs
* Copyright (c) 2000-2003 by Frank Singleton
* Copyright (c) 2000-2015 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifndef _RIGLIST_H
#define _RIGLIST_H 1
//! @cond Doxygen_Suppress
// The rig model number is designed to fit in a 32-bit int
// As of 2020-02-18 we have 33 backends defined
// With a max of 1000 models per backend we get total a model number range of 1001-33001
// This MAX was 100 prior to 2020-02-18 and Icom was close to running out of the 100 range
#define MAX_MODELS_PER_BACKEND 1000
#define RIG_MAKE_MODEL(a,b) ((a)*MAX_MODELS_PER_BACKEND+(b))
#define RIG_BACKEND_NUM(a) ((a)/MAX_MODELS_PER_BACKEND)
/*! \file riglist.h
* \brief Hamlib rig(radio) model definitions.
*
* This file contains rig model definitions for the Hamlib rig API. Each
* distinct rig type has a unique model number (ID) and is used by hamlib to
* identify and distinguish between the different hardware drivers. The
* exact model numbers can be acquired using the macros in this file. To
* obtain a list of supported rig branches, one can use the statically
* defined RIG_BACKEND_LIST macro. To obtain a full list of supported rig
* (including each model in every branch), the foreach_opened_rig() API
* function can be used.
*
* The model number, or ID, is used to tell hamlib, which rig the client
* whishes to use. It is done with the rig_init() API call.
*/
#define RIG_MODEL_NONE 0
/*! \def RIG_MODEL_DUMMY
* \brief A macro that returns the model number for the dummy backend.
*
* The dummy backend, as the name suggests, is a backend which performs no
* hardware operations and always behaves as one would expect. It can be
* thought of as a hardware simulator and is very useful for testing client
* applications.
*
* It has also been expanded to provide support to "virtual" type of rigs
* such as the network rig control backend and W1HKJ's Flrig application.
*/
#define RIG_DUMMY 0
#define RIG_BACKEND_DUMMY "dummy"
#define RIG_MODEL_DUMMY RIG_MAKE_MODEL(RIG_DUMMY, 1)
#define RIG_MODEL_NETRIGCTL RIG_MAKE_MODEL(RIG_DUMMY, 2)
#define RIG_MODEL_ARMSTRONG RIG_MAKE_MODEL(RIG_DUMMY, 3)
#define RIG_MODEL_FLRIG RIG_MAKE_MODEL(RIG_DUMMY, 4)
#define RIG_MODEL_TRXMANAGER_RIG RIG_MAKE_MODEL(RIG_DUMMY, 5)
#define RIG_MODEL_DUMMY_NOVFO RIG_MAKE_MODEL(RIG_DUMMY, 6)
#define RIG_MODEL_TCI1X RIG_MAKE_MODEL(RIG_DUMMY, 7)
/*
* Yaesu
*/
#define RIG_YAESU 1
#define RIG_BACKEND_YAESU "yaesu"
#define RIG_MODEL_FT847 RIG_MAKE_MODEL(RIG_YAESU, 1)
#define RIG_MODEL_FT1000 RIG_MAKE_MODEL(RIG_YAESU, 2)
#define RIG_MODEL_FT1000D RIG_MAKE_MODEL(RIG_YAESU, 3)
#define RIG_MODEL_FT1000MPMKV RIG_MAKE_MODEL(RIG_YAESU, 4)
#define RIG_MODEL_FT747 RIG_MAKE_MODEL(RIG_YAESU, 5)
#define RIG_MODEL_FT757 RIG_MAKE_MODEL(RIG_YAESU, 6)
#define RIG_MODEL_FT757GXII RIG_MAKE_MODEL(RIG_YAESU, 7)
#define RIG_MODEL_FT575 RIG_MAKE_MODEL(RIG_YAESU, 8)
#define RIG_MODEL_FT767 RIG_MAKE_MODEL(RIG_YAESU, 9)
#define RIG_MODEL_FT736R RIG_MAKE_MODEL(RIG_YAESU, 10)
#define RIG_MODEL_FT840 RIG_MAKE_MODEL(RIG_YAESU, 11)
#define RIG_MODEL_FT820 RIG_MAKE_MODEL(RIG_YAESU, 12)
#define RIG_MODEL_FT900 RIG_MAKE_MODEL(RIG_YAESU, 13)
#define RIG_MODEL_FT920 RIG_MAKE_MODEL(RIG_YAESU, 14)
#define RIG_MODEL_FT890 RIG_MAKE_MODEL(RIG_YAESU, 15)
#define RIG_MODEL_FT990 RIG_MAKE_MODEL(RIG_YAESU, 16)
#define RIG_MODEL_FRG100 RIG_MAKE_MODEL(RIG_YAESU, 17)
#define RIG_MODEL_FRG9600 RIG_MAKE_MODEL(RIG_YAESU, 18)
#define RIG_MODEL_FRG8800 RIG_MAKE_MODEL(RIG_YAESU, 19)
#define RIG_MODEL_FT817 RIG_MAKE_MODEL(RIG_YAESU, 20)
#define RIG_MODEL_FT100 RIG_MAKE_MODEL(RIG_YAESU, 21)
#define RIG_MODEL_FT857 RIG_MAKE_MODEL(RIG_YAESU, 22)
#define RIG_MODEL_FT897 RIG_MAKE_MODEL(RIG_YAESU, 23)
#define RIG_MODEL_FT1000MP RIG_MAKE_MODEL(RIG_YAESU, 24)
#define RIG_MODEL_FT1000MPMKVFLD RIG_MAKE_MODEL(RIG_YAESU, 25)
#define RIG_MODEL_VR5000 RIG_MAKE_MODEL(RIG_YAESU, 26)
#define RIG_MODEL_FT450 RIG_MAKE_MODEL(RIG_YAESU, 27)
#define RIG_MODEL_FT950 RIG_MAKE_MODEL(RIG_YAESU, 28)
#define RIG_MODEL_FT2000 RIG_MAKE_MODEL(RIG_YAESU, 29)
#define RIG_MODEL_FT9000 RIG_MAKE_MODEL(RIG_YAESU, 30)
#define RIG_MODEL_FT980 RIG_MAKE_MODEL(RIG_YAESU, 31)
#define RIG_MODEL_FTDX5000 RIG_MAKE_MODEL(RIG_YAESU, 32)
#define RIG_MODEL_VX1700 RIG_MAKE_MODEL(RIG_YAESU, 33)
#define RIG_MODEL_FTDX1200 RIG_MAKE_MODEL(RIG_YAESU, 34)
#define RIG_MODEL_FT991 RIG_MAKE_MODEL(RIG_YAESU, 35)
#define RIG_MODEL_FT891 RIG_MAKE_MODEL(RIG_YAESU, 36)
#define RIG_MODEL_FTDX3000 RIG_MAKE_MODEL(RIG_YAESU, 37)
#define RIG_MODEL_FT847UNI RIG_MAKE_MODEL(RIG_YAESU, 38)
#define RIG_MODEL_FT600 RIG_MAKE_MODEL(RIG_YAESU, 39)
#define RIG_MODEL_FTDX101D RIG_MAKE_MODEL(RIG_YAESU, 40)
#define RIG_MODEL_FT818 RIG_MAKE_MODEL(RIG_YAESU, 41)
#define RIG_MODEL_FTDX10 RIG_MAKE_MODEL(RIG_YAESU, 42)
#define RIG_MODEL_FT897D RIG_MAKE_MODEL(RIG_YAESU, 43)
#define RIG_MODEL_FTDX101MP RIG_MAKE_MODEL(RIG_YAESU, 44)
#define RIG_MODEL_MCHFQRP RIG_MAKE_MODEL(RIG_YAESU, 45)
/*
* Kenwood
*/
#define RIG_KENWOOD 2
#define RIG_BACKEND_KENWOOD "kenwood"
#define RIG_MODEL_TS50 RIG_MAKE_MODEL(RIG_KENWOOD, 1)
#define RIG_MODEL_TS440 RIG_MAKE_MODEL(RIG_KENWOOD, 2)
#define RIG_MODEL_TS450S RIG_MAKE_MODEL(RIG_KENWOOD, 3)
#define RIG_MODEL_TS570D RIG_MAKE_MODEL(RIG_KENWOOD, 4)
#define RIG_MODEL_TS690S RIG_MAKE_MODEL(RIG_KENWOOD, 5)
#define RIG_MODEL_TS711 RIG_MAKE_MODEL(RIG_KENWOOD, 6)
#define RIG_MODEL_TS790 RIG_MAKE_MODEL(RIG_KENWOOD, 7)
#define RIG_MODEL_TS811 RIG_MAKE_MODEL(RIG_KENWOOD, 8)
#define RIG_MODEL_TS850 RIG_MAKE_MODEL(RIG_KENWOOD, 9)
#define RIG_MODEL_TS870S RIG_MAKE_MODEL(RIG_KENWOOD, 10)
#define RIG_MODEL_TS940 RIG_MAKE_MODEL(RIG_KENWOOD, 11)
#define RIG_MODEL_TS950S RIG_MAKE_MODEL(RIG_KENWOOD, 12)
#define RIG_MODEL_TS950SDX RIG_MAKE_MODEL(RIG_KENWOOD, 13)
#define RIG_MODEL_TS2000 RIG_MAKE_MODEL(RIG_KENWOOD, 14)
#define RIG_MODEL_R5000 RIG_MAKE_MODEL(RIG_KENWOOD, 15)
#define RIG_MODEL_TS570S RIG_MAKE_MODEL(RIG_KENWOOD, 16)
#define RIG_MODEL_THD7A RIG_MAKE_MODEL(RIG_KENWOOD, 17)
#define RIG_MODEL_THD7AG RIG_MAKE_MODEL(RIG_KENWOOD, 18)
#define RIG_MODEL_THF6A RIG_MAKE_MODEL(RIG_KENWOOD, 19)
#define RIG_MODEL_THF7E RIG_MAKE_MODEL(RIG_KENWOOD, 20)
#define RIG_MODEL_K2 RIG_MAKE_MODEL(RIG_KENWOOD, 21)
#define RIG_MODEL_TS930 RIG_MAKE_MODEL(RIG_KENWOOD, 22)
#define RIG_MODEL_THG71 RIG_MAKE_MODEL(RIG_KENWOOD, 23)
#define RIG_MODEL_TS680S RIG_MAKE_MODEL(RIG_KENWOOD, 24)
#define RIG_MODEL_TS140S RIG_MAKE_MODEL(RIG_KENWOOD, 25)
#define RIG_MODEL_TMD700 RIG_MAKE_MODEL(RIG_KENWOOD, 26)
#define RIG_MODEL_TMV7 RIG_MAKE_MODEL(RIG_KENWOOD, 27)
#define RIG_MODEL_TS480 RIG_MAKE_MODEL(RIG_KENWOOD, 28)
#define RIG_MODEL_K3 RIG_MAKE_MODEL(RIG_KENWOOD, 29)
#define RIG_MODEL_TRC80 RIG_MAKE_MODEL(RIG_KENWOOD, 30)
#define RIG_MODEL_TS590S RIG_MAKE_MODEL(RIG_KENWOOD, 31)
#define RIG_MODEL_TRANSFOX RIG_MAKE_MODEL(RIG_KENWOOD, 32) /* SigFox Transfox */
#define RIG_MODEL_THD72A RIG_MAKE_MODEL(RIG_KENWOOD, 33)
#define RIG_MODEL_TMD710 RIG_MAKE_MODEL(RIG_KENWOOD, 34)
#define RIG_MODEL_TMV71 RIG_MAKE_MODEL(RIG_KENWOOD, 35)
#define RIG_MODEL_F6K RIG_MAKE_MODEL(RIG_KENWOOD, 36) /* Flex 6000 Series */
#define RIG_MODEL_TS590SG RIG_MAKE_MODEL(RIG_KENWOOD, 37)
#define RIG_MODEL_XG3 RIG_MAKE_MODEL(RIG_KENWOOD, 38) /* Elecraft XG-3 signal generator */
#define RIG_MODEL_TS990S RIG_MAKE_MODEL(RIG_KENWOOD, 39)
#define RIG_MODEL_HPSDR RIG_MAKE_MODEL(RIG_KENWOOD, 40) /* OpenHPSDR, PiHPSDR */
#define RIG_MODEL_TS890S RIG_MAKE_MODEL(RIG_KENWOOD, 41)
#define RIG_MODEL_THD74 RIG_MAKE_MODEL(RIG_KENWOOD, 42)
#define RIG_MODEL_K3S RIG_MAKE_MODEL(RIG_KENWOOD, 43)
#define RIG_MODEL_KX2 RIG_MAKE_MODEL(RIG_KENWOOD, 44)
#define RIG_MODEL_KX3 RIG_MAKE_MODEL(RIG_KENWOOD, 45)
#define RIG_MODEL_PT8000A RIG_MAKE_MODEL(RIG_KENWOOD, 46)
#define RIG_MODEL_K4 RIG_MAKE_MODEL(RIG_KENWOOD, 47)
#define RIG_MODEL_POWERSDR RIG_MAKE_MODEL(RIG_KENWOOD, 48)
#define RIG_MODEL_MALACHITE RIG_MAKE_MODEL(RIG_KENWOOD, 49)
/*
* Icom
*/
#define RIG_ICOM 3
#define RIG_BACKEND_ICOM "icom"
#define RIG_MODEL_IC1271 RIG_MAKE_MODEL(RIG_ICOM, 1)
#define RIG_MODEL_IC1275 RIG_MAKE_MODEL(RIG_ICOM, 2)
#define RIG_MODEL_IC271 RIG_MAKE_MODEL(RIG_ICOM, 3)
#define RIG_MODEL_IC275 RIG_MAKE_MODEL(RIG_ICOM, 4)
#define RIG_MODEL_IC375 RIG_MAKE_MODEL(RIG_ICOM, 5)
#define RIG_MODEL_IC471 RIG_MAKE_MODEL(RIG_ICOM, 6)
#define RIG_MODEL_IC475 RIG_MAKE_MODEL(RIG_ICOM, 7)
#define RIG_MODEL_IC575 RIG_MAKE_MODEL(RIG_ICOM, 8)
#define RIG_MODEL_IC706 RIG_MAKE_MODEL(RIG_ICOM, 9)
#define RIG_MODEL_IC706MKII RIG_MAKE_MODEL(RIG_ICOM, 10)
#define RIG_MODEL_IC706MKIIG RIG_MAKE_MODEL(RIG_ICOM, 11)
#define RIG_MODEL_IC707 RIG_MAKE_MODEL(RIG_ICOM, 12)
#define RIG_MODEL_IC718 RIG_MAKE_MODEL(RIG_ICOM, 13)
#define RIG_MODEL_IC725 RIG_MAKE_MODEL(RIG_ICOM, 14)
#define RIG_MODEL_IC726 RIG_MAKE_MODEL(RIG_ICOM, 15)
#define RIG_MODEL_IC728 RIG_MAKE_MODEL(RIG_ICOM, 16)
#define RIG_MODEL_IC729 RIG_MAKE_MODEL(RIG_ICOM, 17)
#define RIG_MODEL_IC731 RIG_MAKE_MODEL(RIG_ICOM, 18)
#define RIG_MODEL_IC735 RIG_MAKE_MODEL(RIG_ICOM, 19)
#define RIG_MODEL_IC736 RIG_MAKE_MODEL(RIG_ICOM, 20)
#define RIG_MODEL_IC737 RIG_MAKE_MODEL(RIG_ICOM, 21)
#define RIG_MODEL_IC738 RIG_MAKE_MODEL(RIG_ICOM, 22)
#define RIG_MODEL_IC746 RIG_MAKE_MODEL(RIG_ICOM, 23)
#define RIG_MODEL_IC751 RIG_MAKE_MODEL(RIG_ICOM, 24)
#define RIG_MODEL_IC751A RIG_MAKE_MODEL(RIG_ICOM, 25)
#define RIG_MODEL_IC756 RIG_MAKE_MODEL(RIG_ICOM, 26)
#define RIG_MODEL_IC756PRO RIG_MAKE_MODEL(RIG_ICOM, 27)
#define RIG_MODEL_IC761 RIG_MAKE_MODEL(RIG_ICOM, 28)
#define RIG_MODEL_IC765 RIG_MAKE_MODEL(RIG_ICOM, 29)
#define RIG_MODEL_IC775 RIG_MAKE_MODEL(RIG_ICOM, 30)
#define RIG_MODEL_IC781 RIG_MAKE_MODEL(RIG_ICOM, 31)
#define RIG_MODEL_IC820 RIG_MAKE_MODEL(RIG_ICOM, 32)
//#define RIG_MODEL_IC821 RIG_MAKE_MODEL(RIG_ICOM, 33) // not implemented and can be reused
#define RIG_MODEL_IC821H RIG_MAKE_MODEL(RIG_ICOM, 34)
#define RIG_MODEL_IC970 RIG_MAKE_MODEL(RIG_ICOM, 35)
#define RIG_MODEL_ICR10 RIG_MAKE_MODEL(RIG_ICOM, 36)
#define RIG_MODEL_ICR71 RIG_MAKE_MODEL(RIG_ICOM, 37)
#define RIG_MODEL_ICR72 RIG_MAKE_MODEL(RIG_ICOM, 38)
#define RIG_MODEL_ICR75 RIG_MAKE_MODEL(RIG_ICOM, 39)
#define RIG_MODEL_ICR7000 RIG_MAKE_MODEL(RIG_ICOM, 40)
#define RIG_MODEL_ICR7100 RIG_MAKE_MODEL(RIG_ICOM, 41)
#define RIG_MODEL_ICR8500 RIG_MAKE_MODEL(RIG_ICOM, 42)
#define RIG_MODEL_ICR9000 RIG_MAKE_MODEL(RIG_ICOM, 43)
#define RIG_MODEL_IC910 RIG_MAKE_MODEL(RIG_ICOM, 44)
#define RIG_MODEL_IC78 RIG_MAKE_MODEL(RIG_ICOM, 45)
#define RIG_MODEL_IC746PRO RIG_MAKE_MODEL(RIG_ICOM, 46)
#define RIG_MODEL_IC756PROII RIG_MAKE_MODEL(RIG_ICOM, 47) /* 48-53 defined below */
#define RIG_MODEL_ICID1 RIG_MAKE_MODEL(RIG_ICOM, 54)
#define RIG_MODEL_IC703 RIG_MAKE_MODEL(RIG_ICOM, 55)
#define RIG_MODEL_IC7800 RIG_MAKE_MODEL(RIG_ICOM, 56)
#define RIG_MODEL_IC756PROIII RIG_MAKE_MODEL(RIG_ICOM, 57)
#define RIG_MODEL_ICR20 RIG_MAKE_MODEL(RIG_ICOM, 58) /* 59 defined below */
#define RIG_MODEL_IC7000 RIG_MAKE_MODEL(RIG_ICOM, 60)
#define RIG_MODEL_IC7200 RIG_MAKE_MODEL(RIG_ICOM, 61)
#define RIG_MODEL_IC7700 RIG_MAKE_MODEL(RIG_ICOM, 62)
#define RIG_MODEL_IC7600 RIG_MAKE_MODEL(RIG_ICOM, 63) /* 64 defined below */
#define RIG_MODEL_IC92D RIG_MAKE_MODEL(RIG_ICOM, 65)
#define RIG_MODEL_ICR9500 RIG_MAKE_MODEL(RIG_ICOM, 66)
#define RIG_MODEL_IC7410 RIG_MAKE_MODEL(RIG_ICOM, 67)
#define RIG_MODEL_IC9100 RIG_MAKE_MODEL(RIG_ICOM, 68)
#define RIG_MODEL_ICRX7 RIG_MAKE_MODEL(RIG_ICOM, 69)
#define RIG_MODEL_IC7100 RIG_MAKE_MODEL(RIG_ICOM, 70)
#define RIG_MODEL_ID5100 RIG_MAKE_MODEL(RIG_ICOM, 71)
#define RIG_MODEL_IC2730 RIG_MAKE_MODEL(RIG_ICOM, 72)
#define RIG_MODEL_IC7300 RIG_MAKE_MODEL(RIG_ICOM, 73)
#define RIG_MODEL_PERSEUS RIG_MAKE_MODEL(RIG_ICOM, 74)
#define RIG_MODEL_IC785x RIG_MAKE_MODEL(RIG_ICOM, 75)
#define RIG_MODEL_X108G RIG_MAKE_MODEL(RIG_ICOM, 76) /* Xiegu X108 */
#define RIG_MODEL_ICR6 RIG_MAKE_MODEL(RIG_ICOM, 77)
#define RIG_MODEL_IC7610 RIG_MAKE_MODEL(RIG_ICOM, 78)
#define RIG_MODEL_ICR8600 RIG_MAKE_MODEL(RIG_ICOM, 79)
#define RIG_MODEL_ICR30 RIG_MAKE_MODEL(RIG_ICOM, 80)
#define RIG_MODEL_IC9700 RIG_MAKE_MODEL(RIG_ICOM, 81)
#define RIG_MODEL_ID4100 RIG_MAKE_MODEL(RIG_ICOM, 82)
#define RIG_MODEL_ID31 RIG_MAKE_MODEL(RIG_ICOM, 83)
#define RIG_MODEL_ID51 RIG_MAKE_MODEL(RIG_ICOM, 84)
#define RIG_MODEL_IC705 RIG_MAKE_MODEL(RIG_ICOM, 85)
/* next one is 86 */
/*
* Optoelectronics (CI-V)
*/
#define RIG_MODEL_MINISCOUT RIG_MAKE_MODEL(RIG_ICOM, 48)
#define RIG_MODEL_XPLORER RIG_MAKE_MODEL(RIG_ICOM, 49)
#define RIG_MODEL_OS535 RIG_MAKE_MODEL(RIG_ICOM, 52)
#define RIG_MODEL_OS456 RIG_MAKE_MODEL(RIG_ICOM, 53)
/*
* TenTec (CI-V)
*/
#define RIG_MODEL_OMNIVI RIG_MAKE_MODEL(RIG_ICOM, 50)
#define RIG_MODEL_OMNIVIP RIG_MAKE_MODEL(RIG_ICOM, 51) /* OMNI-VI+ */
#define RIG_MODEL_PARAGON2 RIG_MAKE_MODEL(RIG_ICOM, 59)
#define RIG_MODEL_DELTAII RIG_MAKE_MODEL(RIG_ICOM, 64)
/*
* Icom PCR
*/
#define RIG_PCR 4
#define RIG_BACKEND_PCR "pcr"
#define RIG_MODEL_PCR1000 RIG_MAKE_MODEL(RIG_PCR, 1)
#define RIG_MODEL_PCR100 RIG_MAKE_MODEL(RIG_PCR, 2)
#define RIG_MODEL_PCR1500 RIG_MAKE_MODEL(RIG_PCR, 3)
#define RIG_MODEL_PCR2500 RIG_MAKE_MODEL(RIG_PCR, 4)
/*
* AOR
*/
#define RIG_AOR 5
#define RIG_BACKEND_AOR "aor"
#define RIG_MODEL_AR8200 RIG_MAKE_MODEL(RIG_AOR, 1)
#define RIG_MODEL_AR8000 RIG_MAKE_MODEL(RIG_AOR, 2)
#define RIG_MODEL_AR7030 RIG_MAKE_MODEL(RIG_AOR, 3)
#define RIG_MODEL_AR5000 RIG_MAKE_MODEL(RIG_AOR, 4)
#define RIG_MODEL_AR3030 RIG_MAKE_MODEL(RIG_AOR, 5)
#define RIG_MODEL_AR3000A RIG_MAKE_MODEL(RIG_AOR, 6)
#define RIG_MODEL_AR3000 RIG_MAKE_MODEL(RIG_AOR, 7)
#define RIG_MODEL_AR2700 RIG_MAKE_MODEL(RIG_AOR, 8)
#define RIG_MODEL_AR2500 RIG_MAKE_MODEL(RIG_AOR, 9)
#define RIG_MODEL_AR16 RIG_MAKE_MODEL(RIG_AOR, 10)
#define RIG_MODEL_SDU5500 RIG_MAKE_MODEL(RIG_AOR, 11)
#define RIG_MODEL_SDU5000 RIG_MAKE_MODEL(RIG_AOR, 12)
#define RIG_MODEL_AR8600 RIG_MAKE_MODEL(RIG_AOR, 13)
#define RIG_MODEL_AR5000A RIG_MAKE_MODEL(RIG_AOR, 14)
#define RIG_MODEL_AR7030P RIG_MAKE_MODEL(RIG_AOR, 15)
#define RIG_MODEL_SR2200 RIG_MAKE_MODEL(RIG_AOR, 16)
/*
* JRC
*/
#define RIG_JRC 6
#define RIG_BACKEND_JRC "jrc"
#define RIG_MODEL_JST145 RIG_MAKE_MODEL(RIG_JRC, 1)
#define RIG_MODEL_JST245 RIG_MAKE_MODEL(RIG_JRC, 2)
#define RIG_MODEL_CMH530 RIG_MAKE_MODEL(RIG_JRC, 3)
#define RIG_MODEL_NRD345 RIG_MAKE_MODEL(RIG_JRC, 4)
#define RIG_MODEL_NRD525 RIG_MAKE_MODEL(RIG_JRC, 5)
#define RIG_MODEL_NRD535 RIG_MAKE_MODEL(RIG_JRC, 6)
#define RIG_MODEL_NRD545 RIG_MAKE_MODEL(RIG_JRC, 7)
/*
* Radio Shack
* Actually, they might be either Icom or Uniden. TBC --SF
*/
#define RIG_RADIOSHACK 7
#define RIG_BACKEND_RADIOSHACK "radioshack"
#define RIG_MODEL_RS64 RIG_MAKE_MODEL(RIG_RADIOSHACK, 1) /* PRO-64 */
#define RIG_MODEL_RS2005 RIG_MAKE_MODEL(RIG_RADIOSHACK, 2) /* w/ OptoElectronics OS456 Board */
#define RIG_MODEL_RS2006 RIG_MAKE_MODEL(RIG_RADIOSHACK, 3) /* w/ OptoElectronics OS456 Board */
#define RIG_MODEL_RS2035 RIG_MAKE_MODEL(RIG_RADIOSHACK, 4) /* w/ OptoElectronics OS435 Board */
#define RIG_MODEL_RS2042 RIG_MAKE_MODEL(RIG_RADIOSHACK, 5) /* w/ OptoElectronics OS435 Board */
#define RIG_MODEL_RS2041 RIG_MAKE_MODEL(RIG_RADIOSHACK, 6) /* PRO-2041 */
/*
* Uniden
*/
#define RIG_UNIDEN 8
#define RIG_BACKEND_UNIDEN "uniden"
#define RIG_MODEL_BC780 RIG_MAKE_MODEL(RIG_UNIDEN, 1) /* Uniden BC780 - Trunk Tracker "Desktop Radio" */
#define RIG_MODEL_BC245 RIG_MAKE_MODEL(RIG_UNIDEN, 2)
#define RIG_MODEL_BC895 RIG_MAKE_MODEL(RIG_UNIDEN, 3)
#define RIG_MODEL_PRO2052 RIG_MAKE_MODEL(RIG_UNIDEN, 4) /* Radio Shack PRO-2052 */
#define RIG_MODEL_BC235 RIG_MAKE_MODEL(RIG_UNIDEN, 5)
#define RIG_MODEL_BC250 RIG_MAKE_MODEL(RIG_UNIDEN, 6)
#define RIG_MODEL_BC785 RIG_MAKE_MODEL(RIG_UNIDEN, 7)
#define RIG_MODEL_BC786 RIG_MAKE_MODEL(RIG_UNIDEN, 8)
#define RIG_MODEL_BCT8 RIG_MAKE_MODEL(RIG_UNIDEN, 9)
#define RIG_MODEL_BCD396T RIG_MAKE_MODEL(RIG_UNIDEN, 10)
#define RIG_MODEL_BCD996T RIG_MAKE_MODEL(RIG_UNIDEN, 11)
#define RIG_MODEL_BC898 RIG_MAKE_MODEL(RIG_UNIDEN, 12)
/*
* Drake
*/
#define RIG_DRAKE 9
#define RIG_BACKEND_DRAKE "drake"
#define RIG_MODEL_DKR8 RIG_MAKE_MODEL(RIG_DRAKE, 1)
#define RIG_MODEL_DKR8A RIG_MAKE_MODEL(RIG_DRAKE, 2)
#define RIG_MODEL_DKR8B RIG_MAKE_MODEL(RIG_DRAKE, 3)
/*
* Lowe
*/
#define RIG_LOWE 10
#define RIG_BACKEND_LOWE "lowe"
#define RIG_MODEL_HF150 RIG_MAKE_MODEL(RIG_LOWE, 1)
#define RIG_MODEL_HF225 RIG_MAKE_MODEL(RIG_LOWE, 2)
#define RIG_MODEL_HF250 RIG_MAKE_MODEL(RIG_LOWE, 3)
#define RIG_MODEL_HF235 RIG_MAKE_MODEL(RIG_LOWE, 4)
/*
* Racal
*/
#define RIG_RACAL 11
#define RIG_BACKEND_RACAL "racal"
#define RIG_MODEL_RA3790 RIG_MAKE_MODEL(RIG_RACAL, 1)
#define RIG_MODEL_RA3720 RIG_MAKE_MODEL(RIG_RACAL, 2)
#define RIG_MODEL_RA6790 RIG_MAKE_MODEL(RIG_RACAL, 3)
#define RIG_MODEL_RA3710 RIG_MAKE_MODEL(RIG_RACAL, 4)
#define RIG_MODEL_RA3702 RIG_MAKE_MODEL(RIG_RACAL, 5)
/*
* Watkins-Johnson
*/
#define RIG_WJ 12
#define RIG_BACKEND_WJ "wj"
#define RIG_MODEL_HF1000 RIG_MAKE_MODEL(RIG_WJ, 1)
#define RIG_MODEL_HF1000A RIG_MAKE_MODEL(RIG_WJ, 2)
#define RIG_MODEL_WJ8711 RIG_MAKE_MODEL(RIG_WJ, 3)
#define RIG_MODEL_WJ8888 RIG_MAKE_MODEL(RIG_WJ, 4)
/*
* Rohde & Schwarz--ek
*/
#define RIG_EK 13
#define RIG_BACKEND_EK "ek"
#define RIG_MODEL_ESM500 RIG_MAKE_MODEL(RIG_EK, 1)
#define RIG_MODEL_EK890 RIG_MAKE_MODEL(RIG_EK, 2)
#define RIG_MODEL_EK891 RIG_MAKE_MODEL(RIG_EK, 3)
#define RIG_MODEL_EK895 RIG_MAKE_MODEL(RIG_EK, 4)
#define RIG_MODEL_EK070 RIG_MAKE_MODEL(RIG_EK, 5)
/*
* Skanti
*/
#define RIG_SKANTI 14
#define RIG_BACKEND_SKANTI "skanti"
#define RIG_MODEL_TRP7000 RIG_MAKE_MODEL(RIG_SKANTI, 1)
#define RIG_MODEL_TRP8000 RIG_MAKE_MODEL(RIG_SKANTI, 2)
#define RIG_MODEL_TRP9000 RIG_MAKE_MODEL(RIG_SKANTI, 3)
#define RIG_MODEL_TRP8255 RIG_MAKE_MODEL(RIG_SKANTI, 4)
/*
* WiNRADiO/LinRADiO
*/
#define RIG_WINRADIO 15
#define RIG_BACKEND_WINRADIO "winradio"
#define RIG_MODEL_WR1000 RIG_MAKE_MODEL(RIG_WINRADIO, 1)
#define RIG_MODEL_WR1500 RIG_MAKE_MODEL(RIG_WINRADIO, 2)
#define RIG_MODEL_WR1550 RIG_MAKE_MODEL(RIG_WINRADIO, 3)
#define RIG_MODEL_WR3100 RIG_MAKE_MODEL(RIG_WINRADIO, 4)
#define RIG_MODEL_WR3150 RIG_MAKE_MODEL(RIG_WINRADIO, 5)
#define RIG_MODEL_WR3500 RIG_MAKE_MODEL(RIG_WINRADIO, 6)
#define RIG_MODEL_WR3700 RIG_MAKE_MODEL(RIG_WINRADIO, 7)
#define RIG_MODEL_G303 RIG_MAKE_MODEL(RIG_WINRADIO, 8)
#define RIG_MODEL_G313 RIG_MAKE_MODEL(RIG_WINRADIO, 9)
#define RIG_MODEL_G305 RIG_MAKE_MODEL(RIG_WINRADIO, 10)
#define RIG_MODEL_G315 RIG_MAKE_MODEL(RIG_WINRADIO, 11)
/*
* Ten Tec
*/
#define RIG_TENTEC 16
#define RIG_BACKEND_TENTEC "tentec"
#define RIG_MODEL_TT550 RIG_MAKE_MODEL(RIG_TENTEC, 1) /* Pegasus */
#define RIG_MODEL_TT538 RIG_MAKE_MODEL(RIG_TENTEC, 2) /* Jupiter */
#define RIG_MODEL_RX320 RIG_MAKE_MODEL(RIG_TENTEC, 3)
#define RIG_MODEL_RX340 RIG_MAKE_MODEL(RIG_TENTEC, 4)
#define RIG_MODEL_RX350 RIG_MAKE_MODEL(RIG_TENTEC, 5)
#define RIG_MODEL_TT526 RIG_MAKE_MODEL(RIG_TENTEC, 6) /* 6N2 */
#define RIG_MODEL_TT516 RIG_MAKE_MODEL(RIG_TENTEC, 7) /* Argonaut V */
#define RIG_MODEL_TT565 RIG_MAKE_MODEL(RIG_TENTEC, 8) /* Orion */
#define RIG_MODEL_TT585 RIG_MAKE_MODEL(RIG_TENTEC, 9) /* Paragon */
#define RIG_MODEL_TT588 RIG_MAKE_MODEL(RIG_TENTEC, 11) /* Omni-VII */
#define RIG_MODEL_RX331 RIG_MAKE_MODEL(RIG_TENTEC, 12)
#define RIG_MODEL_TT599 RIG_MAKE_MODEL(RIG_TENTEC, 13) /* Eagle */
/*
* Alinco
*/
#define RIG_ALINCO 17
#define RIG_BACKEND_ALINCO "alinco"
#define RIG_MODEL_DX77 RIG_MAKE_MODEL(RIG_ALINCO, 1)
#define RIG_MODEL_DXSR8 RIG_MAKE_MODEL(RIG_ALINCO, 2)
/*
* Kachina
*/
#define RIG_KACHINA 18
#define RIG_BACKEND_KACHINA "kachina"
#define RIG_MODEL_505DSP RIG_MAKE_MODEL(RIG_KACHINA, 1)
/*
* Gnuradio backend
*/
#define RIG_GNURADIO 20
#define RIG_BACKEND_GNURADIO "gnuradio"
#define RIG_MODEL_GNURADIO RIG_MAKE_MODEL(RIG_GNURADIO, 1) /* dev model, Chirp source */
#define RIG_MODEL_MC4020 RIG_MAKE_MODEL(RIG_GNURADIO, 2) /* MC4020 */
#define RIG_MODEL_GRAUDIO RIG_MAKE_MODEL(RIG_GNURADIO, 3) /* Sound card source */
#define RIG_MODEL_GRAUDIOIQ RIG_MAKE_MODEL(RIG_GNURADIO, 4) /* I&Q stereo sound card source */
#define RIG_MODEL_USRP_G RIG_MAKE_MODEL(RIG_GNURADIO, 5) /* Universal Software Radio Peripheral */
/*
* Microtune tuners
*/
#define RIG_MICROTUNE 21
#define RIG_BACKEND_MICROTUNE "microtune"
#define RIG_MODEL_MICROTUNE_4937 RIG_MAKE_MODEL(RIG_MICROTUNE, 1) /* eval board */
#define RIG_MODEL_MICROTUNE_4702 RIG_MAKE_MODEL(RIG_MICROTUNE, 2) /* Alan's */
#define RIG_MODEL_MICROTUNE_4707 RIG_MAKE_MODEL(RIG_MICROTUNE, 3)
/*
* TAPR
*/
#define RIG_TAPR 22
#define RIG_BACKEND_TAPR "tapr"
#define RIG_MODEL_DSP10 RIG_MAKE_MODEL(RIG_TAPR, 1)
/*
* Flex-radio
*/
#define RIG_FLEXRADIO 23
#define RIG_BACKEND_FLEXRADIO "flexradio"
#define RIG_MODEL_SDR1000 RIG_MAKE_MODEL(RIG_FLEXRADIO, 1)
#define RIG_MODEL_SDR1000RFE RIG_MAKE_MODEL(RIG_FLEXRADIO, 2)
#define RIG_MODEL_DTTSP RIG_MAKE_MODEL(RIG_FLEXRADIO, 3)
#define RIG_MODEL_DTTSP_UDP RIG_MAKE_MODEL(RIG_FLEXRADIO, 4)
/*
* VEB Funkwerk Köpenick RFT
*/
#define RIG_RFT 24
#define RIG_BACKEND_RFT "rft"
#define RIG_MODEL_EKD500 RIG_MAKE_MODEL(RIG_RFT, 1)
/*
* Various kits
*/
#define RIG_KIT 25
#define RIG_BACKEND_KIT "kit"
#define RIG_MODEL_ELEKTOR304 RIG_MAKE_MODEL(RIG_KIT, 1)
#define RIG_MODEL_DRT1 RIG_MAKE_MODEL(RIG_KIT, 2)
#define RIG_MODEL_DWT RIG_MAKE_MODEL(RIG_KIT, 3)
#define RIG_MODEL_USRP0 RIG_MAKE_MODEL(RIG_KIT, 4) /* prototype */
#define RIG_MODEL_USRP RIG_MAKE_MODEL(RIG_KIT, 5)
#define RIG_MODEL_DDS60 RIG_MAKE_MODEL(RIG_KIT, 6)
#define RIG_MODEL_ELEKTOR507 RIG_MAKE_MODEL(RIG_KIT, 7) /* Elektor SDR USB */
#define RIG_MODEL_MINIVNA RIG_MAKE_MODEL(RIG_KIT, 8)
#define RIG_MODEL_SI570AVRUSB RIG_MAKE_MODEL(RIG_KIT, 9) /* SoftRock Si570 AVR */
#define RIG_MODEL_PMSDR RIG_MAKE_MODEL(RIG_KIT, 10)
#define RIG_MODEL_SI570PICUSB RIG_MAKE_MODEL(RIG_KIT, 11) /* SoftRock Si570 PIC */
#define RIG_MODEL_FIFISDR RIG_MAKE_MODEL(RIG_KIT, 12) /* FiFi-SDR USB */
#define RIG_MODEL_FUNCUBEDONGLE RIG_MAKE_MODEL(RIG_KIT, 13) /* FunCUBE Dongle */
#define RIG_MODEL_HIQSDR RIG_MAKE_MODEL(RIG_KIT, 14) /* HiQSDR */
#define RIG_MODEL_FASDR RIG_MAKE_MODEL(RIG_KIT,15) /* Funkamateur Sdr */
#define RIG_MODEL_SI570PEABERRY1 RIG_MAKE_MODEL(RIG_KIT, 16) /* Peaberry V1 */
#define RIG_MODEL_SI570PEABERRY2 RIG_MAKE_MODEL(RIG_KIT, 17) /* Peaberry V2 */
#define RIG_MODEL_FUNCUBEDONGLEPLUS RIG_MAKE_MODEL(RIG_KIT, 18) /* FunCUBE Dongle Pro+ */
#define RIG_MODEL_RSHFIQ RIG_MAKE_MODEL(RIG_KIT, 19) /* RS-HFIQ */
/*
* SW/FM/TV tuner cards supported by Video4Linux,*BSD, ..
*/
#define RIG_TUNER 26
#define RIG_BACKEND_TUNER "tuner"
#define RIG_MODEL_V4L RIG_MAKE_MODEL(RIG_TUNER, 1)
#define RIG_MODEL_V4L2 RIG_MAKE_MODEL(RIG_TUNER, 2)
/*
* Rohde & Schwarz--rs
*/
#define RIG_RS 27
#define RIG_BACKEND_RS "rs"
#define RIG_MODEL_ESMC RIG_MAKE_MODEL(RIG_RS, 1)
#define RIG_MODEL_EB200 RIG_MAKE_MODEL(RIG_RS, 2)
#define RIG_MODEL_XK2100 RIG_MAKE_MODEL(RIG_RS, 3)
/*
* Phillips/Simoco PRM80
*/
#define RIG_PRM80 28
#define RIG_BACKEND_PRM80 "prm80"
#define RIG_MODEL_PRM8060 RIG_MAKE_MODEL(RIG_PRM80, 1)
#define RIG_MODEL_PRM8070 RIG_MAKE_MODEL(RIG_PRM80, 2)
/*
* ADAT by HB9CBU
*
* ADDED: frgo (DG1SBG), 2012-01-01
*/
#define RIG_ADAT 29
#define RIG_BACKEND_ADAT "adat"
#define RIG_MODEL_ADT_200A RIG_MAKE_MODEL(RIG_ADAT, 1)
/*
* ICOM Marine
*/
#define RIG_ICMARINE 30
#define RIG_BACKEND_ICMARINE "icmarine"
#define RIG_MODEL_IC_M700PRO RIG_MAKE_MODEL(RIG_ICMARINE, 1)
#define RIG_MODEL_IC_M802 RIG_MAKE_MODEL(RIG_ICMARINE, 2)
#define RIG_MODEL_IC_M710 RIG_MAKE_MODEL(RIG_ICMARINE, 3)
#define RIG_MODEL_IC_M803 RIG_MAKE_MODEL(RIG_ICMARINE, 4)
/*
* Dorji transceiver modules
*/
#define RIG_DORJI 31
#define RIG_BACKEND_DORJI "dorji"
#define RIG_MODEL_DORJI_DRA818V RIG_MAKE_MODEL(RIG_DORJI, 1)
#define RIG_MODEL_DORJI_DRA818U RIG_MAKE_MODEL(RIG_DORJI, 2)
/*
* Barrett
*/
#define RIG_BARRETT 32
#define RIG_BACKEND_BARRETT "barrett"
#define RIG_MODEL_BARRETT_2050 RIG_MAKE_MODEL(RIG_BARRETT, 1)
#define RIG_MODEL_BARRETT_950 RIG_MAKE_MODEL(RIG_BARRETT, 2)
/*
* Elad
*/
#define RIG_ELAD 33
#define RIG_BACKEND_ELAD "elad"
#define RIG_MODEL_ELAD_FDM_DUO RIG_MAKE_MODEL(RIG_ELAD, 1)
//! @endcond
/*
* TODO:
RIG_MODEL_KWZ30, KNEISNER +DOERING
RIG_MODEL_E1800, DASA-Telefunken
etc.
*/
/*! \typedef typedef int rig_model_t
\brief Convenience type definition for rig model.
*/
typedef uint32_t rig_model_t;
/*
* struct rig_backend_list {
* rig_model_t model;
* const char *backend;
* } rig_backend_list[] = RIG_LIST;
*
* TODO:
*
{ RIG_RADIOSHACK, RIG_BACKEND_RADIOSHACK }, \
*/
#endif /* _RIGLIST_H */

View File

@ -0,0 +1,805 @@
/*
* Hamlib Interface - Rotator API header
* Copyright (c) 2000-2005 by Stephane Fillod
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifndef _ROTATOR_H
#define _ROTATOR_H 1
#include <hamlib/rig.h>
#include <hamlib/rotlist.h>
/**
* \addtogroup rotator
* @{
*/
/**
* \file rotator.h
* \brief Hamlib rotator data structures.
*
* This file contains the data structures and declarations for the Hamlib
* rotator Application Programming Interface (API).
*
* See the rotator.c file for more details on the rotator API functions.
*/
__BEGIN_DECLS
/* Forward struct references */
struct rot;
struct rot_state;
/**
* \typedef typedef struct s_rot ROT
* \brief Main rotator handle type definition.
*
* The #ROT handle is returned by rot_init() and is passed as a parameter to
* every rotator specific API call.
*
* rot_cleanup() must be called when this handle is no longer needed.
*/
typedef struct s_rot ROT;
/**
* \typedef typedef float elevation_t
* \brief Type definition for elevation.
*
* The \a elevation_t type is used as parameter for the rot_set_position() and
* rot_get_position() functions.
*
* Unless specified otherwise, the unit of \a elevation_t is decimal degrees.
*/
typedef float elevation_t;
/**
* \typedef typedef float azimuth_t
* \brief Type definition for azimuth.
*
* The \a azimuth_t type is used as parameter for the rot_set_position() and
* rot_get_position() functions.
*
* Unless specified otherwise, the unit of \a azimuth_t is decimal degrees.
*/
typedef float azimuth_t;
/**
* \brief The token in the netrotctl protocol for returning an error condition code.
*/
#define NETROTCTL_RET "RPRT "
/**
* \def ROT_RESET_ALL
* \brief A macro that returns the flag for the \b reset operation.
*
* \sa rot_reset(), rot_reset_t
*/
#define ROT_RESET_ALL 1
/**
* \typedef typedef int rot_reset_t
* \brief Type definition for rotator reset.
*
* The \a rot_reset_t type is used as parameter for the rot_reset() API
* function.
*/
typedef int rot_reset_t;
/**
* \brief Rotator type flags for bitmasks.
*/
typedef enum {
ROT_FLAG_AZIMUTH = (1 << 1), /*!< Azimuth */
ROT_FLAG_ELEVATION = (1 << 2) /*!< Elevation */
} rot_type_t;
//! @cond Doxygen_Suppress
/* So far only used in ests/dumpcaps_rot.c. */
#define ROT_TYPE_MASK (ROT_FLAG_AZIMUTH|ROT_FLAG_ELEVATION)
//! @endcond
/**
* \def ROT_TYPE_OTHER
* \brief Other type of rotator.
* \def ROT_TYPE_AZIMUTH
* \brief Azimuth only rotator.
* \def ROT_TYPE_ELEVATION
* \brief Elevation only rotator.
* \def ROT_TYPE_AZEL
* \brief Combination azimuth/elevation rotator.
*/
#define ROT_TYPE_OTHER 0
#define ROT_TYPE_AZIMUTH ROT_FLAG_AZIMUTH
#define ROT_TYPE_ELEVATION ROT_FLAG_ELEVATION
#define ROT_TYPE_AZEL (ROT_FLAG_AZIMUTH|ROT_FLAG_ELEVATION)
/**
* \def ROT_MOVE_UP
* \brief A macro that returns the flag for the \b UP direction.
*
* This macro defines the value of the \b UP direction which can be
* used with the rot_move() function.
*
* \sa rot_move(), ROT_MOVE_DOWN, ROT_MOVE_LEFT, ROT_MOVE_CCW,
* ROT_MOVE_RIGHT, ROT_MOVE_CW
*/
#define ROT_MOVE_UP (1<<1)
/**
* \def ROT_MOVE_DOWN
* \brief A macro that returns the flag for the \b DOWN direction.
*
* This macro defines the value of the \b DOWN direction which can be
* used with the rot_move() function.
*
* \sa rot_move(), ROT_MOVE_UP, ROT_MOVE_LEFT, ROT_MOVE_CCW, ROT_MOVE_RIGHT,
* ROT_MOVE_CW
*/
#define ROT_MOVE_DOWN (1<<2)
/**
* \def ROT_MOVE_LEFT
* \brief A macro that returns the flag for the \b LEFT direction.
*
* This macro defines the value of the \b LEFT direction which can be
* used with the rot_move function.
*
* \sa rot_move(), ROT_MOVE_UP, ROT_MOVE_DOWN, ROT_MOVE_CCW, ROT_MOVE_RIGHT,
* ROT_MOVE_CW
*/
#define ROT_MOVE_LEFT (1<<3)
/**
* \def ROT_MOVE_CCW
* \brief A macro that returns the flag for the \b counterclockwise direction.
*
* This macro defines the value of the \b counterclockwise direction which
* can be used with the rot_move() function. This value is equivalent to
* ROT_MOVE_LEFT.
*
* \sa rot_move(), ROT_MOVE_UP, ROT_MOVE_DOWN, ROT_MOVE_LEFT, ROT_MOVE_RIGHT,
* ROT_MOVE_CW
*/
#define ROT_MOVE_CCW ROT_MOVE_LEFT
/**
* \def ROT_MOVE_RIGHT
* \brief A macro that returns the flag for the \b RIGHT direction.
*
* This macro defines the value of the \b RIGHT direction which can be used
* with the rot_move() function.
*
* \sa rot_move(), ROT_MOVE_UP, ROT_MOVE_DOWN, ROT_MOVE_LEFT, ROT_MOVE_CCW,
* ROT_MOVE_CW
*/
#define ROT_MOVE_RIGHT (1<<4)
/**
* \def ROT_MOVE_CW
* \brief A macro that returns the flag for the \b clockwise direction.
*
* This macro defines the value of the \b clockwise direction which can be
* used with the rot_move() function. This value is equivalent to
* ROT_MOVE_RIGHT.
*
* \sa rot_move(), ROT_MOVE_UP, ROT_MOVE_DOWN, ROT_MOVE_LEFT, ROT_MOVE_CCW,
* ROT_MOVE_RIGHT
*/
#define ROT_MOVE_CW ROT_MOVE_RIGHT
/**
* \brief Rotator status flags
*/
typedef enum {
ROT_STATUS_NONE = 0, /*!< '' -- No status. */
ROT_STATUS_BUSY = (1 << 0), /*!< Rotator is busy, not accepting commands. */
ROT_STATUS_MOVING = (1 << 1), /*!< Rotator is currently moving (direction type not specified). */
ROT_STATUS_MOVING_AZ = (1 << 2), /*!< Azimuth rotator is currently moving (direction not specified). */
ROT_STATUS_MOVING_LEFT = (1 << 3), /*!< Azimuth rotator is currently moving left. */
ROT_STATUS_MOVING_RIGHT = (1 << 4), /*!< Azimuth rotator is currently moving right. */
ROT_STATUS_MOVING_EL = (1 << 5), /*!< Elevation rotator is currently moving (direction not specified). */
ROT_STATUS_MOVING_UP = (1 << 6), /*!< Elevation rotator is currently moving up. */
ROT_STATUS_MOVING_DOWN = (1 << 7), /*!< Elevation rotator is currently moving down. */
ROT_STATUS_LIMIT_UP = (1 << 8), /*!< The elevation rotator has reached its limit to move up. */
ROT_STATUS_LIMIT_DOWN = (1 << 9), /*!< The elevation rotator has reached its limit to move down.*/
ROT_STATUS_LIMIT_LEFT = (1 << 10), /*!< The azimuth rotator has reached its limit to move left (CCW). */
ROT_STATUS_LIMIT_RIGHT = (1 << 11), /*!< The azimuth rotator has reached its limit to move right (CW). */
ROT_STATUS_OVERLAP_UP = (1 << 12), /*!< The elevation rotator has rotated up past 360 degrees. */
ROT_STATUS_OVERLAP_DOWN = (1 << 13), /*!< The elevation rotator has rotated down past 0 degrees. */
ROT_STATUS_OVERLAP_LEFT = (1 << 14), /*!< The azimuth rotator has rotated left (CCW) past 0 degrees. */
ROT_STATUS_OVERLAP_RIGHT = (1 << 16), /*!< The azimuth rotator has rotated right (CW) past 360 degrees. */
} rot_status_t;
//! @cond Doxygen_Suppress
/* So far only used in tests/sprintflst.c. */
#define ROT_STATUS_N(n) (1u<<(n))
//! @endcond
/**
* \brief Macro for not changing the rotator speed with move() function.
*/
#define ROT_SPEED_NOCHANGE (-1)
/**
* \brief Rotator Level Settings.
*
* Various operating levels supported by a rotator.
*
* \c STRING used in the \c rotctl and \c rotctld utilities.
*
* \sa rot_parse_level(), rot_strlevel()
*/
enum rot_level_e {
ROT_LEVEL_NONE = 0, /*!< '' -- No Level. */
ROT_LEVEL_SPEED = (1 << 0), /*!< \c SPEED -- Rotation speed, arg int (default range 1-100 if not specified). */
ROT_LEVEL_63 = CONSTANT_64BIT_FLAG(63), /*!< **Future use**, last level. */
};
//! @cond Doxygen_Suppress
#define ROT_LEVEL_FLOAT_LIST (0)
#define ROT_LEVEL_READONLY_LIST (0)
#define ROT_LEVEL_IS_FLOAT(l) ((l)&ROT_LEVEL_FLOAT_LIST)
#define ROT_LEVEL_SET(l) ((l)&~ROT_LEVEL_READONLY_LIST)
//! @endcond
/** @cond Doxygen_Suppress
* FIXME: The following needs more explanation about how STRING relates
* to this macro.
* @endcond
*/
/**
* \brief Rotator Parameters
*
* Parameters are settings that are not related to core rotator functionality,
* i.e. antenna rotation.
*
* \c STRING used in the \c rotctl and \c rotctld utilities.
*
* \sa rot_parse_parm(), rot_strparm()
*/
enum rot_parm_e {
ROT_PARM_NONE = 0, /*!< '' -- No Parm */
};
//! @cond Doxygen_Suppress
#define ROT_PARM_FLOAT_LIST (0)
#define ROT_PARM_READONLY_LIST (0)
#define ROT_PARM_IS_FLOAT(l) ((l)&ROT_PARM_FLOAT_LIST)
#define ROT_PARM_SET(l) ((l)&~ROT_PARM_READONLY_LIST)
//! @endcond
/** @cond Doxygen_Suppress
* FIXME: The following needs more explanation about how STRING relates
* to these macros.
* @endcond
*/
/**
* \brief Rotator Function Settings.
*
* Various operating functions supported by a rotator.
*
* \c STRING used in the \c rotctl and \c rotctld utilities.
*
* \sa rot_parse_func(), rot_strfunc()
*/
#define ROT_FUNC_NONE 0 /*!< '' -- No Function */
#ifndef SWIGLUAHIDE
/* Hide the top 32 bits from the old Lua binding as they can't be represented */
#define ROT_FUNC_BIT63 CONSTANT_64BIT_FLAG (63) /*!< **Future use**, ROT_FUNC items. */
/* 63 is this highest bit number that can be used */
#endif
/* Basic rot type, can store some useful info about different rotators. Each
* lib must be able to populate this structure, so we can make useful
* enquiries about capabilities.
*/
/**
* \struct rot_caps
* \brief Rotator capability data structure.
*
* The main idea of this structure is that it will be defined by the backend
* rotator driver, and will remain read-only for the application. Fields that
* need to be modifiable by the application are copied into the rot_state
* structure, which is the private memory area of the #ROT instance.
*
* This way, you can have several rotators running within the same
* application, sharing the rot_caps structure of the backend, while keeping
* their own customized data.
*
* \b Note: Don't move fields around and only add new fields at the end of the
* rot_caps structure. Shared libraries and DLLs depend on a constant
* structure to maintain compatibility.
*/
struct rot_caps {
rot_model_t rot_model; /*!< Rotator model as defined in rotlist.h. */
const char *model_name; /*!< Model name, e.g. TT-360. */
const char *mfg_name; /*!< Manufacturer, e.g. Tower Torquer. */
const char *version; /*!< Driver version, typically in YYYYMMDD.x format. */
const char *copyright; /*!< Copyright info (should be LGPL). */
enum rig_status_e status; /*!< Driver status. */
int rot_type; /*!< Rotator type. */
enum rig_port_e port_type; /*!< Type of communication port (serial, ethernet, etc.). */
int serial_rate_min; /*!< Minimal serial speed. */
int serial_rate_max; /*!< Maximal serial speed. */
int serial_data_bits; /*!< Number of data bits. */
int serial_stop_bits; /*!< Number of stop bits. */
enum serial_parity_e serial_parity; /*!< Parity. */
enum serial_handshake_e serial_handshake; /*!< Handshake. */
int write_delay; /*!< Write delay. */
int post_write_delay; /*!< Post-write delay. */
int timeout; /*!< Timeout. */
int retry; /*!< Number of retries if command fails. */
setting_t has_get_func; /*!< List of get functions. */
setting_t has_set_func; /*!< List of set functions. */
setting_t has_get_level; /*!< List of get levels. */
setting_t has_set_level; /*!< List of set levels. */
setting_t has_get_parm; /*!< List of get parameters. */
setting_t has_set_parm; /*!< List of set parameters. */
rot_status_t has_status; /*!< Supported status flags. */
gran_t level_gran[RIG_SETTING_MAX]; /*!< level granularity (i.e. steps). */
gran_t parm_gran[RIG_SETTING_MAX]; /*!< parm granularity (i.e. steps). */
const struct confparams *extparms; /*!< Extension parameters list, \sa rot_ext.c. */
const struct confparams *extlevels; /*!< Extension levels list, \sa rot_ext.c. */
const struct confparams *extfuncs; /*!< Extension functions list, \sa rot_ext.c. */
int *ext_tokens; /*!< Extension token list. */
/*
* Movement range, az is relative to North
* negative values allowed for overlap
*/
azimuth_t min_az; /*!< Lower limit for azimuth (relative to North). */
azimuth_t max_az; /*!< Upper limit for azimuth (relative to North). */
elevation_t
min_el; /*!< Lower limit for elevation. */
elevation_t
max_el; /*!< Upper limit for elevation. */
const struct confparams *cfgparams; /*!< Configuration parameters. */
const rig_ptr_t priv; /*!< Private data. */
/*
* Rot Admin API
*
*/
int (*rot_init)(ROT *rot); /*!< Pointer to backend implementation of ::rot_init(). */
int (*rot_cleanup)(ROT *rot); /*!< Pointer to backend implementation of ::rot_cleanup(). */
int (*rot_open)(ROT *rot); /*!< Pointer to backend implementation of ::rot_open(). */
int (*rot_close)(ROT *rot); /*!< Pointer to backend implementation of ::rot_close(). */
int (*set_conf)(ROT *rot, token_t token, const char *val); /*!< Pointer to backend implementation of ::rot_set_conf(). */
int (*get_conf)(ROT *rot, token_t token, char *val); /*!< Pointer to backend implementation of ::rot_get_conf(). */
/*
* General API commands, from most primitive to least.. :()
* List Set/Get functions pairs
*/
int (*set_position)(ROT *rot, azimuth_t azimuth, elevation_t elevation); /*!< Pointer to backend implementation of ::rot_set_position(). */
int (*get_position)(ROT *rot, azimuth_t *azimuth, elevation_t *elevation); /*!< Pointer to backend implementation of ::rot_get_position(). */
int (*stop)(ROT *rot); /*!< Pointer to backend implementation of ::rot_stop(). */
int (*park)(ROT *rot); /*!< Pointer to backend implementation of ::rot_park(). */
int (*reset)(ROT *rot, rot_reset_t reset); /*!< Pointer to backend implementation of ::rot_reset(). */
int (*move)(ROT *rot, int direction, int speed); /*!< Pointer to backend implementation of ::rot_move(). */
/* get firmware info, etc. */
const char * (*get_info)(ROT *rot); /*!< Pointer to backend implementation of ::rot_get_info(). */
int (*set_level)(ROT *rot, setting_t level, value_t val); /*!< Pointer to backend implementation of ::rot_set_level(). */
int (*get_level)(ROT *rot, setting_t level, value_t *val); /*!< Pointer to backend implementation of ::rot_get_level(). */
int (*set_func)(ROT *rot, setting_t func, int status); /*!< Pointer to backend implementation of ::rot_set_func(). */
int (*get_func)(ROT *rot, setting_t func, int *status); /*!< Pointer to backend implementation of ::rot_get_func(). */
int (*set_parm)(ROT *rot, setting_t parm, value_t val); /*!< Pointer to backend implementation of ::rot_set_parm(). */
int (*get_parm)(ROT *rot, setting_t parm, value_t *val); /*!< Pointer to backend implementation of ::rot_get_parm(). */
int (*set_ext_level)(ROT *rot, token_t token, value_t val); /*!< Pointer to backend implementation of ::rot_set_ext_level(). */
int (*get_ext_level)(ROT *rot, token_t token, value_t *val); /*!< Pointer to backend implementation of ::rot_get_ext_level(). */
int (*set_ext_func)(ROT *rot, token_t token, int status); /*!< Pointer to backend implementation of ::rot_set_ext_func(). */
int (*get_ext_func)(ROT *rot, token_t token, int *status); /*!< Pointer to backend implementation of ::rot_get_ext_func(). */
int (*set_ext_parm)(ROT *rot, token_t token, value_t val); /*!< Pointer to backend implementation of ::rot_set_ext_parm(). */
int (*get_ext_parm)(ROT *rot, token_t token, value_t *val); /*!< Pointer to backend implementation of ::rot_get_ext_parm(). */
int (*get_status)(ROT *rot, rot_status_t *status); /*!< Pointer to backend implementation of ::rot_get_status(). */
const char *macro_name; /*!< Rotator model macro name. */
};
//! @cond Doxygen_Suppress
#define ROT_MODEL(arg) .rot_model=arg,.macro_name=#arg
//! @endcond
/**
* \struct rot_state
* \brief Rotator state structure
*
* This structure contains live data, as well as a copy of capability fields
* that may be updated, i.e. customized while the #ROT handle is instantiated.
*
* It is fine to move fields around, as this kind of structure should not be
* initialized like rot_caps are.
*/
struct rot_state {
/*
* overridable fields
*/
azimuth_t min_az; /*!< Lower limit for azimuth (overridable). */
azimuth_t max_az; /*!< Upper limit for azimuth (overridable). */
elevation_t min_el; /*!< Lower limit for elevation (overridable). */
elevation_t max_el; /*!< Upper limit for elevation (overridable). */
int south_zero; /*!< South is zero degrees. */
azimuth_t az_offset; /*!< Offset to be applied to azimuth. */
elevation_t el_offset; /*!< Offset to be applied to elevation. */
setting_t has_get_func; /*!< List of get functions. */
setting_t has_set_func; /*!< List of set functions. */
setting_t has_get_level; /*!< List of get levels. */
setting_t has_set_level; /*!< List of set levels. */
setting_t has_get_parm; /*!< List of get parameters. */
setting_t has_set_parm; /*!< List of set parameters. */
rot_status_t has_status; /*!< Supported status flags. */
gran_t level_gran[RIG_SETTING_MAX]; /*!< Level granularity. */
gran_t parm_gran[RIG_SETTING_MAX]; /*!< Parameter granularity. */
/*
* non overridable fields, internal use
*/
hamlib_port_t rotport; /*!< Rotator port (internal use). */
hamlib_port_t rotport2; /*!< 2nd Rotator port (internal use). */
int comm_state; /*!< Comm port state, i.e. opened or closed. */
rig_ptr_t priv; /*!< Pointer to private rotator state data. */
rig_ptr_t obj; /*!< Internal use by hamlib++ for event handling. */
int current_speed; /*!< Current speed 1-100, to be used when no change to speed is requested. */
/* etc... */
};
/**
* \struct s_rot
* \brief Master rotator structure.
*
* This is the master data structure acting as the #ROT handle for the
* controlled rotator. A pointer to this structure is returned by the
* rot_init() API function and is passed as a parameter to every rotator
* specific API call.
*
* \sa rot_init(), rot_caps, rot_state
*/
struct s_rot {
struct rot_caps *caps; /*!< Rotator caps. */
struct rot_state state; /*!< Rotator state. */
};
//! @cond Doxygen_Suppress
/* --------------- API function prototypes -----------------*/
extern HAMLIB_EXPORT(ROT *)
rot_init HAMLIB_PARAMS((rot_model_t rot_model));
extern HAMLIB_EXPORT(int)
rot_open HAMLIB_PARAMS((ROT *rot));
extern HAMLIB_EXPORT(int)
rot_close HAMLIB_PARAMS((ROT *rot));
extern HAMLIB_EXPORT(int)
rot_cleanup HAMLIB_PARAMS((ROT *rot));
extern HAMLIB_EXPORT(int)
rot_set_conf HAMLIB_PARAMS((ROT *rot,
token_t token,
const char *val));
extern HAMLIB_EXPORT(int)
rot_get_conf HAMLIB_PARAMS((ROT *rot,
token_t token,
char *val));
/*
* General API commands, from most primitive to least.. )
* List Set/Get functions pairs
*/
extern HAMLIB_EXPORT(int)
rot_set_position HAMLIB_PARAMS((ROT *rot,
azimuth_t azimuth,
elevation_t elevation));
extern HAMLIB_EXPORT(int)
rot_get_position HAMLIB_PARAMS((ROT *rot,
azimuth_t *azimuth,
elevation_t *elevation));
extern HAMLIB_EXPORT(int)
rot_stop HAMLIB_PARAMS((ROT *rot));
extern HAMLIB_EXPORT(int)
rot_park HAMLIB_PARAMS((ROT *rot));
extern HAMLIB_EXPORT(int)
rot_reset HAMLIB_PARAMS((ROT *rot,
rot_reset_t reset));
extern HAMLIB_EXPORT(int)
rot_move HAMLIB_PARAMS((ROT *rot,
int direction,
int speed));
extern HAMLIB_EXPORT(setting_t)
rot_has_get_level HAMLIB_PARAMS((ROT *rot,
setting_t level));
extern HAMLIB_EXPORT(setting_t)
rot_has_set_level HAMLIB_PARAMS((ROT *rot,
setting_t level));
extern HAMLIB_EXPORT(setting_t)
rot_has_get_parm HAMLIB_PARAMS((ROT *rot,
setting_t parm));
extern HAMLIB_EXPORT(setting_t)
rot_has_set_parm HAMLIB_PARAMS((ROT *rot,
setting_t parm));
extern HAMLIB_EXPORT(setting_t)
rot_has_get_func HAMLIB_PARAMS((ROT *rot,
setting_t func));
extern HAMLIB_EXPORT(setting_t)
rot_has_set_func HAMLIB_PARAMS((ROT *rot,
setting_t func));
extern HAMLIB_EXPORT(int)
rot_set_func HAMLIB_PARAMS((ROT *rot,
setting_t func,
int status));
extern HAMLIB_EXPORT(int)
rot_get_func HAMLIB_PARAMS((ROT *rot,
setting_t func,
int *status));
extern HAMLIB_EXPORT(int)
rot_set_level HAMLIB_PARAMS((ROT *rig,
setting_t level,
value_t val));
extern HAMLIB_EXPORT(int)
rot_get_level HAMLIB_PARAMS((ROT *rig,
setting_t level,
value_t *val));
extern HAMLIB_EXPORT(int)
rot_set_parm HAMLIB_PARAMS((ROT *rig,
setting_t parm,
value_t val));
extern HAMLIB_EXPORT(int)
rot_get_parm HAMLIB_PARAMS((ROT *rig,
setting_t parm,
value_t *val));
extern HAMLIB_EXPORT(int)
rot_set_ext_level HAMLIB_PARAMS((ROT *rig,
token_t token,
value_t val));
extern HAMLIB_EXPORT(int)
rot_get_ext_level HAMLIB_PARAMS((ROT *rig,
token_t token,
value_t *val));
extern HAMLIB_EXPORT(int)
rot_set_ext_func HAMLIB_PARAMS((ROT *rig,
token_t token,
int status));
extern HAMLIB_EXPORT(int)
rot_get_ext_func HAMLIB_PARAMS((ROT *rig,
token_t token,
int *status));
extern HAMLIB_EXPORT(int)
rot_set_ext_parm HAMLIB_PARAMS((ROT *rig,
token_t token,
value_t val));
extern HAMLIB_EXPORT(int)
rot_get_ext_parm HAMLIB_PARAMS((ROT *rig,
token_t token,
value_t *val));
extern HAMLIB_EXPORT(const char *)
rot_get_info HAMLIB_PARAMS((ROT *rot));
extern HAMLIB_EXPORT(int)
rot_get_status HAMLIB_PARAMS((ROT *rot,
rot_status_t *status));
extern HAMLIB_EXPORT(int)
rot_register HAMLIB_PARAMS((const struct rot_caps *caps));
extern HAMLIB_EXPORT(int)
rot_unregister HAMLIB_PARAMS((rot_model_t rot_model));
extern HAMLIB_EXPORT(int)
rot_list_foreach HAMLIB_PARAMS((int (*cfunc)(const struct rot_caps *,
rig_ptr_t),
rig_ptr_t data));
extern HAMLIB_EXPORT(int)
rot_load_backend HAMLIB_PARAMS((const char *be_name));
extern HAMLIB_EXPORT(int)
rot_check_backend HAMLIB_PARAMS((rot_model_t rot_model));
extern HAMLIB_EXPORT(int)
rot_load_all_backends HAMLIB_PARAMS((void));
extern HAMLIB_EXPORT(rot_model_t)
rot_probe_all HAMLIB_PARAMS((hamlib_port_t *p));
extern HAMLIB_EXPORT(int)
rot_token_foreach HAMLIB_PARAMS((ROT *rot,
int (*cfunc)(const struct confparams *,
rig_ptr_t),
rig_ptr_t data));
extern HAMLIB_EXPORT(const struct confparams *)
rot_confparam_lookup HAMLIB_PARAMS((ROT *rot,
const char *name));
extern HAMLIB_EXPORT(token_t)
rot_token_lookup HAMLIB_PARAMS((ROT *rot,
const char *name));
extern HAMLIB_EXPORT(int)
rot_ext_func_foreach HAMLIB_PARAMS((ROT *rot,
int (*cfunc)(ROT *,
const struct confparams *,
rig_ptr_t),
rig_ptr_t data));
extern HAMLIB_EXPORT(int)
rot_ext_level_foreach HAMLIB_PARAMS((ROT *rot,
int (*cfunc)(ROT *,
const struct confparams *,
rig_ptr_t),
rig_ptr_t data));
extern HAMLIB_EXPORT(int)
rot_ext_parm_foreach HAMLIB_PARAMS((ROT *rot,
int (*cfunc)(ROT *,
const struct confparams *,
rig_ptr_t),
rig_ptr_t data));
extern HAMLIB_EXPORT(const struct confparams *)
rot_ext_lookup HAMLIB_PARAMS((ROT *rot,
const char *name));
extern HAMLIB_EXPORT(const struct confparams *)
rot_ext_lookup_tok HAMLIB_PARAMS((ROT *rot,
token_t token));
extern HAMLIB_EXPORT(token_t)
rot_ext_token_lookup HAMLIB_PARAMS((ROT *rot,
const char *name));
extern HAMLIB_EXPORT(const struct rot_caps *)
rot_get_caps HAMLIB_PARAMS((rot_model_t rot_model));
extern HAMLIB_EXPORT(int)
qrb HAMLIB_PARAMS((double lon1,
double lat1,
double lon2,
double lat2,
double *distance,
double *azimuth));
extern HAMLIB_EXPORT(double)
distance_long_path HAMLIB_PARAMS((double distance));
extern HAMLIB_EXPORT(double)
azimuth_long_path HAMLIB_PARAMS((double azimuth));
extern HAMLIB_EXPORT(int)
longlat2locator HAMLIB_PARAMS((double longitude,
double latitude,
char *locator_res,
int pair_count));
extern HAMLIB_EXPORT(int)
locator2longlat HAMLIB_PARAMS((double *longitude,
double *latitude,
const char *locator));
extern HAMLIB_EXPORT(double)
dms2dec HAMLIB_PARAMS((int degrees,
int minutes,
double seconds,
int sw));
extern HAMLIB_EXPORT(int)
dec2dms HAMLIB_PARAMS((double dec,
int *degrees,
int *minutes,
double *seconds,
int *sw));
extern HAMLIB_EXPORT(int)
dec2dmmm HAMLIB_PARAMS((double dec,
int *degrees,
double *minutes,
int *sw));
extern HAMLIB_EXPORT(double)
dmmm2dec HAMLIB_PARAMS((int degrees,
double minutes,
double seconds,
int sw));
extern HAMLIB_EXPORT(setting_t) rot_parse_func(const char *s);
extern HAMLIB_EXPORT(setting_t) rot_parse_level(const char *s);
extern HAMLIB_EXPORT(setting_t) rot_parse_parm(const char *s);
extern HAMLIB_EXPORT(const char *) rot_strfunc(setting_t);
extern HAMLIB_EXPORT(const char *) rot_strlevel(setting_t);
extern HAMLIB_EXPORT(const char *) rot_strparm(setting_t);
extern HAMLIB_EXPORT(const char *) rot_strstatus(rot_status_t);
//! @endcond
/**
* \def rot_debug
* \brief Convenience macro for generating debugging messages.
*
* This is an alias of the rig_debug() function call and is used in the same
* manner.
*/
#define rot_debug rig_debug
__END_DECLS
#endif /* _ROTATOR_H */
/** @} */

View File

@ -0,0 +1,637 @@
/*
* Hamlib Interface - list of known rotators
* Copyright (c) 2000-2011 by Stephane Fillod
* Copyright (c) 2000-2002 by Frank Singleton
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifndef _ROTLIST_H
#define _ROTLIST_H 1
//! @cond Doxygen_Suppress
#define ROT_MAKE_MODEL(a,b) ((a)*100+(b))
#define ROT_BACKEND_NUM(a) ((a)/100)
//! @endcond
/**
* \addtogroup rotator
* @{
*/
/**
* \file rotlist.h
* \brief Hamlib rotator model definitions.
*
* This file contains rotator model definitions for the Hamlib rotator
* Application Programming Interface (API). Each distinct rotator type has a
* unique model number (ID) and is used by Hamlib to identify and distinguish
* between the different hardware drivers. The exact model numbers can be
* acquired using the macros in this file. To obtain a list of supported
* rotator branches, one can use the statically defined ROT_BACKEND_LIST macro
* (defined in configure.ac). To obtain a full list of supported rotators
* (including each model in every branch), the foreach_opened_rot() API
* function can be used.
*
* The model number, or ID, is used to tell Hamlib which rotator the client
* wishes to use which is done with the rot_init() API call.
*/
/**
* \def ROT_MODEL_NONE
* \brief A macro that returns the model number for an unknown model.
*
* The none backend, as the name suggests, does nothing. It is mainly for
* internal use.
*/
#define ROT_MODEL_NONE 0
/**
* \brief A macro that returns the model number for the DUMMY backend.
*
* \def ROT_MODEL_DUMMY
*
* The DUMMY backend, as the name suggests, is a backend which performs
* no hardware operations and always behaves as one would expect. It can
* be thought of as a hardware simulator and is very useful for testing
* client applications.
*/
/**
* \brief A macro that returns the model number for the NETROTCTL backend.
*
* \def ROT_MODEL_NETROTCTL
*
* The NETROTCTL backend allows use of the `rotctld` daemon through the normal
* Hamlib API.
*/
//! @cond Doxygen_Suppress
#define ROT_DUMMY 0
#define ROT_BACKEND_DUMMY "dummy"
//! @endcond
#define ROT_MODEL_DUMMY ROT_MAKE_MODEL(ROT_DUMMY, 1)
#define ROT_MODEL_NETROTCTL ROT_MAKE_MODEL(ROT_DUMMY, 2)
/**
* \brief A macro that returns the model number of the EASYCOMM 1 backend.
*
* \def ROT_MODEL_EASYCOMM1
*
* The EASYCOMM1 backend can be used with rotators that support the EASYCOMM
* I Standard.
*/
/**
* \brief A macro that returns the model number of the EASYCOMM 2 backend.
*
* \def ROT_MODEL_EASYCOMM2
*
* The EASYCOMM2 backend can be used with rotators that support the EASYCOMM
* II Standard.
*/
/**
* \brief A macro that returns the model number of the EASYCOMM 3 backend.
*
* \def ROT_MODEL_EASYCOMM3
*
* The EASYCOMM3 backend can be used with rotators that support the EASYCOMM
* III Standard.
*/
//! @cond Doxygen_Suppress
#define ROT_EASYCOMM 2
#define ROT_BACKEND_EASYCOMM "easycomm"
//! @endcond
#define ROT_MODEL_EASYCOMM1 ROT_MAKE_MODEL(ROT_EASYCOMM, 1)
#define ROT_MODEL_EASYCOMM2 ROT_MAKE_MODEL(ROT_EASYCOMM, 2)
#define ROT_MODEL_EASYCOMM3 ROT_MAKE_MODEL(ROT_EASYCOMM, 4)
/**
* \brief A macro that returns the model number of the FODTRACK backend.
*
* \def ROT_MODEL_FODTRACK
*
* The FODTRACK backend can be used with rotators that support the FODTRACK
* Standard.
*/
//! @cond Doxygen_Suppress
#define ROT_FODTRACK 3
#define ROT_BACKEND_FODTRACK "fodtrack"
//! @endcond
#define ROT_MODEL_FODTRACK ROT_MAKE_MODEL(ROT_FODTRACK, 1)
/**
* \brief A macro that returns the model number of the ROTOREZ backend.
*
* \def ROT_MODEL_ROTOREZ
*
* The ROTOREZ backend can be used with Hy-Gain rotators that support the
* extended DCU command set by the Idiom Press Rotor-EZ board.
*/
/**
* \brief A macro that returns the model number of the ROTORCARD backend.
*
* \def ROT_MODEL_ROTORCARD
*
* The ROTORCARD backend can be used with Yaesu rotators that support the
* extended DCU command set by the Idiom Press Rotor Card board.
*/
/**
* \brief A macro that returns the model number of the DCU backend.
*
* \def ROT_MODEL_DCU
*
* The DCU backend can be used with rotators that support the DCU command set
* by Hy-Gain (currently the DCU-1).
*/
/**
* \brief A macro that returns the model number of the ERC backend.
*
* \def ROT_MODEL_ERC
*
* The ERC backend can be used with rotators that support the DCU command set
* by DF9GR (currently the ERC).
*/
/**
* \brief A macro that returns the model number of the RT21 backend.
*
* \def ROT_MODEL_RT21
*
* The RT21 backend can be used with rotators that support the DCU command set
* by Green Heron (currently the RT-21).
*/
//! @cond Doxygen_Suppress
#define ROT_ROTOREZ 4
#define ROT_BACKEND_ROTOREZ "rotorez"
//! @endcond
#define ROT_MODEL_ROTOREZ ROT_MAKE_MODEL(ROT_ROTOREZ, 1)
#define ROT_MODEL_ROTORCARD ROT_MAKE_MODEL(ROT_ROTOREZ, 2)
#define ROT_MODEL_DCU ROT_MAKE_MODEL(ROT_ROTOREZ, 3)
#define ROT_MODEL_ERC ROT_MAKE_MODEL(ROT_ROTOREZ, 4)
#define ROT_MODEL_RT21 ROT_MAKE_MODEL(ROT_ROTOREZ, 5)
/**
* \brief A macro that returns the model number of the SARTEK1 backend.
*
* \def ROT_MODEL_SARTEK1
*
* The SARTEK1 backend can be used with rotators that support the SARtek
* protocol.
*/
//! @cond Doxygen_Suppress
#define ROT_SARTEK 5
#define ROT_BACKEND_SARTEK "sartek"
//! @endcond
#define ROT_MODEL_SARTEK1 ROT_MAKE_MODEL(ROT_SARTEK, 1)
/**
* \brief A macro that returns the model number of the GS232A backend.
*
* \def ROT_MODEL_GS232A
*
* The GS232A backend can be used with rotators that support the GS-232A
* protocol.
*/
/**
* \brief A macro that returns the model number of the GS232 backend.
*
* \def ROT_MODEL_GS232_GENERIC
*
* The GS232_GENERIC backend can be used with rotators that support the
* generic (even if not coded correctly) GS-232 protocol.
*/
/**
* \brief A macro that returns the model number of the GS232B backend.
*
* \def ROT_MODEL_GS232B
*
* The GS232B backend can be used with rotators that support the GS232B
* protocol.
*/
/**
* \brief A macro that returns the model number of the F1TETRACKER backend.
*
* \def ROT_MODEL_F1TETRACKER
*
* The F1TETRACKER backend can be used with rotators that support the F1TE
* Tracker protocol.
*/
/**
* \brief A macro that returns the model number of the GS23 backend.
*
* \def ROT_MODEL_GS23
*
* The GS23 backend can be used with rotators that support the GS-23 protocol.
*/
/**
* \brief A macro that returns the model number of the GS232 backend.
*
* \def ROT_MODEL_GS232
*
* The GS232 backend can be used with rotators that support the GS-232
* protocol.
*/
/**
* \brief A macro that returns the model number of the LVB backend.
*
* \def ROT_MODEL_LVB
*
* The LVB backend can be used with rotators that support the G6LVB AMSAT LVB
* Tracker GS-232 based protocol.
*/
/**
* \brief A macro that returns the model number of the ST2 backend.
*
* \def ROT_MODEL_ST2
*
* The ST2 backend can be used with rotators that support the Fox Delta ST2
* GS-232 based protocol.
*/
/**
* \brief A macro that returns the model number of the GS232A_AZ Azimuth backend.
*
* \def ROT_MODEL_GS232A_AZ
*
* The GS232A_AZ backend can be used with azimuth rotators that support the
* GS-232A protocol.
*/
/**
* \brief A macro that returns the model number of the GS232A_EL Elevation backend.
*
* \def ROT_MODEL_GS232A_EL
*
* The GS232A_EL backend can be used with elevation rotators that support the
* GS-232A protocol.
*/
/**
* \brief A macro that returns the model number of the GS232B_AZ Azimuth backend.
*
* \def ROT_MODEL_GS232B_AZ
*
* The GS232B_AZ backend can be used with azimuth rotators that support the
* GS-232B protocol.
*/
/**
* \brief A macro that returns the model number of the GS232B_EL Elevation backend.
*
* \def ROT_MODEL_GS232B_EL
*
* The GS232B_EL backend can be used with elevation rotators that support the
* GS-232B protocol.
*/
//! @cond Doxygen_Suppress
#define ROT_GS232A 6
#define ROT_BACKEND_GS232A "gs232a"
//! @endcond
#define ROT_MODEL_GS232A ROT_MAKE_MODEL(ROT_GS232A, 1)
#define ROT_MODEL_GS232_GENERIC ROT_MAKE_MODEL(ROT_GS232A, 2) /* GENERIC */
#define ROT_MODEL_GS232B ROT_MAKE_MODEL(ROT_GS232A, 3)
#define ROT_MODEL_F1TETRACKER ROT_MAKE_MODEL(ROT_GS232A, 4)
#define ROT_MODEL_GS23 ROT_MAKE_MODEL(ROT_GS232A, 5)
#define ROT_MODEL_GS232 ROT_MAKE_MODEL(ROT_GS232A, 6) /* Not A or B */
#define ROT_MODEL_LVB ROT_MAKE_MODEL(ROT_GS232A, 7)
#define ROT_MODEL_ST2 ROT_MAKE_MODEL(ROT_GS232A, 8)
#define ROT_MODEL_GS232A_AZ ROT_MAKE_MODEL(ROT_GS232A, 9)
#define ROT_MODEL_GS232A_EL ROT_MAKE_MODEL(ROT_GS232A, 10)
#define ROT_MODEL_GS232B_AZ ROT_MAKE_MODEL(ROT_GS232A, 11)
#define ROT_MODEL_GS232B_EL ROT_MAKE_MODEL(ROT_GS232A, 12)
/**
* \brief A macro that returns the model number of the PCROTOR backend.
*
* \def ROT_MODEL_PCROTOR
*
* The PCROTOR backend is a member of the kit backend group that can be used
* with home brewed rotators.
*/
//! @cond Doxygen_Suppress
#define ROT_KIT 7
#define ROT_BACKEND_KIT "kit"
//! @endcond
#define ROT_MODEL_PCROTOR ROT_MAKE_MODEL(ROT_KIT, 1)
/**
* \brief A macro that returns the model number of the HD1780 backend.
*
* \def ROT_MODEL_HD1780
*
* The HD1780 backend can be used with rotators that support the Heathkit
* HD-1780 protocol.
*/
//! @cond Doxygen_Suppress
#define ROT_HEATHKIT 8
#define ROT_BACKEND_HEATHKIT "heathkit"
//! @endcond
#define ROT_MODEL_HD1780 ROT_MAKE_MODEL(ROT_HEATHKIT, 1)
/**
* \brief A macro that returns the model number of the ROT2PROG backend.
*
* \def ROT_MODEL_SPID_ROT2PROG
*
* The SPID_ROT2PROG backend can be used with rotators that support the SPID
* azimuth and elevation protocol.
*/
/**
* \brief A macro that returns the model number of the ROT1PROG backend.
*
* \def ROT_MODEL_SPID_ROT1PROG
*
* The SPID_ROT1PROG backend can be used with rotators that support the SPID
* azimuth protocol.
*/
/**
* \brief A macro that returns the model number of the SPID_MD01_ROT2PROG backend.
*
* \def ROT_MODEL_SPID_MD01_ROT2PROG
*
* The SPID_MD01_ROT2PROG backend can be used with rotators that support the
* extended SPID ROT2PROG azimuth and elevation protocol.
*/
//! @cond Doxygen_Suppress
#define ROT_SPID 9
#define ROT_BACKEND_SPID "spid"
//! @endcond
#define ROT_MODEL_SPID_ROT2PROG ROT_MAKE_MODEL(ROT_SPID, 1)
#define ROT_MODEL_SPID_ROT1PROG ROT_MAKE_MODEL(ROT_SPID, 2)
#define ROT_MODEL_SPID_MD01_ROT2PROG ROT_MAKE_MODEL(ROT_SPID, 3)
/**
* \brief A macro that returns the model number of the RC2800 backend.
*
* \def ROT_MODEL_RC2800
*
* The RC2800 backend can be used with rotators that support the M2 (M
* Squared) RC2800 protocol.
*/
/**
* \brief A macro that returns the model number of the RC2800_EARLY_AZ
* backend.
*
* \def ROT_MODEL_RC2800_EARLY_AZ
*
* The RC2800_EARLY_AZ backend can be used with rotators that support the M2
* (M Squared) RC2800 early azimuth protocol.
*/
/**
* \brief A macro that returns the model number of the RC2800_EARLY_AZEL
* backend.
*
* \def ROT_MODEL_RC2800_EARLY_AZEL
*
* The RC2800_EARLY_AZEL backend can be used with rotators that support the M2
* (M Squared) RC2800 early azimuth and elevation protocol.
*/
//! @cond Doxygen_Suppress
#define ROT_M2 10
#define ROT_BACKEND_M2 "m2"
//! @endcond
#define ROT_MODEL_RC2800 ROT_MAKE_MODEL(ROT_M2, 1)
#define ROT_MODEL_RC2800_EARLY_AZ ROT_MAKE_MODEL(ROT_M2, 2)
#define ROT_MODEL_RC2800_EARLY_AZEL ROT_MAKE_MODEL(ROT_M2, 3)
/**
* \brief A macro that returns the model number of the RCI_AZEL backend.
*
* \def ROT_MODEL_RCI_AZEL
*
* The RCI_AZEL backend can be used with rotators that support the ARS azimuth
* and elevation protocol.
*/
/**
* \brief A macro that returns the model number of the RCI_AZ backend.
*
* \def ROT_MODEL_RCI_AZ
*
* The RCI_AZ backend can be used with rotators that support the ARS azimuth
* protocol.
*/
//! @cond Doxygen_Suppress
#define ROT_ARS 11
#define ROT_BACKEND_ARS "ars"
//! @endcond
#define ROT_MODEL_RCI_AZEL ROT_MAKE_MODEL(ROT_ARS, 1)
#define ROT_MODEL_RCI_AZ ROT_MAKE_MODEL(ROT_ARS, 2)
/**
* \brief A macro that returns the model number of the IF100 backend.
*
* \def ROT_MODEL_IF100
*
* The IF100 backend can be used with rotators that support the AMSAT IF-100
* interface.
*/
//! @cond Doxygen_Suppress
#define ROT_AMSAT 12
#define ROT_BACKEND_AMSAT "amsat"
//! @endcond
#define ROT_MODEL_IF100 ROT_MAKE_MODEL(ROT_AMSAT, 1)
/**
* \brief A macro that returns the model number of the TS7400 backend.
*
* \def ROT_MODEL_TS7400
*
* The TS7400 backend supports an embedded ARM board using the TS-7400 Linux
* board. More information is at https://www.embeddedarm.com
*/
//! @cond Doxygen_Suppress
#define ROT_TS7400 13
#define ROT_BACKEND_TS7400 "ts7400"
//! @endcond
#define ROT_MODEL_TS7400 ROT_MAKE_MODEL(ROT_TS7400, 1)
/**
* \brief A macro that returns the model number of the NEXSTAR backend.
*
* \def ROT_MODEL_NEXSTAR
*
* The NEXSTAR backend can be used with rotators that support the Celestron
* NexStar protocol and alike.
*/
//! @cond Doxygen_Suppress
#define ROT_CELESTRON 14
#define ROT_BACKEND_CELESTRON "celestron"
//! @endcond
#define ROT_MODEL_NEXSTAR ROT_MAKE_MODEL(ROT_CELESTRON, 1)
/**
* \brief A macro that returns the model number of the ETHER6 backend.
*
* \def ROT_MODEL_ETHER6
*
* The ETHER6 backend can be used with rotators that support the Ether6
* protocol.
*/
//! @cond Doxygen_Suppress
#define ROT_ETHER6 15
#define ROT_BACKEND_ETHER6 "ether6"
//! @endcond
#define ROT_MODEL_ETHER6 ROT_MAKE_MODEL(ROT_ETHER6, 1)
/**
* \brief A macro that returns the model number of the CNCTRK backend.
*
* \def ROT_MODEL_CNCTRK
*
* The CNCTRK backend can be used with rotators that support the LinuxCNC
* running Axis GUI interface.
*/
//! @cond Doxygen_Suppress
#define ROT_CNCTRK 16
#define ROT_BACKEND_CNCTRK "cnctrk"
//! @endcond
#define ROT_MODEL_CNCTRK ROT_MAKE_MODEL(ROT_CNCTRK, 1)
/**
* \brief A macro that returns the model number of the PROSISTEL_D_AZ backend.
*
* \def ROT_MODEL_PROSISTEL_D_AZ
*
* The PROSISTEL_D_AZ backend can be used with rotators that support the Prosistel
* azimuth protocol.
*/
/**
* \brief A macro that returns the model number of the PROSISTEL_D_EL backend.
*
* \def ROT_MODEL_PROSISTEL_D_EL
*
* The PROSISTEL_D_EL backend can be used with rotators that support the Prosistel
* elevation protocol.
*/
/**
* \brief A macro that returns the model number of the
* PROSISTEL_COMBI_TRACK_AZEL backend.
*
* \def ROT_MODEL_PROSISTEL_COMBI_TRACK_AZEL
*
* The PROSISTEL_AZEL_COMBI_TRACK_AZEL backend can be used with rotators that
* support the Prosistel combination azimuth and elevation protocol.
*/
//! @cond Doxygen_Suppress
#define ROT_PROSISTEL 17
#define ROT_BACKEND_PROSISTEL "prosistel"
//! @endcond
#define ROT_MODEL_PROSISTEL_D_AZ ROT_MAKE_MODEL(ROT_PROSISTEL, 1)
#define ROT_MODEL_PROSISTEL_D_EL ROT_MAKE_MODEL(ROT_PROSISTEL, 2)
#define ROT_MODEL_PROSISTEL_COMBI_TRACK_AZEL ROT_MAKE_MODEL(ROT_PROSISTEL, 3)
/**
* \brief A macro that returns the model number of the MEADE backend.
*
* \def ROT_MODEL_MEADE
*
* The MEADE backend can be used with Meade telescope rotators like the
* DS-2000.
*/
//! @cond Doxygen_Suppress
#define ROT_MEADE 18
#define ROT_BACKEND_MEADE "meade"
//! @endcond
#define ROT_MODEL_MEADE ROT_MAKE_MODEL(ROT_MEADE, 1)
/**
* \brief A macro that returns the model number of the IOPTRON backend.
*
* \def ROT_MODEL_IOPTRON
*
* The IOPTRON backend can be used with IOPTRON telescope mounts.
*/
//! @cond Doxygen_Suppress
#define ROT_IOPTRON 19
#define ROT_BACKEND_IOPTRON "ioptron"
//! @endcond
#define ROT_MODEL_IOPTRON ROT_MAKE_MODEL(ROT_IOPTRON, 1)
/**
* \brief A macro that returns the model number of the INDI backend.
*
* \def ROT_MODEL_INDI
*
* The INDI backend can be used with rotators that support the INDI interface.
*/
//! @cond Doxygen_Suppress
#define ROT_INDI 20
#define ROT_BACKEND_INDI "indi"
//! @endcond
#define ROT_MODEL_INDI ROT_MAKE_MODEL(ROT_INDI, 1)
/**
* \brief A macro that returns the model number of the SATEL backend.
*
* \def ROT_MODEL_SATEL
*
* The SATEL backend can be used with rotators that support the VE5FP
* interface.
*/
//! @cond Doxygen_Suppress
#define ROT_SATEL 21
#define ROT_BACKEND_SATEL "satel"
//! @endcond
#define ROT_MODEL_SATEL ROT_MAKE_MODEL(ROT_SATEL, 1)
/**
* \brief A macro that returns the model number of the RADANT backend.
*
* \def ROT_MODEL_RADANT
*
* The RADANT backend can be used with rotators that support the MS232
* interface.
*/
//! @cond Doxygen_Suppress
#define ROT_RADANT 22
#define ROT_BACKEND_RADANT "radant"
//! @endcond
#define ROT_MODEL_RADANT ROT_MAKE_MODEL(ROT_RADANT, 1)
#define ROT_ANDROIDSENSOR 23
#define ROT_BACKEND_ANDROIDSENSOR "androidsensor"
#define ROT_MODEL_ANDROIDSENSOR ROT_MAKE_MODEL(ROT_ANDROIDSENSOR, 1)
/**
* \brief Convenience type definition for a rotator model.
*
* \typedef typedef int rot_model_t
*/
typedef int rot_model_t;
#endif /* _ROTLIST_H */
/** @} */

View File

@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

View File

@ -0,0 +1,11 @@
- Building libliquid.dll and libliquid.a:
-----------------------------------------
- Install the Msys2 distribution as described on their site (https://msys2.github.io/)
- Add mingw32 and mingw64 compiler to the Msys2 installation.
- Copy config.h, makefile.mingw32, makefile.mingw64 in the liquid-dsp root directory.
- Run a Msys2 Win32 shell (mingw32.exe) and execute 'make -f makefile.mingw32 -j clean' then 'make -f makefile.mingw32 -j' to compile a libliquid.dll 32bit Windows Dll.
- Run a Msys2 Win64 shell (mingw64.exe) and execute 'make -f makefile.mingw64 -j clean' then 'make -f makefile.mingw64 -j' to compile a libliquid.dll 64bit Windows Dll.
This process generates a .dll, .a together with libliquid.def the listing exported functions, and libliquid.lib the import lib matching the dll.
In order to develop with Visual Studio, you need both the include/liquid.h at source level, and the libliquid.lib import library referenced in your project.

View File

@ -0,0 +1,236 @@
/* config.h. Generated from config.h.in by configure. */
/* config.h.in. Generated from configure.ac by autoheader. */
#ifndef __LIQUID_CONFIG_H__
#define __LIQUID_CONFIG_H__
/* Support AVX (Advanced Vector Extensions) instructions */
#define HAVE_AVX 1
/* Define to 1 if you have the `cargf' function. */
#define HAVE_CARGF 1
/* Define to 1 if you have the `cexpf' function. */
#define HAVE_CEXPF 1
/* Define to 1 if you have the `cimagf' function. */
#define HAVE_CIMAGF 1
/* Define to 1 if you have the <complex.h> header file. */
#define HAVE_COMPLEX_H 1
/* Define to 1 if you have the `cosf' function. */
#define HAVE_COSF 1
/* Define to 1 if you have the `crealf' function. */
#define HAVE_CREALF 1
/* Define to 1 if you have the <emmintrin.h> header file. */
#define HAVE_EMMINTRIN_H 1
/* Define to 1 if you have the `expf' function. */
#define HAVE_EXPF 1
/* Define to 1 if you have the <fec.h> header file. */
/* #undef HAVE_FEC_H */
/* Define to 1 if you have the <fftw3.h> header file. */
/* #undef HAVE_FFTW3_H */
/* Define to 1 if you have the <float.h> header file. */
#define HAVE_FLOAT_H 1
/* Define to 1 if you have the `free' function. */
#define HAVE_FREE 1
/* Define to 1 if you have the <getopt.h> header file. */
#define HAVE_GETOPT_H 1
/* Define to 1 if you have the <immintrin.h> header file. */
#define HAVE_IMMINTRIN_H 1
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if you have the `c' library (-lc). */
#define HAVE_LIBC 1
/* Define to 1 if you have the `fec' library (-lfec). */
/* #undef HAVE_LIBFEC */
/* Define to 1 if you have the `fftw3f' library (-lfftw3f). */
/* #undef HAVE_LIBFFTW3F */
/* Define to 1 if you have the `m' library (-lm). */
#define HAVE_LIBM 1
/* Define to 1 if you have the <limits.h> header file. */
#define HAVE_LIMITS_H 1
/* Define to 1 if you have the `malloc' function. */
#define HAVE_MALLOC 1
/* Define to 1 if you have the `memmove' function. */
#define HAVE_MEMMOVE 1
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define to 1 if you have the `memset' function. */
#define HAVE_MEMSET 1
/* Define to 1 if you have the <mmintrin.h> header file. */
#define HAVE_MMINTRIN_H 1
/* Support MMX instructions */
#define HAVE_MMX 1
/* Define to 1 if you have the <pmmintrin.h> header file. */
#define HAVE_PMMINTRIN_H 1
/* Define to 1 if you have the `realloc' function. */
#define HAVE_REALLOC 1
/* Define to 1 if you have the `sinf' function. */
#define HAVE_SINF 1
/* Define to 1 if you have the <smmintrin.h> header file. */
#define HAVE_SMMINTRIN_H 1
/* Define to 1 if you have the `sqrtf' function. */
#define HAVE_SQRTF 1
/* Support SSE (Streaming SIMD Extensions) instructions */
#define HAVE_SSE 1
/* Support SSE2 (Streaming SIMD Extensions 2) instructions */
#define HAVE_SSE2 1
/* Support SSE3 (Streaming SIMD Extensions 3) instructions */
#define HAVE_SSE3 1
/* Support SSE4.1 (Streaming SIMD Extensions 4.1) instructions */
#define HAVE_SSE41 1
/* Support SSE4.2 (Streaming SIMD Extensions 4.2) instructions */
#define HAVE_SSE42 1
/* Support SSSE3 (Supplemental Streaming SIMD Extensions 3) instructions */
#define HAVE_SSSE3 1
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdio.h> header file. */
#define HAVE_STDIO_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the <sys/resource.h> header file. */
#define HAVE_SYS_RESOURCE_H 1
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <tmmintrin.h> header file. */
#define HAVE_TMMINTRIN_H 1
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define to 1 if you have the <xmmintrin.h> header file. */
#define HAVE_XMMINTRIN_H 1
/* Force internal FFT even if libfftw is available */
#define LIQUID_FFTOVERRIDE 1
/* Force overriding of SIMD (use portable C code) */
/* #undef LIQUID_SIMDOVERRIDE */
/* Enable strict program exit on error */
/* #undef LIQUID_STRICT_EXIT */
/* Suppress printing errors to stderr */
/* #undef LIQUID_SUPPRESS_ERROR_OUTPUT */
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "joseph@liquidsdr.org"
/* Define to the full name of this package. */
#define PACKAGE_NAME "liquid-dsp"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "liquid-dsp 1.4.0"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "liquid-dsp"
/* Define to the home page for this package. */
#define PACKAGE_URL ""
/* Define to the version of this package. */
#define PACKAGE_VERSION "1.4.0"
/* The size of `int', as computed by sizeof. */
#define SIZEOF_INT 4
/* The size of `long int', as computed by sizeof. */
#define SIZEOF_LONG_INT 8
/* The size of `long long int', as computed by sizeof. */
#define SIZEOF_LONG_LONG_INT 8
/* The size of `short int', as computed by sizeof. */
#define SIZEOF_SHORT_INT 2
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
#define below would cause a syntax error. */
/* #undef _UINT32_T */
/* Define for Solaris 2.5.1 so the uint8_t typedef from <sys/synch.h>,
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
#define below would cause a syntax error. */
/* #undef _UINT8_T */
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
/* #undef inline */
#endif
/* Define to rpl_malloc if the replacement function should be used. */
/* #undef malloc */
/* Define to rpl_realloc if the replacement function should be used. */
/* #undef realloc */
/* Define to `unsigned int' if <sys/types.h> does not define. */
/* #undef size_t */
/* Define to the type of an unsigned integer type of width exactly 32 bits if
such a type exists and the standard includes do not define it. */
/* #undef uint32_t */
/* Define to the type of an unsigned integer type of width exactly 8 bits if
such a type exists and the standard includes do not define it. */
/* #undef uint8_t */
#endif // __LIQUID_CONFIG_H__

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More