Changeset f98fa50 in subsurface


Ignore:
Timestamp:
Jun 27, 2017, 8:53:11 PM (5 months ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
master
Children:
ea8e300
Parents:
fbdba88
Message:

BLE code: address some compiler warnings

Signed-off-by: Dirk Hohndel <dirk@…>

Location:
core
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • core/qt-ble.cpp

    r5265956 rf98fa50  
    3838void BLEObject::serviceStateChanged(QLowEnergyService::ServiceState s)
    3939{
     40        Q_UNUSED(s)
     41
    4042        QList<QLowEnergyCharacteristic> list;
    4143
     
    5153void BLEObject::characteristcStateChanged(const QLowEnergyCharacteristic &c, const QByteArray &value)
    5254{
     55        Q_UNUSED(c)
     56
    5357        receivedPackets.append(value);
    5458        waitForPacket.exit();
     
    5761void BLEObject::writeCompleted(const QLowEnergyDescriptor &d, const QByteArray &value)
    5862{
     63        Q_UNUSED(d)
     64        Q_UNUSED(value)
     65
    5966        qDebug() << "BLE write completed";
    6067}
     
    100107dc_status_t BLEObject::write(const void *data, size_t size, size_t *actual)
    101108{
     109        Q_UNUSED(actual) // that seems like it might cause problems
     110
    102111        QList<QLowEnergyCharacteristic> list = preferredService()->characteristics();
    103112        QByteArray bytes((const char *)data, (int) size);
     
    128137                        return DC_STATUS_IO;
    129138
    130                 const QLowEnergyCharacteristic &c = list.constLast();
    131 
    132139                QTimer timer;
    133140                int msec = 5000;
     
    148155                packet.remove(0,2);
    149156
    150         if (size > packet.size())
     157        if (size > (size_t)packet.size())
    151158                size = packet.size();
    152159        memcpy(data, packet.data(), size);
     
    157164dc_status_t qt_ble_open(dc_custom_io_t *io, dc_context_t *context, const char *devaddr)
    158165{
     166        Q_UNUSED(context)
    159167        /*
    160168         * LE-only devices get the "LE:" prepended by the scanning
  • core/qtserialbluetooth.cpp

    rd01b7bf rf98fa50  
    107107                return DC_STATUS_SUCCESS;
    108108        buffer.out_bytes = 0;
    109         ble_serial_ops.packet_write(&ble_serial_ops, buffer.out, bytes, NULL);
     109        return ble_serial_ops.packet_write(&ble_serial_ops, buffer.out, bytes, NULL);
    110110}
    111111
     
    125125static dc_status_t ble_serial_read(dc_custom_io_t *io, void* data, size_t size, size_t *actual)
    126126{
    127         int len;
     127        Q_UNUSED(io)
     128        size_t len;
    128129
    129130        if (buffer.in_pos >= buffer.in_bytes) {
     
    154155static dc_status_t ble_serial_write(dc_custom_io_t *io, const void* data, size_t size, size_t *actual)
    155156{
     157        Q_UNUSED(io)
    156158        dc_status_t rc = DC_STATUS_SUCCESS;
    157159        size_t transferred = 0;
     
    159161        ble_serial_flush_read();
    160162        while (size) {
    161                 int len = sizeof(buffer.out) - buffer.out_bytes;
     163                size_t len = sizeof(buffer.out) - buffer.out_bytes;
    162164
    163165                if (len > size)
     
    182184static dc_status_t ble_serial_purge(dc_custom_io_t *io, dc_direction_t queue)
    183185{
     186        Q_UNUSED(io)
     187        Q_UNUSED(queue)
    184188        /* Do we care? */
    185189        return DC_STATUS_SUCCESS;
     
    188192static dc_status_t ble_serial_get_available(dc_custom_io_t *io, size_t *available)
    189193{
     194        Q_UNUSED(io)
    190195        *available = buffer.in_bytes - buffer.in_pos;
    191196        return DC_STATUS_SUCCESS;
     
    194199static dc_status_t ble_serial_set_timeout(dc_custom_io_t *io, long timeout)
    195200{
     201        Q_UNUSED(io)
     202        Q_UNUSED(timeout)
    196203        /* Do we care? */
    197204        return DC_STATUS_SUCCESS;
Note: See TracChangeset for help on using the changeset viewer.