Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
sub PrintQRCodeForUrl(var qrCodeData : A500)
// This code all comes from the "Oracle System Interface Module (SIM) Manual" pdf named "SIM_Manual_E64254_01.pdf" with the comments added by me for posterity
// Link to manual: [URL unfurl="true"]https://docs.oracle.com/cd/E68915_01/docs/SIM_Manual_E64254_01.pdf[/URL]
var qrCodeDataLen : N3
var rawDataLen : N3
qrCodeDataLen = len(qrCodeData) + 3 // The +3 is unknown (maybe it's for "ABC"?)--this is what's in the docs from oracle.
rawDataLen = len(qrCodeData) + 48 // 48 is the number of 'chr' characters being sent to the printer, so the entire 'raw' length is the length of the QR code plus said 48 characters of commands.
// FORMATRAW allows the SIM to send raw / unaltered data to the printer.
// The "ABC" piece is the argument that will be looked for and replaced with the un-altered/raw data from all the following parameters
// 200 is the max length of the data to be sent to the printer. 200 might be optimistic but I don't know if that includes the qrCode URL itself as part of the length
FORMATRAW "ABC", 200, chr(127), rawDataLen, ";", \ // 127 deletes the last character from the buffer. Not sure what the 200 or semi-colon is. (TODO)
chr(13), chr(10), \ // 13 starts a new line ('CR'), and 10 is a line feed ('new line')
chr(27), chr(97), chr(1), \ // This ensures the text is centered
chr(29), chr(40), chr(107), chr(4), chr(0), chr(49), chr(65), chr(50), chr(0), \ // This sends "Function 165" to the printer: "QR Code: Select the model"
chr(29), chr(40), chr(107), chr(3), chr(0), chr(49), chr(67), chr(5), \ // This sends "Function 167" to the printer: "QR Code: Set the size of the module"
chr(29), chr(40), chr(107), chr(3), chr(0), chr(49), chr(69), chr(48), \ // This sends "Function 169" to the printer: "QR Code: Select the error correction level"
chr(29), chr(40), chr(107), chr(qrCodeDataLen), chr(0), chr(49), chr(80), chr(48), qrCodeData, \ // This sends "Function 180" to the printer: "QR Code: Store the data in the symbol storage area". The QR code is then sent, and the printer will format the QR code into the "image" on its own. Part of the parameter list is the length of the string itself (a url in this case).
chr(29), chr(40), chr(107), chr(3), chr(0), chr(49), chr(81), chr(48), \ // This sends "Function 181" to the printer: "QR Code: Print the symbol data in the symbol storage area"
chr(27), chr(64) // This clears all codes but not the buffer of the printer
@trailer[1]= ""
@trailer[2]= "Some header that might be enticing"
@trailer[3]= ""
@trailer[4]= "@@ABC@@"
@trailer[5]= ""
@trailer[6]= ""
endsub