Initializes the specified EAAccesory and protocolString.

Syntax

-(void)setupControllerForAccessory:
  (EAAccessory *)accessory 
  withProtocolString:(NSString *)protocolString;

Parameters

accessory
Specify the accessory.
protocolString
Specifies the OPH-5000i protocol string.

Return value

None

Remarks

  • You can connect to OPH-5000i by executing the setupControllerForAccessory () method of OPHBluetoothService.
  • In this sample, the accessory and protocol string, which are the arguments required to execute the setupControllerForAccessory () method, are acquired and connected.
    Sample
    NSArray *accessoryList = [[NSMutableArray alloc] initWithArray:[EAAccessoryManager sharedAccessoryManager] connectedAccessories]];
    if(accessoryList == nil || accessoryList.count == 0) return NO;       
    EAAccessory *accessory = [accessoryList lastObject];
    OPHBluetoothService *service =  [OPHBluetoothService sharedController];
    NSArray *protocolStrings = [accessory protocolStrings];
    if(protocolStrings == nil || [protocolStrings count]==0) return NO;
    NSString *protocolString = [protocolStrings objectAtIndex:0];
    [service setupControllerForAccessory:accessory withProtocolString:protocolString];
    

Requirements

#import <OPHBluetoothService/OPHBluetoothService.h>

Related matters

Last updated: 2022/05/09