Blue Bamboo P25 Development Manual

Blue Bamboo P25 Development Manual

Hide thumbs Also See for P25:
Table of Contents

Advertisement

P25 Development Guide
Blue Bamboo
P25 Development Guide
Firmware version: 1.0.58 (or higher)
Document version: V 3.4.1
Document date: 2011-09-22
Products: P25 / P25-M / P25i / P25i-M
www.bluebamboo.com

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the P25 and is the answer not in the manual?

Questions and answers

Summary of Contents for Blue Bamboo P25

  • Page 1 P25 Development Guide Blue Bamboo P25 Development Guide Firmware version: 1.0.58 (or higher) Document version: V 3.4.1 Document date: 2011-09-22 Products: P25 / P25-M / P25i / P25i-M www.bluebamboo.com...
  • Page 2 No part of this publication may be copied, distributed, stored in a retrieval system, translated into any human or computer language, transmitted, in any form or by any means, without the prior written consent of BLUE BAMBOO. All other brand names and trademarks in this guide are the property of Blue Bamboo.
  • Page 3: Table Of Contents

    3.5.2 Print..........................48 3.5.3 MSR Operation ......................54 3.5.4 Set the time to power off ....................55 3.6 P25i/P25i-M Communication Protocol (Applies only to P25 Made for iPhone version)..56 3.6.1 Operation Commands Format ..................56 3.6.1.1 Print command ............................ 56 3.6.1.2 Print Result Command ........................
  • Page 4 P25 Development Guide 4.1 Java for Blackberry......................60 4.2 Java for Motorola......................... 60 4.3 Windows Mobile 5.x and 6.x ....................61 4.4 Windows CE 4.2........................61 4.4.1 Introduction ........................61 4.4.2 Setting up a Serial Port profile (SPP) Connection ............62 4.4.3 Needed Components for this Demonstration ..............
  • Page 5: Introduction

    P25 Development Guide 1 Introduction 1.1 Purpose This document is a guide for the basic application development of the P25 Printer product family. 1.2 Scope This document consists of the communication options and software protocols for communication with the P25.
  • Page 6: Esc Commands

    P25 Development Guide 2 ESC commands Support command list: Customers can click page number directly to view detail command information. Instruction set Description Page LF, CR Print and line feed ESC J Print and feed paper ESC d Print and feed n lines...
  • Page 7: Print Commands

    P25 Development Guide 2.1 Print Commands The P25 printer supports the following commands for printing characters and feeding paper: Command Print and feed line LF, CR Print and feed paper ESC J Print and feed n lines ESC d [Name]...
  • Page 8 P25 Development Guide ESC J [Name] Print and feed paper [Format] ASCII ESC J Decimal [Range] 0 ≤ n ≤ 255 [Description] Print the data in the print buffer and feed paper [n x (vertical or horizontal motion unit)] inches.
  • Page 9 P25 Development Guide GS k d1...dn [Name] Print bar code(one dimension) [Format] ASCII d1 … dn d1 … dn Decimal d1 … dn [Range] 0 ≤ m ≤ 4 , m = 0x49 if m=2 then n=0x0d (ean-13) if m=3 then n=0x08 (ean-8)
  • Page 10: Line Space Commands

    P25 Development Guide 2.2 Line Space Commands The P25 printer supports the following commands for setting line space. These commands can only be used for specifying line space, not actually feeding paper. The line space set through these commands affects the results of LF and ESC d and paper feeding by using FEED.
  • Page 11: Character Commands

    P25 Development Guide 2.3 Character Commands The printer supports the following commands for setting character font and size: Command Select ACP or UTF8 coding ESC K Select an international character set ESC R Select print mode ESC ! Turn underline mode on/off...
  • Page 12 [Format] ASCII Decimal [Range] 0 , 30,65 [Description] Select an international character set n from the following table. n(hex) Character set (ISO/IEC 8859-15)Latin Character (include English, France, Germany, Spain…) Simplified Chinese UTF8(Since P25 Version S1.0.41) [Default] n = 0 www.bluebamboo.com...
  • Page 13 P25 Development Guide ESC ! [Name] Select print mode. [Format] ASCII ESC Decimal [Range] 0 ≤ n ≤ 255 [Description] Select print mode(s) using n as follows. Off/On Value Function Select font char/per line) eg. 1B 21 00 Select font char/per line) eg.
  • Page 14 P25 Development Guide GS ! can also select character size. However, the setting of the last received command is effective. This command should be placed previous than any normal printing characters in a line. [Reference] ESC -, GS ! ESC –...
  • Page 15 P25 Development Guide GS ! [Name] Select character size [Format] ASCII Decimal [Range] 0 ≤ n ≤ 255 [Description] Select the character height using bits 0 to 3, and select the character width using bits 4 to 7, as follows;...
  • Page 16: Keypad Button Commands

    [Note] If keypad buttons are disabled, all buttons in panel are disabled (including POWER button, in other words, user could not press key to power off P25, but user could use command to power off P25). 2.5 Print Position Commands The printer supports the following commands for setting the print position.
  • Page 17 P25 Development Guide ESC $ [Name] Set absolute print position [Format] ASCII ESC $ nL nH 24 nL nH Decimal 27 36 nL nH [Range] 0 ≤ nL ≤ 255, 0 ≤ nH ≤ 255 [Description] Set the distance from the beginning of the line to the position where subsequent characters are to be printed.
  • Page 18 P25 Development Guide [Note] The command is enabled only when processed at the beginning of the line. This command formats the justification in the printing area. This command justifies the space area according to HT, ESC $ or ESC \ [Default] n =...
  • Page 19 P25 Development Guide This command cancels the previous horizontal tab settings. If you set n=8, the print position is moved to column 9 by sending HT. Up to 32 tab positions (k=32) can be set. Data exceeding 32 tab positions is processed as normal data.
  • Page 20: Bit-Image Commands

    P25 Development Guide 2.6 Bit-Image Commands The printer supports the following bit-image command: Command Print bit image vertical mode ESC * Print bit image horizon mode ESC X Print downloaded bit image ESC f m nL nH d1 dk ESC *...
  • Page 21 P25 Development Guide d indicates the bit-image data. Set a corresponding bit to 1 to print a dot or to 0 to not print a dot. If the width of the printing area set by GS L is less than the width required by the data sent with the ESC * command, the following will be performed on the line in question (but the printing cannot exceed the maximum printable area).The width of...
  • Page 22 P25 Development Guide www.bluebamboo.com...
  • Page 23 P25 Development Guide X 1 x y d1…dk ESC X X 4 x y d1…dk Print bit-image horizon mode [Name] [Format] ASCII ESC 1 x y d1...dk 4 x y d1...dk 1B 58 31 x y d1…dk 1B 58 34 x y d1…dk Decimal 27 88 49 x y d1…dk...
  • Page 24: Miscellaneous Function Commands

    Print a downloaded bit image2 when n = 1 or n = 49. [Reference] ESC L, ESC FF 2.7 Miscellaneous Function Commands The P25 printer supports the following miscellaneous function commands: Command Set horizontal and vertical motion units GS P...
  • Page 25: Control Device Commands

    Set enter power off mode time, unit is minute, after P25 enter sleep mode(ref above cmd), if no operation occurs, P25 will auto power off after this time, set to 0xFF means disable this feature( never auto power off), default setting is 15 minutes.
  • Page 26 This command only support those P25 equipt with new version BlueTooth module, set result save to flash, customer could display it by self test printing. If P25 equipt with old BT module, self print would display “Inctrl BT”, its act like “One Connect”...
  • Page 27: Esc/Gs Commands With Respond Info

    The default Baud rate in the bootloader firmware is 115200, and it can not be changed. These commands are only used to adjust the Baud rate in the application of the P25. Furthermore, the change will be affect only after you restart the printer.
  • Page 28: Enter/Quit Bridge Mode Commands

    (serial port) and Bluetooth port which connects with other device. Power on the P25 printer, it is in the normal mode by default. You can send the printer the commands of ENTER_BRIDGE_MODE to enter bridge mode, and send the commands of QUIT_BRIDGE_MODE to quit bridge mode.
  • Page 29: Realtime Commands

    P25 Development Guide 2.11 Realtime Commands OVERVIEW Character Data and Normal Commands The printer stores data sent from the host computer in the receive buffer temporarily, and then the printer interprets the data and classifies them into commands or character data sequentially. If the data from the receive buffer is a normal command, the printer processes the command corresponding to its function;...
  • Page 30 P25 Development Guide The transmitted battery status from this printer is constructed by [Header ~ NUL] as shown in the following table. Transmitted data Decimal Amount of data Header 1 byte Identifier 1 byte Power source (*1) 1 byte Battery remaining amount (*2)
  • Page 31: Introduction Of Communication Protocol

    “Hyper terminal” in Windows to the P25, and type something to make the printer print. If using the plain text protocol to print text, no data will be sent from the P25, so the user will have to wait until the P25 finishes printing, and the waiting time depends on the contents that are printed.
  • Page 32: Process Of Getting The Printer Status

    P25 Development Guide The items marked ‘X’ must be present during the entire communication process. The items marked ‘O’ must be present during certain parts of the process. During transmission, if C0H, C1H, and/or 7DH are shown in the DATA field, 7DH should be inserted before the data and the data should be XORed with 20H and sent.
  • Page 33: Printing Or Downloading Data

    P25 Development Guide 3.4 Printing or Downloading Data Figure 2: Process of printing data Figure 3: Process of software update Note: The “Sending ENQ frame” is optional, it just let app know whether print is working normally, customer could print data without sending this frame (that is only sending data frame).
  • Page 34: Format Of Printing Or Downloading Data Frame

    Data Length: “0001” ~ “3000”. Each number must be an ASCII code, the highest byte of Data Length should be transmitted first, P25 does not support printing more than 3000 characters per frame. Checksum: 2 bytes. The first byte is the result of XORing the even parts of data in the Print Data field and the second byte is from doing the same to the odd numbers.
  • Page 35: Format Of Download Frame

    P25 Development Guide Please see Figure 4. Figure 4: DATA Field Description Each byte in the DATA field should be in HEX code; the highest byte should be transmitted first in the same way DATA Length is transmitted. 3.4.3 Format of Download Frame ‘F’(0x46)
  • Page 36: Msr Response Frame Format

    P25 Development Guide 3.4.6 MSR Response Frame Format DATA in clear text ‘H’(0x48) DATA ID DATA CHECK (SOF) (TOF) Number Length DATA (EOF) The ‘DATA’ field contains the three tracks of MSR data, the format of each track is: Track No...
  • Page 37 Specify the data encryption protocol version. It should be 0x02 Key ID (RFU) Specify which key is used to encrypt data. P25 supports only one key right now. Its value should be 0x00. Alg ID Specify the type of data encryption and key management...
  • Page 38: Ack Frame Format

    ‘F’ (0x46) 3.4.11 Format of Set DUKPT KSN and initial key (Request) If customer need encrypt MSR data with DUKPT algorism, they need first set DUKPT KSN and initial key to P25. (0x9B) DATA ID DATA...
  • Page 39: Format Of Set Dukpt Ksn And Initial Key (Response)

    00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E IKEY 58 CC frame end 3.4.12 Format of Set DUKPT KSN and initial key (Response) This Data is respond from P25 to program like Device Manager. (0x9C) DATA ID DATA Versio...
  • Page 40: P25 Mk (Master Key)/Sk (Session Key) Encrypt

    P25 Development Guide 3.4.13 P25 MK (Master key)/SK (Session Key) Encrypt The purpose to set MK and SK is to ensure the printing commands in P25 safer than before. The user can set MK/SK according to their request. 1. Encrypt Algorism...
  • Page 41 P25 Development Guide REQUEST: Eg Data Content Length Explain start of frame CMD_SET_MASTER_KEY_DOWN_REQ data id 30 30 35 31 data len Version Algor, ENCRYPT_ALG_3DES key id 12 34..34 56 master key 08 E1 frame end RESPONSE: Eg Data Content Length...
  • Page 42: Irp_Mj_Write

    Main procedures of syncing session key is shown as the below diagram. The customer can encrypt the card information by setting session key which length is 24 bytes in P25 printer. Session key only in ram, if customer begin new session, better renew it, Sync session key: Use command "./P25EncryptApp sync_session_key_down"...
  • Page 43 P25 Development Guide REQUEST: Eg Data Length Explain Content start of frame CT_ENCRYPT_WITH_MASTER data id 30 30 33 data len Version key id Algor, ENCRYPT_ALG_3DES ENCRYPTED_WITH_MASTER_KEY(CMD_SET_SESSION_KEY,SE SSION_KEY,CRC,PADDING) after decrypt, it would be: 87...B6 Eg data content Length Explain CMD_SYNC_SESSION_KEY_DOWN_ ??...??
  • Page 44 4. Print encrypted information by session key The following operation is a combined operation. Sync session key for the encrypted information first then print it out through P25 printer. This paragraph only explains the format of printing encrypted information. Sync session key and print string "abc"...
  • Page 45 Length: 0003, Data: C0 05 C1 [00000023] IRP_MJ_READ Length: 0006, Data: 00 C0 06 C1 0D 0A Just confirm P25 works OK, or following send msr command may timeout for long time, it would confuse user, but this command is option www.bluebamboo.com...
  • Page 46 P25 Development Guide [00000024] IRP_MJ_WRITE Length: 0021 Data: C0 81 37 30 30 31 31 01 01 01 11 9D F1 BA 87 39 15 CA D4 73 C1 Request to read MSR data Eg Data Length Explain Content start of frame...
  • Page 47: Some Example Of Communication Command

    P25 Development Guide Eg Data Length Explain Content start of frame CT_ENCRYPT_WITH_SESSION data id 30 31 32 data len Version key id Algor, ENCRYPT_ALG_3DES FD 78...E7 Multipl ENCRYPTED_WITH_MASTER_KEY(CMD_MSR_RESPONSE,msr_i nfo,CRC,PADDING)after decrypt, it would be: e of 8 other content, means error occure.
  • Page 48: Query Status

    Note: Step 1. Query P25 Status Step 2. P25 report no error, The 00 Byte indicates no error Step 4. P25 report no paper, The 01 Byte indicates no paper or cover open Error Indicate Byte Meaning: 00 ----------- No error 01 ----------- No paper or cover open 04 ----------- Printer header’s temperature too high...
  • Page 49 P25 Development Guide b) print 2D barcode Barcode content: Hello, world! A PDF417 example. Frame content: c0 44 33 30 30 34 30 1d 6b 10 00 00 00 00 00 1f 48 65 6c 6c 6f 2c 20 77...
  • Page 50 P25 Development Guide c2) double small font size: Frame Content: c0 44 34 30 30 33 33 1b 4b 31 1b 21 19 1b 2d 00 1d 42 00 57 65 6c 63 6f 6d 65 20 74 6f 20 62 6c...
  • Page 51 P25 Development Guide c4) double big font size: Frame Content: c0 44 36 30 30 33 33 1b 4b 31 1b 21 18 1b 2d 00 1d 42 00 57 65 6c 63 6f 6d 65 20 74 6f 20 62 6c...
  • Page 52 P25 Development Guide Description: C0: start tag 44: print command 39: frame sequence 30 30 34 31: 41 bytes data 1b 4b 31: UTF-8 1b 21 19: double width double height based on small font size 1b 52 30: Chinese language ef..0a: text data...
  • Page 53 P25 Development Guide e) Print Image print Image Data: width* height: 30 * 30 pixels Frame content: c0 44 32 30 31 32 35 1b 58 31 04 1e 00 00 00 00 00 00 00 00 1f ff ff e0...
  • Page 54: Msr Operation

    Length: 0006, Data: 00 C0 04 C1 0D 0A [00027589] IRP_MJ_READ Length: 0006, Data: 00 C0 15 C1 0D 0A Note: 1. MSR request, set Timeout to 20 second 2. P25 immediatly back EOT 3. After 20 seconds, no card swipt, P25 back error [00046059] IRP_MJ_WRITE...
  • Page 55: Set The Time To Power Off

    Set enter power off mode time, unit is minute, after P25 enter sleep mode(ref [Description] above cmd), if no operation occurs, P25 will auto power off after this time, set to 0xFF means disable this feature( never auto power off), default setting is 15 minutes.
  • Page 56: Data

    P25 Development Guide 3.6 P25i/P25i-M Communication Protocol (Applies only to P25 Made for iPhone version) P25i/P25i-M is a special Printer that can working with iPhone/iPod Touch through serial cable. It has two operations, Print receipt and read MSR read protocolString "com.bluebamboo.p25i", protocolIndex 1 Default bundleSeedIDString is "YT79N447RD", in fact, we would custom it to our customer's App...
  • Page 57: Msr Read Command

    P25i/P25i-M need(s) to wait when MSR Read is processing. 3.6.1.4 MSR Result Command Direction: P25i/P25i-M printer(s)--to-->iPhone If MSR read has been already processed, P25 will send a print response message to iPhone with process result. For example:...
  • Page 58: Length: 0010

    [00000013] IRP_MJ_WRITE Length: 0018 Data: FF 55 0E 00 43 00 02 00 00 55 66 77 88 44 30 31 32 1C DevACK: means P25 accept last command [00000023] IRP_MJ_READ Length: 0010 Data: FF 55 06 00 41 00 02 00 43 74...
  • Page 59 P25 Development Guide ACK: [00000287] IRP_MJ_WRITE Length: 0010 Data: FF 55 06 00 02 00 02 00 42 B4 CloseDataSession: [00000300] IRP_MJ_WRITE Length: 0010 Data: FF 55 06 00 40 00 03 00 00 B7 DevACK: [00000310] IRP_MJ_READ Length: 0010 Data: FF 55 06 00 41 00 03 00 40 76 www.bluebamboo.com...
  • Page 60: P25 Reference Code

    Developers can copy and modify this code to accelerate their development. Please see the Software license agreement at the end of this text which applies to all Blue Bamboo software products. When using this software, you are agreeing to the Software license agreement.
  • Page 61: Windows Mobile 5.X And 6.X

    4.4.1 Introduction This’code has been extended from Blue Bamboo's Developer Network as a reference for customer use. Blue Bamboo is not the author of this code and takes no liability in warranting/supporting it. Please review the Blue Bamboo Software License Agreement packaged with this source code.
  • Page 62: Setting Up A Serial Port Profile (Spp) Connection

    4.4.3 Needed Components for this Demonstration The following is a list of the needed components to duplicate this demonstration: • Host Device Running P25 with Bluetooth module supporting SPP profile • Reference Code (virtual COM port mapping of SPP profile) •...
  • Page 63: Software License Agreement

    (the P25 Reference Code). In consideration for BLUE BAMBOO allowing you to access the P25 Reference Code, you are agreeing to be bound by the terms of this Agreement. IF YOU DO NOT AGREE TO ALL OF THE TERMS OF THIS AGREEMENT, DO NOT INSTALL THE P25 Reference Code.
  • Page 64: U.s. Government Disclosure

    BLUE BAMBOO shall be under no obligation to assist Licensee to use, execute, perform or copy the P25 Reference Code, or to provide support to Licensee of the P25 Reference Code, or to provide maintenance, correction, modification, enhancement, or upgrades to the P25 Reference Code.
  • Page 65: Damage Limitation

    BLUE BAMBOO P25 Reference Code. 4.5.12 Intellectual Property Ownership BLUE BAMBOO shall retain title to and ownership of all proprietary rights with respect to the P25 Reference Code and copies thereof. LICENSEE shall retain title to and ownership of all...
  • Page 66: Revision History

    Revision 1.1 (February 18, 2008) Add Print Commands in Section 2.1 Add Communication protocol in Section 3. Revision 1.2 (June 16, 2008) Add P25 Reference Code and the Software License Agreement. Revision 1.3 (August, 2008) Add commands of P25. Revision 1.4 (September, 2008) Add data encryption in Section 3.4.6...

This manual is also suitable for:

P25iP25-mP25i-m

Table of Contents