How to tell Qt Network to change outgoing network interface? [duplicate] - linux

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How to choose which Network interface to use?
My machine is connected to ethernet and wireless LAN.
Is there any way to tell Qt to use specified network as outgoing interface ?
Is there any c library functions in linux to do the same ?

Use QNetworkAccessManager::setConfiguration for instance of your QNetworkAccessManager.
Doc: QNetworkAccessManager

Related

Mifare Classic Card Emulation [duplicate]

This question already has answers here:
Why doesn't Android HCE support Mifare Classic type?
(1 answer)
Emulate Mifare card with Android 4.4
(4 answers)
Closed last month.
my task is that when the Android device is in contact with an already existing reader that works on the 14443-3 protocol (Mifare Classic). Give it the value of some blocks. The unique ID is not important to me. Also, I already understood that Android HCE is not my option.
Are there any examples? Or the SDK?

any help for MQTT mosquitto proto in linux? [duplicate]

This question already exists:
how can i code an MQTT mosquitto proto in linux? [closed]
Closed 10 months ago.
I’m working on the development and realization of a multiprotocol platform for a microservice architecture that handles multiprotocol (Modbus TCP) and sends data via MQTT. I have to create a .proto file for MQTT and config manager. I searched the internet for mosquito in a protobuf format that takes a message from the config manager and publish it but i didn't find anything If someone can help me with some links or guide me it would be great Thank you so much

How to use Shark-CLI library with 2 USB connected devices?

I am unable to use the Shark-CLI library with 2 devices connected to the computer. Is there any parameter to select which device will be used by the library?
This is not currently supported by Shark-CLI, I filed an issue here: https://github.com/square/leakcanary/issues/1642 . It's open source, if you're interested you can add support for it.

difference tun/tap, is the interfaces that handle protocols or the OS?

I have difficulties to understand difference between tap and tun interface. I know it is an often asked question and I apologize for that.
I read tap work at layer 2 and tun works at layer 3. I also read that tap is used for bridging and tun is used for routing.
I already heard things like "ROUTERS work at layer 3" or "BRIDGES work at layer 3" : this make sense for me because routers manipulate layer 3 protocols and bridge manipulate layer 2 protocols?
but, because tap and tun are "interfaces", it means the sentence like "INTERFACES work at layer 3" has a sense but i don't understand what it is : I mean interfaces doesn't manipulate protocols(the OS do that but not an interface) so it sounds like tun interface == tap interface:
If I create two tap interfaces(with tunctl) with two ip that are on different networks (192.168.2.1/24 and 192.168.3.1/24), then I link these to two kvm virtual machine (one tap interface match to one VM) and if I enable routing on the host, my two VM can communicate.
So tap interfaces can also be used for routing : what is the difference with tun ? maybe a tap is also a tun interface?
Also I can create a tap interface with tunctl command but how can I create a tun interface with the same command(the command is called TUNctl not TAPctl...)?
Can you help me to clarify that?
Thank you.

How to open localhost when connecting USB to a linux emb device [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I'm currently programming an arm embedded device. Currently I have installed thttpd and I have a web server running on the device. We have checked, using an ethernet connection, and everything runs fine. This web page controls systems running some sh script that execs c++ programs that communicates over pmpp with the final systems.
This device has an usb port that we plan to use to connect android / ios / bb devices(mobile phone or tablet) and open the same web page, for example, through 192.168.0.222.
Suppose I'm a worker and I have my company smartphone, I want to modify some values of the product so I just plug the usb, I access using safari/chrome or whatever navigator I decided to use, change the values and go home to spend the rest of the afternoon with my family.
What we do not want to do it's to develop an application to retrieve the web page from the device to draw them if we have previously created it.
You have several fundamental architectural problems to solve here if you I understand the question correctly - which is that you want an ethernet connection over a direct USB connection with a mobile device, so that the mobile device can consume a web-service on your embedded system.
1) USB roles: One of the devices needs to have a USB Host Controller, and act as the host. As it happens mobile phones support USB-OTG on their USB ports - and you'll be wanting to get them into host mode (appropriate cable for phones with micro-USB connectors, USB Camera Connection Kit for an iOS device).
2) USB device role: Your embedded device will need to implement an appropriate end-point for the host to communicate. One option is the CDC Ethernet from the Linux Gadget Framework. Provided your device has a functional USB Device stack and supports the gadget framework, this ought to be a case to changing your kernel config and recompiling. Alternatively, you write a driver that spoofs an existing USB Ethernet dongle's API.
3) USB Host drivers: You will need a corresponding USB driver on host. This is where it all starts to fall apart. None of the phones are likely to ship with these. On Android, you could in theory root the phone and then side-load additional drivers. On iOS, the you need to join the Made For iPnone programme to even start to consider this. Even the cost of getting on the scheme is covered by NDA, and it's only intended for volume OEMs. I presume Blackberries are well locked down too.
Alternatively, an approach that is far more likely to work is to connect a USB Ethernet (cost: about $15) or Wifi dongle (Ethernet is far, far easier) to the USB Host port of your embedded device and bring that interface up on your office network.
In terms of implementing the embedded side of this, any webserver capable of CGI is a quick and dirty way of doing the job.

Resources