1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-26 15:54:15 +01:00

LP-151 OPLink: Allow custom Device ID or auto generated.

This commit is contained in:
Laurent Lalanne 2016-04-16 09:04:18 +02:00
parent 4ada670272
commit c9fff7e16e
10 changed files with 513 additions and 388 deletions

View File

@ -7,7 +7,8 @@
* @{
*
* @file pios_rfm22b.c
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
* @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2016.
* The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
* @brief Implements a driver the the RFM22B driver
* @see The GNU Public License (GPL) Version 3
*
@ -187,6 +188,7 @@ static enum pios_radio_event rfm22_fatal_error(struct pios_rfm22b_dev *rfm22b_de
static void rfm22b_add_rx_status(struct pios_rfm22b_dev *rfm22b_dev, enum pios_rfm22b_rx_packet_status status);
static void rfm22_setNominalCarrierFrequency(struct pios_rfm22b_dev *rfm22b_dev, uint8_t init_chan);
static bool rfm22_setFreqHopChannel(struct pios_rfm22b_dev *rfm22b_dev, uint8_t channel);
static void rfm22_generateDeviceID(struct pios_rfm22b_dev *rfm22b_dev);
static void rfm22_updatePairStatus(struct pios_rfm22b_dev *radio_dev);
static void rfm22_updateStats(struct pios_rfm22b_dev *rfm22b_dev);
static bool rfm22_checkTimeOut(struct pios_rfm22b_dev *rfm22b_dev);
@ -446,18 +448,8 @@ int32_t PIOS_RFM22B_Init(uint32_t *rfm22b_id, uint32_t spi_id, uint32_t slave_nu
// Create a semaphore to know if an ISR needs responding to
vSemaphoreCreateBinary(rfm22b_dev->isrPending);
// Create our (hopefully) unique 32 bit id from the processor serial number.
uint8_t crcs[] = { 0, 0, 0, 0 };
{
char serial_no_str[33];
PIOS_SYS_SerialNumberGet(serial_no_str);
// Create a 32 bit value using 4 8 bit CRC values.
for (uint8_t i = 0; serial_no_str[i] != 0; ++i) {
crcs[i % 4] = PIOS_CRC_updateByte(crcs[i % 4], serial_no_str[i]);
}
}
rfm22b_dev->deviceID = crcs[0] | crcs[1] << 8 | crcs[2] << 16 | crcs[3] << 24;
DEBUG_PRINTF(2, "RF device ID: %x\n\r", rfm22b_dev->deviceID);
// Create default (hopefully) unique 32 bit id from the processor serial number.
rfm22_generateDeviceID(rfm22b_dev);
// Initialize the external interrupt.
PIOS_EXTI_Init(cfg->exti_cfg);
@ -510,6 +502,26 @@ bool PIOS_RFM22_EXT_Int(void)
return false;
}
/**
* Set the device ID for the RFM22B device.
*
* @param[in] rfm22b_id The RFM22B device index.
*
*/
void PIOS_RFM22B_SetDeviceID(uint32_t rfm22b_id, uint32_t custom_device_id)
{
struct pios_rfm22b_dev *rfm22b_dev = (struct pios_rfm22b_dev *)rfm22b_id;
if (custom_device_id > 0) {
rfm22b_dev->deviceID = custom_device_id;
} else {
rfm22_generateDeviceID(rfm22b_dev);
}
DEBUG_PRINTF(2, "RF device ID: %x\n\r", rfm22b_dev->deviceID);
}
/**
* Returns the unique device ID for the RFM22B device.
*
@ -1711,6 +1723,29 @@ static bool rfm22_setFreqHopChannel(struct pios_rfm22b_dev *rfm22b_dev, uint8_t
return true;
}
/**
* Generate the unique device ID for the RFM22B device.
*
* @param[in] rfm22b_id The RFM22B device index.
*
*/
void rfm22_generateDeviceID(struct pios_rfm22b_dev *rfm22b_dev)
{
// Create our (hopefully) unique 32 bit id from the processor serial number.
uint8_t crcs[] = { 0, 0, 0, 0 };
{
char serial_no_str[33];
PIOS_SYS_SerialNumberGet(serial_no_str);
// Create a 32 bit value using 4 8 bit CRC values.
for (uint8_t i = 0; serial_no_str[i] != 0; ++i) {
crcs[i % 4] = PIOS_CRC_updateByte(crcs[i % 4], serial_no_str[i]);
}
}
rfm22b_dev->deviceID = crcs[0] | crcs[1] << 8 | crcs[2] << 16 | crcs[3] << 24;
DEBUG_PRINTF(2, "Generated RF device ID: %x\n\r", rfm22b_dev->deviceID);
}
/**
* Read the RFM22B interrupt and device status registers
*

View File

@ -7,7 +7,8 @@
* @{
*
* @file pios_rfm22b.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
* @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2016.
* The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
* @brief RFM22B functions header.
* @see The GNU Public License (GPL) Version 3
*
@ -105,6 +106,7 @@ extern void PIOS_RFM22B_Reinit(uint32_t rfb22b_id);
extern void PIOS_RFM22B_SetTxPower(uint32_t rfm22b_id, enum rfm22b_tx_power tx_pwr);
extern void PIOS_RFM22B_SetChannelConfig(uint32_t rfm22b_id, enum rfm22b_datarate datarate, uint8_t min_chan, uint8_t max_chan, bool coordinator, bool oneway, bool ppm_mode, bool ppm_only);
extern void PIOS_RFM22B_SetCoordinatorID(uint32_t rfm22b_id, uint32_t coord_id);
extern void PIOS_RFM22B_SetDeviceID(uint32_t rfm22b_id, uint32_t device_id);
extern uint32_t PIOS_RFM22B_DeviceID(uint32_t rfb22b_id);
extern void PIOS_RFM22B_GetStats(uint32_t rfm22b_id, struct rfm22b_stats *stats);
extern uint8_t PIOS_RFM22B_GetPairStats(uint32_t rfm22b_id, uint32_t *device_ids, int8_t *RSSIs, uint8_t max_pairs);

View File

@ -674,7 +674,7 @@ struct pios_rfm22b_dev {
// The device ID
uint32_t deviceID;
// The coodinator ID (0 if this modem is a coordinator).
// The coordinator ID (0 if this modem is a coordinator).
uint32_t coordinatorID;
// The task handle

View File

@ -1,8 +1,9 @@
/**
******************************************************************************
* @file pios_board.c
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2011.
* @author PhoenixPilot, http://github.com/PhoenixPilot, Copyright (C) 2012
* @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2016.
* The OpenPilot Team, http://www.openpilot.org Copyright (C) 2011.
* PhoenixPilot, http://github.com/PhoenixPilot, Copyright (C) 2012
* @addtogroup OpenPilotSystem OpenPilot System
* @{
* @addtogroup OpenPilotCore OpenPilot Core
@ -804,6 +805,7 @@ void PIOS_Board_Init(void)
}
/* Set the radio configuration parameters. */
PIOS_RFM22B_SetDeviceID(pios_rfm22b_id, oplinkSettings.CustomDeviceID);
PIOS_RFM22B_SetChannelConfig(pios_rfm22b_id, datarate, oplinkSettings.MinChannel, oplinkSettings.MaxChannel, is_coordinator, is_oneway, ppm_mode, ppm_only);
PIOS_RFM22B_SetCoordinatorID(pios_rfm22b_id, oplinkSettings.CoordID);
@ -812,7 +814,7 @@ void PIOS_Board_Init(void)
PIOS_RFM22B_SetPPMCallback(pios_rfm22b_id, PIOS_Board_PPM_callback);
}
/* Set the modem Tx poer level */
/* Set the modem Tx power level */
switch (oplinkSettings.MaxRFPower) {
case OPLINKSETTINGS_MAXRFPOWER_125:
PIOS_RFM22B_SetTxPower(pios_rfm22b_id, RFM22_tx_pwr_txpow_0);

View File

@ -6,7 +6,8 @@
* @{
*
* @file pios_board.c
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2016.
* The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Defines board specific static initializers for hardware for the OpenPilot board.
* @see The GNU Public License (GPL) Version 3
*
@ -406,7 +407,7 @@ void PIOS_Board_Init(void)
break;
}
/* Set the modem Tx poer level */
/* Set the modem Tx power level */
switch (oplinkSettings.MaxRFPower) {
case OPLINKSETTINGS_MAXRFPOWER_125:
PIOS_RFM22B_SetTxPower(pios_rfm22b_id, RFM22_tx_pwr_txpow_0);
@ -438,6 +439,7 @@ void PIOS_Board_Init(void)
}
// Set the radio configuration parameters.
PIOS_RFM22B_SetDeviceID(pios_rfm22b_id, oplinkSettings.CustomDeviceID);
PIOS_RFM22B_SetCoordinatorID(pios_rfm22b_id, oplinkSettings.CoordID);
PIOS_RFM22B_SetChannelConfig(pios_rfm22b_id, datarate, oplinkSettings.MinChannel, oplinkSettings.MaxChannel, is_coordinator, is_oneway, ppm_mode, ppm_only);
@ -446,7 +448,7 @@ void PIOS_Board_Init(void)
PIOS_RFM22B_SetPPMCallback(pios_rfm22b_id, PIOS_Board_PPM_callback);
}
// Reinitilize the modem to affect te changes.
// Reinitialize the modem to affect the changes.
PIOS_RFM22B_Reinit(pios_rfm22b_id);
} else {
oplinkStatus.LinkState = OPLINKSTATUS_LINKSTATE_DISABLED;

View File

@ -1,7 +1,7 @@
/**
******************************************************************************
* @file pios_board.c
* @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2015.
* @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2015-2016.
* The OpenPilot Team, http://www.openpilot.org Copyright (C) 2011.
* PhoenixPilot, http://github.com/PhoenixPilot, Copyright (C) 2012
* @addtogroup OpenPilotSystem OpenPilot System
@ -885,6 +885,7 @@ void PIOS_Board_Init(void)
}
/* Set the radio configuration parameters. */
PIOS_RFM22B_SetDeviceID(pios_rfm22b_id, oplinkSettings.CustomDeviceID);
PIOS_RFM22B_SetCoordinatorID(pios_rfm22b_id, oplinkSettings.CoordID);
PIOS_RFM22B_SetChannelConfig(pios_rfm22b_id, datarate, oplinkSettings.MinChannel, oplinkSettings.MaxChannel, is_coordinator, is_oneway, ppm_mode, ppm_only);
@ -893,7 +894,7 @@ void PIOS_Board_Init(void)
PIOS_RFM22B_SetPPMCallback(pios_rfm22b_id, PIOS_Board_PPM_callback);
}
/* Set the modem Tx poer level */
/* Set the modem Tx power level */
switch (oplinkSettings.MaxRFPower) {
case OPLINKSETTINGS_MAXRFPOWER_125:
PIOS_RFM22B_SetTxPower(pios_rfm22b_id, RFM22_tx_pwr_txpow_0);

View File

@ -1,14 +1,14 @@
/**
******************************************************************************
*
* @file configtxpidswidget.cpp
* @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2015.
* @file configoplinkwidget.cpp
* @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2015-2016.
* The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
* @addtogroup GCSPlugins GCS Plugins
* @{
* @addtogroup ConfigPlugin Config Plugin
* @{
* @brief The Configuration Gadget used to configure the PipXtreme
* @brief The Configuration Gadget used to configure the OPLink and Revo modem
*****************************************************************************/
/*
* This program is free software; you can redistribute it and/or modify
@ -80,6 +80,7 @@ ConfigOPLinkWidget::ConfigOPLinkWidget(QWidget *parent) : ConfigTaskWidget(paren
addWidgetBinding("OPLinkSettings", "PPMOnly", m_oplink->PPMOnly);
addWidgetBinding("OPLinkSettings", "PPM", m_oplink->PPM);
addWidgetBinding("OPLinkSettings", "ComSpeed", m_oplink->ComSpeed);
addWidgetBinding("OPLinkSettings", "CustomDeviceID", m_oplink->CustomDeviceID);
addWidgetBinding("OPLinkStatus", "DeviceID", m_oplink->DeviceID);
addWidgetBinding("OPLinkStatus", "RxGood", m_oplink->Good);
@ -112,6 +113,9 @@ ConfigOPLinkWidget::ConfigOPLinkWidget(QWidget *parent) : ConfigTaskWidget(paren
connect(m_oplink->PPMOnly, SIGNAL(toggled(bool)), this, SLOT(ppmOnlyChanged()));
connect(m_oplink->MinimumChannel, SIGNAL(valueChanged(int)), this, SLOT(minChannelChanged()));
connect(m_oplink->MaximumChannel, SIGNAL(valueChanged(int)), this, SLOT(maxChannelChanged()));
connect(m_oplink->CustomDeviceID, SIGNAL(editingFinished()), this, SLOT(updateCustomDeviceID()));
m_oplink->CustomDeviceID->setInputMask("HHHHHHHH");
m_oplink->MinimumChannel->setKeyboardTracking(false);
m_oplink->MaximumChannel->setKeyboardTracking(false);
@ -247,7 +251,6 @@ void ConfigOPLinkWidget::updateSettings(UAVObject *object)
if (!settingsUpdated) {
settingsUpdated = true;
// Enable components based on the board type connected.
UAVObjectField *board_type_field = oplinkStatusObj->getField("BoardType");
switch (board_type_field->getValue().toInt()) {
@ -294,6 +297,7 @@ void ConfigOPLinkWidget::updateSettings(UAVObject *object)
void ConfigOPLinkWidget::updateEnableControls()
{
updateCustomDeviceID();
enableControls(true);
ppmOnlyChanged();
}
@ -384,6 +388,15 @@ void ConfigOPLinkWidget::channelChanged(bool isMax)
m_oplink->MaxFreq->setText("(" + QString::number(maxFrequency, 'f', 3) + " MHz)");
}
void ConfigOPLinkWidget::updateCustomDeviceID()
{
bool customDeviceIDNotSet = (m_oplink->CustomDeviceID->text() == "0");
if (settingsUpdated && customDeviceIDNotSet) {
m_oplink->CustomDeviceID->clear();
m_oplink->CustomDeviceID->setPlaceholderText(m_oplink->DeviceID->text());
}
}
/**
@}
@}

View File

@ -1,13 +1,14 @@
/**
******************************************************************************
*
* @file configpipxtremewidget.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
* @file configoplinkwidget.h
* @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2016.
* The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
* @addtogroup GCSPlugins GCS Plugins
* @{
* @addtogroup ConfigPlugin Config Plugin
* @{
* @brief The Configuration Gadget used to configure PipXtreme
* @brief The Configuration Gadget used to configure the OPLink and Revo modem
*****************************************************************************/
/*
* This program is free software; you can redistribute it and/or modify
@ -24,8 +25,8 @@
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef CONFIGPIPXTREMEWIDGET_H
#define CONFIGPIPXTREMEWIDGET_H
#ifndef CONFIGOPLINKWIDGET_H
#define CONFIGOPLINKWIDGET_H
#include "configtaskwidget.h"
@ -65,7 +66,8 @@ private slots:
void ppmOnlyChanged();
void minChannelChanged();
void maxChannelChanged();
void updateCustomDeviceID();
void channelChanged(bool isMax);
};
#endif // CONFIGTXPIDWIDGET_H
#endif // CONFIGOPLINKWIDGET_H

View File

@ -54,360 +54,6 @@
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_5">
<item row="0" column="1">
<widget class="QGroupBox" name="groupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="title">
<string>Configuration</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="4" column="4">
<widget class="QComboBox" name="ComSpeed">
<property name="statusTip">
<string>Com speed in bps.</string>
</property>
</widget>
</item>
<item row="4" column="3">
<widget class="QLabel" name="ComSpeedLabel">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Com Speed</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="9" column="3">
<widget class="QLabel" name="VCPPortLabel">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>VCP Port</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="7" column="4">
<widget class="QComboBox" name="FlexiPort">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Choose the function for the flexi port</string>
</property>
</widget>
</item>
<item row="6" column="3">
<widget class="QLabel" name="MainPortLabel">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Main Port</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="6" column="4">
<widget class="QComboBox" name="MainPort">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Choose the function for the main port</string>
</property>
</widget>
</item>
<item row="9" column="4">
<widget class="QComboBox" name="VCPPort">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Choose the function for the USB virtual com port</string>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QComboBox" name="MaxRFTxPower">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Set the maximum TX output power the modem will use (mW)</string>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="modelColumn">
<number>0</number>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QLabel" name="MaxRFTxPowerLabel">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Max Power</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="10" column="4">
<widget class="QComboBox" name="FlexiIOPort"/>
</item>
<item row="10" column="3">
<widget class="QLabel" name="FlexiIOPortLabel">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>FlexiIO Port</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QSpinBox" name="MaximumChannel">
<property name="maximumSize">
<size>
<width>60</width>
<height>16777215</height>
</size>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="toolTip">
<string>Channel 0 is 430 MHz, channel 250 is 440 MHz, and the channel spacing is 40 KHz.</string>
</property>
<property name="maximum">
<number>250</number>
</property>
</widget>
</item>
<item row="7" column="3">
<widget class="QLabel" name="FlexiPortLabel">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Flexi Port</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="MaximumChannelLabel">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Max Chan</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="MinimumChannelLabel">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Min Chan</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QSpinBox" name="MinimumChannel">
<property name="maximumSize">
<size>
<width>60</width>
<height>16777215</height>
</size>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="toolTip">
<string>Channel 0 is 430 MHz, channel 250 is 440 MHz, and the channel spacing is 40 KHz.</string>
</property>
<property name="maximum">
<number>250</number>
</property>
</widget>
</item>
<item row="10" column="0" colspan="2">
<widget class="QCheckBox" name="Coordinator">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="statusTip">
<string>This modem will be a coordinator and other modems will bind to it.</string>
</property>
<property name="text">
<string>Coordinator</string>
</property>
</widget>
</item>
<item row="6" column="2">
<widget class="QLabel" name="MaxFreq">
<property name="maximumSize">
<size>
<width>110</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>440.000 (MHz)</string>
</property>
</widget>
</item>
<item row="7" column="2">
<widget class="QLabel" name="MinFreq">
<property name="maximumSize">
<size>
<width>110</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>430.000 (MHz)</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QCheckBox" name="OneWayLink">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="acceptDrops">
<bool>false</bool>
</property>
<property name="statusTip">
<string>If selected, data will only be transmitted from the coordinator to the Rx modem.</string>
</property>
<property name="text">
<string>One-Way</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="PPMOnly">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="statusTip">
<string>Only PPM packets will be transmitted.</string>
</property>
<property name="text">
<string>PPM Only</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="PPM">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="statusTip">
<string>PPM packets will be received by this modem. Must be selected if Coordinator modem is configured for PPM.</string>
</property>
<property name="text">
<string>PPM</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="0" column="0">
<widget class="QGroupBox" name="PairingGroupBox">
<property name="title">
@ -759,6 +405,9 @@
<bold>false</bold>
</font>
</property>
<property name="maxLength">
<number>8</number>
</property>
<property name="frame">
<bool>false</bool>
</property>
@ -769,7 +418,7 @@
<bool>true</bool>
</property>
<property name="placeholderText">
<string>12345678</string>
<string>AA00FF99</string>
</property>
</widget>
</item>
@ -1789,6 +1438,424 @@
</property>
</spacer>
</item>
<item row="0" column="1">
<widget class="QGroupBox" name="groupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="title">
<string>Configuration</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="9" column="0" colspan="3">
<widget class="QCheckBox" name="Coordinator">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="statusTip">
<string>This modem will be a coordinator and other modems will bind to it.</string>
</property>
<property name="text">
<string>Coordinator</string>
</property>
</widget>
</item>
<item row="4" column="4">
<widget class="QComboBox" name="ComSpeed">
<property name="statusTip">
<string>Com speed in bps.</string>
</property>
</widget>
</item>
<item row="4" column="3">
<widget class="QLabel" name="ComSpeedLabel">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Com Speed</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="9" column="3">
<widget class="QLabel" name="VCPPortLabel">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>VCP Port</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="7" column="4">
<widget class="QComboBox" name="FlexiPort">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Choose the function for the flexi port</string>
</property>
</widget>
</item>
<item row="6" column="3">
<widget class="QLabel" name="MainPortLabel">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Main Port</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="6" column="4">
<widget class="QComboBox" name="MainPort">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Choose the function for the main port</string>
</property>
</widget>
</item>
<item row="9" column="4">
<widget class="QComboBox" name="VCPPort">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Choose the function for the USB virtual com port</string>
</property>
</widget>
</item>
<item row="10" column="4">
<widget class="QComboBox" name="FlexiIOPort"/>
</item>
<item row="0" column="4">
<widget class="QComboBox" name="MaxRFTxPower">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Set the maximum TX output power the modem will use (mW)</string>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="modelColumn">
<number>0</number>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QLabel" name="MaxRFTxPowerLabel">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Max Power</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QSpinBox" name="MaximumChannel">
<property name="maximumSize">
<size>
<width>60</width>
<height>16777215</height>
</size>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="toolTip">
<string>Channel 0 is 430 MHz, channel 250 is 440 MHz, and the channel spacing is 40 KHz.</string>
</property>
<property name="maximum">
<number>250</number>
</property>
</widget>
</item>
<item row="10" column="3">
<widget class="QLabel" name="FlexiIOPortLabel">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>FlexiIO Port</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="7" column="3">
<widget class="QLabel" name="FlexiPortLabel">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Flexi Port</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QSpinBox" name="MinimumChannel">
<property name="maximumSize">
<size>
<width>60</width>
<height>16777215</height>
</size>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="toolTip">
<string>Channel 0 is 430 MHz, channel 250 is 440 MHz, and the channel spacing is 40 KHz.</string>
</property>
<property name="maximum">
<number>250</number>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="MaximumChannelLabel">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Max Chan</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="MinimumChannelLabel">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Min Chan</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="7" column="2">
<widget class="QLabel" name="MinFreq">
<property name="maximumSize">
<size>
<width>110</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>430.000 (MHz)</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QCheckBox" name="OneWayLink">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="acceptDrops">
<bool>false</bool>
</property>
<property name="statusTip">
<string>If selected, data will only be transmitted from the coordinator to the Rx modem.</string>
</property>
<property name="text">
<string>One-Way</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="PPMOnly">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="statusTip">
<string>Only PPM packets will be transmitted.</string>
</property>
<property name="text">
<string>PPM Only</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="PPM">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="statusTip">
<string>PPM packets will be received by this modem. Must be selected if Coordinator modem is configured for PPM.</string>
</property>
<property name="text">
<string>PPM</string>
</property>
</widget>
</item>
<item row="6" column="2">
<widget class="QLabel" name="MaxFreq">
<property name="maximumSize">
<size>
<width>110</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>440.000 (MHz)</string>
</property>
</widget>
</item>
<item row="10" column="1" colspan="2">
<widget class="QLineEdit" name="CustomDeviceID">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>101</width>
<height>16777215</height>
</size>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="toolTip">
<string>Enter your custom ID for this device as hexadecimal value,
this allow device clones. Be sure only one same Device ID transmit once!
Leave blank for Device ID autogenerated.</string>
</property>
<property name="maxLength">
<number>8</number>
</property>
<property name="frame">
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="readOnly">
<bool>false</bool>
</property>
<property name="placeholderText">
<string>AA00FF99</string>
</property>
<property name="cursorMoveStyle">
<enum>Qt::LogicalMoveStyle</enum>
</property>
<property name="clearButtonEnabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="customDeviceIDLabel">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Device ID</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</widget>

View File

@ -13,6 +13,7 @@
<field name="MaxRFPower" units="mW" type="enum" elements="1" options="0,1.25,1.6,3.16,6.3,12.6,25,50,100" defaultvalue="0"/>
<field name="MinChannel" units="" type="uint8" elements="1" defaultvalue="0"/>
<field name="MaxChannel" units="" type="uint8" elements="1" defaultvalue="250"/>
<field name="CustomDeviceID" units="hex" type="uint32" elements="1" defaultvalue="0"/>
<access gcs="readwrite" flight="readwrite"/>
<telemetrygcs acked="true" updatemode="onchange" period="0"/>