From e84b22227259a9cfd7e4f6290ecf00f71bbbee24 Mon Sep 17 00:00:00 2001 From: pip Date: Sat, 18 Dec 2010 13:54:35 +0000 Subject: [PATCH] PipX modem settings update .. note that they do not yet function. git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2248 ebee16cc-31ac-478f-84a7-5cbb03baadba --- .../UAVObjects/inc/pipxtrememodemsettings.h | 22 +++++-- .../UAVObjects/inc/pipxtrememodemstatus.h | 8 +-- .../UAVObjects/pipxtrememodemsettings.c | 6 +- .../UAVObjects/pipxtrememodemstatus.c | 26 +------- .../uavobjects/pipxtrememodemsettings.cpp | 66 ++++++++++++------- .../uavobjects/pipxtrememodemsettings.h | 22 +++++-- .../uavobjects/pipxtrememodemsettings.py | 38 ++++++++++- .../uavobjects/pipxtrememodemstatus.cpp | 60 ++--------------- .../plugins/uavobjects/pipxtrememodemstatus.h | 8 +-- .../uavobjects/pipxtrememodemstatus.py | 35 +--------- .../pipxtrememodemsettings.xml | 9 ++- .../pipxtrememodemstatus.xml | 11 ++-- 12 files changed, 137 insertions(+), 174 deletions(-) diff --git a/flight/OpenPilot/UAVObjects/inc/pipxtrememodemsettings.h b/flight/OpenPilot/UAVObjects/inc/pipxtrememodemsettings.h index 3c65502b4..616eaa4d1 100644 --- a/flight/OpenPilot/UAVObjects/inc/pipxtrememodemsettings.h +++ b/flight/OpenPilot/UAVObjects/inc/pipxtrememodemsettings.h @@ -41,7 +41,7 @@ #define PIPXTREMEMODEMSETTINGS_H // Object constants -#define PIPXTREMEMODEMSETTINGS_OBJID 2660664364U +#define PIPXTREMEMODEMSETTINGS_OBJID 3822692478U #define PIPXTREMEMODEMSETTINGS_NAME "PipXtremeModemSettings" #define PIPXTREMEMODEMSETTINGS_METANAME "PipXtremeModemSettingsMeta" #define PIPXTREMEMODEMSETTINGS_ISSINGLEINST 1 @@ -71,26 +71,34 @@ // Object data typedef struct { + uint8_t Mode; + uint8_t Serial_Baudrate; uint8_t Frequency_Calibration; uint32_t Frequency_Min; uint32_t Frequency_Max; uint32_t Frequency; - uint8_t RF_Bandwidth; + uint8_t Max_RF_Bandwidth; uint8_t Max_Tx_Power; uint8_t AES_Encryption; uint8_t AES_EncryptionKey[16]; - uint32_t Paired_Serial_Number_CRC; + uint32_t Paired_Serial_Number; } __attribute__((packed)) PipXtremeModemSettingsData; // Field information +// Field Mode information +/* Enumeration options for field Mode */ +typedef enum { PIPXTREMEMODEMSETTINGS_MODE_NORMAL=0, PIPXTREMEMODEMSETTINGS_MODE_TEST_CARRIER=1, PIPXTREMEMODEMSETTINGS_MODE_TEST_SPECTRUM=2 } PipXtremeModemSettingsModeOptions; +// Field Serial_Baudrate information +/* Enumeration options for field Serial_Baudrate */ +typedef enum { PIPXTREMEMODEMSETTINGS_SERIAL_BAUDRATE_1200=0, PIPXTREMEMODEMSETTINGS_SERIAL_BAUDRATE_2400=1, PIPXTREMEMODEMSETTINGS_SERIAL_BAUDRATE_4800=2, PIPXTREMEMODEMSETTINGS_SERIAL_BAUDRATE_9600=3, PIPXTREMEMODEMSETTINGS_SERIAL_BAUDRATE_19200=4, PIPXTREMEMODEMSETTINGS_SERIAL_BAUDRATE_38400=5, PIPXTREMEMODEMSETTINGS_SERIAL_BAUDRATE_57600=6, PIPXTREMEMODEMSETTINGS_SERIAL_BAUDRATE_115200=7, PIPXTREMEMODEMSETTINGS_SERIAL_BAUDRATE_230400=8 } PipXtremeModemSettingsSerial_BaudrateOptions; // Field Frequency_Calibration information // Field Frequency_Min information // Field Frequency_Max information // Field Frequency information -// Field RF_Bandwidth information -/* Enumeration options for field RF_Bandwidth */ -typedef enum { PIPXTREMEMODEMSETTINGS_RF_BANDWIDTH_500=0, PIPXTREMEMODEMSETTINGS_RF_BANDWIDTH_1000=1, PIPXTREMEMODEMSETTINGS_RF_BANDWIDTH_2000=2, PIPXTREMEMODEMSETTINGS_RF_BANDWIDTH_4000=3, PIPXTREMEMODEMSETTINGS_RF_BANDWIDTH_8000=4, PIPXTREMEMODEMSETTINGS_RF_BANDWIDTH_9600=5, PIPXTREMEMODEMSETTINGS_RF_BANDWIDTH_16000=6, PIPXTREMEMODEMSETTINGS_RF_BANDWIDTH_19200=7, PIPXTREMEMODEMSETTINGS_RF_BANDWIDTH_24000=8, PIPXTREMEMODEMSETTINGS_RF_BANDWIDTH_32000=9, PIPXTREMEMODEMSETTINGS_RF_BANDWIDTH_64000=10, PIPXTREMEMODEMSETTINGS_RF_BANDWIDTH_128000=11, PIPXTREMEMODEMSETTINGS_RF_BANDWIDTH_192000=12 } PipXtremeModemSettingsRF_BandwidthOptions; +// Field Max_RF_Bandwidth information +/* Enumeration options for field Max_RF_Bandwidth */ +typedef enum { PIPXTREMEMODEMSETTINGS_MAX_RF_BANDWIDTH_500=0, PIPXTREMEMODEMSETTINGS_MAX_RF_BANDWIDTH_1000=1, PIPXTREMEMODEMSETTINGS_MAX_RF_BANDWIDTH_2000=2, PIPXTREMEMODEMSETTINGS_MAX_RF_BANDWIDTH_4000=3, PIPXTREMEMODEMSETTINGS_MAX_RF_BANDWIDTH_8000=4, PIPXTREMEMODEMSETTINGS_MAX_RF_BANDWIDTH_9600=5, PIPXTREMEMODEMSETTINGS_MAX_RF_BANDWIDTH_16000=6, PIPXTREMEMODEMSETTINGS_MAX_RF_BANDWIDTH_19200=7, PIPXTREMEMODEMSETTINGS_MAX_RF_BANDWIDTH_24000=8, PIPXTREMEMODEMSETTINGS_MAX_RF_BANDWIDTH_32000=9, PIPXTREMEMODEMSETTINGS_MAX_RF_BANDWIDTH_64000=10, PIPXTREMEMODEMSETTINGS_MAX_RF_BANDWIDTH_128000=11, PIPXTREMEMODEMSETTINGS_MAX_RF_BANDWIDTH_192000=12 } PipXtremeModemSettingsMax_RF_BandwidthOptions; // Field Max_Tx_Power information /* Enumeration options for field Max_Tx_Power */ typedef enum { PIPXTREMEMODEMSETTINGS_MAX_TX_POWER_1=0, PIPXTREMEMODEMSETTINGS_MAX_TX_POWER_2=1, PIPXTREMEMODEMSETTINGS_MAX_TX_POWER_5=2, PIPXTREMEMODEMSETTINGS_MAX_TX_POWER_8=3, PIPXTREMEMODEMSETTINGS_MAX_TX_POWER_11=4, PIPXTREMEMODEMSETTINGS_MAX_TX_POWER_14=5, PIPXTREMEMODEMSETTINGS_MAX_TX_POWER_17=6, PIPXTREMEMODEMSETTINGS_MAX_TX_POWER_20=7 } PipXtremeModemSettingsMax_Tx_PowerOptions; @@ -100,7 +108,7 @@ typedef enum { PIPXTREMEMODEMSETTINGS_AES_ENCRYPTION_FALSE=0, PIPXTREMEMODEMSETT // Field AES_EncryptionKey information /* Number of elements for field AES_EncryptionKey */ #define PIPXTREMEMODEMSETTINGS_AES_ENCRYPTIONKEY_NUMELEM 16 -// Field Paired_Serial_Number_CRC information +// Field Paired_Serial_Number information // Generic interface functions diff --git a/flight/OpenPilot/UAVObjects/inc/pipxtrememodemstatus.h b/flight/OpenPilot/UAVObjects/inc/pipxtrememodemstatus.h index fd718ac20..79ffd92f0 100644 --- a/flight/OpenPilot/UAVObjects/inc/pipxtrememodemstatus.h +++ b/flight/OpenPilot/UAVObjects/inc/pipxtrememodemstatus.h @@ -41,7 +41,7 @@ #define PIPXTREMEMODEMSTATUS_H // Object constants -#define PIPXTREMEMODEMSTATUS_OBJID 3920019084U +#define PIPXTREMEMODEMSTATUS_OBJID 539085060U #define PIPXTREMEMODEMSTATUS_NAME "PipXtremeModemStatus" #define PIPXTREMEMODEMSTATUS_METANAME "PipXtremeModemStatusMeta" #define PIPXTREMEMODEMSTATUS_ISSINGLEINST 1 @@ -71,8 +71,7 @@ // Object data typedef struct { - uint8_t Serial_Number[24]; - uint32_t Serial_Number_CRC; + uint32_t Serial_Number; uint32_t Up_Time; uint32_t Frequency; uint32_t RF_Bandwidth; @@ -86,9 +85,6 @@ typedef struct { // Field information // Field Serial_Number information -/* Number of elements for field Serial_Number */ -#define PIPXTREMEMODEMSTATUS_SERIAL_NUMBER_NUMELEM 24 -// Field Serial_Number_CRC information // Field Up_Time information // Field Frequency information // Field RF_Bandwidth information diff --git a/flight/OpenPilot/UAVObjects/pipxtrememodemsettings.c b/flight/OpenPilot/UAVObjects/pipxtrememodemsettings.c index 7c8ebc717..f3611085f 100644 --- a/flight/OpenPilot/UAVObjects/pipxtrememodemsettings.c +++ b/flight/OpenPilot/UAVObjects/pipxtrememodemsettings.c @@ -80,11 +80,13 @@ static void setDefaults(UAVObjHandle obj, uint16_t instId) // Initialize object fields to their default values UAVObjGetInstanceData(obj, instId, &data); memset(&data, 0, sizeof(PipXtremeModemSettingsData)); + data.Mode = 0; + data.Serial_Baudrate = 6; data.Frequency_Calibration = 127; data.Frequency_Min = 0; data.Frequency_Max = 0; data.Frequency = 0; - data.RF_Bandwidth = 11; + data.Max_RF_Bandwidth = 11; data.Max_Tx_Power = 4; data.AES_Encryption = 0; data.AES_EncryptionKey[0] = 0; @@ -103,7 +105,7 @@ static void setDefaults(UAVObjHandle obj, uint16_t instId) data.AES_EncryptionKey[13] = 0; data.AES_EncryptionKey[14] = 0; data.AES_EncryptionKey[15] = 0; - data.Paired_Serial_Number_CRC = 0; + data.Paired_Serial_Number = 0; UAVObjSetInstanceData(obj, instId, &data); diff --git a/flight/OpenPilot/UAVObjects/pipxtrememodemstatus.c b/flight/OpenPilot/UAVObjects/pipxtrememodemstatus.c index fed663b0f..09f8db4aa 100644 --- a/flight/OpenPilot/UAVObjects/pipxtrememodemstatus.c +++ b/flight/OpenPilot/UAVObjects/pipxtrememodemstatus.c @@ -80,31 +80,7 @@ static void setDefaults(UAVObjHandle obj, uint16_t instId) // Initialize object fields to their default values UAVObjGetInstanceData(obj, instId, &data); memset(&data, 0, sizeof(PipXtremeModemStatusData)); - data.Serial_Number[0] = 0; - data.Serial_Number[1] = 0; - data.Serial_Number[2] = 0; - data.Serial_Number[3] = 0; - data.Serial_Number[4] = 0; - data.Serial_Number[5] = 0; - data.Serial_Number[6] = 0; - data.Serial_Number[7] = 0; - data.Serial_Number[8] = 0; - data.Serial_Number[9] = 0; - data.Serial_Number[10] = 0; - data.Serial_Number[11] = 0; - data.Serial_Number[12] = 0; - data.Serial_Number[13] = 0; - data.Serial_Number[14] = 0; - data.Serial_Number[15] = 0; - data.Serial_Number[16] = 0; - data.Serial_Number[17] = 0; - data.Serial_Number[18] = 0; - data.Serial_Number[19] = 0; - data.Serial_Number[20] = 0; - data.Serial_Number[21] = 0; - data.Serial_Number[22] = 0; - data.Serial_Number[23] = 0; - data.Serial_Number_CRC = 0; + data.Serial_Number = 0; UAVObjSetInstanceData(obj, instId, &data); diff --git a/ground/src/plugins/uavobjects/pipxtrememodemsettings.cpp b/ground/src/plugins/uavobjects/pipxtrememodemsettings.cpp index 4326f0293..ae5d4bb9f 100644 --- a/ground/src/plugins/uavobjects/pipxtrememodemsettings.cpp +++ b/ground/src/plugins/uavobjects/pipxtrememodemsettings.cpp @@ -42,6 +42,26 @@ PipXtremeModemSettings::PipXtremeModemSettings(): UAVDataObject(OBJID, ISSINGLEI { // Create fields QList fields; + QStringList ModeElemNames; + ModeElemNames.append("0"); + QStringList ModeEnumOptions; + ModeEnumOptions.append("Normal"); + ModeEnumOptions.append("Test_Carrier"); + ModeEnumOptions.append("Test_Spectrum"); + fields.append( new UAVObjectField(QString("Mode"), QString(""), UAVObjectField::ENUM, ModeElemNames, ModeEnumOptions) ); + QStringList Serial_BaudrateElemNames; + Serial_BaudrateElemNames.append("0"); + QStringList Serial_BaudrateEnumOptions; + Serial_BaudrateEnumOptions.append("1200"); + Serial_BaudrateEnumOptions.append("2400"); + Serial_BaudrateEnumOptions.append("4800"); + Serial_BaudrateEnumOptions.append("9600"); + Serial_BaudrateEnumOptions.append("19200"); + Serial_BaudrateEnumOptions.append("38400"); + Serial_BaudrateEnumOptions.append("57600"); + Serial_BaudrateEnumOptions.append("115200"); + Serial_BaudrateEnumOptions.append("230400"); + fields.append( new UAVObjectField(QString("Serial_Baudrate"), QString("bits/sec"), UAVObjectField::ENUM, Serial_BaudrateElemNames, Serial_BaudrateEnumOptions) ); QStringList Frequency_CalibrationElemNames; Frequency_CalibrationElemNames.append("0"); fields.append( new UAVObjectField(QString("Frequency_Calibration"), QString(""), UAVObjectField::UINT8, Frequency_CalibrationElemNames, QStringList()) ); @@ -54,23 +74,23 @@ PipXtremeModemSettings::PipXtremeModemSettings(): UAVDataObject(OBJID, ISSINGLEI QStringList FrequencyElemNames; FrequencyElemNames.append("0"); fields.append( new UAVObjectField(QString("Frequency"), QString("Hz"), UAVObjectField::UINT32, FrequencyElemNames, QStringList()) ); - QStringList RF_BandwidthElemNames; - RF_BandwidthElemNames.append("0"); - QStringList RF_BandwidthEnumOptions; - RF_BandwidthEnumOptions.append("500"); - RF_BandwidthEnumOptions.append("1000"); - RF_BandwidthEnumOptions.append("2000"); - RF_BandwidthEnumOptions.append("4000"); - RF_BandwidthEnumOptions.append("8000"); - RF_BandwidthEnumOptions.append("9600"); - RF_BandwidthEnumOptions.append("16000"); - RF_BandwidthEnumOptions.append("19200"); - RF_BandwidthEnumOptions.append("24000"); - RF_BandwidthEnumOptions.append("32000"); - RF_BandwidthEnumOptions.append("64000"); - RF_BandwidthEnumOptions.append("128000"); - RF_BandwidthEnumOptions.append("192000"); - fields.append( new UAVObjectField(QString("RF_Bandwidth"), QString("Hz"), UAVObjectField::ENUM, RF_BandwidthElemNames, RF_BandwidthEnumOptions) ); + QStringList Max_RF_BandwidthElemNames; + Max_RF_BandwidthElemNames.append("0"); + QStringList Max_RF_BandwidthEnumOptions; + Max_RF_BandwidthEnumOptions.append("500"); + Max_RF_BandwidthEnumOptions.append("1000"); + Max_RF_BandwidthEnumOptions.append("2000"); + Max_RF_BandwidthEnumOptions.append("4000"); + Max_RF_BandwidthEnumOptions.append("8000"); + Max_RF_BandwidthEnumOptions.append("9600"); + Max_RF_BandwidthEnumOptions.append("16000"); + Max_RF_BandwidthEnumOptions.append("19200"); + Max_RF_BandwidthEnumOptions.append("24000"); + Max_RF_BandwidthEnumOptions.append("32000"); + Max_RF_BandwidthEnumOptions.append("64000"); + Max_RF_BandwidthEnumOptions.append("128000"); + Max_RF_BandwidthEnumOptions.append("192000"); + fields.append( new UAVObjectField(QString("Max_RF_Bandwidth"), QString("bits/sec"), UAVObjectField::ENUM, Max_RF_BandwidthElemNames, Max_RF_BandwidthEnumOptions) ); QStringList Max_Tx_PowerElemNames; Max_Tx_PowerElemNames.append("0"); QStringList Max_Tx_PowerEnumOptions; @@ -107,9 +127,9 @@ PipXtremeModemSettings::PipXtremeModemSettings(): UAVDataObject(OBJID, ISSINGLEI AES_EncryptionKeyElemNames.append("14"); AES_EncryptionKeyElemNames.append("15"); fields.append( new UAVObjectField(QString("AES_EncryptionKey"), QString(""), UAVObjectField::UINT8, AES_EncryptionKeyElemNames, QStringList()) ); - QStringList Paired_Serial_Number_CRCElemNames; - Paired_Serial_Number_CRCElemNames.append("0"); - fields.append( new UAVObjectField(QString("Paired_Serial_Number_CRC"), QString(""), UAVObjectField::UINT32, Paired_Serial_Number_CRCElemNames, QStringList()) ); + QStringList Paired_Serial_NumberElemNames; + Paired_Serial_NumberElemNames.append("0"); + fields.append( new UAVObjectField(QString("Paired_Serial_Number"), QString(""), UAVObjectField::UINT32, Paired_Serial_NumberElemNames, QStringList()) ); // Initialize object initializeFields(fields, (quint8*)&data, NUMBYTES); @@ -143,11 +163,13 @@ UAVObject::Metadata PipXtremeModemSettings::getDefaultMetadata() */ void PipXtremeModemSettings::setDefaultFieldValues() { + data.Mode = 0; + data.Serial_Baudrate = 6; data.Frequency_Calibration = 127; data.Frequency_Min = 0; data.Frequency_Max = 0; data.Frequency = 0; - data.RF_Bandwidth = 11; + data.Max_RF_Bandwidth = 11; data.Max_Tx_Power = 4; data.AES_Encryption = 0; data.AES_EncryptionKey[0] = 0; @@ -166,7 +188,7 @@ void PipXtremeModemSettings::setDefaultFieldValues() data.AES_EncryptionKey[13] = 0; data.AES_EncryptionKey[14] = 0; data.AES_EncryptionKey[15] = 0; - data.Paired_Serial_Number_CRC = 0; + data.Paired_Serial_Number = 0; } diff --git a/ground/src/plugins/uavobjects/pipxtrememodemsettings.h b/ground/src/plugins/uavobjects/pipxtrememodemsettings.h index ab2b7b92f..ff625ea42 100644 --- a/ground/src/plugins/uavobjects/pipxtrememodemsettings.h +++ b/ground/src/plugins/uavobjects/pipxtrememodemsettings.h @@ -43,26 +43,34 @@ class UAVOBJECTS_EXPORT PipXtremeModemSettings: public UAVDataObject public: // Field structure typedef struct { + quint8 Mode; + quint8 Serial_Baudrate; quint8 Frequency_Calibration; quint32 Frequency_Min; quint32 Frequency_Max; quint32 Frequency; - quint8 RF_Bandwidth; + quint8 Max_RF_Bandwidth; quint8 Max_Tx_Power; quint8 AES_Encryption; quint8 AES_EncryptionKey[16]; - quint32 Paired_Serial_Number_CRC; + quint32 Paired_Serial_Number; } __attribute__((packed)) DataFields; // Field information + // Field Mode information + /* Enumeration options for field Mode */ + typedef enum { MODE_NORMAL=0, MODE_TEST_CARRIER=1, MODE_TEST_SPECTRUM=2 } ModeOptions; + // Field Serial_Baudrate information + /* Enumeration options for field Serial_Baudrate */ + typedef enum { SERIAL_BAUDRATE_1200=0, SERIAL_BAUDRATE_2400=1, SERIAL_BAUDRATE_4800=2, SERIAL_BAUDRATE_9600=3, SERIAL_BAUDRATE_19200=4, SERIAL_BAUDRATE_38400=5, SERIAL_BAUDRATE_57600=6, SERIAL_BAUDRATE_115200=7, SERIAL_BAUDRATE_230400=8 } Serial_BaudrateOptions; // Field Frequency_Calibration information // Field Frequency_Min information // Field Frequency_Max information // Field Frequency information - // Field RF_Bandwidth information - /* Enumeration options for field RF_Bandwidth */ - typedef enum { RF_BANDWIDTH_500=0, RF_BANDWIDTH_1000=1, RF_BANDWIDTH_2000=2, RF_BANDWIDTH_4000=3, RF_BANDWIDTH_8000=4, RF_BANDWIDTH_9600=5, RF_BANDWIDTH_16000=6, RF_BANDWIDTH_19200=7, RF_BANDWIDTH_24000=8, RF_BANDWIDTH_32000=9, RF_BANDWIDTH_64000=10, RF_BANDWIDTH_128000=11, RF_BANDWIDTH_192000=12 } RF_BandwidthOptions; + // Field Max_RF_Bandwidth information + /* Enumeration options for field Max_RF_Bandwidth */ + typedef enum { MAX_RF_BANDWIDTH_500=0, MAX_RF_BANDWIDTH_1000=1, MAX_RF_BANDWIDTH_2000=2, MAX_RF_BANDWIDTH_4000=3, MAX_RF_BANDWIDTH_8000=4, MAX_RF_BANDWIDTH_9600=5, MAX_RF_BANDWIDTH_16000=6, MAX_RF_BANDWIDTH_19200=7, MAX_RF_BANDWIDTH_24000=8, MAX_RF_BANDWIDTH_32000=9, MAX_RF_BANDWIDTH_64000=10, MAX_RF_BANDWIDTH_128000=11, MAX_RF_BANDWIDTH_192000=12 } Max_RF_BandwidthOptions; // Field Max_Tx_Power information /* Enumeration options for field Max_Tx_Power */ typedef enum { MAX_TX_POWER_1=0, MAX_TX_POWER_2=1, MAX_TX_POWER_5=2, MAX_TX_POWER_8=3, MAX_TX_POWER_11=4, MAX_TX_POWER_14=5, MAX_TX_POWER_17=6, MAX_TX_POWER_20=7 } Max_Tx_PowerOptions; @@ -72,11 +80,11 @@ public: // Field AES_EncryptionKey information /* Number of elements for field AES_EncryptionKey */ static const quint32 AES_ENCRYPTIONKEY_NUMELEM = 16; - // Field Paired_Serial_Number_CRC information + // Field Paired_Serial_Number information // Constants - static const quint32 OBJID = 2660664364U; + static const quint32 OBJID = 3822692478U; static const QString NAME; static const bool ISSINGLEINST = 1; static const bool ISSETTINGS = 1; diff --git a/ground/src/plugins/uavobjects/pipxtrememodemsettings.py b/ground/src/plugins/uavobjects/pipxtrememodemsettings.py index 1923bf87a..cc1c0e015 100644 --- a/ground/src/plugins/uavobjects/pipxtrememodemsettings.py +++ b/ground/src/plugins/uavobjects/pipxtrememodemsettings.py @@ -37,6 +37,38 @@ from collections import namedtuple # This is a list of instances of the data fields contained in this object _fields = [ \ + uavobject.UAVObjectField( + 'Mode', + 'b', + 1, + [ + '0', + ], + { + '0' : 'Normal', + '1' : 'Test_Carrier', + '2' : 'Test_Spectrum', + } + ), + uavobject.UAVObjectField( + 'Serial_Baudrate', + 'b', + 1, + [ + '0', + ], + { + '0' : '1200', + '1' : '2400', + '2' : '4800', + '3' : '9600', + '4' : '19200', + '5' : '38400', + '6' : '57600', + '7' : '115200', + '8' : '230400', + } + ), uavobject.UAVObjectField( 'Frequency_Calibration', 'B', @@ -78,7 +110,7 @@ _fields = [ \ } ), uavobject.UAVObjectField( - 'RF_Bandwidth', + 'Max_RF_Bandwidth', 'b', 1, [ @@ -156,7 +188,7 @@ _fields = [ \ } ), uavobject.UAVObjectField( - 'Paired_Serial_Number_CRC', + 'Paired_Serial_Number', 'I', 1, [ @@ -170,7 +202,7 @@ _fields = [ \ class PipXtremeModemSettings(uavobject.UAVObject): ## Object constants - OBJID = 2660664364 + OBJID = 3822692478 NAME = "PipXtremeModemSettings" METANAME = "PipXtremeModemSettingsMeta" ISSINGLEINST = 1 diff --git a/ground/src/plugins/uavobjects/pipxtrememodemstatus.cpp b/ground/src/plugins/uavobjects/pipxtrememodemstatus.cpp index bf8b062b3..812dc736d 100644 --- a/ground/src/plugins/uavobjects/pipxtrememodemstatus.cpp +++ b/ground/src/plugins/uavobjects/pipxtrememodemstatus.cpp @@ -44,33 +44,7 @@ PipXtremeModemStatus::PipXtremeModemStatus(): UAVDataObject(OBJID, ISSINGLEINST, QList fields; QStringList Serial_NumberElemNames; Serial_NumberElemNames.append("0"); - Serial_NumberElemNames.append("1"); - Serial_NumberElemNames.append("2"); - Serial_NumberElemNames.append("3"); - Serial_NumberElemNames.append("4"); - Serial_NumberElemNames.append("5"); - Serial_NumberElemNames.append("6"); - Serial_NumberElemNames.append("7"); - Serial_NumberElemNames.append("8"); - Serial_NumberElemNames.append("9"); - Serial_NumberElemNames.append("10"); - Serial_NumberElemNames.append("11"); - Serial_NumberElemNames.append("12"); - Serial_NumberElemNames.append("13"); - Serial_NumberElemNames.append("14"); - Serial_NumberElemNames.append("15"); - Serial_NumberElemNames.append("16"); - Serial_NumberElemNames.append("17"); - Serial_NumberElemNames.append("18"); - Serial_NumberElemNames.append("19"); - Serial_NumberElemNames.append("20"); - Serial_NumberElemNames.append("21"); - Serial_NumberElemNames.append("22"); - Serial_NumberElemNames.append("23"); - fields.append( new UAVObjectField(QString("Serial_Number"), QString(""), UAVObjectField::UINT8, Serial_NumberElemNames, QStringList()) ); - QStringList Serial_Number_CRCElemNames; - Serial_Number_CRCElemNames.append("0"); - fields.append( new UAVObjectField(QString("Serial_Number_CRC"), QString(""), UAVObjectField::UINT32, Serial_Number_CRCElemNames, QStringList()) ); + fields.append( new UAVObjectField(QString("Serial_Number"), QString(""), UAVObjectField::UINT32, Serial_NumberElemNames, QStringList()) ); QStringList Up_TimeElemNames; Up_TimeElemNames.append("0"); fields.append( new UAVObjectField(QString("Up_Time"), QString("ms"), UAVObjectField::UINT32, Up_TimeElemNames, QStringList()) ); @@ -79,7 +53,7 @@ PipXtremeModemStatus::PipXtremeModemStatus(): UAVDataObject(OBJID, ISSINGLEINST, fields.append( new UAVObjectField(QString("Frequency"), QString("Hz"), UAVObjectField::UINT32, FrequencyElemNames, QStringList()) ); QStringList RF_BandwidthElemNames; RF_BandwidthElemNames.append("0"); - fields.append( new UAVObjectField(QString("RF_Bandwidth"), QString("Hz"), UAVObjectField::UINT32, RF_BandwidthElemNames, QStringList()) ); + fields.append( new UAVObjectField(QString("RF_Bandwidth"), QString("bits/sec"), UAVObjectField::UINT32, RF_BandwidthElemNames, QStringList()) ); QStringList Tx_PowerElemNames; Tx_PowerElemNames.append("0"); fields.append( new UAVObjectField(QString("Tx_Power"), QString("dBm"), UAVObjectField::INT8, Tx_PowerElemNames, QStringList()) ); @@ -96,10 +70,10 @@ PipXtremeModemStatus::PipXtremeModemStatus(): UAVDataObject(OBJID, ISSINGLEINST, fields.append( new UAVObjectField(QString("Tx_Retry"), QString(""), UAVObjectField::UINT16, Tx_RetryElemNames, QStringList()) ); QStringList Tx_Data_RateElemNames; Tx_Data_RateElemNames.append("0"); - fields.append( new UAVObjectField(QString("Tx_Data_Rate"), QString("bytes/sec"), UAVObjectField::UINT32, Tx_Data_RateElemNames, QStringList()) ); + fields.append( new UAVObjectField(QString("Tx_Data_Rate"), QString("bits/sec"), UAVObjectField::UINT32, Tx_Data_RateElemNames, QStringList()) ); QStringList Rx_Data_RateElemNames; Rx_Data_RateElemNames.append("0"); - fields.append( new UAVObjectField(QString("Rx_Data_Rate"), QString("bytes/sec"), UAVObjectField::UINT32, Rx_Data_RateElemNames, QStringList()) ); + fields.append( new UAVObjectField(QString("Rx_Data_Rate"), QString("bits/sec"), UAVObjectField::UINT32, Rx_Data_RateElemNames, QStringList()) ); // Initialize object initializeFields(fields, (quint8*)&data, NUMBYTES); @@ -133,31 +107,7 @@ UAVObject::Metadata PipXtremeModemStatus::getDefaultMetadata() */ void PipXtremeModemStatus::setDefaultFieldValues() { - data.Serial_Number[0] = 0; - data.Serial_Number[1] = 0; - data.Serial_Number[2] = 0; - data.Serial_Number[3] = 0; - data.Serial_Number[4] = 0; - data.Serial_Number[5] = 0; - data.Serial_Number[6] = 0; - data.Serial_Number[7] = 0; - data.Serial_Number[8] = 0; - data.Serial_Number[9] = 0; - data.Serial_Number[10] = 0; - data.Serial_Number[11] = 0; - data.Serial_Number[12] = 0; - data.Serial_Number[13] = 0; - data.Serial_Number[14] = 0; - data.Serial_Number[15] = 0; - data.Serial_Number[16] = 0; - data.Serial_Number[17] = 0; - data.Serial_Number[18] = 0; - data.Serial_Number[19] = 0; - data.Serial_Number[20] = 0; - data.Serial_Number[21] = 0; - data.Serial_Number[22] = 0; - data.Serial_Number[23] = 0; - data.Serial_Number_CRC = 0; + data.Serial_Number = 0; } diff --git a/ground/src/plugins/uavobjects/pipxtrememodemstatus.h b/ground/src/plugins/uavobjects/pipxtrememodemstatus.h index 0d9e302c3..287aa266d 100644 --- a/ground/src/plugins/uavobjects/pipxtrememodemstatus.h +++ b/ground/src/plugins/uavobjects/pipxtrememodemstatus.h @@ -43,8 +43,7 @@ class UAVOBJECTS_EXPORT PipXtremeModemStatus: public UAVDataObject public: // Field structure typedef struct { - quint8 Serial_Number[24]; - quint32 Serial_Number_CRC; + quint32 Serial_Number; quint32 Up_Time; quint32 Frequency; quint32 RF_Bandwidth; @@ -58,9 +57,6 @@ public: // Field information // Field Serial_Number information - /* Number of elements for field Serial_Number */ - static const quint32 SERIAL_NUMBER_NUMELEM = 24; - // Field Serial_Number_CRC information // Field Up_Time information // Field Frequency information // Field RF_Bandwidth information @@ -74,7 +70,7 @@ public: // Constants - static const quint32 OBJID = 3920019084U; + static const quint32 OBJID = 539085060U; static const QString NAME; static const bool ISSINGLEINST = 1; static const bool ISSETTINGS = 0; diff --git a/ground/src/plugins/uavobjects/pipxtrememodemstatus.py b/ground/src/plugins/uavobjects/pipxtrememodemstatus.py index 2b4f5cad5..5af364aa5 100644 --- a/ground/src/plugins/uavobjects/pipxtrememodemstatus.py +++ b/ground/src/plugins/uavobjects/pipxtrememodemstatus.py @@ -39,39 +39,6 @@ from collections import namedtuple _fields = [ \ uavobject.UAVObjectField( 'Serial_Number', - 'B', - 24, - [ - '0', - '1', - '2', - '3', - '4', - '5', - '6', - '7', - '8', - '9', - '10', - '11', - '12', - '13', - '14', - '15', - '16', - '17', - '18', - '19', - '20', - '21', - '22', - '23', - ], - { - } - ), - uavobject.UAVObjectField( - 'Serial_Number_CRC', 'I', 1, [ @@ -169,7 +136,7 @@ _fields = [ \ class PipXtremeModemStatus(uavobject.UAVObject): ## Object constants - OBJID = 3920019084 + OBJID = 539085060 NAME = "PipXtremeModemStatus" METANAME = "PipXtremeModemStatusMeta" ISSINGLEINST = 1 diff --git a/ground/src/shared/uavobjectdefinition/pipxtrememodemsettings.xml b/ground/src/shared/uavobjectdefinition/pipxtrememodemsettings.xml index 985121799..55a6a6470 100644 --- a/ground/src/shared/uavobjectdefinition/pipxtrememodemsettings.xml +++ b/ground/src/shared/uavobjectdefinition/pipxtrememodemsettings.xml @@ -2,19 +2,24 @@ Settings for the @ref PipXtremeModemSettings + + + + + - + - + diff --git a/ground/src/shared/uavobjectdefinition/pipxtrememodemstatus.xml b/ground/src/shared/uavobjectdefinition/pipxtrememodemstatus.xml index afcfcc0ee..5a475c9dd 100644 --- a/ground/src/shared/uavobjectdefinition/pipxtrememodemstatus.xml +++ b/ground/src/shared/uavobjectdefinition/pipxtrememodemstatus.xml @@ -1,21 +1,22 @@ Status for the @ref PipXtremeModem - - + - + + + - - + +