mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-04 12:24:11 +01:00
Eliminated several (dozen) compiler warnings.
Conflicts: ground/openpilotgcs/src/plugins/config/configgadgetwidget.cpp
This commit is contained in:
parent
a94142ec30
commit
9ebc32da3d
@ -43,6 +43,8 @@ namespace core {
|
|||||||
LanguageStr=LanguageType().toShortString(Language);
|
LanguageStr=LanguageType().toShortString(Language);
|
||||||
Cache::Instance();
|
Cache::Instance();
|
||||||
|
|
||||||
|
// OPMaps::MemoryCache();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -91,6 +91,7 @@ Size PlateCarreeProjection::GetTileMatrixMaxXY(const int &zoom)
|
|||||||
|
|
||||||
Size PlateCarreeProjection::GetTileMatrixMinXY(const int &zoom)
|
Size PlateCarreeProjection::GetTileMatrixMinXY(const int &zoom)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(zoom);
|
||||||
return Size(0, 0);
|
return Size(0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -90,6 +90,7 @@ Size PlateCarreeProjectionPergo::GetTileMatrixMaxXY(const int &zoom)
|
|||||||
|
|
||||||
Size PlateCarreeProjectionPergo::GetTileMatrixMinXY(const int &zoom)
|
Size PlateCarreeProjectionPergo::GetTileMatrixMinXY(const int &zoom)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(zoom)
|
||||||
return Size(0, 0);
|
return Size(0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,9 @@ TrailItem::TrailItem(internals::PointLatLng const& coord,int const& altitude, QB
|
|||||||
|
|
||||||
void TrailItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
void TrailItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(option);
|
||||||
|
Q_UNUSED(widget);
|
||||||
|
|
||||||
painter->setBrush(m_brush);
|
painter->setBrush(m_brush);
|
||||||
painter->drawEllipse(-2,-2,4,4);
|
painter->drawEllipse(-2,-2,4,4);
|
||||||
}
|
}
|
||||||
|
@ -60,6 +60,9 @@ int WayPointCircle::type() const
|
|||||||
|
|
||||||
void WayPointCircle::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
void WayPointCircle::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(option);
|
||||||
|
Q_UNUSED(widget);
|
||||||
|
|
||||||
QPointF p1;
|
QPointF p1;
|
||||||
QPointF p2;
|
QPointF p2;
|
||||||
p1=QPointF(line.p1().x(),line.p1().y()+line.length());
|
p1=QPointF(line.p1().x(),line.p1().y()+line.length());
|
||||||
|
@ -75,6 +75,8 @@ QPainterPath WayPointLine::shape() const
|
|||||||
}
|
}
|
||||||
void WayPointLine::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
void WayPointLine::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(option);
|
||||||
|
Q_UNUSED(widget);
|
||||||
|
|
||||||
QPen myPen = pen();
|
QPen myPen = pen();
|
||||||
myPen.setColor(myColor);
|
myPen.setColor(myColor);
|
||||||
|
@ -114,6 +114,8 @@ void MyTabbedStackWidget::showWidget(int index)
|
|||||||
|
|
||||||
void MyTabbedStackWidget::insertCornerWidget(int index, QWidget *widget)
|
void MyTabbedStackWidget::insertCornerWidget(int index, QWidget *widget)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(index);
|
||||||
|
|
||||||
widget->hide();
|
widget->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -218,6 +218,7 @@ ConfigCcpmWidget::~ConfigCcpmWidget()
|
|||||||
|
|
||||||
void ConfigCcpmWidget::setupUI(QString frameType)
|
void ConfigCcpmWidget::setupUI(QString frameType)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(frameType);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigCcpmWidget::ResetActuators(GUIConfigDataUnion* configData)
|
void ConfigCcpmWidget::ResetActuators(GUIConfigDataUnion* configData)
|
||||||
|
@ -112,7 +112,9 @@ void VehicleConfig::SetConfigData(GUIConfigDataUnion configData) {
|
|||||||
|
|
||||||
void VehicleConfig::ResetActuators(GUIConfigDataUnion* configData)
|
void VehicleConfig::ResetActuators(GUIConfigDataUnion* configData)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(configData);
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList VehicleConfig::getChannelDescriptions()
|
QStringList VehicleConfig::getChannelDescriptions()
|
||||||
{
|
{
|
||||||
QStringList channelDesc;
|
QStringList channelDesc;
|
||||||
|
@ -218,6 +218,8 @@ void ConfigGadgetWidget::tabAboutToChange(int i,bool * proceed)
|
|||||||
*/
|
*/
|
||||||
void ConfigGadgetWidget::updatePipXStatus(UAVObject *object)
|
void ConfigGadgetWidget::updatePipXStatus(UAVObject *object)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(object);
|
||||||
|
|
||||||
// Restart the disconnection timer.
|
// Restart the disconnection timer.
|
||||||
pipxTimeout->start(5000);
|
pipxTimeout->start(5000);
|
||||||
if (!pipxConnected)
|
if (!pipxConnected)
|
||||||
|
@ -1268,7 +1268,7 @@ void ConfigInputWidget::simpleCalibration(bool enable)
|
|||||||
|
|
||||||
restoreMdata();
|
restoreMdata();
|
||||||
|
|
||||||
for (int i = 0; i < ManualControlCommand::CHANNEL_NUMELEM; i++)
|
for (unsigned int i = 0; i < ManualControlCommand::CHANNEL_NUMELEM; i++)
|
||||||
manualSettingsData.ChannelNeutral[i] = manualCommandData.Channel[i];
|
manualSettingsData.ChannelNeutral[i] = manualCommandData.Channel[i];
|
||||||
|
|
||||||
// Force flight mode neutral to middle
|
// Force flight mode neutral to middle
|
||||||
|
@ -266,7 +266,9 @@ void ConfigPipXtremeWidget::updateStatus(UAVObject *object)
|
|||||||
*/
|
*/
|
||||||
void ConfigPipXtremeWidget::updateSettings(UAVObject *object)
|
void ConfigPipXtremeWidget::updateSettings(UAVObject *object)
|
||||||
{
|
{
|
||||||
if (!settingsUpdated)
|
Q_UNUSED(object);
|
||||||
|
|
||||||
|
if (!settingsUpdated)
|
||||||
{
|
{
|
||||||
settingsUpdated = true;
|
settingsUpdated = true;
|
||||||
enableControls(true);
|
enableControls(true);
|
||||||
|
@ -84,6 +84,8 @@ void ModeManager::init()
|
|||||||
|
|
||||||
void ModeManager::addWidget(QWidget *widget)
|
void ModeManager::addWidget(QWidget *widget)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(widget);
|
||||||
|
|
||||||
// We want the actionbar to stay on the bottom
|
// We want the actionbar to stay on the bottom
|
||||||
// so m_modeStack->cornerWidgetCount() -1 inserts it at the position immediately above
|
// so m_modeStack->cornerWidgetCount() -1 inserts it at the position immediately above
|
||||||
// the actionbar
|
// the actionbar
|
||||||
@ -220,6 +222,8 @@ void ModeManager::aboutToRemoveObject(QObject *obj)
|
|||||||
|
|
||||||
void ModeManager::addAction(Command *command, int priority, QMenu *menu)
|
void ModeManager::addAction(Command *command, int priority, QMenu *menu)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(menu);
|
||||||
|
|
||||||
m_actions.insert(command, priority);
|
m_actions.insert(command, priority);
|
||||||
|
|
||||||
// Count the number of commands with a higher priority
|
// Count the number of commands with a higher priority
|
||||||
|
@ -198,6 +198,8 @@ void GCSControlGadget::sticksChangedLocally(double leftX, double leftY, double r
|
|||||||
|
|
||||||
void GCSControlGadget::gamepads(quint8 count)
|
void GCSControlGadget::gamepads(quint8 count)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(count);
|
||||||
|
|
||||||
// sdlGamepad.setGamepad(0);
|
// sdlGamepad.setGamepad(0);
|
||||||
// sdlGamepad.setTickRate(JOYSTICK_UPDATE_RATE);
|
// sdlGamepad.setTickRate(JOYSTICK_UPDATE_RATE);
|
||||||
}
|
}
|
||||||
@ -291,7 +293,7 @@ double GCSControlGadget::constrain(double value)
|
|||||||
|
|
||||||
void GCSControlGadget::buttonState(ButtonNumber number, bool pressed)
|
void GCSControlGadget::buttonState(ButtonNumber number, bool pressed)
|
||||||
{
|
{
|
||||||
int state;
|
// int state;
|
||||||
if ((buttonSettings[number].ActionID>0)&&(buttonSettings[number].FunctionID>0)&&(pressed))
|
if ((buttonSettings[number].ActionID>0)&&(buttonSettings[number].FunctionID>0)&&(pressed))
|
||||||
{//this button is configured
|
{//this button is configured
|
||||||
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
||||||
|
@ -71,6 +71,8 @@ void GCSControlGadgetOptionsPage::buttonState(ButtonNumber number, bool pressed)
|
|||||||
|
|
||||||
void GCSControlGadgetOptionsPage::gamepads(quint8 count)
|
void GCSControlGadgetOptionsPage::gamepads(quint8 count)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(count);
|
||||||
|
|
||||||
/*options_page->AvailableControllerList->clear();
|
/*options_page->AvailableControllerList->clear();
|
||||||
for (int i=0;i<count;i++)
|
for (int i=0;i<count;i++)
|
||||||
{
|
{
|
||||||
@ -105,6 +107,8 @@ void GCSControlGadgetOptionsPage::axesValues(QListInt16 values)
|
|||||||
//creates options page widget (uses the UI file)
|
//creates options page widget (uses the UI file)
|
||||||
QWidget *GCSControlGadgetOptionsPage::createPage(QWidget *parent)
|
QWidget *GCSControlGadgetOptionsPage::createPage(QWidget *parent)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(parent);
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
options_page = new Ui::GCSControlGadgetOptionsPage();
|
options_page = new Ui::GCSControlGadgetOptionsPage();
|
||||||
QWidget *optionsPageWidget = new QWidget;
|
QWidget *optionsPageWidget = new QWidget;
|
||||||
|
@ -154,6 +154,8 @@ void GCSControlGadgetWidget::toggleArmed(int state)
|
|||||||
|
|
||||||
void GCSControlGadgetWidget::mccChanged(UAVObject * obj)
|
void GCSControlGadgetWidget::mccChanged(UAVObject * obj)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(obj);
|
||||||
|
|
||||||
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
||||||
UAVObjectManager *objManager = pm->getObject<UAVObjectManager>();
|
UAVObjectManager *objManager = pm->getObject<UAVObjectManager>();
|
||||||
UAVDataObject* flightStatus = dynamic_cast<UAVDataObject*>( objManager->getObject(QString("FlightStatus")) );
|
UAVDataObject* flightStatus = dynamic_cast<UAVDataObject*>( objManager->getObject(QString("FlightStatus")) );
|
||||||
|
@ -165,6 +165,8 @@ return s1.portName<s2.portName;
|
|||||||
//creates options page widget (uses the UI file)
|
//creates options page widget (uses the UI file)
|
||||||
QWidget *GpsDisplayGadgetOptionsPage::createPage(QWidget *parent)
|
QWidget *GpsDisplayGadgetOptionsPage::createPage(QWidget *parent)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(parent);
|
||||||
|
|
||||||
options_page = new Ui::GpsDisplayGadgetOptionsPage();
|
options_page = new Ui::GpsDisplayGadgetOptionsPage();
|
||||||
QWidget *optionsPageWidget = new QWidget;
|
QWidget *optionsPageWidget = new QWidget;
|
||||||
options_page->setupUi(optionsPageWidget);
|
options_page->setupUi(optionsPageWidget);
|
||||||
|
@ -301,7 +301,7 @@ void NMEAParser::nmeaProcessGPGSV(char *packet)
|
|||||||
|
|
||||||
const int sentence_total = tokenslist.at(1).toInt(); // Number of sentences for full data
|
const int sentence_total = tokenslist.at(1).toInt(); // Number of sentences for full data
|
||||||
const int sentence_index = tokenslist.at(2).toInt(); // sentence x of y
|
const int sentence_index = tokenslist.at(2).toInt(); // sentence x of y
|
||||||
const int sat_count = tokenslist.at(3).toInt(); // Number of satellites in view
|
// const int sat_count = tokenslist.at(3).toInt(); // Number of satellites in view
|
||||||
|
|
||||||
int sats = (tokenslist.size() - 4) /4;
|
int sats = (tokenslist.size() - 4) /4;
|
||||||
for(int sat = 0; sat < sats; sat++) {
|
for(int sat = 0; sat < sats; sat++) {
|
||||||
|
@ -34,6 +34,8 @@ IPconnectionConfiguration::IPconnectionConfiguration(QString classId, QSettings*
|
|||||||
m_Port(1000),
|
m_Port(1000),
|
||||||
m_UseTCP(1)
|
m_UseTCP(1)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(qSettings);
|
||||||
|
|
||||||
settings = Core::ICore::instance()->settings();
|
settings = Core::ICore::instance()->settings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -177,6 +177,8 @@ QList <Core::IConnection::device> IPconnectionConnection::availableDevices()
|
|||||||
|
|
||||||
QIODevice *IPconnectionConnection::openDevice(const QString &deviceName)
|
QIODevice *IPconnectionConnection::openDevice(const QString &deviceName)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(deviceName);
|
||||||
|
|
||||||
QString HostName;
|
QString HostName;
|
||||||
int Port;
|
int Port;
|
||||||
bool UseTCP;
|
bool UseTCP;
|
||||||
@ -211,6 +213,8 @@ QIODevice *IPconnectionConnection::openDevice(const QString &deviceName)
|
|||||||
|
|
||||||
void IPconnectionConnection::closeDevice(const QString &deviceName)
|
void IPconnectionConnection::closeDevice(const QString &deviceName)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(deviceName);
|
||||||
|
|
||||||
if (ipSocket){
|
if (ipSocket){
|
||||||
ipConMutex.lock();
|
ipConMutex.lock();
|
||||||
emit CloseSocket(ipSocket);
|
emit CloseSocket(ipSocket);
|
||||||
|
@ -60,6 +60,8 @@ void modelMapProxy::WPValuesChanged(WayPointItem * wp)
|
|||||||
|
|
||||||
void modelMapProxy::currentRowChanged(QModelIndex current, QModelIndex previous)
|
void modelMapProxy::currentRowChanged(QModelIndex current, QModelIndex previous)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(previous);
|
||||||
|
|
||||||
QList<WayPointItem*> list;
|
QList<WayPointItem*> list;
|
||||||
WayPointItem * wp=findWayPointNumber(current.row());
|
WayPointItem * wp=findWayPointNumber(current.row());
|
||||||
if(!wp)
|
if(!wp)
|
||||||
@ -202,6 +204,8 @@ WayPointItem * modelMapProxy::findWayPointNumber(int number)
|
|||||||
|
|
||||||
void modelMapProxy::rowsRemoved(const QModelIndex &parent, int first, int last)
|
void modelMapProxy::rowsRemoved(const QModelIndex &parent, int first, int last)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(parent);
|
||||||
|
|
||||||
for(int x=last;x>first-1;x--)
|
for(int x=last;x>first-1;x--)
|
||||||
{
|
{
|
||||||
myMap->WPDelete(x);
|
myMap->WPDelete(x);
|
||||||
@ -211,6 +215,8 @@ void modelMapProxy::rowsRemoved(const QModelIndex &parent, int first, int last)
|
|||||||
|
|
||||||
void modelMapProxy::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
|
void modelMapProxy::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(bottomRight);
|
||||||
|
|
||||||
WayPointItem * item=findWayPointNumber(topLeft.row());
|
WayPointItem * item=findWayPointNumber(topLeft.row());
|
||||||
if(!item)
|
if(!item)
|
||||||
return;
|
return;
|
||||||
|
@ -287,5 +287,7 @@ void opmap_edit_waypoint_dialog::enableEditWidgets(bool value)
|
|||||||
|
|
||||||
void opmap_edit_waypoint_dialog::currentRowChanged(QModelIndex current, QModelIndex previous)
|
void opmap_edit_waypoint_dialog::currentRowChanged(QModelIndex current, QModelIndex previous)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(previous);
|
||||||
|
|
||||||
mapper->setCurrentIndex(current.row());
|
mapper->setCurrentIndex(current.row());
|
||||||
}
|
}
|
||||||
|
@ -46,6 +46,7 @@ PFDGadgetOptionsPage::PFDGadgetOptionsPage(PFDGadgetConfiguration *config, QObje
|
|||||||
//creates options page widget (uses the UI file)
|
//creates options page widget (uses the UI file)
|
||||||
QWidget *PFDGadgetOptionsPage::createPage(QWidget *parent)
|
QWidget *PFDGadgetOptionsPage::createPage(QWidget *parent)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(parent);
|
||||||
|
|
||||||
options_page = new Ui::PFDGadgetOptionsPage();
|
options_page = new Ui::PFDGadgetOptionsPage();
|
||||||
//main widget
|
//main widget
|
||||||
|
@ -46,6 +46,7 @@ QmlViewGadgetOptionsPage::QmlViewGadgetOptionsPage(QmlViewGadgetConfiguration *c
|
|||||||
//creates options page widget (uses the UI file)
|
//creates options page widget (uses the UI file)
|
||||||
QWidget *QmlViewGadgetOptionsPage::createPage(QWidget *parent)
|
QWidget *QmlViewGadgetOptionsPage::createPage(QWidget *parent)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(parent);
|
||||||
|
|
||||||
options_page = new Ui::QmlViewGadgetOptionsPage();
|
options_page = new Ui::QmlViewGadgetOptionsPage();
|
||||||
//main widget
|
//main widget
|
||||||
|
@ -90,7 +90,7 @@ static void hid_close(hid_t *);
|
|||||||
static void attach_callback(void *, IOReturn, void *, IOHIDDeviceRef);
|
static void attach_callback(void *, IOReturn, void *, IOHIDDeviceRef);
|
||||||
static void detach_callback(void *, IOReturn, void *hid_mgr, IOHIDDeviceRef dev);
|
static void detach_callback(void *, IOReturn, void *hid_mgr, IOHIDDeviceRef dev);
|
||||||
static void input_callback(void *, IOReturn, void *, IOHIDReportType, uint32_t, uint8_t *, CFIndex);
|
static void input_callback(void *, IOReturn, void *, IOHIDReportType, uint32_t, uint8_t *, CFIndex);
|
||||||
static void output_callback(hid_t *context, IOReturn ret, void *sender, IOHIDReportType type, uint32_t id, uint8_t *data, CFIndex len);
|
//static void output_callback(hid_t *context, IOReturn ret, void *sender, IOHIDReportType type, uint32_t id, uint8_t *data, CFIndex len);
|
||||||
static void timeout_callback(CFRunLoopTimerRef, void *);
|
static void timeout_callback(CFRunLoopTimerRef, void *);
|
||||||
|
|
||||||
|
|
||||||
@ -173,7 +173,7 @@ int pjrc_rawhid::open(int max, int vid, int pid, int usage_page, int usage)
|
|||||||
IOHIDManagerRegisterDeviceRemovalCallback(hid_manager, detach_callback, NULL);
|
IOHIDManagerRegisterDeviceRemovalCallback(hid_manager, detach_callback, NULL);
|
||||||
ret = IOHIDManagerOpen(hid_manager, kIOHIDOptionsTypeNone);
|
ret = IOHIDManagerOpen(hid_manager, kIOHIDOptionsTypeNone);
|
||||||
if (ret != kIOReturnSuccess) {
|
if (ret != kIOReturnSuccess) {
|
||||||
printf("Could not start IOHIDManager");
|
qDebug()<< "Could not start IOHIDManager";
|
||||||
IOHIDManagerUnscheduleFromRunLoop(hid_manager,
|
IOHIDManagerUnscheduleFromRunLoop(hid_manager,
|
||||||
CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);
|
CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);
|
||||||
CFRelease(hid_manager);
|
CFRelease(hid_manager);
|
||||||
@ -181,7 +181,7 @@ int pjrc_rawhid::open(int max, int vid, int pid, int usage_page, int usage)
|
|||||||
}
|
}
|
||||||
// Set the run loop reference:
|
// Set the run loop reference:
|
||||||
the_correct_runloop = CFRunLoopGetCurrent();
|
the_correct_runloop = CFRunLoopGetCurrent();
|
||||||
printf("run loop\n");
|
qDebug() << "run loop";
|
||||||
// let it do the callback for all devices
|
// let it do the callback for all devices
|
||||||
while (CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, true) == kCFRunLoopRunHandledSource) ;
|
while (CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, true) == kCFRunLoopRunHandledSource) ;
|
||||||
// count up how many were added by the callback
|
// count up how many were added by the callback
|
||||||
@ -240,7 +240,7 @@ int pjrc_rawhid::receive(int num, void *buf, int len, int timeout)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!hid->open) {
|
if (!hid->open) {
|
||||||
printf("pjrc_rawhid_recv, device not open\n");
|
qDebug() << "pjrc_rawhid_recv, device not open\n";
|
||||||
ret = -1;
|
ret = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -263,6 +263,8 @@ int pjrc_rawhid::receive(int num, void *buf, int len, int timeout)
|
|||||||
//
|
//
|
||||||
int pjrc_rawhid::send(int num, void *buf, int len, int timeout)
|
int pjrc_rawhid::send(int num, void *buf, int len, int timeout)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(timeout);
|
||||||
|
|
||||||
hid_t *hid;
|
hid_t *hid;
|
||||||
int result=-100;
|
int result=-100;
|
||||||
|
|
||||||
@ -287,6 +289,7 @@ int pjrc_rawhid::send(int num, void *buf, int len, int timeout)
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
#if 0
|
#if 0
|
||||||
|
#define TIMEOUT_FIXED
|
||||||
// No matter what I tried this never actually sends an output
|
// No matter what I tried this never actually sends an output
|
||||||
// report and output_callback never gets called. Why??
|
// report and output_callback never gets called. Why??
|
||||||
// Did I miss something? This is exactly the same params as
|
// Did I miss something? This is exactly the same params as
|
||||||
@ -358,6 +361,9 @@ void pjrc_rawhid::close(int num)
|
|||||||
//
|
//
|
||||||
static void input_callback(void *context, IOReturn ret, void *sender, IOHIDReportType type, uint32_t id, uint8_t *data, CFIndex len)
|
static void input_callback(void *context, IOReturn ret, void *sender, IOHIDReportType type, uint32_t id, uint8_t *data, CFIndex len)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(type);
|
||||||
|
Q_UNUSED(id);
|
||||||
|
|
||||||
buffer_t *n;
|
buffer_t *n;
|
||||||
hid_t *hid;
|
hid_t *hid;
|
||||||
|
|
||||||
@ -365,7 +371,7 @@ static void input_callback(void *context, IOReturn ret, void *sender, IOHIDRepor
|
|||||||
if (ret != kIOReturnSuccess || len < 1) return;
|
if (ret != kIOReturnSuccess || len < 1) return;
|
||||||
hid = (hid_t*)context;
|
hid = (hid_t*)context;
|
||||||
if (!hid || hid->ref != sender) return;
|
if (!hid || hid->ref != sender) return;
|
||||||
printf("Processing packet");
|
qDebug() << "Processing packet";
|
||||||
n = (buffer_t *)malloc(sizeof(buffer_t));
|
n = (buffer_t *)malloc(sizeof(buffer_t));
|
||||||
if (!n) return;
|
if (!n) return;
|
||||||
if (len > BUFFER_SIZE) len = BUFFER_SIZE;
|
if (len > BUFFER_SIZE) len = BUFFER_SIZE;
|
||||||
@ -385,6 +391,8 @@ static void input_callback(void *context, IOReturn ret, void *sender, IOHIDRepor
|
|||||||
|
|
||||||
static void timeout_callback(CFRunLoopTimerRef timer, void *info)
|
static void timeout_callback(CFRunLoopTimerRef timer, void *info)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(timer);
|
||||||
|
|
||||||
//qDebug("timeout_callback\n");
|
//qDebug("timeout_callback\n");
|
||||||
*(int *)info = 1;
|
*(int *)info = 1;
|
||||||
//qDebug() << "Stop CFRunLoop from timeout_callback" << CFRunLoopGetCurrent();
|
//qDebug() << "Stop CFRunLoop from timeout_callback" << CFRunLoopGetCurrent();
|
||||||
@ -440,9 +448,13 @@ static void hid_close(hid_t *hid)
|
|||||||
|
|
||||||
static void detach_callback(void *context, IOReturn r, void *hid_mgr, IOHIDDeviceRef dev)
|
static void detach_callback(void *context, IOReturn r, void *hid_mgr, IOHIDDeviceRef dev)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(context);
|
||||||
|
Q_UNUSED(r);
|
||||||
|
Q_UNUSED(hid_mgr);
|
||||||
|
|
||||||
hid_t *p;
|
hid_t *p;
|
||||||
|
|
||||||
printf("detach callback\n");
|
qDebug()<< "detach callback";
|
||||||
for (p = first_hid; p; p = p->next) {
|
for (p = first_hid; p; p = p->next) {
|
||||||
if (p->ref == dev) {
|
if (p->ref == dev) {
|
||||||
p->open = 0;
|
p->open = 0;
|
||||||
@ -454,9 +466,13 @@ static void detach_callback(void *context, IOReturn r, void *hid_mgr, IOHIDDevic
|
|||||||
|
|
||||||
static void attach_callback(void *context, IOReturn r, void *hid_mgr, IOHIDDeviceRef dev)
|
static void attach_callback(void *context, IOReturn r, void *hid_mgr, IOHIDDeviceRef dev)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(context);
|
||||||
|
Q_UNUSED(r);
|
||||||
|
Q_UNUSED(hid_mgr);
|
||||||
|
|
||||||
struct hid_struct *h;
|
struct hid_struct *h;
|
||||||
|
|
||||||
printf("attach callback\n");
|
qDebug() << "attach callback";
|
||||||
if (IOHIDDeviceOpen(dev, kIOHIDOptionsTypeNone) != kIOReturnSuccess) return;
|
if (IOHIDDeviceOpen(dev, kIOHIDOptionsTypeNone) != kIOReturnSuccess) return;
|
||||||
h = (hid_t *)malloc(sizeof(hid_t));
|
h = (hid_t *)malloc(sizeof(hid_t));
|
||||||
if (!h) return;
|
if (!h) return;
|
||||||
@ -468,15 +484,22 @@ static void attach_callback(void *context, IOReturn r, void *hid_mgr, IOHIDDevic
|
|||||||
add_hid(h);
|
add_hid(h);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef TIMEOUT_FIXED
|
||||||
static void output_callback(hid_t *context, IOReturn ret, void *sender, IOHIDReportType type, uint32_t id, uint8_t *data, CFIndex len)
|
static void output_callback(hid_t *context, IOReturn ret, void *sender, IOHIDReportType type, uint32_t id, uint8_t *data, CFIndex len)
|
||||||
{
|
{
|
||||||
printf("output_callback, r=%d\n", ret);
|
Q_UNUSED(sender);
|
||||||
if (ret == kIOReturnSuccess) {
|
Q_UNUSED(type);
|
||||||
*(int *)context = len;
|
Q_UNUSED(id);
|
||||||
} else {
|
Q_UNUSED(data);
|
||||||
// timeout if not success?
|
|
||||||
*(int *)context = 0;
|
|
||||||
}
|
|
||||||
CFRunLoopStop(CFRunLoopGetCurrent());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
qDebug()<< QString("output_callback, r=%1").arg(ret);
|
||||||
|
// printf("output_callback, r=%d\n", ret);
|
||||||
|
if (ret == kIOReturnSuccess) {
|
||||||
|
*(int *)context = len;
|
||||||
|
} else {
|
||||||
|
// timeout if not success?
|
||||||
|
*(int *)context = 0;
|
||||||
|
}
|
||||||
|
CFRunLoopStop(CFRunLoopGetCurrent());
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
@ -117,6 +117,10 @@ void USBMonitor::removeDevice(IOHIDDeviceRef dev) {
|
|||||||
*/
|
*/
|
||||||
void USBMonitor::detach_callback(void *context, IOReturn r, void *hid_mgr, IOHIDDeviceRef dev)
|
void USBMonitor::detach_callback(void *context, IOReturn r, void *hid_mgr, IOHIDDeviceRef dev)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(context);
|
||||||
|
Q_UNUSED(r);
|
||||||
|
Q_UNUSED(hid_mgr);
|
||||||
|
|
||||||
qDebug() << "USBMonitor: Device detached event";
|
qDebug() << "USBMonitor: Device detached event";
|
||||||
instance()->removeDevice(dev);
|
instance()->removeDevice(dev);
|
||||||
}
|
}
|
||||||
@ -129,6 +133,10 @@ void USBMonitor::addDevice(USBPortInfo info) {
|
|||||||
|
|
||||||
void USBMonitor::attach_callback(void *context, IOReturn r, void *hid_mgr, IOHIDDeviceRef dev)
|
void USBMonitor::attach_callback(void *context, IOReturn r, void *hid_mgr, IOHIDDeviceRef dev)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(context);
|
||||||
|
Q_UNUSED(r);
|
||||||
|
Q_UNUSED(hid_mgr);
|
||||||
|
|
||||||
bool got_properties = true;
|
bool got_properties = true;
|
||||||
|
|
||||||
// CFTypeRef prop;
|
// CFTypeRef prop;
|
||||||
|
@ -38,6 +38,8 @@ SerialPluginConfiguration::SerialPluginConfiguration(QString classId, QSettings*
|
|||||||
IUAVGadgetConfiguration(classId, parent),
|
IUAVGadgetConfiguration(classId, parent),
|
||||||
m_speed("57600")
|
m_speed("57600")
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(qSettings);
|
||||||
|
|
||||||
settings = Core::ICore::instance()->settings();
|
settings = Core::ICore::instance()->settings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -802,6 +802,8 @@ qssp::qssp(port * info,bool debug):debug(debug)
|
|||||||
}
|
}
|
||||||
void qssp::pfCallBack( uint8_t * buf, uint16_t size)
|
void qssp::pfCallBack( uint8_t * buf, uint16_t size)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(size);
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
qDebug()<<"receive callback"<<buf[0]<<buf[1]<<buf[2]<<buf[3]<<buf[4];
|
qDebug()<<"receive callback"<<buf[0]<<buf[1]<<buf[2]<<buf[3]<<buf[4];
|
||||||
}
|
}
|
||||||
|
@ -47,6 +47,8 @@ UploaderGadgetOptionsPage::UploaderGadgetOptionsPage(UploaderGadgetConfiguration
|
|||||||
//creates options page widget
|
//creates options page widget
|
||||||
QWidget *UploaderGadgetOptionsPage::createPage(QWidget *parent)
|
QWidget *UploaderGadgetOptionsPage::createPage(QWidget *parent)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(parent);
|
||||||
|
|
||||||
//main widget
|
//main widget
|
||||||
QWidget *widget = new QWidget;
|
QWidget *widget = new QWidget;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user