mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-01 21:54:55 -04:00
Review presets #1. Apply to HackRF
This commit is contained in:
@@ -4,7 +4,7 @@ set(hackrf_SOURCES
|
||||
hackrfgui.cpp
|
||||
hackrfinput.cpp
|
||||
hackrfplugin.cpp
|
||||
hackrfserializer.cpp
|
||||
hackrfsettings.cpp
|
||||
hackrfthread.cpp
|
||||
)
|
||||
|
||||
@@ -12,7 +12,7 @@ set(hackrf_HEADERS
|
||||
hackrfgui.h
|
||||
hackrfinput.h
|
||||
hackrfplugin.h
|
||||
hackrfserializer.h
|
||||
hackrfsettings.h
|
||||
hackrfthread.h
|
||||
)
|
||||
|
||||
|
||||
@@ -233,13 +233,13 @@ void HackRFGui::on_decim_valueChanged(int value)
|
||||
void HackRFGui::on_fcPos_currentIndexChanged(int index)
|
||||
{
|
||||
if (index == 0) {
|
||||
m_settings.m_fcPos = HackRFInput::FC_POS_INFRA;
|
||||
m_settings.m_fcPos = HackRFSettings::FC_POS_INFRA;
|
||||
sendSettings();
|
||||
} else if (index == 1) {
|
||||
m_settings.m_fcPos = HackRFInput::FC_POS_SUPRA;
|
||||
m_settings.m_fcPos = HackRFSettings::FC_POS_SUPRA;
|
||||
sendSettings();
|
||||
} else if (index == 2) {
|
||||
m_settings.m_fcPos = HackRFInput::FC_POS_CENTER;
|
||||
m_settings.m_fcPos = HackRFSettings::FC_POS_CENTER;
|
||||
sendSettings();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ private:
|
||||
Ui::HackRFGui* ui;
|
||||
|
||||
PluginAPI* m_pluginAPI;
|
||||
HackRFInput::Settings m_settings;
|
||||
HackRFSettings m_settings;
|
||||
QTimer m_updateTimer;
|
||||
SampleSource* m_sampleSource;
|
||||
|
||||
|
||||
@@ -24,82 +24,11 @@
|
||||
#include "hackrfinput.h"
|
||||
|
||||
#include "hackrfgui.h"
|
||||
#include "hackrfserializer.h"
|
||||
#include "hackrfthread.h"
|
||||
|
||||
MESSAGE_CLASS_DEFINITION(HackRFInput::MsgConfigureHackRF, Message)
|
||||
MESSAGE_CLASS_DEFINITION(HackRFInput::MsgReportHackRF, Message)
|
||||
|
||||
HackRFInput::Settings::Settings() :
|
||||
m_centerFrequency(435000*1000),
|
||||
m_devSampleRateIndex(0),
|
||||
m_LOppmTenths(0),
|
||||
m_lnaGain(14),
|
||||
m_bandwidthIndex(0),
|
||||
m_vgaGain(4),
|
||||
m_log2Decim(0),
|
||||
m_fcPos(FC_POS_CENTER),
|
||||
m_biasT(false),
|
||||
m_lnaExt(false)
|
||||
{
|
||||
}
|
||||
|
||||
void HackRFInput::Settings::resetToDefaults()
|
||||
{
|
||||
m_centerFrequency = 435000*1000;
|
||||
m_devSampleRateIndex = 0;
|
||||
m_LOppmTenths = 0;
|
||||
m_lnaGain = 14;
|
||||
m_bandwidthIndex = 0;
|
||||
m_vgaGain = 4;
|
||||
m_log2Decim = 0;
|
||||
m_fcPos = FC_POS_CENTER;
|
||||
m_biasT = false;
|
||||
m_lnaExt = false;
|
||||
}
|
||||
|
||||
QByteArray HackRFInput::Settings::serialize() const
|
||||
{
|
||||
HackRFSerializer::HackRFData data;
|
||||
|
||||
data.m_data.m_frequency = m_centerFrequency;
|
||||
data.m_LOppmTenths = m_LOppmTenths;
|
||||
data.m_sampleRateIndex = m_devSampleRateIndex;
|
||||
data.m_log2Decim = m_log2Decim;
|
||||
data.m_fcPos = (qint32) m_fcPos;
|
||||
data.m_lnaGain = m_lnaGain;
|
||||
data.m_bandwidthIndex = m_bandwidthIndex;
|
||||
data.m_vgaGain = m_vgaGain;
|
||||
data.m_biasT = m_biasT;
|
||||
data.m_lnaExt = m_lnaExt;
|
||||
|
||||
QByteArray byteArray;
|
||||
|
||||
HackRFSerializer::writeSerializedData(data, byteArray);
|
||||
|
||||
return byteArray;
|
||||
}
|
||||
|
||||
bool HackRFInput::Settings::deserialize(const QByteArray& serializedData)
|
||||
{
|
||||
HackRFSerializer::HackRFData data;
|
||||
|
||||
bool valid = HackRFSerializer::readSerializedData(serializedData, data);
|
||||
|
||||
m_centerFrequency = data.m_data.m_frequency;
|
||||
m_LOppmTenths = data.m_LOppmTenths;
|
||||
m_devSampleRateIndex = data.m_sampleRateIndex;
|
||||
m_log2Decim = data.m_log2Decim;
|
||||
m_fcPos = (fcPos_t) data.m_fcPos;
|
||||
m_lnaGain = data.m_lnaGain;
|
||||
m_bandwidthIndex = data.m_bandwidthIndex;
|
||||
m_vgaGain = data.m_vgaGain;
|
||||
m_biasT = data.m_biasT;
|
||||
m_lnaExt = data.m_lnaExt;
|
||||
|
||||
return valid;
|
||||
}
|
||||
|
||||
HackRFInput::HackRFInput() :
|
||||
m_settings(),
|
||||
m_dev(0),
|
||||
@@ -242,7 +171,7 @@ void HackRFInput::setCenterFrequency(quint64 freq_hz)
|
||||
}
|
||||
}
|
||||
|
||||
bool HackRFInput::applySettings(const Settings& settings, bool force)
|
||||
bool HackRFInput::applySettings(const HackRFSettings& settings, bool force)
|
||||
{
|
||||
QMutexLocker mutexLocker(&m_mutex);
|
||||
|
||||
@@ -313,19 +242,19 @@ bool HackRFInput::applySettings(const Settings& settings, bool force)
|
||||
m_settings.m_centerFrequency = settings.m_centerFrequency;
|
||||
m_settings.m_LOppmTenths = settings.m_LOppmTenths;
|
||||
|
||||
if ((m_settings.m_log2Decim == 0) || (m_settings.m_fcPos == FC_POS_CENTER))
|
||||
if ((m_settings.m_log2Decim == 0) || (m_settings.m_fcPos == HackRFSettings::FC_POS_CENTER))
|
||||
{
|
||||
deviceCenterFrequency = m_settings.m_centerFrequency;
|
||||
f_img = deviceCenterFrequency;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_settings.m_fcPos == FC_POS_INFRA)
|
||||
if (m_settings.m_fcPos == HackRFSettings::FC_POS_INFRA)
|
||||
{
|
||||
deviceCenterFrequency = m_settings.m_centerFrequency + (devSampleRate / 4);
|
||||
f_img = deviceCenterFrequency + devSampleRate/2;
|
||||
}
|
||||
else if (m_settings.m_fcPos == FC_POS_SUPRA)
|
||||
else if (m_settings.m_fcPos == HackRFSettings::FC_POS_SUPRA)
|
||||
{
|
||||
deviceCenterFrequency = m_settings.m_centerFrequency - (devSampleRate / 4);
|
||||
f_img = deviceCenterFrequency - devSampleRate/2;
|
||||
|
||||
@@ -19,51 +19,29 @@
|
||||
|
||||
#include "dsp/samplesource.h"
|
||||
#include "libhackrf/hackrf.h"
|
||||
#include "hackrfsettings.h"
|
||||
#include <QString>
|
||||
|
||||
class HackRFThread;
|
||||
|
||||
class HackRFInput : public SampleSource {
|
||||
public:
|
||||
typedef enum {
|
||||
FC_POS_INFRA = 0,
|
||||
FC_POS_SUPRA,
|
||||
FC_POS_CENTER
|
||||
} fcPos_t;
|
||||
|
||||
struct Settings {
|
||||
quint64 m_centerFrequency;
|
||||
qint32 m_LOppmTenths;
|
||||
quint32 m_devSampleRateIndex;
|
||||
quint32 m_bandwidthIndex;
|
||||
quint32 m_lnaGain;
|
||||
quint32 m_vgaGain;
|
||||
quint32 m_log2Decim;
|
||||
fcPos_t m_fcPos;
|
||||
bool m_biasT;
|
||||
bool m_lnaExt;
|
||||
|
||||
Settings();
|
||||
void resetToDefaults();
|
||||
QByteArray serialize() const;
|
||||
bool deserialize(const QByteArray& data);
|
||||
};
|
||||
|
||||
class MsgConfigureHackRF : public Message {
|
||||
MESSAGE_CLASS_DECLARATION
|
||||
|
||||
public:
|
||||
const Settings& getSettings() const { return m_settings; }
|
||||
const HackRFSettings& getSettings() const { return m_settings; }
|
||||
|
||||
static MsgConfigureHackRF* create(const Settings& settings)
|
||||
static MsgConfigureHackRF* create(const HackRFSettings& settings)
|
||||
{
|
||||
return new MsgConfigureHackRF(settings);
|
||||
}
|
||||
|
||||
private:
|
||||
Settings m_settings;
|
||||
HackRFSettings m_settings;
|
||||
|
||||
MsgConfigureHackRF(const Settings& settings) :
|
||||
MsgConfigureHackRF(const HackRFSettings& settings) :
|
||||
Message(),
|
||||
m_settings(settings)
|
||||
{ }
|
||||
@@ -100,12 +78,12 @@ public:
|
||||
virtual bool handleMessage(const Message& message);
|
||||
|
||||
private:
|
||||
bool applySettings(const Settings& settings, bool force);
|
||||
bool applySettings(const HackRFSettings& settings, bool force);
|
||||
hackrf_device *open_hackrf_from_sequence(int sequence);
|
||||
void setCenterFrequency(quint64 freq);
|
||||
|
||||
QMutex m_mutex;
|
||||
Settings m_settings;
|
||||
HackRFSettings m_settings;
|
||||
struct hackrf_device* m_dev;
|
||||
HackRFThread* m_hackRFThread;
|
||||
QString m_deviceDescription;
|
||||
|
||||
@@ -33,6 +33,8 @@ const PluginDescriptor HackRFPlugin::m_pluginDescriptor = {
|
||||
QString("https://github.com/f4exb/sdrangel")
|
||||
};
|
||||
|
||||
const QString HackRFPlugin::m_deviceTypeID = HACKRF_DEVICE_TYPE_ID;
|
||||
|
||||
HackRFPlugin::HackRFPlugin(QObject* parent) :
|
||||
QObject(parent),
|
||||
m_pluginAPI(0)
|
||||
@@ -47,7 +49,7 @@ const PluginDescriptor& HackRFPlugin::getPluginDescriptor() const
|
||||
void HackRFPlugin::initPlugin(PluginAPI* pluginAPI)
|
||||
{
|
||||
m_pluginAPI = pluginAPI;
|
||||
m_pluginAPI->registerSampleSource("org.osmocom.sdr.samplesource.hackrf", this);
|
||||
m_pluginAPI->registerSampleSource(m_deviceTypeID, this);
|
||||
}
|
||||
|
||||
PluginInterface::SampleSourceDevices HackRFPlugin::enumSampleSources()
|
||||
@@ -96,7 +98,7 @@ PluginInterface::SampleSourceDevices HackRFPlugin::enumSampleSources()
|
||||
s.writeS32(1, i);
|
||||
s.writeString(2, serial_str);
|
||||
s.writeU64(3, serial_num);
|
||||
result.append(SampleSourceDevice(displayedName, "org.osmocom.sdr.samplesource.hackrf", s.final()));
|
||||
result.append(SampleSourceDevice(displayedName, m_deviceTypeID, s.final()));
|
||||
qDebug("HackRFPlugin::enumSampleSources: enumerated HackRF device #%d", i);
|
||||
|
||||
hackrf_close(hackrf_ptr);
|
||||
@@ -120,7 +122,7 @@ PluginGUI* HackRFPlugin::createSampleSourcePluginGUI(const QString& sourceName,
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(sourceName == "org.osmocom.sdr.samplesource.hackrf")
|
||||
if(sourceName == m_deviceTypeID)
|
||||
{
|
||||
HackRFGui* gui = new HackRFGui(m_pluginAPI);
|
||||
m_pluginAPI->setInputGUI(gui);
|
||||
|
||||
@@ -20,10 +20,12 @@
|
||||
#include <QObject>
|
||||
#include "plugin/plugininterface.h"
|
||||
|
||||
#define HACKRF_DEVICE_TYPE_ID "sdrangel.samplesource.hackrf"
|
||||
|
||||
class HackRFPlugin : public QObject, public PluginInterface {
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(PluginInterface)
|
||||
Q_PLUGIN_METADATA(IID "org.osmocom.sdr.samplesource.hackrf")
|
||||
Q_PLUGIN_METADATA(IID HACKRF_DEVICE_TYPE_ID)
|
||||
|
||||
public:
|
||||
explicit HackRFPlugin(QObject* parent = NULL);
|
||||
@@ -34,6 +36,8 @@ public:
|
||||
SampleSourceDevices enumSampleSources();
|
||||
PluginGUI* createSampleSourcePluginGUI(const QString& sourceName, const QByteArray& address);
|
||||
|
||||
static const QString m_deviceTypeID;
|
||||
|
||||
private:
|
||||
static const PluginDescriptor m_pluginDescriptor;
|
||||
|
||||
|
||||
@@ -1,89 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright (C) 2015 Edouard Griffiths, F4EXB //
|
||||
// //
|
||||
// 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 as version 3 of the License, or //
|
||||
// //
|
||||
// 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 V3 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/>. //
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "hackrfserializer.h"
|
||||
|
||||
void HackRFSerializer::writeSerializedData(const HackRFData& data, QByteArray& serializedData)
|
||||
{
|
||||
QByteArray sampleSourceSerialized;
|
||||
SampleSourceSerializer::writeSerializedData(data.m_data, sampleSourceSerialized);
|
||||
|
||||
SimpleSerializer s(1);
|
||||
|
||||
s.writeBlob(1, sampleSourceSerialized);
|
||||
s.writeS32(2, data.m_LOppmTenths);
|
||||
s.writeU32(3, data.m_sampleRateIndex);
|
||||
s.writeU32(4, data.m_log2Decim);
|
||||
s.writeS32(5, data.m_fcPos);
|
||||
s.writeU32(6, data.m_lnaGain);
|
||||
s.writeU32(7, data.m_bandwidthIndex);
|
||||
s.writeU32(8, data.m_vgaGain);
|
||||
s.writeBool(9, data.m_biasT);
|
||||
s.writeBool(10, data.m_lnaExt);
|
||||
|
||||
serializedData = s.final();
|
||||
}
|
||||
|
||||
bool HackRFSerializer::readSerializedData(const QByteArray& serializedData, HackRFData& data)
|
||||
{
|
||||
bool valid = SampleSourceSerializer::readSerializedData(serializedData, data.m_data);
|
||||
|
||||
QByteArray sampleSourceSerialized;
|
||||
|
||||
SimpleDeserializer d(serializedData);
|
||||
|
||||
if (!d.isValid())
|
||||
{
|
||||
setDefaults(data);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (d.getVersion() == SampleSourceSerializer::getSerializerVersion())
|
||||
{
|
||||
int intval;
|
||||
|
||||
d.readBlob(1, &sampleSourceSerialized);
|
||||
d.readS32(2, &data.m_LOppmTenths, 0);
|
||||
d.readU32(3, &data.m_sampleRateIndex, 0);
|
||||
d.readU32(4, &data.m_log2Decim, 0);
|
||||
d.readS32(5, &data.m_fcPos, 0);
|
||||
d.readU32(6, &data.m_lnaGain, 16);
|
||||
d.readU32(7, &data.m_bandwidthIndex, 0);
|
||||
d.readU32(8, &data.m_vgaGain, 16);
|
||||
d.readBool(9, &data.m_biasT, false);
|
||||
d.readBool(10, &data.m_lnaExt, false);
|
||||
|
||||
return SampleSourceSerializer::readSerializedData(sampleSourceSerialized, data.m_data);
|
||||
}
|
||||
else
|
||||
{
|
||||
setDefaults(data);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void HackRFSerializer::setDefaults(HackRFData& data)
|
||||
{
|
||||
data.m_LOppmTenths = 0;
|
||||
data.m_sampleRateIndex = 0;
|
||||
data.m_log2Decim = 0;
|
||||
data.m_fcPos = 0;
|
||||
data.m_lnaGain = 16;
|
||||
data.m_bandwidthIndex = 0;
|
||||
data.m_vgaGain = 16;
|
||||
data.m_biasT = false;
|
||||
data.m_lnaExt = false;
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright (C) 2015 Edouard Griffiths, F4EXB //
|
||||
// //
|
||||
// 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 as version 3 of the License, or //
|
||||
// //
|
||||
// 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 V3 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/>. //
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <QtGlobal>
|
||||
#include "util/simpleserializer.h"
|
||||
#include "hackrfsettings.h"
|
||||
|
||||
HackRFSettings::HackRFSettings()
|
||||
{
|
||||
resetToDefaults();
|
||||
}
|
||||
|
||||
void HackRFSettings::resetToDefaults()
|
||||
{
|
||||
m_centerFrequency = 435000 * 1000;
|
||||
m_LOppmTenths = 0;
|
||||
m_devSampleRateIndex = 0;
|
||||
m_biasT = false;
|
||||
m_log2Decim = 0;
|
||||
m_fcPos = FC_POS_CENTER;
|
||||
m_lnaExt = false;
|
||||
m_lnaGain = 16;
|
||||
m_bandwidthIndex = 0;
|
||||
m_vgaGain = 16;
|
||||
m_dcBlock = false;
|
||||
m_iqCorrection = false;
|
||||
}
|
||||
|
||||
QByteArray HackRFSettings::serialize() const
|
||||
{
|
||||
SimpleSerializer s(1);
|
||||
|
||||
s.writeS32(1, m_LOppmTenths);
|
||||
s.writeU32(2, m_devSampleRateIndex);
|
||||
s.writeBool(3, m_biasT);
|
||||
s.writeU32(4, m_log2Decim);
|
||||
s.writeS32(5, m_fcPos);
|
||||
s.writeBool(6, m_lnaExt);
|
||||
s.writeU32(7, m_lnaGain);
|
||||
s.writeU32(8, m_bandwidthIndex);
|
||||
s.writeU32(9, m_vgaGain);
|
||||
s.writeBool(10, m_dcBlock);
|
||||
s.writeBool(11, m_iqCorrection);
|
||||
|
||||
return s.final();
|
||||
}
|
||||
|
||||
bool HackRFSettings::deserialize(const QByteArray& data)
|
||||
{
|
||||
SimpleDeserializer d(data);
|
||||
|
||||
if (!d.isValid())
|
||||
{
|
||||
resetToDefaults();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (d.getVersion() == 1)
|
||||
{
|
||||
int intval;
|
||||
|
||||
d.readS32(1, &m_LOppmTenths, 0);
|
||||
d.readU32(2, &m_devSampleRateIndex, 0);
|
||||
d.readBool(3, &m_biasT, false);
|
||||
d.readU32(4, &m_log2Decim, 0);
|
||||
d.readS32(5, &intval, 0);
|
||||
m_fcPos = (fcPos_t) intval;
|
||||
d.readBool(6, &m_lnaExt, false);
|
||||
d.readU32(7, &m_lnaGain, 16);
|
||||
d.readU32(8, &m_bandwidthIndex, 0);
|
||||
d.readU32(9, &m_vgaGain, 16);
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
resetToDefaults();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
+25
-24
@@ -14,32 +14,33 @@
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef PLUGINS_SAMPLESOURCE_HACKRF_HACKRFSERIALIZER_H_
|
||||
#define PLUGINS_SAMPLESOURCE_HACKRF_HACKRFSERIALIZER_H_
|
||||
#ifndef _HACKRF_HACKRFSETTINGS_H_
|
||||
#define _HACKRF_HACKRFSETTINGS_H_
|
||||
|
||||
#include "util/samplesourceserializer.h"
|
||||
struct HackRFSettings {
|
||||
typedef enum {
|
||||
FC_POS_INFRA = 0,
|
||||
FC_POS_SUPRA,
|
||||
FC_POS_CENTER
|
||||
} fcPos_t;
|
||||
|
||||
class HackRFSerializer
|
||||
{
|
||||
public:
|
||||
struct HackRFData
|
||||
{
|
||||
SampleSourceSerializer::Data m_data;
|
||||
qint32 m_LOppmTenths;
|
||||
quint32 m_sampleRateIndex;
|
||||
quint32 m_log2Decim;
|
||||
qint32 m_fcPos;
|
||||
quint32 m_lnaGain;
|
||||
quint32 m_bandwidthIndex;
|
||||
quint32 m_vgaGain;
|
||||
bool m_biasT;
|
||||
bool m_lnaExt;
|
||||
};
|
||||
quint64 m_centerFrequency;
|
||||
qint32 m_LOppmTenths;
|
||||
quint32 m_devSampleRateIndex;
|
||||
quint32 m_bandwidthIndex;
|
||||
quint32 m_lnaGain;
|
||||
quint32 m_vgaGain;
|
||||
quint32 m_log2Decim;
|
||||
fcPos_t m_fcPos;
|
||||
bool m_biasT;
|
||||
bool m_lnaExt;
|
||||
bool m_dcBlock;
|
||||
bool m_iqCorrection;
|
||||
|
||||
static void writeSerializedData(const HackRFData& data, QByteArray& serializedData);
|
||||
static bool readSerializedData(const QByteArray& serializedData, HackRFData& data);
|
||||
static void setDefaults(HackRFData& data);
|
||||
HackRFSettings();
|
||||
void resetToDefaults();
|
||||
QByteArray serialize() const;
|
||||
bool deserialize(const QByteArray& data);
|
||||
};
|
||||
|
||||
|
||||
#endif /* PLUGINS_SAMPLESOURCE_HACKRF_HACKRFSERIALIZER_H_ */
|
||||
#endif /* _HACKRF_HACKRFSETTINGS_H_ */
|
||||
Reference in New Issue
Block a user