AS-289R2 Thermal Printer shield control library

Dependents:   AS-289R2_Hello-World AS-289R2_Hello-World-mbed-OS hybrid_image_as289r2 microbit_AS-289R2 ... more

Files at this revision

API Documentation at this revision

Comitter:
MACRUM
Date:
Mon Sep 19 13:46:03 2016 +0000
Parent:
1:ee311b8f969b
Child:
3:f3dfeb7ccb22
Commit message:
Fix parameter type

Changed in this revision

AS289R2.cpp Show annotated file Show diff for this revision Revisions of this file
AS289R2.h Show annotated file Show diff for this revision Revisions of this file
--- a/AS289R2.cpp	Sun Sep 04 03:09:27 2016 +0000
+++ b/AS289R2.cpp	Mon Sep 19 13:46:03 2016 +0000
@@ -107,7 +107,7 @@
     _serial.putc(font);
 }
 
-void AS289R2::printQRCode(uint32_t err, char* param)
+void AS289R2::printQRCode(uint32_t err, const char* param)
 {
     uint32_t len = strlen(param);
     char buf[4] = {0x1D, 0x78};
@@ -121,7 +121,7 @@
     }
 }
 
-void AS289R2::printBarCode(uint32_t code, char* param)
+void AS289R2::printBarCode(uint32_t code, const char* param)
 {
     char buf[3] = {0x1D, 0x6B};
     buf[2] = code;
@@ -134,7 +134,7 @@
     _serial.putc('\0');
 }
 
-void AS289R2::printBitmapImage(uint32_t mode, uint16_t lines, char * image)
+void AS289R2::printBitmapImage(uint32_t mode, uint16_t lines, const char * image)
 {
     char buf[3] = {0x1C, 0x2A};
     buf[2] = mode;
--- a/AS289R2.h	Sun Sep 04 03:09:27 2016 +0000
+++ b/AS289R2.h	Mon Sep 19 13:46:03 2016 +0000
@@ -162,14 +162,14 @@
      * @param err QR code error correction level e.g. AS289R2::QR_ERR_LVL_M
      * @param buf Data to be printed
      */
-    void printQRCode(uint32_t err, char* buf);
+    void printQRCode(uint32_t err, const char* buf);
 
     /** Print Bar code
      *
      * @param code Type of Bar code e.g. AS289R2::JAN13
      * @param buf Data to be printed
      */
-    void printBarCode(uint32_t code, char* param);
+    void printBarCode(uint32_t code, const char* param);
 
     /** Print bitmap image
      *
@@ -177,7 +177,7 @@
      * @param lines Number of print line
      * @param image Data to be printed
      */
-    void printBitmapImage(uint32_t cmd, uint16_t lines, char * image);
+    void printBitmapImage(uint32_t cmd, uint16_t lines, const char * image);
 
 private:
     Serial *_serial_p;