                                            format: format,
                                            maxValue: dict["MaxValue"] as? NSNumber,
                                            minValue: dict["MinValue"] as? NSNumber,
-                                           properties: dict["Properties"] as? Int ?? Int(dict["Properties"].debugDescription)!,
+                                           permissions: CharacteristicInfoPermission(rawValue:  dict["Properties"] as! Int),
                                            stepValue: dict["StepValue"] as? NSNumber,
                                            units: dict["Units"] as? String))
                     characteristicFormats.insert(format)

            let enumType = enumeratedCharacteristics.contains(characteristic.hkname) ?
                "Enums.\(name.uppercasedFirstLetter())" :
                typeName(characteristic.format)
            return enumType + (characteristic.isReadable ? "" : "?")
        }

        for service in serviceInfo.sorted(by: { $0.className < $1.className }) {

        }

        func defaultValue(_ characteristic: CharacteristicInfo) -> String {
            if characteristic.permissions.contains(.read) {
                if enumeratedCharacteristics.contains(characteristic.hkname) {
                    guard let defaultCase = defaultEnumCase[characteristic.hkname] else {
                        preconditionFailure("No default enum case for enum \(characteristic.hkname)")
