ALMeterScanPlugin Class Reference

Inherits from ALAbstractScanPlugin : NSObject
Declared in ALMeterScanPlugin.h

Overview

The ALMeterScanPlugin class declares the programmatic interface for an object that manages easy access to Anylines energy meter scanning mode.

Communication with the host application is managed with a delegate that conforms to ALMeterScanPluginDelegate.

ALMeterScanPlugin is able to scan the most common energy meters. The scan mode is set with setScanMode:error.

– initWithPluginID:licenseKey:delegate:error:

Constructor for the MeterScanPlugin

- (instancetype _Nullable)initWithPluginID:(NSString *_Nullable)pluginID licenseKey:(NSString *_Nonnull)licenseKey delegate:(id<ALMeterScanPluginDelegate> _Nonnull)delegate error:(NSError *_Nullable *_Nullable)error

Parameters

pluginID

An unique pluginID

licenseKey

The Anyline license key

delegate

The delegate which receives the results

error

The Error object if something fails

Return Value

Boolean indicating the success / failure of the call.

Declared In

ALMeterScanPlugin.h

– init

- (instancetype _Nullable)init

  delegates

@property (nonatomic, strong, readonly) NSHashTable<ALMeterScanPluginDelegate> *delegates

  scanMode

Sets the scan mode. It has to be ALAnalogMeter, ALGasMeter, ALBarcode or ALSerialNumber

@property (nonatomic, assign, readonly) ALScanMode scanMode

Declared In

ALMeterScanPlugin.h

  serialNumberValidationRegex

A validation regex string for the Serial scanMode. Regex has to follow the ECMAScript standard. This parameter will be ignored in the other scanModes. If you want to have no regex this property has to be set to nil.

@property (nonatomic, strong) NSString *serialNumberValidationRegex

Declared In

ALMeterScanPlugin.h

  serialNumberCharWhitelist

A character whitelist for the Serial scanMode. This parameter will be ignored in the other scanModes. If you want to have no regex this property has to be set to nil.

@property (nonatomic, strong) NSString *serialNumberCharWhitelist

Discussion

Warning: There are only numbers and uppercase characters allowed.

Declared In

ALMeterScanPlugin.h

– setScanMode:error:

Sets the scan mode and returns an NSError if something failed.

- (BOOL)setScanMode:(ALScanMode)scanMode error:(NSError *_Nullable *_Nullable)error

Parameters

scanMode

The scan mode to set.

error

The error if something goes wrong. Can be nil.

Return Value

Boolean indicating the success / failure of the call.

Declared In

ALMeterScanPlugin.h

– addDelegate:

- (void)addDelegate:(id<ALMeterScanPluginDelegate> _Nonnull)delegate

– removeDelegate:

- (void)removeDelegate:(id<ALMeterScanPluginDelegate> _Nonnull)delegate

– parseScanModeString:

- (ALScanMode)parseScanModeString:(NSString *_Nonnull)scanMode