4.7. ISCPConnectParser

added in version 1.7.0

An interface to provide functions to generate commands to get the connection/disconnection status of the peripheral.

This interface is only for models which support the peripheral. For the supporting models, refer to Supported Peripherals .

  • Member

    Name

    Contents

    connect

    Gets the connection/disconnection status of the peripheral.

4.7.1. connect

added in version 1.7.0

Gets the connection/disconnection status of the peripheral.

Executes after the completionHandler returns StarIoExtParserCompletionResultSuccess .

  • Declaration

    - (BOOL)connect;
    
  • Parameter

    None

  • Return value

    Contents

    Type

    The connection/disconnection status of the peripheral.

    BOOL

  • Examples

    ISCPConnectParser *parser = [StarIoExt createDisplayConnectParser:StarIoExtDisplayModelSCD222];
    
    [Communication parseDoNotCheckCondition:parser port:port completionHandler:^(BOOL result, NSString *title, NSString *message) {
        if (result == YES) {
        if (parser.connect == YES) {
            UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Check Status" message:@"Display Connect." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
            [alertView show];
        }
        else {
            UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Check Status" message:@"Display Disconnect." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
            [alertView show];
        }
        }
        else {
        // UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Failure" message:@"Display Impossible." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
        UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Failure" message:@"Printer Impossible." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
        [alertView show];
        }
    }];
    

    Refer to DisplayViewController.m / DisplayExtViewController.m / MelodySpeakerViewController.m.