BmDescriptorData.fromMap constructor

BmDescriptorData.fromMap(
  1. Map json
)

Implementation

factory BmDescriptorData.fromMap(Map<dynamic, dynamic> json) {
  return BmDescriptorData(
    remoteId: DeviceIdentifier(json['remote_id']),
    serviceUuid: Guid(json['service_uuid']),
    secondaryServiceUuid: json['secondary_service_uuid'] != null ? Guid(json['secondary_service_uuid']) : null,
    characteristicUuid: Guid(json['characteristic_uuid']),
    descriptorUuid: Guid(json['descriptor_uuid']),
    value: _hexDecode(json['value']),
    success: json['success'] != 0,
    errorCode: json['error_code'],
    errorString: json['error_string'],
  );
}