5.2. SMCSAllReceipts

Provides the function of AllReceipts service

Supported Method for each models.

Model/Emulation

mC-Print2 mC-Print3 mPOP FVP10 TSP100IIIW TSP100IIIBITSP100LAN TSP650II TSP650IISK TSP700II TSP800IISM-S210i SM-S220i SM-S230i SM-T300i/T300 SM-T400i BSC10 SM-L200 SM-L300 SP700
StarPRNT StarPRNT StarPRNT StarLine StarGraphic StarGraphic StarGraphic StarLine StarLine StarLine StarLine StarPRNT EscPosMobile StarPRNT EscPosMobile StarPRNT EscPosMobile StarPRNT EscPosMobile StarPRNT EscPosMobile EscPos StarPRNT StarPRNT StarDotImpact

UploadBitmapAsync

- - - - - -

UploadDataAsync

- - - - - -

UpdateStatusAsync

- - - - - -

GenerateAllReceiptsAsync

- - - - - -

5.2.1. UploadBitmapAsync

Uploads bitmap to the Star Micronics Service.

  • Declaration

    public static IAsyncOperation<IBuffer> UploadBitmapAsync(Windows.Graphics.Imaging.BitmapDecoder decoder)
    
  • Parameter

    Name Contents Type
    bitmap Bitmap to upload Windows.Graphics.Imaging.BitmapDecoder
  • Return value

    Contents Type
    Uploaded URL IBuffer
  • Examples

    public async static Task<IBuffer> CreateRasterReceiptData(Emulation emulation, bool receipt, bool info, bool qrCode)
    {
        var image = await GetPrintImageAsync("RasterReceiptImage.png");
        IBuffer urlbuffer = await SMCSAllReceipts.UploadBitmapAsync(image);
    
        ICommandBuilder builder = StarIO_Extension.StarIoExt.CreateCommandBuilder(emulation); builder.BeginDocument();
    
        await builder.AppendBitmapAsync(image, false);
    
        IBuffer buffer = await SMCSAllReceipts.GenerateAllReceiptsAsync(urlbuffer, emulation, info, qrCode); builder.AppendRawData(buffer);
    
        builder.AppendCutPaper(CutPaperAction.FullCutWithFeed);
    
        builder.EndDocument();
    
        return builder.GetCommands();
    }
    

    Refer to AllReceiptsFunctions.cs

5.2.2. UploadDataAsync

Uploads data to the Star Micronics Service.

  • Declaration

    public static IAsyncOperation<IBuffer> UploadDataAsync(byte[] data, StarIO_Extension.Emulation emulation, CharacterCode characterCode, uint width)
    
  • Parameter

    Name Contents Type
    data Data to upload byte[]
    emulation Emulation type Emulation
    characterCode Character code type constants CharacterCode
    width Printable width (Units : Dots) int

    Constant of Emulation for each model, refer to Emulation Constants.

  • Return value

    Contents Type
    Uploaded URL IBuffer
  • Examples

    public async static Task<IBuffer> CreateTextReceiptData(Emulation emulation, ILocalizeReceipts localizeReceipts, uint width, bool utf8, bool receipt, bool info, bool qrCode)
    {
        ICommandBuilder builder = StarIoExt.CreateCommandBuilder(emulation);
    
        builder.BeginDocument();
    
        localizeReceipts.AppendTextReceiptData(builder, utf8);
    
        builder.EndDocument();
    
        IBuffer temp = builder.GetCommands();
        byte[] receiptsData = temp.ToArray();
    
        IBuffer url = await SMCSAllReceipts.UploadDataAsync(receiptsData, emulation, localizeReceipts.CharacterCode, width);
    
        printDataBuilder.BeginDocument();
    
        localizeReceipts.AppendTextReceiptData(printDataBuilder, utf8);
    
        IBuffer allReceiptsData = await SMCSAllReceipts.GenerateAllReceiptsAsync(url, emulation, info, qrCode);
    
        printDataBuilder.AppendRawData(allReceiptsData);
    
        printDataBuilder.AppendCutPaper(CutPaperAction.PartialCutWithFeed);
    
        printDataBuilder.EndDocument();
    
        return builder.GetCommands();
    }
    

    Refer to AllReceiptsFunctions.cs

5.2.3. UpdateStatusAsync

Updates the device status information on the Star Micronics Cloud.

  • Declaration

    public async static void UpdateStatusAsync(string status)
    
  • Parameter

    Name Contents Type
    status
    Updated status

    Hexdecimal 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.
    string
  • Return value

    None

  • Examples

    async void starIoExtManager_StatusUpdatedEvent(object sender, object e)
    {
        // Hexadecimal digit sequence of 3rd to 6th bytes in Automatic Status of string type (*) is stored in the second parameter (e).
        // Type cast as string type and get status information.
        await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
        {
            string status = e as string;
            SMCloudServices.SMCSAllReceipts.UpdateStatusAsync(status);
        }
    }
    

    Refer to AllReceiptsExtSamplePage.xaml.cs.

5.2.4. GenerateAllReceiptsAsync

Generates the print data for the AllReceiptsTMuse.

  • Declaration

    public static IAsyncOperation<IBuffer> GenerateAllReceiptsAsync(IBuffer url, Emulation emulation, bool info, bool qrCode)
    public static IAsyncOperation<IBuffer> GenerateAllReceiptsAsync(IBuffer url, Emulation emulation, bool info, bool qrCode, int width)
    
  • Parameter

    Name Contents Type
    url Uploaded URL IBuffer
    emulation Emulation type Emulation
    info
    Generates information logo
    true … Valid
    false … Invlid
    bool
    qrCode
    Generates QR code.
    true … Valid
    false … Invlid
    bool
    width Printable width (Units : Dots) int

    Constant of Emulation for each model, refer to Emulation Constants.

  • Return value

    Contents Type
    Generated print data IBuffer
  • Examples

    public async static Task<IBuffer> CreateRasterReceiptData(Emulation emulation, bool receipt, bool info, bool qrCode)
    {
        var image = await GetPrintImageAsync("RasterReceiptImage.png");
        IBuffer urlbuffer = await SMCSAllReceipts.UploadBitmapAsync(image);
    
        ICommandBuilder builder = StarIO_Extension.StarIoExt.CreateCommandBuilder(emulation);
    
        builder.BeginDocument();
    
        await builder.AppendBitmapAsync(image, false);
    
        IBuffer buffer = await SMCSAllReceipts.GenerateAllReceiptsAsync(urlbuffer, emulation, info, qrCode, width);
    
        builder.AppendRawData(buffer);
    
        builder.AppendCutPaper(CutPaperAction.FullCutWithFeed);
    
        builder.EndDocument();
    
        return builder.GetCommands();
    }
    

    Refer to AllReceiptsFunctions.cs

5.2.5. UploadedBitmapResultEvent

Occurs when UploadBitmapAsync method is completed.

  • Syntax

    public static event EventHandler<RequestResult> UploadedBitmapResultEvent
    
  • Examples

    protected override async void OnNavigatedTo(NavigationEventArgs e)
    {
        SMCloudServices.SMCSAllReceipts.UploadedBitmapResultEvent += SMCSAllReceipts_UploadedBitmapResultEvent;
    }
    
    static void SMCSAllReceipts_UploadedBitmapResultEvent(object sender, RequestResult e)
    {
        // The updating result of RequestResult type is in the second parameter.
    
        string message = null;
        if (e.ErrorMessage != "")
        {
            message = e.ErrorMessage;
        }
        else {
            message = "Status Code : " + e.StatusCode.ToString();
        }
    }
    

    Refer to AllReceiptsFunctions.cs

5.2.6. UploadDataResultEvent

Occurs when UploadDataAsync method is completed.

  • Syntax

    public static event EventHandler<RequestResult> UploadDataResultEvent
    
  • Examples

    protected override async void OnNavigatedTo(NavigationEventArgs e)
    {
        SMCloudServices.SMCSAllReceipts.UpdatedStatusResultEvent += SMCSAllReceipts_UpdatedStatusResultEvent;
        SMCloudServices.SMCSAllReceipts.UploadDataResultEvent += SMCSAllReceipts_UploadDataResultEvent;
    }
    
    static void SMCSAllReceipts_UploadDataResultEvent (object sender, RequestResult e)
    {
        // The updating result of RequestResult type is in the second parameter.
    
        string message = null;
        if (e.ErrorMessage != "")
        {
            message = e.ErrorMessage;
        }
        else {
            message = "Status Code : " + e.StatusCode.ToString();
        }
    }
    

    Refer to AllReceiptSamplePage.xaml.cs.

5.2.7. UpdatedStatusResultEvent

Occurs when UpdateStatusAsync method is completed.

  • Syntax

    public static event EventHandler<RequestResult> UpdatedStatusResultEvent
    
  • Examples

    protected override async void OnNavigatedTo(NavigationEventArgs e)
    {
        SMCloudServices.SMCSAllReceipts.UpdatedStatusResultEvent += SMCSAllReceipts_UpdatedStatusResultEvent;
    }
    
    static void SMCSAllReceipts_UpdatedStatusResultEvent(object sender, RequestResult e)
    {
        // The updating result of RequestResult type is in the second parameter.
    
        string message = null;
        if (e.ErrorMessage != "")
        {
            message = e.ErrorMessage;
        }
        else
        {
            message = "Status Code : " + e.StatusCode.ToString(); }
        }
    }
    

    Refer to AllReceiptsFunctions.cs

5.3. RequestResult

Request result notification class

  • Declaration

    public class RequestResult : EventArgs
    
  • Property

    Name Contents
    StatusCode HTTP status code
    ErrorMessage Error information when fails to upload data

5.3.1. StatusCode

HTTP status code

  • Syntax

    public int StatusCode { get; }
    

5.3.2. ErrorMessage

Error information when fails to upload data

  • Syntax

    public string ErrorMessage { get; }