I'm trying to write code to connect my Android phone with an XBee-PRO .
Here's my code:
XBee xbee = new XBee();
try {
xbee.open("COM22", 115200);
// ..
Why doesn't it work?
You probably need to use a different name for the serial port, something along the lines of /dev/ttyS##
where ##
is the serial port number. You'll have to open a shell on the Android device and get a listing of ports ( ls /dev/tty*
).
If this is a USB connection, get a listing of ports before and after connecting the XBee so you can identify it's device name (the tty that shows up after connecting the device).
Do you have a terminal emulator on the Android device that you can use for debugging? Maybe ssh in and use minicom?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.