Skip to content

Add built-in printer service integration guide for OEMs#2

Open
rvs-godaddy wants to merge 3 commits intogdcorp-commerce:masterfrom
rvs-godaddy:printer-sample
Open

Add built-in printer service integration guide for OEMs#2
rvs-godaddy wants to merge 3 commits intogdcorp-commerce:masterfrom
rvs-godaddy:printer-sample

Conversation

@rvs-godaddy
Copy link

Summary

This PR introduces a sample built-in printer service and a practical integration guide for OEM partners. It shows how to wire an in-device (built-in) printer to Poynt OS via IPoyntPrinterService, how to convert receipts to printable bitmaps, and how to map OEM printer result codes to the standardized Poynt printer error codes expected by apps.

What’s included

  • New sample service com.sample.printer.BuiltinPrinterService implementing IPoyntPrinterService
    • Supports printing of raw Bitmap
  • Leverages Poynt SDK utilities to render PrintedReceipt (v1) and PrintedReceiptV2 (v2) to printable Bitmap (OEMs can use the provided helpers; no custom renderer required)
    • Example threading model for non-blocking print execution
    • Centralized listener result handling for success and error paths
  • Clear guidance on OEM error mapping to Poynt codes
    • Map OEM-specific statuses (e.g., out of paper, cover open, overheat) to public Poynt printer error codes
    • Use a single function to translate OEM result codes and notify the IPoyntPrinterServiceListener
  • Integration placeholders for OEM SDKs
    • Replace the pseudo-code in printImageBitmap(...) with your printer SDK’s init/print/feed/finish calls
    • Insert your bitmap rendering of PrintedReceipt and PrintedReceiptV2
  • Manifest entry for the printer SPI service intent filter

Files changed

  • app/src/main/java/com/sample/printer/BuiltinPrinterService.java (new/updated): sample implementation and inline guidance
  • app/src/main/AndroidManifest.xml: declares BuiltinPrinterService with co.poynt.os.services.v1.IPoyntPrinterService intent-filter

How OEMs should integrate

  1. Plug in your OEM printer SDK inside printImageBitmap(jobId, bitmap, listener)
    • Initialize printer, print the bitmap, optionally feed paper, and close
    • Capture OEM result code and message
  2. Convert receipts to Bitmap
  • Use Poynt SDK helpers to render PrintedReceipt/PrintedReceiptV2 to a Bitmap (or provide your own renderer if desired)
    • Call printImageBitmap(...) with the rendered bitmap
  1. Map OEM result codes in handlePrintResultWithListener(...)
    • Translate to Poynt-standard codes (e.g., OUT_OF_PAPER → PRINTER_OUT_OF_PAPER)
    • Notify listener for success/failure appropriately
  2. Avoid printing when bitmap == null and provide meaningful failure callbacks

Error mapping guidance

Map your OEM statuses to the public Poynt printer error codes. Example categories:

  • Out of paper
  • Cover open
  • Low battery
  • Success / generic failure

This ensures consistent behavior for POS apps relying on IPoyntPrinterServiceListener.

Backward compatibility

  • Non-breaking: adds a sample implementation and documentation only
  • No changes to public AIDL APIs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant