How to Use the Terminal's Bluetooth Printer Service

From wizarPOS
Revision as of 02:53, 17 April 2018 by Zzy (talk | contribs)

Bluetooth printing is a service what terminal, which get a connection with buletooth printer,sending data to the printer through the connection and then the printer data printing the data.And the connection is built by terminal with SPP(Serial Port Profile). The process of the service:

  1. open bluetooth if doesn't open

example below:

     if (!mBluetoothAdapter.isEnabled()) {
           Intent enableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
           startActivityForResult(enableIntent, REQUEST_ENABLE_BT);
           
       }
  1. scan and discovery the bluetooth devices surrounding
  1. select and pair the bluetooth printer
  2. send data that is a series of ESC command
  3. printer print the data