Link to home
Start Free TrialLog in
Avatar of sasllc
sasllcFlag for United States of America

asked on

Sending files to bluetooth device using vb.net

We write software for the Symbol/Motorola 9090 scanner, using vb.net 2005, Windows CE, Framework 2.0.  One feature that works well is an interface to a weight scale with a serial interface, where we can send and receive data through the scanner's COM1 port on the bottom, using the snap-on cable.  And, we can send lines of print to a dot matrix printer, going out that same COM1 port, and converting the serial data to the parallel port on the printer.  We use Franson serial tools to manage the coding for the serial port, which I think it just an easy-to-use version of the serial commands built into vb.net 2005.

But now a customer wants to be able to send print lines from the scanner to a Zebra bluetooth printer--which raises questions, since we've never done this before:

1) Will I simply pair the scanner to the printer, much like pairing a cell phone to a bluetooth-equipped car?

2) The documentation for the scanner says I can pick from COM4, COM5, or COM9 for my "virtual serial port".  Since they are referred to as COM ports, does this mean that I should be able to use the Fransion serial tools code that I now use for a normal COM1 port, simply setting the right COM port and baud rate, etc.?  Or, is it somehow more complicated sending data to a bluetooth printer through a "virtual COM port"...and if so, in what way?

3) Will I need to define which of these virtual COM ports I want to use on the printer itself?  Or, will it be sufficient to simply pair with it, and then I can expect the data to flow from scanner to printer, regardless of which virtual COM port I choose on the scanner?

4) Maybe I just need some general guidelines on how to send data to a bluetooth device from a vb.net program???

TIA
SOLUTION
Avatar of Dirk Haest
Dirk Haest
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sasllc

ASKER

After much experimentation, I finally got this working on a Symbol/Motorola 9090 running Win CE and a Zebra P4T mobile printer.  A few things I learned:

The Symbol 9090 does not appear to make a distinction between input and output COM ports.  I picked the lowest one on their list--COM4--and used it, and I unchecked the other two, which was probably not necessary.

I paired the scanner to the printer using the bluetooth utilities built into the scanner, so that I did not need to worry with putting software in my app to do discovery, etc.

I was indeed able to output data to COM4 using the same Franson commands that I normally use to output serial data over COM1.  Apparently it does not care about the settings for baud rate and parity, etc. because it's running in bluetooth mode.

For the longest time I could not get any output from the printer, making me think that I was doing something wrong in my app.  This was especially true since I WAS able to get text output when the printer was connected to my PC via USB--such as "this is a test" sent from Notepad.  But the problem ended being a setting in the printer, which can be adjusted using Zebra's free Label Vista software.  In Label Vista, I found a setup screen at Priner> Printer Settings that allowed me to define the Printer Language to "Line Print", which then accepted plain text and printed just fine.  Once I realized that I did have a connection after all, I was then able to go back and change that setting to ZPL and send ZPL-formatted text to create bar codes as usual.
ah, you're right, Zebra printers have Label and Journal modes

and I've misread that this is WinCE, not WinMo, so Bluetooth config and ports are slightly different :), just as you have described. BT Virtual com port doesn't care much about parity and other settings because internally it uses BT serial profile and opens ACM port (as far as I remember it)