void SheerCloudLink::request_completed(){ disconnect( this, SLOT(login_completed()) ); disconnect( this, SLOT(download_completed()) ); disconnect( this, SLOT(upload_completed()) ); disconnect( this, SLOT(delete_completed()) ); disconnect( this, SIGNAL(progress(qint64, qint64))); m_reply->deleteLater(); m_reply = NULL; done(); }
void vendor_req( void ) { u16 wIndex; u16 wValue; u16 wLength; u8 buf[2]; #ifdef CONFIG_NET2270 // DISABLE; #endif wIndex = ControlData.DeviceRequest.wIndex; wValue = ControlData.DeviceRequest.wValue; wLength = ControlData.DeviceRequest.wLength; // puts( "vendor_req." ); if( ControlData.DeviceRequest.bmRequestType & USB_ENDPOINT_DIRECTION_MASK ) { switch( wIndex ) { case GET_FIRMWARE_VERSION: puts( "Connected.\n" ); puts( "Select file in FlashTool and download.\n" ); #ifdef CONFIG_NET2270 send_fifo(EndPoint0, "\x01", 1 ); /* why??? */ if( usb_current_block_size > 0 ) { //udelay(10); read_main_data(EndPointB); } #endif #ifdef CONFIG_PDIUSB12 single_transmit( "x01", 1); #endif break; case GET_FLASH_STATUS: /* * FIXME!!! * NOT COMPLETED. MAKE ME WORK!!! */ if(bEPPflags.bits.verbose) { puts( " get flash status.\n" ); } buf[1] = 0; switch( upg_buffer_status ) { case UPGBUF_UNUSED: buf[0] = 0x00; break; default: buf[0] = 0x02; break; } #ifdef CONFIG_NET2270 send_fifo(EndPoint0, buf, 2 ); #endif #ifdef CONFIG_PDIUSB12 D12_WriteEndpoint(1, buf, 2); #endif break; default: printf( " unknown index. (0x%04x)\n", wIndex ); #ifdef CONFIG_PDIUSB12 single_transmit(0, 0); #endif break; } } else { switch( wIndex ) { case SET_FILE_DOWN_HEADER: if(bEPPflags.bits.verbose) { puts( " set file down header.\n" ); } if( set_file_down_header( (struct _FileDownHeader*)ControlData.dataBuffer, wLength ) ) { puts( "download is not accepted\n" ); } #ifdef CONFIG_PDIUSB12 single_transmit(0, 0); #endif break; case SET_FILE_DOWN: if(bEPPflags.bits.verbose) { puts( " set file down.\n" ); } set_file_down( (struct _IO_REQUEST*)ControlData.dataBuffer, wLength ); #ifdef CONFIG_PDIUSB12 single_transmit(0, 0); #endif break; case USB_CMD_END: if(bEPPflags.bits.verbose) { puts( " cmd end\n" ); } download_completed(); #ifdef CONFIG_PDIUSB12 single_transmit(0, 0); #endif break; default: printf( " unknown index.(0x%04x)\n", wIndex ); #ifdef CONFIG_PDIUSB12 single_transmit(0, 0); #endif break; } } #ifdef CONFIG_NET2270 // ENABLE; #endif }
void SheerCloudLink::Download(QString file, QByteArray & out){ m_reply = get( QNetworkRequest( QUrl( m_location + "/download?login="******"&password="******"&file=" + file ) )); m_out = &out; connect(m_reply, SIGNAL(finished()), SLOT(download_completed())); connect(m_reply, SIGNAL(downloadProgress ( qint64 , qint64 ) ), SIGNAL(progress ( qint64 , qint64 ) )); };