             case .insufficientResources: return "Insufficient resources"
             case .invalidObject:         return "Invalid object"
             case .signatureMismatch:     return "Signature mismatch"
-            case .operationNotpermitted: return "Operation not permitted"
+            case .operationNotPermitted: return "Operation not permitted"
             case .unsupportedType:       return "Unsupported type"
             case .operationFailed:       return "Operation failed"
             case .extendedError:         return "Extended error"

    }
}

internal enum SecureDFURequest {
    case createCommandObject(withSize : UInt32)
    case createDataObject(withSize : UInt32)
    case readCommandObjectInfo
    case readDataObjectInfo
    case setPacketReceiptNotification(value : UInt16)
    case calculateChecksumCommand
    case executeCommand

    var data : Data {
        switch self {
        case .createDataObject(let aSize):
            var data = Data([SecureDFUOpCode.createObject.code, SecureDFUProcedureType.data.rawValue])
            data += aSize.littleEndian

import CoreBluetooth

internal enum SecureDFUOpCode : UInt8 {
    case getProtocolVersion   = 0x0  // not supported by this library
    case createObject         = 0x01
    case setPRNValue          = 0x02
    case calculateChecksum    = 0x03
    case execute              = 0x04
 // case no-such-op-code      = 0x05
    case readObjectInfo       = 0x06
    case getMtu               = 0x07 // not supported by this library
    case write                = 0x08 // not supported by this library
    case ping                 = 0x09 // not supported by this library
    case getHwVersion         = 0x0A // not supported by this library
    case getFwVersion         = 0x0B // not supported by this library
    case abort                = 0x0C
    case responseCode         = 0x60

    var code: UInt8 {
