Skip to main content

Aila_GetHardwareSerialNumber

Since 3.0.0Changed in 3.2.0Returns Aila_SerialNumberTimeout instead of an empty string when the serial number can't be read.

Return current hardware serial number.

Signature​

void Aila_GetHardwareSerialNumber(void (^completion)(NSString *serialNumber));

Parameters​

  • completion - Block/closure called with the serial number

Description​

Returns the serial number for the connected Aila hardware via a completion callback. If the call succeeds, the serial number is returned as the serialNumber parameter. If no hardware is connected, or the hardware doesn't respond within 10 seconds, Aila_SerialNumberTimeout is returned instead.

Usage​

Aila_GetHardwareSerialNumber(^(NSString *serialNumber) {
if (![serialNumber isEqualToString:Aila_SerialNumberTimeout]) {
NSLog(@"Serial Number: %@", serialNumber);
} else {
NSLog(@"Failed to retrieve serial number");
}
});

Aila_SerialNumberTimeout​

Since 3.2.0

Value passed to the completion when the serial number couldn't be read.

extern NSString * const Aila_SerialNumberTimeout;

Compare the returned value against this constant rather than its contents, which may change between versions.

See Also​