Skip to content

How to get device information

To retrieve a connected device's information, use the PGPeripheral requestDeviceInformation method. Method accepts DeviceInfoCommand, wrapping the PGDeviceInformationRequest and completionHandler parameters.
If successful, the completion handler will return PGDeviceInformation object containing all the available information.
In case the request fails, an error object will be returned via the completion handler.

Currently exposed data-points:

  • serialNumber
  • firmwareRevision
- (void)requestDeviceInformationWithDeviceInfoCommand:(nonnull PGCommand<PGDeviceInformationRequest *> *)deviceInfoCommand completionHandler:(void (^_Nonnull)(PGDeviceInformation * _Nullable deviceInformation, NSError * _Nullable error))completionHandler;
func requestDeviceInformation(withDeviceInfoCommand deviceInfoCommand: PGCommand<PGDeviceInformationRequest>, completionHandler: @escaping (PGDeviceInformation?, Error?) -> Void)