Send data to USB port - java

I wonder how to send data to USB port without have any device connected to it. The problem I'm facing, is sending a simple "logical one" to the chosen USB port, so next I could check the D+ output of the USB cable on the osciloscope. It is needed for the further conversion of the USB signal to the analog output ended with BNC plug.
Currently I play arround a little with http://usb4java.org/index.html and checked its examples https://github.com/usb4java/usb4java-javax-examples/tree/master/src/main/java/org/usb4java/javax/examples. I know the idVendor and idProduct values of my port/cable, but I don't know how could I simply send data "to USB port" without connected any device to it.

Related

Detect USB to send USB Serial using Android Tablet

I would like to ask how to get and detect the USB.
The red one wire connect to usb to have 2 connections
The second wire connect to CPU to debug using Android Studio
Connect to terminal like printer(this one i want to connect but i cant figure it out how to detect and send data from this).
because I'm trying to send data from the serial port, but the thing here is that the device has 3 usb ports. Its similar to COM PORTS in windows.
I'm using Java and Android Studio.

Android: UDP Packets not reaching CDMA Device

Referred to this link and i have done sample Client/Server Apps using android.The apps work well on GSM sim's able to send and receive packets,but on CDMA device i am not able to receive any packets but able to send packets.
Ip address details is drawn from this app
Whats going on here?

How can I use serial communication (port) via Android Bluetooth to send data?

How can I use serial communication (port) via Bluetooth to send data?
I need to send serial data through an Android device to a Bluetooth model (BlueSMiRF Silver) (that is connected to an Arduino board).
I was literally sitting for three day trying to understand how to do that...
Would be nice to have more details about what you tried and where you are stuck.
On the Android side the first step is to pair with the BlueSMiRF module. You should be able to discover the BlueSMiRF and pair from the "Bluetooth Settings" on android. You might have to put the BlueSMiRF module in discoverable mode (and you can set the a pin code for it).
Once paired, to be able to send and receive data you need to connect using a Bluetooth socket. To communicate with the BlueSMiRF module you need to use the Serial Port Profile (SPP) and create and RFCOMM socket. For an example you can have a look at this post.

Is it possible to transfer data directly between two android devices to other users in the same network?

Let's say I have two android mobile devices, connected to the same wireless network, and that network hasnt external/internet access.
Without third party software, is it possible to transfer data through wifi without knowing the ip from each other and without creating an hotspot? Something like we do on Windows (if 2 pcs are on same network, they can share information directly without internet access)
Starting with the basics, I would like to develop an application, where android phones on same network appears on a list , and then a user choose on of them and writes something - and if the other user have the same app running, appears that on his phone (and then he can reply of course - basically, a chat.
I know this make no practical sense, but believe makes all the sense for what I need to do (it's not a chat of course). If anyone knows anything, please help me - i found nothing.
Thanks in advance.
If you want to send data or messages from one phone to another using the network you will eventually need the IP address of the recipient phone. However, If you don't care about targeting specific phones you could always send UDP broadcast packets that each device on the network should receive.
If you don't want to manually specify an IP you'll need to create a discovery protocol that a phone uses to discover all the other phones on the network. You could do this buy scanning all available IP addresses and checking to see if they are a valid android phone. Or you could have each phone broadcast its presence on the network using a UDP broadcast packet sent to a predefined port.
Once you have discovered all the phones on the network its really up to you to decide how you want to send the data between phones and there are hundreds of examples of how to send data between devices/computers/processes using sockets.

Is it possible to write to a serial port without device connected to it?

I have installed java rxtx library to communicate to the serial port. I have connected EFTPOS terminal to the serial port now. I want to check if my writing is happening onto the port. Even if i use the test program given by the rxtx i couldn get it right. Is it possible to write to the serial port without connecting any devices to the port ? And how can i watch the packets written on the serial port ? Please help me to solve this isssue!!
It depends on your software as to whether it will transmit without anything being connected to the serial port.
Some software will check if a signal line (DTR? I can't remember which one) is being driven high, other software will transmit in a dumb fashion and it will not matter if anything is connected, but there may be a protocol that does error checking to ensure that what is being received is the same as that sent. Basic transmission integrity checking can also be carried out by the receiver echoing back the transmitted character.
It is possible to buy intelligent breakout boxes for serial ports, they will display whatever is sent out. The alternative is to use a null modem cable and connect up a PC running a terminal program. Both methods will display characters, any 'packets' sent out are likely to be a proprietory protocol as mentioned above.

Categories

Resources