5.2. SMCSAllReceipts¶
Provides the function of AllReceipts service
Method
Name
Contents
Uploads bitmap to the Star Micronics Service.
Uploads data to the Star Micronics Service.
Updates the device status information on the Star Micronics Cloud.
Generates the print data for the AllReceiptsTMuse.
Supported Method for each models.
Model/Emulation |
mC-Print2 | mC-Print3 | mPOP | FVP10 | TSP100IIIW | TSP100IIIBI | TSP100IIIU | TSP100ECO | TSP100U | TSP100GT | TSP100LAN | TSP650II | TSP650IISK | TSP700II | TSP800II | SM-S210i | SM-S220i | SM-S230i | SM-T300i/T300 | SM-T400i | BSC10 | SM-L200 | SM-L300 | SP700 | |||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
StarPRNT | StarPRNT | StarPRNT | StarLine | StarGraphic | StarGraphic | StarGraphic | StarGraphic | StarGraphic | StarGraphic | StarGraphic | StarLine | StarLine | StarLine | StarLine | StarPRNT | EscPosMobile | StarPRNT | EscPosMobile | StarPRNT | EscPosMobile | StarPRNT | EscPosMobile | StarPRNT | EscPosMobile | EscPos | StarPRNT | StarPRNT | StarDotImpact | |
uploadBitmap |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | - | ✔ | - | ✔ | - | ✔ | - | ✔ | - | ✔ | ✔ | ✔ | - |
uploadData |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | - | ✔ | - | ✔ | - | ✔ | - | ✔ | - | ✔ | ✔ | ✔ | - |
updateStatus |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | - | ✔ | - | ✔ | - | ✔ | - | ✔ | - | ✔ | ✔ | ✔ | - |
generateAllReceipts |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | - | ✔ | - | ✔ | - | ✔ | - | ✔ | - | ✔ | ✔ | ✔ | - |
5.2.1. uploadBitmap¶
Uploads bitmap to the Star Micronics Service.
Declaration
+ (NSString *)uploadBitmap:(UIImage *)image completion:(void (^)(NSInteger statusCode, NSError *error))completion;
Parameter
Name Contents Type image Bitmap to upload UIImage * completion When the upload is completed, check upload result as following status- statusCode - … HTTP status code- error - … Error information when fails to upload datavoid (^)(NSInteger statusCode, NSError *error) Return value
Contents Type Uploaded URL NSString *
Examples
+ (NSData *)createData:(StarIoExtEmulation)emulation image:(UIImage *)image { NSString *urlString = [SMCSAllReceipts uploadBitmap:image completion:nil]; ISCBBuilder *builder = [StarIoExt createCommandBuilder:emulation]; [builder beginDocument]; [builder appendBitmap:image diffusion:NO]; NSData *data = [SMCSAllReceipts generateAllReceipts:urlString emulation:emulation info:YES qrCode:YES]; [builder appendRawData:data]; [builder appendCutPaper:SCBCutPaperActionPartialCutWithFeed]; [builder endDocument]; return [builder.commands copy]; }
Refer to AllReceiptsFunctions.m.
5.2.2. uploadData¶
Uploads data to the Star Micronics Service.
Declaration
+ (NSString *)uploadData:(NSData *)data emulation:(StarIoExtEmulation)emulation characterCode:(StarIoExtCharacterCode)characterCode width:(NSInteger)width completion:(void (^)(NSInteger statusCode, NSError *error))completion;
Parameter
Name Contents Type data Data to upload NSData * emulation Emulation type StarIoExtEmulation characterCode Character code type constants StarIoExtCharacterCode width Printable width (Units : Dots) NSInteger completion When the upload is completed, check upload result as following status- statusCode - … HTTP status code- error - … Error information when fails to upload datavoid (^)(NSInteger statusCode, NSError *error) Constant of Emulation for each model, refer to StarIoExtEmulation Constants.
Return value
Contents Type Uploaded URL NSString *
Examples
+ (NSData *)createData:(StarIoExtEmulation)emulation characterCode:(StarIoExtCharacterCode)characterCode data:(NSData *)data width:(NSInteger)width { ISCBBuilder *builder = [StarIoExt createCommandBuilder:emulation]; [builder beginDocument]; [builder appendData:data]; [builder endDocument]; NSData *receiptData = [builder.commands copy]; NSString *urlString = [SMCSAllReceipts uploadData:receiptData emulation:emulation characterCode:characterCode width:width completion:nil]; builder = [StarIoExt createCommandBuilder:emulation]; [builder beginDocument]; [builder appendData:data]; NSData *allReceiptsData = [SMCSAllReceipts generateAllReceipts:urlString emulation:emulation info:YES qrCode:YES]; [builder appendRawData:allReceiptsData]; [builder appendCutPaper:SCBCutPaperActionPartialCutWithFeed]; [builder endDocument]; return [builder.commands copy]; }
Refer to AllReceiptsFunctions.m.
5.2.3. updateStatus¶
Updates the device status information on the Star Micronics Cloud.
Declaration
+ (void)updateStatus:(NSString *)status completion:(void (^)(NSInteger statusCode, NSError *error))completion;
Parameter
Name Contents Type status Updated statusHexdecimal digit sequence of 3rd to 6th bytes in Automatic Status. (ex. “28000000”)Please refer to STAR Line Mode and StarPRNT command manual for details of Automatic Status.NSString * completion When the update is completed, check update result as following parameter.- statusCode - … HTTP status code- error - … If the request fails, the error parameter contains information about the failure.void (^)(NSInteger statusCode, NSError *error) Return value
None
Examples
- (void)didStatusUpdate:(StarIoExtManager *)manager status:(NSString *)status { [SMCSAllReceipts updateStatus:status completion:^(NSInteger statusCode, NSError *error) { ... }]; }
Refer to AllReceiptsExtViewController.m.
5.2.4. generateAllReceipts¶
Generates the print data for the AllReceiptsTMuse.
Declaration
+ (NSData *)generateAllReceipts:(NSString *)urlString emulation:(StarIoExtEmulation)emulation info:(BOOL)info qrCode:(BOOL)qrCode; + (NSData *)generateAllReceipts:(NSString *)urlString emulation:(StarIoExtEmulation)emulation info:(BOOL)info qrCode:(BOOL)qrCode width:(NSInteger)width;
Parameter
Name Contents Type urlString Uploaded URL NSString * emulation Emulation type StarIoExtEmulation info Generates information logoYES … ValidNO … InvlidBOOL qrCode Generates QR code.YES … ValidNO … InvlidBOOL width Printable width (Units : Dots) NSInteger Constant of Emulation for each model, refer to StarIoExtEmulation Constants.
Return value
Contents Type Generated print data NSData *
Examples