diff --git a/Plugins/GenerateBluetoothDefinitions/CompanyIdentifier.swift b/Plugins/GenerateBluetoothDefinitions/CompanyIdentifier.swift new file mode 100644 index 000000000..f6a05f7a2 --- /dev/null +++ b/Plugins/GenerateBluetoothDefinitions/CompanyIdentifier.swift @@ -0,0 +1,80 @@ +// +// CompanyIdentifier.swift +// Bluetooth +// +// Created by Alsey Coleman Miller on 11/5/24. +// + +import Foundation +import PackagePlugin + +extension GenerateBluetoothDefinitionsPlugin { + + func companyIdentifiersBuildCommands( + for context: PluginContext, + target: SwiftSourceModuleTarget, + commands: inout [Command] + ) throws { + guard target.name == "Bluetooth" else { + return + } + // Generate Bluetooth Company Identifier Definitions + let inputFileName = "CompanyIdentifier.json" + let inputPath = target + .sourceFiles(withSuffix: "json") + .filter { $0.type == .unknown } + .first { $0.path.lastComponent == inputFileName } + .map { $0.path } + guard let inputPath = inputPath else { + Diagnostics.error("Missing \(inputFileName)") + throw CocoaError(CocoaError.fileNoSuchFile) + } + let outputDirectory = context.pluginWorkDirectory + let outputPaths = [ + outputDirectory.appending("CompanyIdentifiers.swift"), + outputDirectory.appending("CompanyIdentifierNames.swift") + ] + let command = Command.buildCommand( + displayName: "Generate Bluetooth Company Identifier Definitions", + executable: try context.tool(named: "GenerateBluetooth").path, + arguments: ["companyIdentifier", inputPath] + outputPaths, + inputFiles: [inputPath], + outputFiles: outputPaths + ) + commands.append(command) + } + + func companyIdentifierTestsBuildCommands( + for context: PluginContext, + target: SwiftSourceModuleTarget, + commands: inout [Command] + ) throws { + // Generate Bluetooth Company Identifier Unit Tests + guard target.name == "BluetoothTests" else { + return + } + let inputFileName = "CompanyIdentifier.json" + guard let bluetoothTarget = try context.package.targets(named: ["Bluetooth"]).first as? SwiftSourceModuleTarget else { + fatalError("Missing Bluetooth target") + } + let inputPath = bluetoothTarget + .sourceFiles(withSuffix: "json") + .filter { $0.type == .unknown } + .first { $0.path.lastComponent == inputFileName } + .map { $0.path } + guard let inputPath = inputPath else { + Diagnostics.error("Missing \(inputFileName)") + throw CocoaError(CocoaError.fileNoSuchFile) + } + let outputDirectory = context.pluginWorkDirectory + let outputPath = outputDirectory.appending("CompanyIdentifierTests.swift") + let command = Command.buildCommand( + displayName: "Generate Bluetooth Company Identifier Unit Tests", + executable: try context.tool(named: "GenerateBluetooth").path, + arguments: ["companyIdentifierTests", inputPath, outputPath], + inputFiles: [inputPath], + outputFiles: [outputPath] + ) + commands.append(command) + } +} diff --git a/Plugins/GenerateBluetoothDefinitions/Plugin.swift b/Plugins/GenerateBluetoothDefinitions/Plugin.swift index 664914c78..f67009ab3 100644 --- a/Plugins/GenerateBluetoothDefinitions/Plugin.swift +++ b/Plugins/GenerateBluetoothDefinitions/Plugin.swift @@ -13,60 +13,24 @@ struct GenerateBluetoothDefinitionsPlugin: BuildToolPlugin { /// This entry point is called when operating on a Swift package. func createBuildCommands(context: PluginContext, target: Target) throws -> [Command] { - let target = target as! SwiftSourceModuleTarget + guard let target = target as? SwiftSourceModuleTarget else { + return [] + } var commands = [Command]() + commands.reserveCapacity(10) + // Generate Bluetooth Company Identifier Definitions - if target.name == "Bluetooth" { - let inputFileName = "CompanyIdentifiers.json" - let inputPath = target - .sourceFiles(withSuffix: "json") - .filter { $0.type == .unknown } - .first { $0.path.lastComponent == inputFileName } - .map { $0.path } - guard let inputPath = inputPath else { - Diagnostics.error("Missing \(inputFileName)") - throw CocoaError(CocoaError.fileNoSuchFile) - } - let outputDirectory = context.pluginWorkDirectory - let outputPaths = [ - outputDirectory.appending("CompanyIdentifiers.swift"), - outputDirectory.appending("CompanyIdentifierNames.swift") - ] - let command = Command.buildCommand( - displayName: "Generate Bluetooth Company Identifier Definitions", - executable: try context.tool(named: "GenerateBluetooth").path, - arguments: ["companyIdentifier", inputPath] + outputPaths, - inputFiles: [inputPath], - outputFiles: outputPaths - ) - commands.append(command) - } + try companyIdentifiersBuildCommands(for: context, target: target, commands: &commands) // Generate Bluetooth Company Identifier Unit Tests - if target.name == "BluetoothTests" { - let inputFileName = "CompanyIdentifiers.json" - guard let bluetoothTarget = try context.package.targets(named: ["Bluetooth"]).first as? SwiftSourceModuleTarget else { - fatalError("Missing Bluetooth target") - } - let inputPath = bluetoothTarget - .sourceFiles(withSuffix: "json") - .filter { $0.type == .unknown } - .first { $0.path.lastComponent == inputFileName } - .map { $0.path } - guard let inputPath = inputPath else { - Diagnostics.error("Missing \(inputFileName)") - throw CocoaError(CocoaError.fileNoSuchFile) - } - let outputDirectory = context.pluginWorkDirectory - let outputPath = outputDirectory.appending("CompanyIdentifierTests.swift") - let command = Command.buildCommand( - displayName: "Generate Bluetooth Company Identifier Unit Tests", - executable: try context.tool(named: "GenerateBluetooth").path, - arguments: ["companyIdentifierTests", inputPath, outputPath], - inputFiles: [inputPath], - outputFiles: [outputPath] - ) - commands.append(command) - } + try companyIdentifierTestsBuildCommands(for: context, target: target, commands: &commands) + + // Generate Bluetooth Unit Identifier Definitions + try unitIdentifiersBuildCommands(for: context, target: target, commands: &commands) + // Generate Bluetooth Unit Identifier Unit Tests + try unitIdentifierTestsBuildCommands(for: context, target: target, commands: &commands) + + + return commands } } diff --git a/Plugins/GenerateBluetoothDefinitions/UnitIdentifier.swift b/Plugins/GenerateBluetoothDefinitions/UnitIdentifier.swift new file mode 100644 index 000000000..880bf724a --- /dev/null +++ b/Plugins/GenerateBluetoothDefinitions/UnitIdentifier.swift @@ -0,0 +1,80 @@ +// +// UnitIdentifier.swift +// Bluetooth +// +// Created by Alsey Coleman Miller on 11/5/24. +// + +import Foundation +import PackagePlugin + +extension GenerateBluetoothDefinitionsPlugin { + + func unitIdentifiersBuildCommands( + for context: PluginContext, + target: SwiftSourceModuleTarget, + commands: inout [Command] + ) throws { + guard target.name == "Bluetooth" else { + return + } + // Generate Bluetooth Unit Identifier Definitions + let inputFileName = "UnitIdentifier.json" + let inputPath = target + .sourceFiles(withSuffix: "json") + .filter { $0.type == .unknown } + .first { $0.path.lastComponent == inputFileName } + .map { $0.path } + guard let inputPath = inputPath else { + Diagnostics.error("Missing \(inputFileName)") + throw CocoaError(CocoaError.fileNoSuchFile) + } + let outputDirectory = context.pluginWorkDirectory + let outputPaths = [ + outputDirectory.appending("UnitIdentifiers.swift"), + outputDirectory.appending("UnitIdentifierMetadata.swift") + ] + let command = Command.buildCommand( + displayName: "Generate Bluetooth Unit Identifier Definitions", + executable: try context.tool(named: "GenerateBluetooth").path, + arguments: ["unitIdentifier", inputPath] + outputPaths, + inputFiles: [inputPath], + outputFiles: outputPaths + ) + commands.append(command) + } + + func unitIdentifierTestsBuildCommands( + for context: PluginContext, + target: SwiftSourceModuleTarget, + commands: inout [Command] + ) throws { + // Generate Bluetooth Unit Identifier Unit Tests + guard target.name == "BluetoothTests" else { + return + } + let inputFileName = "UnitIdentifier.json" + guard let bluetoothTarget = try context.package.targets(named: ["Bluetooth"]).first as? SwiftSourceModuleTarget else { + fatalError("Missing Bluetooth target") + } + let inputPath = bluetoothTarget + .sourceFiles(withSuffix: "json") + .filter { $0.type == .unknown } + .first { $0.path.lastComponent == inputFileName } + .map { $0.path } + guard let inputPath = inputPath else { + Diagnostics.error("Missing \(inputFileName)") + throw CocoaError(CocoaError.fileNoSuchFile) + } + let outputDirectory = context.pluginWorkDirectory + let outputPath = outputDirectory.appending("UnitIdentifierTests.swift") + let command = Command.buildCommand( + displayName: "Generate Bluetooth Unit Identifier Unit Tests", + executable: try context.tool(named: "GenerateBluetooth").path, + arguments: ["unitIdentifierTests", inputPath, outputPath], + inputFiles: [inputPath], + outputFiles: [outputPath] + ) + commands.append(command) + } +} diff --git a/Sources/Bluetooth/Generated/GeneratedUnitIdentifierMetadata.swift b/Sources/Bluetooth/Generated/GeneratedUnitIdentifierMetadata.swift new file mode 100644 index 000000000..352f97ee8 --- /dev/null +++ b/Sources/Bluetooth/Generated/GeneratedUnitIdentifierMetadata.swift @@ -0,0 +1,143 @@ +// +// UnitIdentifierNames.swift +// Bluetooth +// + +#if (swift(<5.6) || !SWIFTPM_ENABLE_PLUGINS) && !os(WASI) && !hasFeature(Embedded) +internal extension UnitIdentifier { + + static let unitIdentifiers: [UInt16: (name: String, type: String)] = { + + var unitIdentifiers = [UInt16: (name: String, type: String)]() + unitIdentifiers.reserveCapacity(126) + + unitIdentifiers[0x2700] = (#"unitless"#, #"org.bluetooth.unit.unitless"#) + unitIdentifiers[0x2701] = (#"length (metre)"#, #"org.bluetooth.unit.length.metre"#) + unitIdentifiers[0x2702] = (#"mass (kilogram)"#, #"org.bluetooth.unit.mass.kilogram"#) + unitIdentifiers[0x2703] = (#"time (second)"#, #"org.bluetooth.unit.time.second"#) + unitIdentifiers[0x2704] = (#"electric current (ampere)"#, #"org.bluetooth.unit.electric_current.ampere"#) + unitIdentifiers[0x2705] = (#"thermodynamic temperature (kelvin)"#, #"org.bluetooth.unit.thermodynamic_temperature.kelvin"#) + unitIdentifiers[0x2706] = (#"amount of substance (mole)"#, #"org.bluetooth.unit.amount_of_substance.mole"#) + unitIdentifiers[0x2707] = (#"luminous intensity (candela)"#, #"org.bluetooth.unit.luminous_intensity.candela"#) + unitIdentifiers[0x2710] = (#"area (square metres)"#, #"org.bluetooth.unit.area.square_metres"#) + unitIdentifiers[0x2711] = (#"volume (cubic metres)"#, #"org.bluetooth.unit.volume.cubic_metres"#) + unitIdentifiers[0x2712] = (#"velocity (metres per second)"#, #"org.bluetooth.unit.velocity.metres_per_second"#) + unitIdentifiers[0x2713] = (#"acceleration (metres per second squared)"#, #"org.bluetooth.unit.acceleration.metres_per_second_squared"#) + unitIdentifiers[0x2714] = (#"wavenumber (reciprocal metre)"#, #"org.bluetooth.unit.wavenumber.reciprocal_metre"#) + unitIdentifiers[0x2715] = (#"density (kilogram per cubic metre)"#, #"org.bluetooth.unit.density.kilogram_per_cubic_metre"#) + unitIdentifiers[0x2716] = (#"surface density (kilogram per square metre)"#, #"org.bluetooth.unit.surface_density.kilogram_per_square_metre"#) + unitIdentifiers[0x2717] = (#"specific volume (cubic metre per kilogram)"#, #"org.bluetooth.unit.specific_volume.cubic_metre_per_kilogram"#) + unitIdentifiers[0x2718] = (#"current density (ampere per square metre)"#, #"org.bluetooth.unit.current_density.ampere_per_square_metre"#) + unitIdentifiers[0x2719] = (#"magnetic field strength (ampere per metre)"#, #"org.bluetooth.unit.magnetic_field_strength.ampere_per_metre"#) + unitIdentifiers[0x271A] = (#"amount concentration (mole per cubic metre)"#, #"org.bluetooth.unit.amount_concentration.mole_per_cubic_metre"#) + unitIdentifiers[0x271B] = (#"mass concentration (kilogram per cubic metre)"#, #"org.bluetooth.unit.mass_concentration.kilogram_per_cubic_metre"#) + unitIdentifiers[0x271C] = (#"luminance (candela per square metre)"#, #"org.bluetooth.unit.luminance.candela_per_square_metre"#) + unitIdentifiers[0x271D] = (#"refractive index"#, #"org.bluetooth.unit.refractive_index"#) + unitIdentifiers[0x271E] = (#"relative permeability"#, #"org.bluetooth.unit.relative_permeability"#) + unitIdentifiers[0x2720] = (#"plane angle (radian)"#, #"org.bluetooth.unit.plane_angle.radian"#) + unitIdentifiers[0x2721] = (#"solid angle (steradian)"#, #"org.bluetooth.unit.solid_angle.steradian"#) + unitIdentifiers[0x2722] = (#"frequency (hertz)"#, #"org.bluetooth.unit.frequency.hertz"#) + unitIdentifiers[0x2723] = (#"force (newton)"#, #"org.bluetooth.unit.force.newton"#) + unitIdentifiers[0x2724] = (#"pressure (pascal)"#, #"org.bluetooth.unit.pressure.pascal"#) + unitIdentifiers[0x2725] = (#"energy (joule)"#, #"org.bluetooth.unit.energy.joule"#) + unitIdentifiers[0x2726] = (#"power (watt)"#, #"org.bluetooth.unit.power.watt"#) + unitIdentifiers[0x2727] = (#"electric charge (coulomb)"#, #"org.bluetooth.unit.electric_charge.coulomb"#) + unitIdentifiers[0x2728] = (#"electric potential difference (volt)"#, #"org.bluetooth.unit.electric_potential_difference.volt"#) + unitIdentifiers[0x2729] = (#"capacitance (farad)"#, #"org.bluetooth.unit.capacitance.farad"#) + unitIdentifiers[0x272A] = (#"electric resistance (ohm)"#, #"org.bluetooth.unit.electric_resistance.ohm"#) + unitIdentifiers[0x272B] = (#"electric conductance (siemens)"#, #"org.bluetooth.unit.electric_conductance.siemens"#) + unitIdentifiers[0x272C] = (#"magnetic flux (weber)"#, #"org.bluetooth.unit.magnetic_flux.weber"#) + unitIdentifiers[0x272D] = (#"magnetic flux density (tesla)"#, #"org.bluetooth.unit.magnetic_flux_density.tesla"#) + unitIdentifiers[0x272E] = (#"inductance (henry)"#, #"org.bluetooth.unit.inductance.henry"#) + unitIdentifiers[0x272F] = (#"Celsius temperature (degree Celsius)"#, #"org.bluetooth.unit.thermodynamic_temperature.degree_celsius"#) + unitIdentifiers[0x2730] = (#"luminous flux (lumen)"#, #"org.bluetooth.unit.luminous_flux.lumen"#) + unitIdentifiers[0x2731] = (#"illuminance (lux)"#, #"org.bluetooth.unit.illuminance.lux"#) + unitIdentifiers[0x2732] = (#"activity referred to a radionuclide (becquerel)"#, #"org.bluetooth.unit.activity_referred_to_a_radionuclide.becquerel"#) + unitIdentifiers[0x2733] = (#"absorbed dose (gray)"#, #"org.bluetooth.unit.absorbed_dose.gray"#) + unitIdentifiers[0x2734] = (#"dose equivalent (sievert)"#, #"org.bluetooth.unit.dose_equivalent.sievert"#) + unitIdentifiers[0x2735] = (#"catalytic activity (katal)"#, #"org.bluetooth.unit.catalytic_activity.katal"#) + unitIdentifiers[0x2740] = (#"dynamic viscosity (pascal second)"#, #"org.bluetooth.unit.dynamic_viscosity.pascal_second"#) + unitIdentifiers[0x2741] = (#"moment of force (newton metre)"#, #"org.bluetooth.unit.moment_of_force.newton_metre"#) + unitIdentifiers[0x2742] = (#"surface tension (newton per metre)"#, #"org.bluetooth.unit.surface_tension.newton_per_metre"#) + unitIdentifiers[0x2743] = (#"angular velocity (radian per second)"#, #"org.bluetooth.unit.angular_velocity.radian_per_second"#) + unitIdentifiers[0x2744] = (#"angular acceleration (radian per second squared)"#, #"org.bluetooth.unit.angular_acceleration.radian_per_second_squared"#) + unitIdentifiers[0x2745] = (#"heat flux density (watt per square metre)"#, #"org.bluetooth.unit.heat_flux_density.watt_per_square_metre"#) + unitIdentifiers[0x2746] = (#"heat capacity (joule per kelvin)"#, #"org.bluetooth.unit.heat_capacity.joule_per_kelvin"#) + unitIdentifiers[0x2747] = (#"specific heat capacity (joule per kilogram kelvin)"#, #"org.bluetooth.unit.specific_heat_capacity.joule_per_kilogram_kelvin"#) + unitIdentifiers[0x2748] = (#"specific energy (joule per kilogram)"#, #"org.bluetooth.unit.specific_energy.joule_per_kilogram"#) + unitIdentifiers[0x2749] = (#"thermal conductivity (watt per metre kelvin)"#, #"org.bluetooth.unit.thermal_conductivity.watt_per_metre_kelvin"#) + unitIdentifiers[0x274A] = (#"energy density (joule per cubic metre)"#, #"org.bluetooth.unit.energy_density.joule_per_cubic_metre"#) + unitIdentifiers[0x274B] = (#"electric field strength (volt per metre)"#, #"org.bluetooth.unit.electric_field_strength.volt_per_metre"#) + unitIdentifiers[0x274C] = (#"electric charge density (coulomb per cubic metre)"#, #"org.bluetooth.unit.electric_charge_density.coulomb_per_cubic_metre"#) + unitIdentifiers[0x274D] = (#"surface charge density (coulomb per square metre)"#, #"org.bluetooth.unit.surface_charge_density.coulomb_per_square_metre"#) + unitIdentifiers[0x274E] = (#"electric flux density (coulomb per square metre)"#, #"org.bluetooth.unit.electric_flux_density.coulomb_per_square_metre"#) + unitIdentifiers[0x274F] = (#"permittivity (farad per metre)"#, #"org.bluetooth.unit.permittivity.farad_per_metre"#) + unitIdentifiers[0x2750] = (#"permeability (henry per metre)"#, #"org.bluetooth.unit.permeability.henry_per_metre"#) + unitIdentifiers[0x2751] = (#"molar energy (joule per mole)"#, #"org.bluetooth.unit.molar_energy.joule_per_mole"#) + unitIdentifiers[0x2752] = (#"molar entropy (joule per mole kelvin)"#, #"org.bluetooth.unit.molar_entropy.joule_per_mole_kelvin"#) + unitIdentifiers[0x2753] = (#"exposure (coulomb per kilogram)"#, #"org.bluetooth.unit.exposure.coulomb_per_kilogram"#) + unitIdentifiers[0x2754] = (#"absorbed dose rate (gray per second)"#, #"org.bluetooth.unit.absorbed_dose_rate.gray_per_second"#) + unitIdentifiers[0x2755] = (#"radiant intensity (watt per steradian)"#, #"org.bluetooth.unit.radiant_intensity.watt_per_steradian"#) + unitIdentifiers[0x2756] = (#"radiance (watt per square metre steradian)"#, #"org.bluetooth.unit.radiance.watt_per_square_metre_steradian"#) + unitIdentifiers[0x2757] = (#"catalytic activity concentration (katal per cubic metre)"#, #"org.bluetooth.unit.catalytic_activity_concentration.katal_per_cubic_metre"#) + unitIdentifiers[0x2760] = (#"time (minute)"#, #"org.bluetooth.unit.time.minute"#) + unitIdentifiers[0x2761] = (#"time (hour)"#, #"org.bluetooth.unit.time.hour"#) + unitIdentifiers[0x2762] = (#"time (day)"#, #"org.bluetooth.unit.time.day"#) + unitIdentifiers[0x2763] = (#"plane angle (degree)"#, #"org.bluetooth.unit.plane_angle.degree"#) + unitIdentifiers[0x2764] = (#"plane angle (minute)"#, #"org.bluetooth.unit.plane_angle.minute"#) + unitIdentifiers[0x2765] = (#"plane angle (second)"#, #"org.bluetooth.unit.plane_angle.second"#) + unitIdentifiers[0x2766] = (#"area (hectare)"#, #"org.bluetooth.unit.area.hectare"#) + unitIdentifiers[0x2767] = (#"volume (litre)"#, #"org.bluetooth.unit.volume.litre"#) + unitIdentifiers[0x2768] = (#"mass (tonne)"#, #"org.bluetooth.unit.mass.tonne"#) + unitIdentifiers[0x2780] = (#"pressure (bar)"#, #"org.bluetooth.unit.pressure.bar"#) + unitIdentifiers[0x2781] = (#"pressure (millimetre of mercury)"#, #"org.bluetooth.unit.pressure.millimetre_of_mercury"#) + unitIdentifiers[0x2782] = (#"length (ångström)"#, #"org.bluetooth.unit.length.ångström"#) + unitIdentifiers[0x2783] = (#"length (nautical mile)"#, #"org.bluetooth.unit.length.nautical_mile"#) + unitIdentifiers[0x2784] = (#"area (barn)"#, #"org.bluetooth.unit.area.barn"#) + unitIdentifiers[0x2785] = (#"velocity (knot)"#, #"org.bluetooth.unit.velocity.knot"#) + unitIdentifiers[0x2786] = (#"logarithmic radio quantity (neper)"#, #"org.bluetooth.unit.logarithmic_radio_quantity.neper"#) + unitIdentifiers[0x2787] = (#"logarithmic radio quantity (bel)"#, #"org.bluetooth.unit.logarithmic_radio_quantity.bel"#) + unitIdentifiers[0x27A0] = (#"length (yard)"#, #"org.bluetooth.unit.length.yard"#) + unitIdentifiers[0x27A1] = (#"length (parsec)"#, #"org.bluetooth.unit.length.parsec"#) + unitIdentifiers[0x27A2] = (#"length (inch)"#, #"org.bluetooth.unit.length.inch"#) + unitIdentifiers[0x27A3] = (#"length (foot)"#, #"org.bluetooth.unit.length.foot"#) + unitIdentifiers[0x27A4] = (#"length (mile)"#, #"org.bluetooth.unit.length.mile"#) + unitIdentifiers[0x27A5] = (#"pressure (pound-force per square inch)"#, #"org.bluetooth.unit.pressure.pound_force_per_square_inch"#) + unitIdentifiers[0x27A6] = (#"velocity (kilometre per hour)"#, #"org.bluetooth.unit.velocity.kilometre_per_hour"#) + unitIdentifiers[0x27A7] = (#"velocity (mile per hour)"#, #"org.bluetooth.unit.velocity.mile_per_hour"#) + unitIdentifiers[0x27A8] = (#"angular velocity (revolution per minute)"#, #"org.bluetooth.unit.angular_velocity.revolution_per_minute"#) + unitIdentifiers[0x27A9] = (#"energy (gram calorie)"#, #"org.bluetooth.unit.energy.gram_calorie"#) + unitIdentifiers[0x27AA] = (#"energy (kilogram calorie)"#, #"org.bluetooth.unit.energy.kilogram_calorie"#) + unitIdentifiers[0x27AB] = (#"energy (kilowatt hour)"#, #"org.bluetooth.unit.energy.kilowatt_hour"#) + unitIdentifiers[0x27AC] = (#"thermodynamic temperature (degree Fahrenheit)"#, #"org.bluetooth.unit.thermodynamic_temperature.degree_fahrenheit"#) + unitIdentifiers[0x27AD] = (#"percentage"#, #"org.bluetooth.unit.percentage"#) + unitIdentifiers[0x27AE] = (#"per mille"#, #"org.bluetooth.unit.per_mille"#) + unitIdentifiers[0x27AF] = (#"period (beats per minute)"#, #"org.bluetooth.unit.period.beats_per_minute"#) + unitIdentifiers[0x27B0] = (#"electric charge (ampere hours)"#, #"org.bluetooth.unit.electric_charge.ampere_hours"#) + unitIdentifiers[0x27B1] = (#"mass density (milligram per decilitre)"#, #"org.bluetooth.unit.mass_density.milligram_per_decilitre"#) + unitIdentifiers[0x27B2] = (#"mass density (millimole per litre)"#, #"org.bluetooth.unit.mass_density.millimole_per_litre"#) + unitIdentifiers[0x27B3] = (#"time (year)"#, #"org.bluetooth.unit.time.year"#) + unitIdentifiers[0x27B4] = (#"time (month)"#, #"org.bluetooth.unit.time.month"#) + unitIdentifiers[0x27B5] = (#"concentration (count per cubic metre)"#, #"org.bluetooth.unit.concentration.count_per_cubic_metre"#) + unitIdentifiers[0x27B6] = (#"irradiance (watt per square metre)"#, #"org.bluetooth.unit.irradiance.watt_per_square_metre"#) + unitIdentifiers[0x27B7] = (#"milliliter (per kilogram per minute)"#, #"org.bluetooth.unit.transfer_rate.milliliter_per_kilogram_per_minute"#) + unitIdentifiers[0x27B8] = (#"mass (pound)"#, #"org.bluetooth.unit.mass.pound"#) + unitIdentifiers[0x27B9] = (#"metabolic equivalent"#, #"org.bluetooth.unit.metabolic_equivalent"#) + unitIdentifiers[0x27BA] = (#"step (per minute)"#, #"org.bluetooth.unit.step_per_minute"#) + unitIdentifiers[0x27BC] = (#"stroke (per minute)"#, #"org.bluetooth.unit.stroke_per_minute"#) + unitIdentifiers[0x27BD] = (#"pace (kilometre per minute)"#, #"org.bluetooth.unit.velocity.kilometer_per_minute"#) + unitIdentifiers[0x27BE] = (#"luminous efficacy (lumen per watt)"#, #"org.bluetooth.unit.luminous_efficacy.lumen_per_watt"#) + unitIdentifiers[0x27BF] = (#"luminous energy (lumen hour)"#, #"org.bluetooth.unit.luminous_energy.lumen_hour"#) + unitIdentifiers[0x27C0] = (#"luminous exposure (lux hour)"#, #"org.bluetooth.unit.luminous_exposure.lux_hour"#) + unitIdentifiers[0x27C1] = (#"mass flow (gram per second)"#, #"org.bluetooth.unit.mass_flow.gram_per_second"#) + unitIdentifiers[0x27C2] = (#"volume flow (litre per second)"#, #"org.bluetooth.unit.volume_flow.litre_per_second"#) + unitIdentifiers[0x27C3] = (#"sound pressure (decibel)"#, #"org.bluetooth.unit.sound_pressure.decibel_spl"#) + unitIdentifiers[0x27C4] = (#"parts per million"#, #"org.bluetooth.unit.ppm"#) + unitIdentifiers[0x27C5] = (#"parts per billion"#, #"org.bluetooth.unit.ppb"#) + unitIdentifiers[0x27C6] = (#"mass density rate ((milligram per decilitre) per minute)"#, #"org.bluetooth.unit.mass_density_rate.milligram_per_decilitre_per_minute"#) + unitIdentifiers[0x27C7] = (#"Electrical Apparent Energy (kilovolt ampere hour)"#, #"org.bluetooth.unit.energy.kilovolt_ampere_hour"#) + unitIdentifiers[0x27C8] = (#"Electrical Apparent Power (volt ampere)"#, #"org.bluetooth.unit.power.volt_ampere"#) + return unitIdentifiers + }() +} +#endif \ No newline at end of file diff --git a/Sources/Bluetooth/UnitIdentifierExtension.swift b/Sources/Bluetooth/Generated/GeneratedUnitIdentifiers.swift similarity index 79% rename from Sources/Bluetooth/UnitIdentifierExtension.swift rename to Sources/Bluetooth/Generated/GeneratedUnitIdentifiers.swift index bee541c9f..185830435 100644 --- a/Sources/Bluetooth/UnitIdentifierExtension.swift +++ b/Sources/Bluetooth/Generated/GeneratedUnitIdentifiers.swift @@ -1,609 +1,766 @@ // -// UnitIdentifierExtension.swift +// UnitIdentifiers.swift // Bluetooth // -// Generated by Carlos Duclos on 5/29/20. -// +#if (swift(<5.6) || !SWIFTPM_ENABLE_PLUGINS) && !os(WASI) public extension UnitIdentifier { /// unitless (`0x2700`) + @_alwaysEmitIntoClient static var unitless: UnitIdentifier { return UnitIdentifier(rawValue: 0x2700) } /// length (metre) (`0x2701`) + @_alwaysEmitIntoClient static var metre: UnitIdentifier { return UnitIdentifier(rawValue: 0x2701) } /// mass (kilogram) (`0x2702`) + @_alwaysEmitIntoClient static var kilogram: UnitIdentifier { return UnitIdentifier(rawValue: 0x2702) } /// time (second) (`0x2703`) + @_alwaysEmitIntoClient static var second: UnitIdentifier { return UnitIdentifier(rawValue: 0x2703) } /// electric current (ampere) (`0x2704`) + @_alwaysEmitIntoClient static var ampere: UnitIdentifier { return UnitIdentifier(rawValue: 0x2704) } /// thermodynamic temperature (kelvin) (`0x2705`) + @_alwaysEmitIntoClient static var kelvin: UnitIdentifier { return UnitIdentifier(rawValue: 0x2705) } /// amount of substance (mole) (`0x2706`) + @_alwaysEmitIntoClient static var mole: UnitIdentifier { return UnitIdentifier(rawValue: 0x2706) } /// luminous intensity (candela) (`0x2707`) + @_alwaysEmitIntoClient static var candela: UnitIdentifier { return UnitIdentifier(rawValue: 0x2707) } /// area (square metres) (`0x2710`) + @_alwaysEmitIntoClient static var area: UnitIdentifier { return UnitIdentifier(rawValue: 0x2710) } /// volume (cubic metres) (`0x2711`) + @_alwaysEmitIntoClient static var volume: UnitIdentifier { return UnitIdentifier(rawValue: 0x2711) } /// velocity (metres per second) (`0x2712`) + @_alwaysEmitIntoClient static var velocity: UnitIdentifier { return UnitIdentifier(rawValue: 0x2712) } /// acceleration (metres per second squared) (`0x2713`) + @_alwaysEmitIntoClient static var acceleration: UnitIdentifier { return UnitIdentifier(rawValue: 0x2713) } /// wavenumber (reciprocal metre) (`0x2714`) + @_alwaysEmitIntoClient static var wavenumber: UnitIdentifier { return UnitIdentifier(rawValue: 0x2714) } /// density (kilogram per cubic metre) (`0x2715`) + @_alwaysEmitIntoClient static var density: UnitIdentifier { return UnitIdentifier(rawValue: 0x2715) } /// surface density (kilogram per square metre) (`0x2716`) + @_alwaysEmitIntoClient static var surfaceDensity: UnitIdentifier { return UnitIdentifier(rawValue: 0x2716) } /// specific volume (cubic metre per kilogram) (`0x2717`) + @_alwaysEmitIntoClient static var specificVolume: UnitIdentifier { return UnitIdentifier(rawValue: 0x2717) } /// current density (ampere per square metre) (`0x2718`) + @_alwaysEmitIntoClient static var currentDensity: UnitIdentifier { return UnitIdentifier(rawValue: 0x2718) } /// magnetic field strength (ampere per metre) (`0x2719`) + @_alwaysEmitIntoClient static var magneticFieldStrengh: UnitIdentifier { return UnitIdentifier(rawValue: 0x2719) } /// amount concentration (mole per cubic metre) (`0x271A`) + @_alwaysEmitIntoClient static var amountConcentration: UnitIdentifier { return UnitIdentifier(rawValue: 0x271A) } /// mass concentration (kilogram per cubic metre) (`0x271B`) + @_alwaysEmitIntoClient static var massConcentration: UnitIdentifier { return UnitIdentifier(rawValue: 0x271B) } /// luminance (candela per square metre) (`0x271C`) + @_alwaysEmitIntoClient static var luminance: UnitIdentifier { return UnitIdentifier(rawValue: 0x271C) } /// refractive index (`0x271D`) + @_alwaysEmitIntoClient static var refractiveIndex: UnitIdentifier { return UnitIdentifier(rawValue: 0x271D) } /// relative permeability (`0x271E`) + @_alwaysEmitIntoClient static var relativePermeability: UnitIdentifier { return UnitIdentifier(rawValue: 0x271E) } /// plane angle (radian) (`0x2720`) + @_alwaysEmitIntoClient static var planeAngle: UnitIdentifier { return UnitIdentifier(rawValue: 0x2720) } /// solid angle (steradian) (`0x2721`) + @_alwaysEmitIntoClient static var solidAngle: UnitIdentifier { return UnitIdentifier(rawValue: 0x2721) } /// frequency (hertz) (`0x2722`) + @_alwaysEmitIntoClient static var frequency: UnitIdentifier { return UnitIdentifier(rawValue: 0x2722) } /// force (newton) (`0x2723`) + @_alwaysEmitIntoClient static var force: UnitIdentifier { return UnitIdentifier(rawValue: 0x2723) } /// pressure (pascal) (`0x2724`) + @_alwaysEmitIntoClient static var pascalPressure: UnitIdentifier { return UnitIdentifier(rawValue: 0x2724) } /// energy (joule) (`0x2725`) + @_alwaysEmitIntoClient static var energy: UnitIdentifier { return UnitIdentifier(rawValue: 0x2725) } /// power (watt) (`0x2726`) + @_alwaysEmitIntoClient static var power: UnitIdentifier { return UnitIdentifier(rawValue: 0x2726) } /// electric charge (coulomb) (`0x2727`) + @_alwaysEmitIntoClient static var coulomb: UnitIdentifier { return UnitIdentifier(rawValue: 0x2727) } /// electric potential difference (volt) (`0x2728`) + @_alwaysEmitIntoClient static var electricPotential: UnitIdentifier { return UnitIdentifier(rawValue: 0x2728) } /// capacitance (farad) (`0x2729`) + @_alwaysEmitIntoClient static var capitance: UnitIdentifier { return UnitIdentifier(rawValue: 0x2729) } /// electric resistance (ohm) (`0x272A`) + @_alwaysEmitIntoClient static var electricResistance: UnitIdentifier { return UnitIdentifier(rawValue: 0x272A) } /// electric conductance (siemens) (`0x272B`) + @_alwaysEmitIntoClient static var electricConductance: UnitIdentifier { return UnitIdentifier(rawValue: 0x272B) } /// magnetic flux (weber) (`0x272C`) + @_alwaysEmitIntoClient static var magneticFlux: UnitIdentifier { return UnitIdentifier(rawValue: 0x272C) } /// magnetic flux density (tesla) (`0x272D`) + @_alwaysEmitIntoClient static var magneticFluxDensity: UnitIdentifier { return UnitIdentifier(rawValue: 0x272D) } /// inductance (henry) (`0x272E`) + @_alwaysEmitIntoClient static var inductance: UnitIdentifier { return UnitIdentifier(rawValue: 0x272E) } /// Celsius temperature (degree Celsius) (`0x272F`) + @_alwaysEmitIntoClient static var celsius: UnitIdentifier { return UnitIdentifier(rawValue: 0x272F) } /// luminous flux (lumen) (`0x2730`) + @_alwaysEmitIntoClient static var luminousFlux: UnitIdentifier { return UnitIdentifier(rawValue: 0x2730) } /// illuminance (lux) (`0x2731`) + @_alwaysEmitIntoClient static var illuminance: UnitIdentifier { return UnitIdentifier(rawValue: 0x2731) } /// activity referred to a radionuclide (becquerel) (`0x2732`) + @_alwaysEmitIntoClient static var becquerel: UnitIdentifier { return UnitIdentifier(rawValue: 0x2732) } /// absorbed dose (gray) (`0x2733`) + @_alwaysEmitIntoClient static var absorbedDose: UnitIdentifier { return UnitIdentifier(rawValue: 0x2733) } /// dose equivalent (sievert) (`0x2734`) + @_alwaysEmitIntoClient static var sievert: UnitIdentifier { return UnitIdentifier(rawValue: 0x2734) } /// catalytic activity (katal) (`0x2735`) + @_alwaysEmitIntoClient static var katal: UnitIdentifier { return UnitIdentifier(rawValue: 0x2735) } /// dynamic viscosity (pascal second) (`0x2740`) + @_alwaysEmitIntoClient static var pascalSecond: UnitIdentifier { return UnitIdentifier(rawValue: 0x2740) } /// moment of force (newton metre) (`0x2741`) + @_alwaysEmitIntoClient static var newtonMetre: UnitIdentifier { return UnitIdentifier(rawValue: 0x2741) } /// surface tension (newton per metre) (`0x2742`) + @_alwaysEmitIntoClient static var surfaceTension: UnitIdentifier { return UnitIdentifier(rawValue: 0x2742) } /// angular velocity (radian per second) (`0x2743`) + @_alwaysEmitIntoClient static var angularVelocity: UnitIdentifier { return UnitIdentifier(rawValue: 0x2743) } /// angular acceleration (radian per second squared) (`0x2744`) + @_alwaysEmitIntoClient static var angularAcceleration: UnitIdentifier { return UnitIdentifier(rawValue: 0x2744) } /// heat flux density (watt per square metre) (`0x2745`) + @_alwaysEmitIntoClient static var heatFluxDensity: UnitIdentifier { return UnitIdentifier(rawValue: 0x2745) } /// heat capacity (joule per kelvin) (`0x2746`) + @_alwaysEmitIntoClient static var heatCapacity: UnitIdentifier { return UnitIdentifier(rawValue: 0x2746) } /// specific heat capacity (joule per kilogram kelvin) (`0x2747`) + @_alwaysEmitIntoClient static var specificHeatCapacity: UnitIdentifier { return UnitIdentifier(rawValue: 0x2747) } /// specific energy (joule per kilogram) (`0x2748`) + @_alwaysEmitIntoClient static var specificEnergy: UnitIdentifier { return UnitIdentifier(rawValue: 0x2748) } /// thermal conductivity (watt per metre kelvin) (`0x2749`) + @_alwaysEmitIntoClient static var thermalConductivity: UnitIdentifier { return UnitIdentifier(rawValue: 0x2749) } /// energy density (joule per cubic metre) (`0x274A`) + @_alwaysEmitIntoClient static var energyDensity: UnitIdentifier { return UnitIdentifier(rawValue: 0x274A) } /// electric field strength (volt per metre) (`0x274B`) + @_alwaysEmitIntoClient static var electricFieldStrength: UnitIdentifier { return UnitIdentifier(rawValue: 0x274B) } /// electric charge density (coulomb per cubic metre) (`0x274C`) + @_alwaysEmitIntoClient static var electricChargeDensity: UnitIdentifier { return UnitIdentifier(rawValue: 0x274C) } /// surface charge density (coulomb per square metre) (`0x274D`) + @_alwaysEmitIntoClient static var surfaceChargeDensity: UnitIdentifier { return UnitIdentifier(rawValue: 0x274D) } /// electric flux density (coulomb per square metre) (`0x274E`) + @_alwaysEmitIntoClient static var electricFluxDensity: UnitIdentifier { return UnitIdentifier(rawValue: 0x274E) } /// permittivity (farad per metre) (`0x274F`) + @_alwaysEmitIntoClient static var permittivity: UnitIdentifier { return UnitIdentifier(rawValue: 0x274F) } /// permeability (henry per metre) (`0x2750`) + @_alwaysEmitIntoClient static var permeability: UnitIdentifier { return UnitIdentifier(rawValue: 0x2750) } /// molar energy (joule per mole) (`0x2751`) + @_alwaysEmitIntoClient static var molarEnergy: UnitIdentifier { return UnitIdentifier(rawValue: 0x2751) } /// molar entropy (joule per mole kelvin) (`0x2752`) + @_alwaysEmitIntoClient static var molarEntropy: UnitIdentifier { return UnitIdentifier(rawValue: 0x2752) } /// exposure (coulomb per kilogram) (`0x2753`) + @_alwaysEmitIntoClient static var exposure: UnitIdentifier { return UnitIdentifier(rawValue: 0x2753) } /// absorbed dose rate (gray per second) (`0x2754`) + @_alwaysEmitIntoClient static var absorbedDoseRate: UnitIdentifier { return UnitIdentifier(rawValue: 0x2754) } /// radiant intensity (watt per steradian) (`0x2755`) + @_alwaysEmitIntoClient static var radradiantIntensityiance: UnitIdentifier { return UnitIdentifier(rawValue: 0x2755) } /// radiance (watt per square metre steradian) (`0x2756`) + @_alwaysEmitIntoClient static var radiance: UnitIdentifier { return UnitIdentifier(rawValue: 0x2756) } /// catalytic activity concentration (katal per cubic metre) (`0x2757`) + @_alwaysEmitIntoClient static var catalyticActivity: UnitIdentifier { return UnitIdentifier(rawValue: 0x2757) } /// time (minute) (`0x2760`) + @_alwaysEmitIntoClient static var minute: UnitIdentifier { return UnitIdentifier(rawValue: 0x2760) } /// time (hour) (`0x2761`) + @_alwaysEmitIntoClient static var hour: UnitIdentifier { return UnitIdentifier(rawValue: 0x2761) } /// time (day) (`0x2762`) + @_alwaysEmitIntoClient static var day: UnitIdentifier { return UnitIdentifier(rawValue: 0x2762) } /// plane angle (degree) (`0x2763`) + @_alwaysEmitIntoClient static var degree: UnitIdentifier { return UnitIdentifier(rawValue: 0x2763) } /// plane angle (minute) (`0x2764`) + @_alwaysEmitIntoClient static var planeAngleMinute: UnitIdentifier { return UnitIdentifier(rawValue: 0x2764) } /// plane angle (second) (`0x2765`) + @_alwaysEmitIntoClient static var planeAngleSecond: UnitIdentifier { return UnitIdentifier(rawValue: 0x2765) } /// area (hectare) (`0x2766`) + @_alwaysEmitIntoClient static var hectare: UnitIdentifier { return UnitIdentifier(rawValue: 0x2766) } /// volume (litre) (`0x2767`) + @_alwaysEmitIntoClient static var litre: UnitIdentifier { return UnitIdentifier(rawValue: 0x2767) } /// mass (tonne) (`0x2768`) + @_alwaysEmitIntoClient static var tonne: UnitIdentifier { return UnitIdentifier(rawValue: 0x2768) } /// pressure (bar) (`0x2780`) + @_alwaysEmitIntoClient static var bar: UnitIdentifier { return UnitIdentifier(rawValue: 0x2780) } /// pressure (millimetre of mercury) (`0x2781`) + @_alwaysEmitIntoClient static var millimetreOfMercury: UnitIdentifier { return UnitIdentifier(rawValue: 0x2781) } - /// length (ngstrm) (`0x2782`) + /// length (ångström) (`0x2782`) + @_alwaysEmitIntoClient static var ngstrm: UnitIdentifier { return UnitIdentifier(rawValue: 0x2782) } /// length (nautical mile) (`0x2783`) + @_alwaysEmitIntoClient static var nauticalMile: UnitIdentifier { return UnitIdentifier(rawValue: 0x2783) } /// area (barn) (`0x2784`) + @_alwaysEmitIntoClient static var barn: UnitIdentifier { return UnitIdentifier(rawValue: 0x2784) } /// velocity (knot) (`0x2785`) + @_alwaysEmitIntoClient static var velocityKnot: UnitIdentifier { return UnitIdentifier(rawValue: 0x2785) } /// logarithmic radio quantity (neper) (`0x2786`) + @_alwaysEmitIntoClient static var neper: UnitIdentifier { return UnitIdentifier(rawValue: 0x2786) } /// logarithmic radio quantity (bel) (`0x2787`) + @_alwaysEmitIntoClient static var bel: UnitIdentifier { return UnitIdentifier(rawValue: 0x2787) } /// length (yard) (`0x27A0`) + @_alwaysEmitIntoClient static var yard: UnitIdentifier { return UnitIdentifier(rawValue: 0x27A0) } /// length (parsec) (`0x27A1`) + @_alwaysEmitIntoClient static var parsec: UnitIdentifier { return UnitIdentifier(rawValue: 0x27A1) } /// length (inch) (`0x27A2`) + @_alwaysEmitIntoClient static var inch: UnitIdentifier { return UnitIdentifier(rawValue: 0x27A2) } /// length (foot) (`0x27A3`) + @_alwaysEmitIntoClient static var foot: UnitIdentifier { return UnitIdentifier(rawValue: 0x27A3) } /// length (mile) (`0x27A4`) + @_alwaysEmitIntoClient static var mile: UnitIdentifier { return UnitIdentifier(rawValue: 0x27A4) } /// pressure (pound-force per square inch) (`0x27A5`) + @_alwaysEmitIntoClient static var pressurePoundForce: UnitIdentifier { return UnitIdentifier(rawValue: 0x27A5) } /// velocity (kilometre per hour) (`0x27A6`) + @_alwaysEmitIntoClient static var kilometrePerHour: UnitIdentifier { return UnitIdentifier(rawValue: 0x27A6) } /// velocity (mile per hour) (`0x27A7`) + @_alwaysEmitIntoClient static var milePerHour: UnitIdentifier { return UnitIdentifier(rawValue: 0x27A7) } /// angular velocity (revolution per minute) (`0x27A8`) + @_alwaysEmitIntoClient static var revolutionPerMinute: UnitIdentifier { return UnitIdentifier(rawValue: 0x27A8) } /// energy (gram calorie) (`0x27A9`) + @_alwaysEmitIntoClient static var gramCalorie: UnitIdentifier { return UnitIdentifier(rawValue: 0x27A9) } /// energy (kilogram calorie) (`0x27AA`) + @_alwaysEmitIntoClient static var kilogramCalorie: UnitIdentifier { return UnitIdentifier(rawValue: 0x27AA) } /// energy (kilowatt hour) (`0x27AB`) + @_alwaysEmitIntoClient static var kilowattHour: UnitIdentifier { return UnitIdentifier(rawValue: 0x27AB) } /// thermodynamic temperature (degree Fahrenheit) (`0x27AC`) + @_alwaysEmitIntoClient static var degreeFahrenheit: UnitIdentifier { return UnitIdentifier(rawValue: 0x27AC) } /// percentage (`0x27AD`) + @_alwaysEmitIntoClient static var percentage: UnitIdentifier { return UnitIdentifier(rawValue: 0x27AD) } /// per mille (`0x27AE`) + @_alwaysEmitIntoClient static var perMille: UnitIdentifier { return UnitIdentifier(rawValue: 0x27AE) } /// period (beats per minute) (`0x27AF`) + @_alwaysEmitIntoClient static var beatsPerMinute: UnitIdentifier { return UnitIdentifier(rawValue: 0x27AF) } /// electric charge (ampere hours) (`0x27B0`) + @_alwaysEmitIntoClient static var ampereHours: UnitIdentifier { return UnitIdentifier(rawValue: 0x27B0) } /// mass density (milligram per decilitre) (`0x27B1`) + @_alwaysEmitIntoClient static var milligramPerDecilitre: UnitIdentifier { return UnitIdentifier(rawValue: 0x27B1) } /// mass density (millimole per litre) (`0x27B2`) + @_alwaysEmitIntoClient static var millimolePerLitre: UnitIdentifier { return UnitIdentifier(rawValue: 0x27B2) } /// time (year) (`0x27B3`) + @_alwaysEmitIntoClient static var year: UnitIdentifier { return UnitIdentifier(rawValue: 0x27B3) } /// time (month) (`0x27B4`) + @_alwaysEmitIntoClient static var month: UnitIdentifier { return UnitIdentifier(rawValue: 0x27B4) } /// concentration (count per cubic metre) (`0x27B5`) + @_alwaysEmitIntoClient static var concentration: UnitIdentifier { return UnitIdentifier(rawValue: 0x27B5) } /// irradiance (watt per square metre) (`0x27B6`) + @_alwaysEmitIntoClient static var irrandiance: UnitIdentifier { return UnitIdentifier(rawValue: 0x27B6) } /// milliliter (per kilogram per minute) (`0x27B7`) + @_alwaysEmitIntoClient static var millilitre: UnitIdentifier { return UnitIdentifier(rawValue: 0x27B7) } /// mass (pound) (`0x27B8`) + @_alwaysEmitIntoClient static var pound: UnitIdentifier { return UnitIdentifier(rawValue: 0x27B8) } /// metabolic equivalent (`0x27B9`) + @_alwaysEmitIntoClient static var metabolicEquivalent: UnitIdentifier { return UnitIdentifier(rawValue: 0x27B9) } /// step (per minute) (`0x27BA`) + @_alwaysEmitIntoClient static var step: UnitIdentifier { return UnitIdentifier(rawValue: 0x27BA) } /// stroke (per minute) (`0x27BC`) + @_alwaysEmitIntoClient static var stroke: UnitIdentifier { return UnitIdentifier(rawValue: 0x27BC) } /// pace (kilometre per minute) (`0x27BD`) + @_alwaysEmitIntoClient static var pace: UnitIdentifier { return UnitIdentifier(rawValue: 0x27BD) } /// luminous efficacy (lumen per watt) (`0x27BE`) + @_alwaysEmitIntoClient static var luminousEfficacy: UnitIdentifier { return UnitIdentifier(rawValue: 0x27BE) } /// luminous energy (lumen hour) (`0x27BF`) + @_alwaysEmitIntoClient static var luminousEnergy: UnitIdentifier { return UnitIdentifier(rawValue: 0x27BF) } /// luminous exposure (lux hour) (`0x27C0`) + @_alwaysEmitIntoClient static var luminousExposure: UnitIdentifier { return UnitIdentifier(rawValue: 0x27C0) } /// mass flow (gram per second) (`0x27C1`) + @_alwaysEmitIntoClient static var massFlow: UnitIdentifier { return UnitIdentifier(rawValue: 0x27C1) } /// volume flow (litre per second) (`0x27C2`) + @_alwaysEmitIntoClient static var volumeFlow: UnitIdentifier { return UnitIdentifier(rawValue: 0x27C2) } + + /// sound pressure (decibel) (`0x27C3`) + @_alwaysEmitIntoClient + static var soundPressure: UnitIdentifier { + return UnitIdentifier(rawValue: 0x27C3) + } + + /// parts per million (`0x27C4`) + @_alwaysEmitIntoClient + static var partsPerMillion: UnitIdentifier { + return UnitIdentifier(rawValue: 0x27C4) + } + + /// parts per billion (`0x27C5`) + @_alwaysEmitIntoClient + static var partsPerBillion: UnitIdentifier { + return UnitIdentifier(rawValue: 0x27C5) + } + + /// mass density rate ((milligram per decilitre) per minute) (`0x27C6`) + @_alwaysEmitIntoClient + static var massDensityRate: UnitIdentifier { + return UnitIdentifier(rawValue: 0x27C6) + } + + /// Electrical Apparent Energy (kilovolt ampere hour) (`0x27C7`) + @_alwaysEmitIntoClient + static var kilovoltAmpereHour: UnitIdentifier { + return UnitIdentifier(rawValue: 0x27C7) + } + + /// Electrical Apparent Power (volt ampere) (`0x27C8`) + @_alwaysEmitIntoClient + static var voltAmpere: UnitIdentifier { + return UnitIdentifier(rawValue: 0x27C8) + } + } +#endif \ No newline at end of file diff --git a/Sources/Bluetooth/Resources/CompanyIdentifiers.json b/Sources/Bluetooth/Resources/CompanyIdentifier.json similarity index 100% rename from Sources/Bluetooth/Resources/CompanyIdentifiers.json rename to Sources/Bluetooth/Resources/CompanyIdentifier.json diff --git a/Sources/Bluetooth/Resources/UnitIdentifier.json b/Sources/Bluetooth/Resources/UnitIdentifier.json new file mode 100644 index 000000000..acc0f51a5 --- /dev/null +++ b/Sources/Bluetooth/Resources/UnitIdentifier.json @@ -0,0 +1,634 @@ +{ + "uuids": [ + { + "uuid": 9984, + "name": "unitless", + "id": "org.bluetooth.unit.unitless" + }, + { + "uuid": 9985, + "name": "length (metre)", + "id": "org.bluetooth.unit.length.metre" + }, + { + "uuid": 9986, + "name": "mass (kilogram)", + "id": "org.bluetooth.unit.mass.kilogram" + }, + { + "uuid": 9987, + "name": "time (second)", + "id": "org.bluetooth.unit.time.second" + }, + { + "uuid": 9988, + "name": "electric current (ampere)", + "id": "org.bluetooth.unit.electric_current.ampere" + }, + { + "uuid": 9989, + "name": "thermodynamic temperature (kelvin)", + "id": "org.bluetooth.unit.thermodynamic_temperature.kelvin" + }, + { + "uuid": 9990, + "name": "amount of substance (mole)", + "id": "org.bluetooth.unit.amount_of_substance.mole" + }, + { + "uuid": 9991, + "name": "luminous intensity (candela)", + "id": "org.bluetooth.unit.luminous_intensity.candela" + }, + { + "uuid": 10000, + "name": "area (square metres)", + "id": "org.bluetooth.unit.area.square_metres" + }, + { + "uuid": 10001, + "name": "volume (cubic metres)", + "id": "org.bluetooth.unit.volume.cubic_metres" + }, + { + "uuid": 10002, + "name": "velocity (metres per second)", + "id": "org.bluetooth.unit.velocity.metres_per_second" + }, + { + "uuid": 10003, + "name": "acceleration (metres per second squared)", + "id": "org.bluetooth.unit.acceleration.metres_per_second_squared" + }, + { + "uuid": 10004, + "name": "wavenumber (reciprocal metre)", + "id": "org.bluetooth.unit.wavenumber.reciprocal_metre" + }, + { + "uuid": 10005, + "name": "density (kilogram per cubic metre)", + "id": "org.bluetooth.unit.density.kilogram_per_cubic_metre" + }, + { + "uuid": 10006, + "name": "surface density (kilogram per square metre)", + "id": "org.bluetooth.unit.surface_density.kilogram_per_square_metre" + }, + { + "uuid": 10007, + "name": "specific volume (cubic metre per kilogram)", + "id": "org.bluetooth.unit.specific_volume.cubic_metre_per_kilogram" + }, + { + "uuid": 10008, + "name": "current density (ampere per square metre)", + "id": "org.bluetooth.unit.current_density.ampere_per_square_metre" + }, + { + "uuid": 10009, + "name": "magnetic field strength (ampere per metre)", + "id": "org.bluetooth.unit.magnetic_field_strength.ampere_per_metre" + }, + { + "uuid": 10010, + "name": "amount concentration (mole per cubic metre)", + "id": "org.bluetooth.unit.amount_concentration.mole_per_cubic_metre" + }, + { + "uuid": 10011, + "name": "mass concentration (kilogram per cubic metre)", + "id": "org.bluetooth.unit.mass_concentration.kilogram_per_cubic_metre" + }, + { + "uuid": 10012, + "name": "luminance (candela per square metre)", + "id": "org.bluetooth.unit.luminance.candela_per_square_metre" + }, + { + "uuid": 10013, + "name": "refractive index", + "id": "org.bluetooth.unit.refractive_index" + }, + { + "uuid": 10014, + "name": "relative permeability", + "id": "org.bluetooth.unit.relative_permeability" + }, + { + "uuid": 10016, + "name": "plane angle (radian)", + "id": "org.bluetooth.unit.plane_angle.radian" + }, + { + "uuid": 10017, + "name": "solid angle (steradian)", + "id": "org.bluetooth.unit.solid_angle.steradian" + }, + { + "uuid": 10018, + "name": "frequency (hertz)", + "id": "org.bluetooth.unit.frequency.hertz" + }, + { + "uuid": 10019, + "name": "force (newton)", + "id": "org.bluetooth.unit.force.newton" + }, + { + "uuid": 10020, + "name": "pressure (pascal)", + "id": "org.bluetooth.unit.pressure.pascal" + }, + { + "uuid": 10021, + "name": "energy (joule)", + "id": "org.bluetooth.unit.energy.joule" + }, + { + "uuid": 10022, + "name": "power (watt)", + "id": "org.bluetooth.unit.power.watt" + }, + { + "uuid": 10023, + "name": "electric charge (coulomb)", + "id": "org.bluetooth.unit.electric_charge.coulomb" + }, + { + "uuid": 10024, + "name": "electric potential difference (volt)", + "id": "org.bluetooth.unit.electric_potential_difference.volt" + }, + { + "uuid": 10025, + "name": "capacitance (farad)", + "id": "org.bluetooth.unit.capacitance.farad" + }, + { + "uuid": 10026, + "name": "electric resistance (ohm)", + "id": "org.bluetooth.unit.electric_resistance.ohm" + }, + { + "uuid": 10027, + "name": "electric conductance (siemens)", + "id": "org.bluetooth.unit.electric_conductance.siemens" + }, + { + "uuid": 10028, + "name": "magnetic flux (weber)", + "id": "org.bluetooth.unit.magnetic_flux.weber" + }, + { + "uuid": 10029, + "name": "magnetic flux density (tesla)", + "id": "org.bluetooth.unit.magnetic_flux_density.tesla" + }, + { + "uuid": 10030, + "name": "inductance (henry)", + "id": "org.bluetooth.unit.inductance.henry" + }, + { + "uuid": 10031, + "name": "Celsius temperature (degree Celsius)", + "id": "org.bluetooth.unit.thermodynamic_temperature.degree_celsius" + }, + { + "uuid": 10032, + "name": "luminous flux (lumen)", + "id": "org.bluetooth.unit.luminous_flux.lumen" + }, + { + "uuid": 10033, + "name": "illuminance (lux)", + "id": "org.bluetooth.unit.illuminance.lux" + }, + { + "uuid": 10034, + "name": "activity referred to a radionuclide (becquerel)", + "id": "org.bluetooth.unit.activity_referred_to_a_radionuclide.becquerel" + }, + { + "uuid": 10035, + "name": "absorbed dose (gray)", + "id": "org.bluetooth.unit.absorbed_dose.gray" + }, + { + "uuid": 10036, + "name": "dose equivalent (sievert)", + "id": "org.bluetooth.unit.dose_equivalent.sievert" + }, + { + "uuid": 10037, + "name": "catalytic activity (katal)", + "id": "org.bluetooth.unit.catalytic_activity.katal" + }, + { + "uuid": 10048, + "name": "dynamic viscosity (pascal second)", + "id": "org.bluetooth.unit.dynamic_viscosity.pascal_second" + }, + { + "uuid": 10049, + "name": "moment of force (newton metre)", + "id": "org.bluetooth.unit.moment_of_force.newton_metre" + }, + { + "uuid": 10050, + "name": "surface tension (newton per metre)", + "id": "org.bluetooth.unit.surface_tension.newton_per_metre" + }, + { + "uuid": 10051, + "name": "angular velocity (radian per second)", + "id": "org.bluetooth.unit.angular_velocity.radian_per_second" + }, + { + "uuid": 10052, + "name": "angular acceleration (radian per second squared)", + "id": "org.bluetooth.unit.angular_acceleration.radian_per_second_squared" + }, + { + "uuid": 10053, + "name": "heat flux density (watt per square metre)", + "id": "org.bluetooth.unit.heat_flux_density.watt_per_square_metre" + }, + { + "uuid": 10054, + "name": "heat capacity (joule per kelvin)", + "id": "org.bluetooth.unit.heat_capacity.joule_per_kelvin" + }, + { + "uuid": 10055, + "name": "specific heat capacity (joule per kilogram kelvin)", + "id": "org.bluetooth.unit.specific_heat_capacity.joule_per_kilogram_kelvin" + }, + { + "uuid": 10056, + "name": "specific energy (joule per kilogram)", + "id": "org.bluetooth.unit.specific_energy.joule_per_kilogram" + }, + { + "uuid": 10057, + "name": "thermal conductivity (watt per metre kelvin)", + "id": "org.bluetooth.unit.thermal_conductivity.watt_per_metre_kelvin" + }, + { + "uuid": 10058, + "name": "energy density (joule per cubic metre)", + "id": "org.bluetooth.unit.energy_density.joule_per_cubic_metre" + }, + { + "uuid": 10059, + "name": "electric field strength (volt per metre)", + "id": "org.bluetooth.unit.electric_field_strength.volt_per_metre" + }, + { + "uuid": 10060, + "name": "electric charge density (coulomb per cubic metre)", + "id": "org.bluetooth.unit.electric_charge_density.coulomb_per_cubic_metre" + }, + { + "uuid": 10061, + "name": "surface charge density (coulomb per square metre)", + "id": "org.bluetooth.unit.surface_charge_density.coulomb_per_square_metre" + }, + { + "uuid": 10062, + "name": "electric flux density (coulomb per square metre)", + "id": "org.bluetooth.unit.electric_flux_density.coulomb_per_square_metre" + }, + { + "uuid": 10063, + "name": "permittivity (farad per metre)", + "id": "org.bluetooth.unit.permittivity.farad_per_metre" + }, + { + "uuid": 10064, + "name": "permeability (henry per metre)", + "id": "org.bluetooth.unit.permeability.henry_per_metre" + }, + { + "uuid": 10065, + "name": "molar energy (joule per mole)", + "id": "org.bluetooth.unit.molar_energy.joule_per_mole" + }, + { + "uuid": 10066, + "name": "molar entropy (joule per mole kelvin)", + "id": "org.bluetooth.unit.molar_entropy.joule_per_mole_kelvin" + }, + { + "uuid": 10067, + "name": "exposure (coulomb per kilogram)", + "id": "org.bluetooth.unit.exposure.coulomb_per_kilogram" + }, + { + "uuid": 10068, + "name": "absorbed dose rate (gray per second)", + "id": "org.bluetooth.unit.absorbed_dose_rate.gray_per_second" + }, + { + "uuid": 10069, + "name": "radiant intensity (watt per steradian)", + "id": "org.bluetooth.unit.radiant_intensity.watt_per_steradian" + }, + { + "uuid": 10070, + "name": "radiance (watt per square metre steradian)", + "id": "org.bluetooth.unit.radiance.watt_per_square_metre_steradian" + }, + { + "uuid": 10071, + "name": "catalytic activity concentration (katal per cubic metre)", + "id": "org.bluetooth.unit.catalytic_activity_concentration.katal_per_cubic_metre" + }, + { + "uuid": 10080, + "name": "time (minute)", + "id": "org.bluetooth.unit.time.minute" + }, + { + "uuid": 10081, + "name": "time (hour)", + "id": "org.bluetooth.unit.time.hour" + }, + { + "uuid": 10082, + "name": "time (day)", + "id": "org.bluetooth.unit.time.day" + }, + { + "uuid": 10083, + "name": "plane angle (degree)", + "id": "org.bluetooth.unit.plane_angle.degree" + }, + { + "uuid": 10084, + "name": "plane angle (minute)", + "id": "org.bluetooth.unit.plane_angle.minute" + }, + { + "uuid": 10085, + "name": "plane angle (second)", + "id": "org.bluetooth.unit.plane_angle.second" + }, + { + "uuid": 10086, + "name": "area (hectare)", + "id": "org.bluetooth.unit.area.hectare" + }, + { + "uuid": 10087, + "name": "volume (litre)", + "id": "org.bluetooth.unit.volume.litre" + }, + { + "uuid": 10088, + "name": "mass (tonne)", + "id": "org.bluetooth.unit.mass.tonne" + }, + { + "uuid": 10112, + "name": "pressure (bar)", + "id": "org.bluetooth.unit.pressure.bar" + }, + { + "uuid": 10113, + "name": "pressure (millimetre of mercury)", + "id": "org.bluetooth.unit.pressure.millimetre_of_mercury" + }, + { + "uuid": 10114, + "name": "length (ångström)", + "id": "org.bluetooth.unit.length.ångström" + }, + { + "uuid": 10115, + "name": "length (nautical mile)", + "id": "org.bluetooth.unit.length.nautical_mile" + }, + { + "uuid": 10116, + "name": "area (barn)", + "id": "org.bluetooth.unit.area.barn" + }, + { + "uuid": 10117, + "name": "velocity (knot)", + "id": "org.bluetooth.unit.velocity.knot" + }, + { + "uuid": 10118, + "name": "logarithmic radio quantity (neper)", + "id": "org.bluetooth.unit.logarithmic_radio_quantity.neper" + }, + { + "uuid": 10119, + "name": "logarithmic radio quantity (bel)", + "id": "org.bluetooth.unit.logarithmic_radio_quantity.bel" + }, + { + "uuid": 10144, + "name": "length (yard)", + "id": "org.bluetooth.unit.length.yard" + }, + { + "uuid": 10145, + "name": "length (parsec)", + "id": "org.bluetooth.unit.length.parsec" + }, + { + "uuid": 10146, + "name": "length (inch)", + "id": "org.bluetooth.unit.length.inch" + }, + { + "uuid": 10147, + "name": "length (foot)", + "id": "org.bluetooth.unit.length.foot" + }, + { + "uuid": 10148, + "name": "length (mile)", + "id": "org.bluetooth.unit.length.mile" + }, + { + "uuid": 10149, + "name": "pressure (pound-force per square inch)", + "id": "org.bluetooth.unit.pressure.pound_force_per_square_inch" + }, + { + "uuid": 10150, + "name": "velocity (kilometre per hour)", + "id": "org.bluetooth.unit.velocity.kilometre_per_hour" + }, + { + "uuid": 10151, + "name": "velocity (mile per hour)", + "id": "org.bluetooth.unit.velocity.mile_per_hour" + }, + { + "uuid": 10152, + "name": "angular velocity (revolution per minute)", + "id": "org.bluetooth.unit.angular_velocity.revolution_per_minute" + }, + { + "uuid": 10153, + "name": "energy (gram calorie)", + "id": "org.bluetooth.unit.energy.gram_calorie" + }, + { + "uuid": 10154, + "name": "energy (kilogram calorie)", + "id": "org.bluetooth.unit.energy.kilogram_calorie" + }, + { + "uuid": 10155, + "name": "energy (kilowatt hour)", + "id": "org.bluetooth.unit.energy.kilowatt_hour" + }, + { + "uuid": 10156, + "name": "thermodynamic temperature (degree Fahrenheit)", + "id": "org.bluetooth.unit.thermodynamic_temperature.degree_fahrenheit" + }, + { + "uuid": 10157, + "name": "percentage", + "id": "org.bluetooth.unit.percentage" + }, + { + "uuid": 10158, + "name": "per mille", + "id": "org.bluetooth.unit.per_mille" + }, + { + "uuid": 10159, + "name": "period (beats per minute)", + "id": "org.bluetooth.unit.period.beats_per_minute" + }, + { + "uuid": 10160, + "name": "electric charge (ampere hours)", + "id": "org.bluetooth.unit.electric_charge.ampere_hours" + }, + { + "uuid": 10161, + "name": "mass density (milligram per decilitre)", + "id": "org.bluetooth.unit.mass_density.milligram_per_decilitre" + }, + { + "uuid": 10162, + "name": "mass density (millimole per litre)", + "id": "org.bluetooth.unit.mass_density.millimole_per_litre" + }, + { + "uuid": 10163, + "name": "time (year)", + "id": "org.bluetooth.unit.time.year" + }, + { + "uuid": 10164, + "name": "time (month)", + "id": "org.bluetooth.unit.time.month" + }, + { + "uuid": 10165, + "name": "concentration (count per cubic metre)", + "id": "org.bluetooth.unit.concentration.count_per_cubic_metre" + }, + { + "uuid": 10166, + "name": "irradiance (watt per square metre)", + "id": "org.bluetooth.unit.irradiance.watt_per_square_metre" + }, + { + "uuid": 10167, + "name": "milliliter (per kilogram per minute)", + "id": "org.bluetooth.unit.transfer_rate.milliliter_per_kilogram_per_minute" + }, + { + "uuid": 10168, + "name": "mass (pound)", + "id": "org.bluetooth.unit.mass.pound" + }, + { + "uuid": 10169, + "name": "metabolic equivalent", + "id": "org.bluetooth.unit.metabolic_equivalent" + }, + { + "uuid": 10170, + "name": "step (per minute)", + "id": "org.bluetooth.unit.step_per_minute" + }, + { + "uuid": 10172, + "name": "stroke (per minute)", + "id": "org.bluetooth.unit.stroke_per_minute" + }, + { + "uuid": 10173, + "name": "pace (kilometre per minute)", + "id": "org.bluetooth.unit.velocity.kilometer_per_minute" + }, + { + "uuid": 10174, + "name": "luminous efficacy (lumen per watt)", + "id": "org.bluetooth.unit.luminous_efficacy.lumen_per_watt" + }, + { + "uuid": 10175, + "name": "luminous energy (lumen hour)", + "id": "org.bluetooth.unit.luminous_energy.lumen_hour" + }, + { + "uuid": 10176, + "name": "luminous exposure (lux hour)", + "id": "org.bluetooth.unit.luminous_exposure.lux_hour" + }, + { + "uuid": 10177, + "name": "mass flow (gram per second)", + "id": "org.bluetooth.unit.mass_flow.gram_per_second" + }, + { + "uuid": 10178, + "name": "volume flow (litre per second)", + "id": "org.bluetooth.unit.volume_flow.litre_per_second" + }, + { + "uuid": 10179, + "name": "sound pressure (decibel)", + "id": "org.bluetooth.unit.sound_pressure.decibel_spl" + }, + { + "uuid": 10180, + "name": "parts per million", + "id": "org.bluetooth.unit.ppm" + }, + { + "uuid": 10181, + "name": "parts per billion", + "id": "org.bluetooth.unit.ppb" + }, + { + "uuid": 10182, + "name": "mass density rate ((milligram per decilitre) per minute)", + "id": "org.bluetooth.unit.mass_density_rate.milligram_per_decilitre_per_minute" + }, + { + "uuid": 10183, + "name": "Electrical Apparent Energy (kilovolt ampere hour)", + "id": "org.bluetooth.unit.energy.kilovolt_ampere_hour" + }, + { + "uuid": 10184, + "name": "Electrical Apparent Power (volt ampere)", + "id": "org.bluetooth.unit.power.volt_ampere" + } + ] +} \ No newline at end of file diff --git a/Sources/Bluetooth/UnitIdentifier.swift b/Sources/Bluetooth/UnitIdentifier.swift index ff7deb5ac..be03405da 100644 --- a/Sources/Bluetooth/UnitIdentifier.swift +++ b/Sources/Bluetooth/UnitIdentifier.swift @@ -34,7 +34,7 @@ extension UnitIdentifier: ExpressibleByIntegerLiteral { extension UnitIdentifier: CustomStringConvertible { public var description: String { - let valueString = rawValue.toHexadecimal() + let valueString = "0x" + rawValue.toHexadecimal() #if !os(WASI) && !hasFeature(Embedded) if let name = self.name { return valueString + " " + "(" + name + ")" @@ -54,135 +54,12 @@ public extension UnitIdentifier { /// The name of the unit. var name: String? { - return units[rawValue]?.name + return Self.unitIdentifiers[rawValue]?.name } /// The Bluetooth type namespace of the unit. var type: String? { - return units[rawValue]?.type + return Self.unitIdentifiers[rawValue]?.type } } - -internal let units: [UInt16: (name: String, type: String)] = [ - 0x2700: ("unitless", "org.bluetooth.unit.unitless"), - 0x2701: ("length (metre)", "org.bluetooth.unit.length.metre"), - 0x2702: ("mass (kilogram)", "org.bluetooth.unit.mass.kilogram"), - 0x2703: ("time (second)", "org.bluetooth.unit.time.second"), - 0x2704: ("electric current (ampere)", "org.bluetooth.unit.electric_current.ampere"), - 0x2705: ("thermodynamic temperature (kelvin)", "org.bluetooth.unit.thermodynamic_temperature.kelvin"), - 0x2706: ("amount of substance (mole)", "org.bluetooth.unit.amount_of_substance.mole"), - 0x2707: ("luminous intensity (candela)", "org.bluetooth.unit.luminous_intensity.candela"), - 0x2710: ("area (square metres)", "org.bluetooth.unit.area.square_metres"), - 0x2711: ("volume (cubic metres)", "org.bluetooth.unit.volume.cubic_metres"), - 0x2712: ("velocity (metres per second)", "org.bluetooth.unit.velocity.metres_per_second"), - 0x2713: ("acceleration (metres per second squared)", "org.bluetooth.unit.acceleration.metres_per_second_squared"), - 0x2714: ("wavenumber (reciprocal metre)", "org.bluetooth.unit.wavenumber.reciprocal_metre"), - 0x2715: ("density (kilogram per cubic metre)", "org.bluetooth.unit.density.kilogram_per_cubic_metre"), - 0x2716: ("surface density (kilogram per square metre)", "org.bluetooth.unit.surface_density.kilogram_per_square_metre"), - 0x2717: ("specific volume (cubic metre per kilogram)", "org.bluetooth.unit.specific_volume.cubic_metre_per_kilogram"), - 0x2718: ("current density (ampere per square metre)", "org.bluetooth.unit.current_density.ampere_per_square_metre"), - 0x2719: ("magnetic field strength (ampere per metre)", "org.bluetooth.unit.magnetic_field_strength.ampere_per_metre"), - 0x271A: ("amount concentration (mole per cubic metre)", "org.bluetooth.unit.amount_concentration.mole_per_cubic_metre"), - 0x271B: ("mass concentration (kilogram per cubic metre)", "org.bluetooth.unit.mass_concentration.kilogram_per_cubic_metre"), - 0x271C: ("luminance (candela per square metre)", "org.bluetooth.unit.luminance.candela_per_square_metre"), - 0x271D: ("refractive index", "org.bluetooth.unit.refractive_index"), - 0x271E: ("relative permeability", "org.bluetooth.unit.relative_permeability"), - 0x2720: ("plane angle (radian)", "org.bluetooth.unit.plane_angle.radian"), - 0x2721: ("solid angle (steradian)", "org.bluetooth.unit.solid_angle.steradian"), - 0x2722: ("frequency (hertz)", "org.bluetooth.unit.frequency.hertz"), - 0x2723: ("force (newton)", "org.bluetooth.unit.force.newton"), - 0x2724: ("pressure (pascal)", "org.bluetooth.unit.pressure.pascal"), - 0x2725: ("energy (joule)", "org.bluetooth.unit.energy.joule"), - 0x2726: ("power (watt)", "org.bluetooth.unit.power.watt"), - 0x2727: ("electric charge (coulomb)", "org.bluetooth.unit.electric_charge.coulomb"), - 0x2728: ("electric potential difference (volt)", "org.bluetooth.unit.electric_potential_difference.volt"), - 0x2729: ("capacitance (farad)", "org.bluetooth.unit.capacitance.farad"), - 0x272A: ("electric resistance (ohm)", "org.bluetooth.unit.electric_resistance.ohm"), - 0x272B: ("electric conductance (siemens)", "org.bluetooth.unit.electric_conductance.siemens"), - 0x272C: ("magnetic flux (weber)", "org.bluetooth.unit.magnetic_flux.weber"), - 0x272D: ("magnetic flux density (tesla)", "org.bluetooth.unit.magnetic_flux_density.tesla"), - 0x272E: ("inductance (henry)", "org.bluetooth.unit.inductance.henry"), - 0x272F: ("Celsius temperature (degree Celsius)", "org.bluetooth.unit.thermodynamic_temperature.degree_celsius"), - 0x2730: ("luminous flux (lumen)", "org.bluetooth.unit.luminous_flux.lumen"), - 0x2731: ("illuminance (lux)", "org.bluetooth.unit.illuminance.lux"), - 0x2732: ("activity referred to a radionuclide (becquerel)", "org.bluetooth.unit.activity_referred_to_a_radionuclide.becquerel"), - 0x2733: ("absorbed dose (gray)", "org.bluetooth.unit.absorbed_dose.gray"), - 0x2734: ("dose equivalent (sievert)", "org.bluetooth.unit.dose_equivalent.sievert"), - 0x2735: ("catalytic activity (katal)", "org.bluetooth.unit.catalytic_activity.katal"), - 0x2740: ("dynamic viscosity (pascal second)", "org.bluetooth.unit.dynamic_viscosity.pascal_second"), - 0x2741: ("moment of force (newton metre)", "org.bluetooth.unit.moment_of_force.newton_metre"), - 0x2742: ("surface tension (newton per metre)", "org.bluetooth.unit.surface_tension.newton_per_metre"), - 0x2743: ("angular velocity (radian per second)", "org.bluetooth.unit.angular_velocity.radian_per_second"), - 0x2744: ("angular acceleration (radian per second squared)", "org.bluetooth.unit.angular_acceleration.radian_per_second_squared"), - 0x2745: ("heat flux density (watt per square metre)", "org.bluetooth.unit.heat_flux_density.watt_per_square_metre"), - 0x2746: ("heat capacity (joule per kelvin)", "org.bluetooth.unit.heat_capacity.joule_per_kelvin"), - 0x2747: ("specific heat capacity (joule per kilogram kelvin)", "org.bluetooth.unit.specific_heat_capacity.joule_per_kilogram_kelvin"), - 0x2748: ("specific energy (joule per kilogram)", "org.bluetooth.unit.specific_energy.joule_per_kilogram"), - 0x2749: ("thermal conductivity (watt per metre kelvin)", "org.bluetooth.unit.thermal_conductivity.watt_per_metre_kelvin"), - 0x274A: ("energy density (joule per cubic metre)", "org.bluetooth.unit.energy_density.joule_per_cubic_metre"), - 0x274B: ("electric field strength (volt per metre)", "org.bluetooth.unit.electric_field_strength.volt_per_metre"), - 0x274C: ("electric charge density (coulomb per cubic metre)", "org.bluetooth.unit.electric_charge_density.coulomb_per_cubic_metre"), - 0x274D: ("surface charge density (coulomb per square metre)", "org.bluetooth.unit.surface_charge_density.coulomb_per_square_metre"), - 0x274E: ("electric flux density (coulomb per square metre)", "org.bluetooth.unit.electric_flux_density.coulomb_per_square_metre"), - 0x274F: ("permittivity (farad per metre)", "org.bluetooth.unit.permittivity.farad_per_metre"), - 0x2750: ("permeability (henry per metre)", "org.bluetooth.unit.permeability.henry_per_metre"), - 0x2751: ("molar energy (joule per mole)", "org.bluetooth.unit.molar_energy.joule_per_mole"), - 0x2752: ("molar entropy (joule per mole kelvin)", "org.bluetooth.unit.molar_entropy.joule_per_mole_kelvin"), - 0x2753: ("exposure (coulomb per kilogram)", "org.bluetooth.unit.exposure.coulomb_per_kilogram"), - 0x2754: ("absorbed dose rate (gray per second)", "org.bluetooth.unit.absorbed_dose_rate.gray_per_second"), - 0x2755: ("radiant intensity (watt per steradian)", "org.bluetooth.unit.radiant_intensity.watt_per_steradian"), - 0x2756: ("radiance (watt per square metre steradian)", "org.bluetooth.unit.radiance.watt_per_square_metre_steradian"), - 0x2757: ("catalytic activity concentration (katal per cubic metre)", "org.bluetooth.unit.catalytic_activity_concentration.katal_per_cubic_metre"), - 0x2760: ("time (minute)", "org.bluetooth.unit.time.minute"), - 0x2761: ("time (hour)", "org.bluetooth.unit.time.hour"), - 0x2762: ("time (day)", "org.bluetooth.unit.time.day"), - 0x2763: ("plane angle (degree)", "org.bluetooth.unit.plane_angle.degree"), - 0x2764: ("plane angle (minute)", "org.bluetooth.unit.plane_angle.minute"), - 0x2765: ("plane angle (second)", "org.bluetooth.unit.plane_angle.second"), - 0x2766: ("area (hectare)", "org.bluetooth.unit.area.hectare"), - 0x2767: ("volume (litre)", "org.bluetooth.unit.volume.litre"), - 0x2768: ("mass (tonne)", "org.bluetooth.unit.mass.tonne"), - 0x2780: ("pressure (bar)", "org.bluetooth.unit.pressure.bar"), - 0x2781: ("pressure (millimetre of mercury)", "org.bluetooth.unit.pressure.millimetre_of_mercury"), - 0x2782: ("length (ngstrm)", "org.bluetooth.unit.length.ngstrm"), - 0x2783: ("length (nautical mile)", "org.bluetooth.unit.length.nautical_mile"), - 0x2784: ("area (barn)", "org.bluetooth.unit.area.barn"), - 0x2785: ("velocity (knot)", "org.bluetooth.unit.velocity.knot"), - 0x2786: ("logarithmic radio quantity (neper)", "org.bluetooth.unit.logarithmic_radio_quantity.neper"), - 0x2787: ("logarithmic radio quantity (bel)", "org.bluetooth.unit.logarithmic_radio_quantity.bel"), - 0x27A0: ("length (yard)", "org.bluetooth.unit.length.yard"), - 0x27A1: ("length (parsec)", "org.bluetooth.unit.length.parsec"), - 0x27A2: ("length (inch)", "org.bluetooth.unit.length.inch"), - 0x27A3: ("length (foot)", "org.bluetooth.unit.length.foot"), - 0x27A4: ("length (mile)", "org.bluetooth.unit.length.mile"), - 0x27A5: ("pressure (pound-force per square inch)", "org.bluetooth.unit.pressure.pound_force_per_square_inch"), - 0x27A6: ("velocity (kilometre per hour)", "org.bluetooth.unit.velocity.kilometre_per_hour"), - 0x27A7: ("velocity (mile per hour)", "org.bluetooth.unit.velocity.mile_per_hour"), - 0x27A8: ("angular velocity (revolution per minute)", "org.bluetooth.unit.angular_velocity.revolution_per_minute"), - 0x27A9: ("energy (gram calorie)", "org.bluetooth.unit.energy.gram_calorie"), - 0x27AA: ("energy (kilogram calorie)", "org.bluetooth.unit.energy.kilogram_calorie"), - 0x27AB: ("energy (kilowatt hour)", "org.bluetooth.unit.energy.kilowatt_hour"), - 0x27AC: ("thermodynamic temperature (degree Fahrenheit)", "org.bluetooth.unit.thermodynamic_temperature.degree_fahrenheit"), - 0x27AD: ("percentage", "org.bluetooth.unit.percentage"), - 0x27AE: ("per mille", "org.bluetooth.unit.per_mille"), - 0x27AF: ("period (beats per minute)", "org.bluetooth.unit.period.beats_per_minute"), - 0x27B0: ("electric charge (ampere hours)", "org.bluetooth.unit.electric_charge.ampere_hours"), - 0x27B1: ("mass density (milligram per decilitre)", "org.bluetooth.unit.mass_density.milligram_per_decilitre"), - 0x27B2: ("mass density (millimole per litre)", "org.bluetooth.unit.mass_density.millimole_per_litre"), - 0x27B3: ("time (year)", "org.bluetooth.unit.time.year"), - 0x27B4: ("time (month)", "org.bluetooth.unit.time.month"), - 0x27B5: ("concentration (count per cubic metre)", "org.bluetooth.unit.concentration.count_per_cubic_metre"), - 0x27B6: ("irradiance (watt per square metre)", "org.bluetooth.unit.irradiance.watt_per_square_metre"), - 0x27B7: ("milliliter (per kilogram per minute)", "org.bluetooth.unit.transfer_rate.milliliter_per_kilogram_per_minute"), - 0x27B8: ("mass (pound)", "org.bluetooth.unit.mass.pound"), - 0x27B9: ("metabolic equivalent", "org.bluetooth.unit.metabolic_equivalent"), - 0x27BA: ("step (per minute)", "org.bluetooth.unit.step_per_minute"), - 0x27BC: ("stroke (per minute)", "org.bluetooth.unit.stroke_per_minute"), - 0x27BD: ("pace (kilometre per minute)", "org.bluetooth.unit.velocity.kilometer_per_minute"), - 0x27BE: ("luminous efficacy (lumen per watt)", "org.bluetooth.unit.luminous_efficacy.lumen_per_watt"), - 0x27BF: ("luminous energy (lumen hour)", "org.bluetooth.unit.luminous_energy.lumen_hour"), - 0x27C0: ("luminous exposure (lux hour)", "org.bluetooth.unit.luminous_exposure.lux_hour"), - 0x27C1: ("mass flow (gram per second)", "org.bluetooth.unit.mass_flow.gram_per_second"), - 0x27C2: ("volume flow (litre per second)", "org.bluetooth.unit.volume_flow.litre_per_second") -] #endif diff --git a/Sources/GenerateBluetooth/CompanyIdentifier.swift b/Sources/GenerateBluetooth/CompanyIdentifier.swift index 20c892c5c..bc4d2c345 100644 --- a/Sources/GenerateBluetooth/CompanyIdentifier.swift +++ b/Sources/GenerateBluetooth/CompanyIdentifier.swift @@ -26,7 +26,7 @@ extension CompanyIdentifiersFile { extension GenerateTool { - static func parseFile(input: URL) throws -> [UInt16: String] { + static func parseCompanyIdentifiersFile(input: URL) throws -> [UInt16: String] { let data = try Data(contentsOf: input, options: [.mappedIfSafe]) let decoder = JSONDecoder() let file = try decoder.decode(CompanyIdentifiersFile.self, from: data) @@ -63,7 +63,7 @@ extension GenerateTool { } static func generateCompanyIdentifiers(input: URL, output: [URL]) throws { - let data = try parseFile(input: input) + let data = try parseCompanyIdentifiersFile(input: input) try generateCompanyIdentifierExtensions(data, output: output[0]) try generateCompanyIdentifierNames(data, output: output[1]) } @@ -98,7 +98,7 @@ extension GenerateTool { 🖨("}") try generatedCode.write(toFile: output.path, atomically: true, encoding: .utf8) - print("Generated Swift \(output.path)") + print("Generated \(output.path)") } static func generateCompanyIdentifierNames(_ data: [UInt16: String], output: URL) throws { @@ -132,12 +132,12 @@ extension GenerateTool { 🖨("}") try generatedCode.write(toFile: output.path, atomically: true, encoding: .utf8) - print("Generated Swift \(output.path)") + print("Generated \(output.path)") } static func generateCompanyIdentifierTests(input: URL, output: URL) throws { - let data = try parseFile(input: input) + let data = try parseCompanyIdentifiersFile(input: input) var generatedCode = "" let companies = companyIdentifiers(from: data) @@ -186,6 +186,6 @@ extension GenerateTool { """) try generatedCode.write(toFile: output.path, atomically: true, encoding: .utf8) - print("Generated Swift \(output.path)") + print("Generated \(output.path)") } } diff --git a/Sources/GenerateBluetooth/Extensions/Hexadecimal.swift b/Sources/GenerateBluetooth/Extensions/Hexadecimal.swift new file mode 100644 index 000000000..86d3f75d1 --- /dev/null +++ b/Sources/GenerateBluetooth/Extensions/Hexadecimal.swift @@ -0,0 +1,19 @@ +// +// Hexadecimal.swift +// Bluetooth +// +// Created by Alsey Coleman Miller on 3/2/16. +// Copyright © 2016 PureSwift. All rights reserved. +// + +internal extension FixedWidthInteger { + + func toHexadecimal() -> String { + + var string = String(self, radix: 16) + while string.utf8.count < (MemoryLayout.size * 2) { + string = "0" + string + } + return string.uppercased() + } +} diff --git a/Sources/GenerateBluetooth/Generate.swift b/Sources/GenerateBluetooth/Generate.swift index 5f6c8f6ae..140c56416 100644 --- a/Sources/GenerateBluetooth/Generate.swift +++ b/Sources/GenerateBluetooth/Generate.swift @@ -44,6 +44,33 @@ struct GenerateTool { input: inputFile, output: outputFile ) + case .unitIdentifier: + // parse arguments + guard arguments.count == 5 else { + throw CommandError.invalidArguments(arguments) + } + let inputFile = URL(fileURLWithPath: arguments[2]) + let outputFiles = [ + URL(fileURLWithPath: arguments[3]), + URL(fileURLWithPath: arguments[4]) + ] + // generate files + try generateUnitIdentifiers( + input: inputFile, + output: outputFiles + ) + case .unitIdentifierTests: + // parse arguments + guard arguments.count == 4 else { + throw CommandError.invalidArguments(arguments) + } + let inputFile = URL(fileURLWithPath: arguments[2]) + let outputFile = URL(fileURLWithPath: arguments[3]) + // generate files + try generateUnitIdentifierTests( + input: inputFile, + output: outputFile + ) } } } @@ -52,6 +79,8 @@ enum CommandType: String { case companyIdentifier case companyIdentifierTests + case unitIdentifier + case unitIdentifierTests } enum CommandError: Error { diff --git a/Sources/GenerateBluetooth/UnitIdentifier.swift b/Sources/GenerateBluetooth/UnitIdentifier.swift new file mode 100644 index 000000000..09d1f0625 --- /dev/null +++ b/Sources/GenerateBluetooth/UnitIdentifier.swift @@ -0,0 +1,328 @@ +// +// UnitIdentifier.swift +// Bluetooth +// +// Created by Alsey Coleman Miller on 11/5/24. +// + +import Foundation + +struct UnitIdentifiersFile: Equatable, Hashable, Codable, Sendable { + + var uuids: [Element] +} + +extension UnitIdentifiersFile { + + struct Element: Equatable, Hashable, Codable, Sendable, Identifiable { + + var id: String + + let uuid: UInt16 + + let name: String + } +} + +extension GenerateTool { + + static func parseUnitIdentifiersFile( + input: URL + ) throws -> [UInt16: (id: String, name: String)] { + let data = try Data(contentsOf: input, options: [.mappedIfSafe]) + let decoder = JSONDecoder() + let file = try decoder.decode(UnitIdentifiersFile.self, from: data) + var output = [UInt16: (id: String, name: String)]() + output.reserveCapacity(file.uuids.count) + for element in file.uuids { + output[element.uuid] = (element.id, element.name) + } + return output + } + + static func unitIdentifiers( + from data: [UInt16: (id: String, name: String)] + ) -> [(id: UInt16, name: String, type: String, member: String)] { + let blacklist: [UInt16] = [ + .max // remove internal use identifier + ] + let units = data + .sorted(by: { $0.key < $1.key }) + .filter { blacklist.contains($0.key) == false } + var memberNames = [UInt16: String]() + memberNames.reserveCapacity(units.count) + for (id, metadata) in units { + let memberName = Self.unitMethodNames[id] + ?? metadata.name + .sanitizeName(prefix: "unit") + .llamaCase() + memberNames[id] = memberName + } + return units.map { ($0, $1.name, $1.id, memberNames[$0]!) } + } + + static func generateUnitIdentifiers(input: URL, output: [URL]) throws { + let data = try parseUnitIdentifiersFile(input: input) + try generateUnitIdentifierExtensions(data, output: output[0]) + try generateUnitIdentifierNames(data, output: output[1]) + } + + static func generateUnitIdentifierExtensions(_ data: [UInt16: (id: String, name: String)], output: URL) throws { + + var generatedCode = "" + let units = unitIdentifiers(from: data) + + func 🖨(_ text: String) { + generatedCode += text + "\n" + } + + 🖨("//") + 🖨("// UnitIdentifiers.swift") + 🖨("// Bluetooth") + 🖨("//") + 🖨("") + 🖨("public extension UnitIdentifier {") + 🖨("") + + for (id, name, _, memberName) in units { + + let hexLiteral = "0x" + id.toHexadecimal() + 🖨(" /// " + name + " " + "(`\(hexLiteral)`)") + 🖨(" @_alwaysEmitIntoClient") + 🖨(" static var " + memberName + ": UnitIdentifier {") + 🖨(" return UnitIdentifier(rawValue: \(hexLiteral))") + 🖨(" }") + 🖨("") + } + + 🖨("}") + + try generatedCode.write(toFile: output.path, atomically: true, encoding: .utf8) + print("Generated \(output.path)") + } + + static func generateUnitIdentifierNames(_ data: [UInt16: (id: String, name: String)], output: URL) throws { + + var generatedCode = "" + let units = unitIdentifiers(from: data) + + func 🖨(_ text: String) { + generatedCode += text + "\n" + } + + 🖨("//") + 🖨("// UnitIdentifierNames.swift") + 🖨("// Bluetooth") + 🖨("//") + 🖨("") + 🖨("internal extension UnitIdentifier {") + 🖨("") + 🖨(" static let unitIdentifiers: [UInt16: (name: String, type: String)] = {") + 🖨("") + 🖨(" var unitIdentifiers = [UInt16: (name: String, type: String)]()") + 🖨(" unitIdentifiers.reserveCapacity(\(units.count))") + 🖨("") + + for (id, name, type, _) in units { + let hexLiteral = "0x" + id.toHexadecimal() + 🖨(" unitIdentifiers[\(hexLiteral)] = (#\"\(name)\"#, #\"\(type)\"#)") + } + + 🖨(" return unitIdentifiers") + 🖨(" }()") + 🖨("}") + + try generatedCode.write(toFile: output.path, atomically: true, encoding: .utf8) + print("Generated \(output.path)") + } + + static func generateUnitIdentifierTests(input: URL, output: URL) throws { + + let data = try parseUnitIdentifiersFile(input: input) + + var generatedCode = "" + let units = unitIdentifiers(from: data) + + func 🖨(_ text: String) { + generatedCode += text + "\n" + } + + // generate unit test for extensions + generatedCode = """ + // + // UnitIdentifierTests.swift + // Bluetooth + // + + import XCTest + import Foundation + @testable import Bluetooth + + // swiftlint:disable type_body_length + final class UnitIdentifierTests: XCTestCase { + + func testUnits() { + + + """ + + // generate test methods + + for (id, name, type, memberName) in units { + let hexLiteral = "0x" + id.toHexadecimal() + let description = hexLiteral + " " + "(" + name + ")" + 🖨(""" + // \(name) + XCTAssertEqual(UnitIdentifier.\(memberName).rawValue, \(hexLiteral)) + XCTAssertEqual(UnitIdentifier.\(memberName).type, #\"\(type)\"#) + XCTAssertEqual(UnitIdentifier.\(memberName).name, #\"\(name)\"#) + XCTAssertEqual(UnitIdentifier.\(memberName).description, #\"\(description)\"#) + + """) + } + + 🖨(""" + } + + } + // swiftlint:enable type_body_length + """) + + try generatedCode.write(toFile: output.path, atomically: true, encoding: .utf8) + print("Generated \(output.path)") + } +} + +private extension GenerateTool { + + static var unitMethodNames: [UInt16: String] { + [ + 0x2700: "unitless", + 0x2701: "metre", + 0x2702: "kilogram", + 0x2703: "second", + 0x2704: "ampere", + 0x2705: "kelvin", + 0x2706: "mole", + 0x2707: "candela", + 0x2710: "area", + 0x2711: "volume", + 0x2712: "velocity", + 0x2713: "acceleration", + 0x2714: "wavenumber", + 0x2715: "density", + 0x2716: "surfaceDensity", + 0x2717: "specificVolume", + 0x2718: "currentDensity", + 0x2719: "magneticFieldStrengh", + 0x271A: "amountConcentration", + 0x271B: "massConcentration", + 0x271C: "luminance", + 0x271D: "refractiveIndex", + 0x271E: "relativePermeability", + 0x2720: "planeAngle", + 0x2721: "solidAngle", + 0x2722: "frequency", + 0x2723: "force", + 0x2724: "pascalPressure", + 0x2725: "energy", + 0x2726: "power", + 0x2727: "coulomb", + 0x2728: "electricPotential", + 0x2729: "capitance", + 0x272A: "electricResistance", + 0x272B: "electricConductance", + 0x272C: "magneticFlux", + 0x272D: "magneticFluxDensity", + 0x272E: "inductance", + 0x272F: "celsius", + 0x2730: "luminousFlux", + 0x2731: "illuminance", + 0x2732: "becquerel", + 0x2733: "absorbedDose", + 0x2734: "sievert", + 0x2735: "katal", + 0x2740: "pascalSecond", + 0x2741: "newtonMetre", + 0x2742: "surfaceTension", + 0x2743: "angularVelocity", + 0x2744: "angularAcceleration", + 0x2745: "heatFluxDensity", + 0x2746: "heatCapacity", + 0x2747: "specificHeatCapacity", + 0x2748: "specificEnergy", + 0x2749: "thermalConductivity", + 0x274A: "energyDensity", + 0x274B: "electricFieldStrength", + 0x274C: "electricChargeDensity", + 0x274D: "surfaceChargeDensity", + 0x274E: "electricFluxDensity", + 0x274F: "permittivity", + 0x2750: "permeability", + 0x2751: "molarEnergy", + 0x2752: "molarEntropy", + 0x2753: "exposure", + 0x2754: "absorbedDoseRate", + 0x2755: "radradiantIntensityiance", + 0x2756: "radiance", + 0x2757: "catalyticActivity", + 0x2760: "minute", + 0x2761: "hour", + 0x2762: "day", + 0x2763: "degree", + 0x2764: "planeAngleMinute", + 0x2765: "planeAngleSecond", + 0x2766: "hectare", + 0x2767: "litre", + 0x2768: "tonne", + 0x2780: "bar", + 0x2781: "millimetreOfMercury", + 0x2782: "ngstrm", + 0x2783: "nauticalMile", + 0x2784: "barn", + 0x2785: "velocityKnot", + 0x2786: "neper", + 0x2787: "bel", + 0x27A0: "yard", + 0x27A1: "parsec", + 0x27A2: "inch", + 0x27A3: "foot", + 0x27A4: "mile", + 0x27A5: "pressurePoundForce", + 0x27A6: "kilometrePerHour", + 0x27A7: "milePerHour", + 0x27A8: "revolutionPerMinute", + 0x27A9: "gramCalorie", + 0x27AA: "kilogramCalorie", + 0x27AB: "kilowattHour", + 0x27AC: "degreeFahrenheit", + 0x27AD: "percentage", + 0x27AE: "perMille", + 0x27AF: "beatsPerMinute", + 0x27B0: "ampereHours", + 0x27B1: "milligramPerDecilitre", + 0x27B2: "millimolePerLitre", + 0x27B3: "year", + 0x27B4: "month", + 0x27B5: "concentration", + 0x27B6: "irrandiance", + 0x27B7: "millilitre", + 0x27B8: "pound", + 0x27B9: "metabolicEquivalent", + 0x27BA: "step", + 0x27BC: "stroke", + 0x27BD: "pace", + 0x27BE: "luminousEfficacy", + 0x27BF: "luminousEnergy", + 0x27C0: "luminousExposure", + 0x27C1: "massFlow", + 0x27C2: "volumeFlow", + 0x27C3: "soundPressure", + 0x27C4: "partsPerMillion", + 0x27C5: "partsPerBillion", + 0x27C6: "massDensityRate", + 0x27C7: "kilovoltAmpereHour", + 0x27C8: "voltAmpere" + ] + } +} diff --git a/Tests/BluetoothTests/DarwinTests.swift b/Tests/BluetoothTests/DarwinTests.swift index 8c1535efe..1acafd6ab 100644 --- a/Tests/BluetoothTests/DarwinTests.swift +++ b/Tests/BluetoothTests/DarwinTests.swift @@ -167,7 +167,7 @@ final class DarwinTests: XCTestCase { var filename = NSTemporaryDirectory() + "DefinedUUIDExtension.swift" XCTAssertNoThrow(try generatedCode.write(toFile: filename, atomically: true, encoding: .utf8)) - print("Generated Swift code \(filename)") + print("Generated code \(filename)") // generate unit test for extensions generatedCode = "" @@ -222,238 +222,7 @@ final class DarwinTests: XCTestCase { filename = NSTemporaryDirectory() + "DefinedUUIDTests.swift" XCTAssertNoThrow(try generatedCode.write(toFile: filename, atomically: true, encoding: .utf8)) - print("Generated Swift code \(filename)") - } - - func testGenerateUnitIdentifier() { - - let unitsMethodNames: [UInt16: String] = [ - 0x2700: "unitless", - 0x2701: "metre", - 0x2702: "kilogram", - 0x2703: "second", - 0x2704: "ampere", - 0x2705: "kelvin", - 0x2706: "mole", - 0x2707: "candela", - 0x2710: "area", - 0x2711: "volume", - 0x2712: "velocity", - 0x2713: "acceleration", - 0x2714: "wavenumber", - 0x2715: "density", - 0x2716: "surfaceDensity", - 0x2717: "specificVolume", - 0x2718: "currentDensity", - 0x2719: "magneticFieldStrengh", - 0x271A: "amountConcentration", - 0x271B: "massConcentration", - 0x271C: "luminance", - 0x271D: "refractiveIndex", - 0x271E: "relativePermeability", - 0x2720: "planeAngle", - 0x2721: "solidAngle", - 0x2722: "frequency", - 0x2723: "force", - 0x2724: "pascalPressure", - 0x2725: "energy", - 0x2726: "power", - 0x2727: "coulomb", - 0x2728: "electricPotential", - 0x2729: "capitance", - 0x272A: "electricResistance", - 0x272B: "electricConductance", - 0x272C: "magneticFlux", - 0x272D: "magneticFluxDensity", - 0x272E: "inductance", - 0x272F: "celsius", - 0x2730: "luminousFlux", - 0x2731: "illuminance", - 0x2732: "becquerel", - 0x2733: "absorbedDose", - 0x2734: "sievert", - 0x2735: "katal", - 0x2740: "pascalSecond", - 0x2741: "newtonMetre", - 0x2742: "surfaceTension", - 0x2743: "angularVelocity", - 0x2744: "angularAcceleration", - 0x2745: "heatFluxDensity", - 0x2746: "heatCapacity", - 0x2747: "specificHeatCapacity", - 0x2748: "specificEnergy", - 0x2749: "thermalConductivity", - 0x274A: "energyDensity", - 0x274B: "electricFieldStrength", - 0x274C: "electricChargeDensity", - 0x274D: "surfaceChargeDensity", - 0x274E: "electricFluxDensity", - 0x274F: "permittivity", - 0x2750: "permeability", - 0x2751: "molarEnergy", - 0x2752: "molarEntropy", - 0x2753: "exposure", - 0x2754: "absorbedDoseRate", - 0x2755: "radradiantIntensityiance", - 0x2756: "radiance", - 0x2757: "catalyticActivity", - 0x2760: "minute", - 0x2761: "hour", - 0x2762: "day", - 0x2763: "degree", - 0x2764: "planeAngleMinute", - 0x2765: "planeAngleSecond", - 0x2766: "hectare", - 0x2767: "litre", - 0x2768: "tonne", - 0x2780: "bar", - 0x2781: "millimetreOfMercury", - 0x2782: "ngstrm", - 0x2783: "nauticalMile", - 0x2784: "barn", - 0x2785: "velocityKnot", - 0x2786: "neper", - 0x2787: "bel", - 0x27A0: "yard", - 0x27A1: "parsec", - 0x27A2: "inch", - 0x27A3: "foot", - 0x27A4: "mile", - 0x27A5: "pressurePoundForce", - 0x27A6: "kilometrePerHour", - 0x27A7: "milePerHour", - 0x27A8: "revolutionPerMinute", - 0x27A9: "gramCalorie", - 0x27AA: "kilogramCalorie", - 0x27AB: "kilowattHour", - 0x27AC: "degreeFahrenheit", - 0x27AD: "percentage", - 0x27AE: "perMille", - 0x27AF: "beatsPerMinute", - 0x27B0: "ampereHours", - 0x27B1: "milligramPerDecilitre", - 0x27B2: "millimolePerLitre", - 0x27B3: "year", - 0x27B4: "month", - 0x27B5: "concentration", - 0x27B6: "irrandiance", - 0x27B7: "millilitre", - 0x27B8: "pound", - 0x27B9: "metabolicEquivalent", - 0x27BA: "step", - 0x27BC: "stroke", - 0x27BD: "pace", - 0x27BE: "luminousEfficacy", - 0x27BF: "luminousEnergy", - 0x27C0: "luminousExposure", - 0x27C1: "massFlow", - 0x27C2: "volumeFlow" - ] - - var generatedCode = "" - - var memberNameCache = [UInt16: String]() - - func 🖨(_ text: String) { - generatedCode += text + "\n" - } - - let dateFormatter = DateFormatter() - dateFormatter.dateStyle = .short - dateFormatter.timeStyle = .none - - let fileDate = dateFormatter.string(from: Date()) - - 🖨("//") - 🖨("// UnitIdentifierExtension.swift") - 🖨("// Bluetooth") - 🖨("//") - 🖨("") - 🖨("public extension UnitIdentifier {") - 🖨("") - - for (identifier, unit) in units.sorted(by: { $0.key < $1.key }) { - - var memberName = unitsMethodNames[identifier]! - - // prevent duplicate entries - var duplicateNumber = 1 - while memberNameCache.values.contains(memberName) { - - duplicateNumber += 1 - memberName = memberName + "\(duplicateNumber)" - } - - let hexValue = "0x\(identifier.toHexadecimal())" - let comment = unit.name + " " + "(`\(hexValue)`)" - - 🖨(" /// " + comment) - 🖨(" static var " + memberName + ": UnitIdentifier {") - 🖨(" return UnitIdentifier(rawValue: \(hexValue))") - 🖨(" }") - 🖨("") - - memberNameCache[identifier] = memberName - } - - 🖨("}") - - var filename = NSTemporaryDirectory() + "UnitIdentifierExtension.swift" - XCTAssertNoThrow(try generatedCode.write(toFile: filename, atomically: true, encoding: .utf8)) - - print("Generated Swift code \(filename)") - - // generate unit test for extensions - generatedCode = "" - - 🖨("//") - 🖨("// UnitIdentifierTests.swift") - 🖨("// Bluetooth") - 🖨("//") - 🖨("// Generated by Carlos Duclos on \(fileDate).") - 🖨("//") - 🖨("") - 🖨("import XCTest") - 🖨("import Foundation") - 🖨("@testable import Bluetooth") - 🖨("") - 🖨("// swiftlint:disable type_body_length") - 🖨("final class UnitIdentifierTests: XCTestCase {") - 🖨("") - 🖨(" static let allTests = [") - 🖨(" (\"testUnits\", testUnits)") - 🖨(" ]") - 🖨("") - 🖨(" func testUnits() {") - 🖨("") - - // generate test methods - - for (identifier, unit) in units.sorted(by: { $0.key < $1.key }) { - - guard let memberName = memberNameCache[identifier] - else { XCTFail("No extension generated for \(identifier)"); return } - - let stringLiteral = unit.name.replacingOccurrences(of: "\"", with: "\\\"") - let hexValue = "0x\(identifier.toHexadecimal())" - - 🖨(" /// \(unit.name)") - 🖨(" XCTAssertEqual(UnitIdentifier.\(memberName).rawValue, \(hexValue))") - 🖨(" XCTAssertEqual(UnitIdentifier.\(memberName).type, \"\(unit.type)\")") - 🖨(" XCTAssertEqual(UnitIdentifier.\(memberName).name, \"\(stringLiteral)\")") - 🖨(" XCTAssertEqual(UnitIdentifier.\(memberName).description, \"\(identifier.toHexadecimal()) (\(stringLiteral))\")") - 🖨("") - } - - 🖨(" }") - 🖨("") - 🖨("}") - 🖨("// swiftlint:enable type_body_length") - - filename = NSTemporaryDirectory() + "UnitIdentifierTests.swift" - XCTAssertNoThrow(try generatedCode.write(toFile: filename, atomically: true, encoding: .utf8)) - - print("Generated Swift code \(filename)") + print("Generated code \(filename)") } } diff --git a/Tests/BluetoothTests/GATTCharacteristicTests.swift b/Tests/BluetoothTests/GATTCharacteristicTests.swift index f939c1330..3121e35a0 100644 --- a/Tests/BluetoothTests/GATTCharacteristicTests.swift +++ b/Tests/BluetoothTests/GATTCharacteristicTests.swift @@ -114,7 +114,7 @@ final class GATTCharacteristicTests: XCTestCase { (101 ... UInt8.max).forEach { XCTAssertNil(GATTBatteryLevel(data: Data([$0]))) } // test percentage - XCTAssertEqual(GATTBatteryPercentage.unitType.description, "27AD (percentage)") + XCTAssertEqual(GATTBatteryPercentage.unitType.description, "0x27AD (percentage)") XCTAssertEqual(GATTBatteryPercentage.unitType.type, "org.bluetooth.unit.percentage") XCTAssertEqual(GATTBatteryPercentage.unitType, .percentage) (0 ... 100).forEach { XCTAssertNotNil(GATTBatteryPercentage(rawValue: $0)) } @@ -1450,4 +1450,4 @@ final class GATTCharacteristicTests: XCTestCase { XCTAssertEqual(GATTObjectID(data: data), GATTObjectID(data: data)) } } -#endif \ No newline at end of file +#endif diff --git a/Tests/BluetoothTests/Generated/GeneratedUnitIdentifierTests.swift b/Tests/BluetoothTests/Generated/GeneratedUnitIdentifierTests.swift new file mode 100644 index 000000000..9ace09fba --- /dev/null +++ b/Tests/BluetoothTests/Generated/GeneratedUnitIdentifierTests.swift @@ -0,0 +1,776 @@ +// +// UnitIdentifierTests.swift +// Bluetooth +// + +import XCTest +import Foundation +@testable import Bluetooth + +// swiftlint:disable type_body_length +#if (swift(<5.6) || !SWIFTPM_ENABLE_PLUGINS) && !os(WASI) +final class UnitIdentifierTests: XCTestCase { + + func testUnits() { + + // unitless + XCTAssertEqual(UnitIdentifier.unitless.rawValue, 0x2700) + XCTAssertEqual(UnitIdentifier.unitless.type, #"org.bluetooth.unit.unitless"#) + XCTAssertEqual(UnitIdentifier.unitless.name, #"unitless"#) + XCTAssertEqual(UnitIdentifier.unitless.description, #"0x2700 (unitless)"#) + + // length (metre) + XCTAssertEqual(UnitIdentifier.metre.rawValue, 0x2701) + XCTAssertEqual(UnitIdentifier.metre.type, #"org.bluetooth.unit.length.metre"#) + XCTAssertEqual(UnitIdentifier.metre.name, #"length (metre)"#) + XCTAssertEqual(UnitIdentifier.metre.description, #"0x2701 (length (metre))"#) + + // mass (kilogram) + XCTAssertEqual(UnitIdentifier.kilogram.rawValue, 0x2702) + XCTAssertEqual(UnitIdentifier.kilogram.type, #"org.bluetooth.unit.mass.kilogram"#) + XCTAssertEqual(UnitIdentifier.kilogram.name, #"mass (kilogram)"#) + XCTAssertEqual(UnitIdentifier.kilogram.description, #"0x2702 (mass (kilogram))"#) + + // time (second) + XCTAssertEqual(UnitIdentifier.second.rawValue, 0x2703) + XCTAssertEqual(UnitIdentifier.second.type, #"org.bluetooth.unit.time.second"#) + XCTAssertEqual(UnitIdentifier.second.name, #"time (second)"#) + XCTAssertEqual(UnitIdentifier.second.description, #"0x2703 (time (second))"#) + + // electric current (ampere) + XCTAssertEqual(UnitIdentifier.ampere.rawValue, 0x2704) + XCTAssertEqual(UnitIdentifier.ampere.type, #"org.bluetooth.unit.electric_current.ampere"#) + XCTAssertEqual(UnitIdentifier.ampere.name, #"electric current (ampere)"#) + XCTAssertEqual(UnitIdentifier.ampere.description, #"0x2704 (electric current (ampere))"#) + + // thermodynamic temperature (kelvin) + XCTAssertEqual(UnitIdentifier.kelvin.rawValue, 0x2705) + XCTAssertEqual(UnitIdentifier.kelvin.type, #"org.bluetooth.unit.thermodynamic_temperature.kelvin"#) + XCTAssertEqual(UnitIdentifier.kelvin.name, #"thermodynamic temperature (kelvin)"#) + XCTAssertEqual(UnitIdentifier.kelvin.description, #"0x2705 (thermodynamic temperature (kelvin))"#) + + // amount of substance (mole) + XCTAssertEqual(UnitIdentifier.mole.rawValue, 0x2706) + XCTAssertEqual(UnitIdentifier.mole.type, #"org.bluetooth.unit.amount_of_substance.mole"#) + XCTAssertEqual(UnitIdentifier.mole.name, #"amount of substance (mole)"#) + XCTAssertEqual(UnitIdentifier.mole.description, #"0x2706 (amount of substance (mole))"#) + + // luminous intensity (candela) + XCTAssertEqual(UnitIdentifier.candela.rawValue, 0x2707) + XCTAssertEqual(UnitIdentifier.candela.type, #"org.bluetooth.unit.luminous_intensity.candela"#) + XCTAssertEqual(UnitIdentifier.candela.name, #"luminous intensity (candela)"#) + XCTAssertEqual(UnitIdentifier.candela.description, #"0x2707 (luminous intensity (candela))"#) + + // area (square metres) + XCTAssertEqual(UnitIdentifier.area.rawValue, 0x2710) + XCTAssertEqual(UnitIdentifier.area.type, #"org.bluetooth.unit.area.square_metres"#) + XCTAssertEqual(UnitIdentifier.area.name, #"area (square metres)"#) + XCTAssertEqual(UnitIdentifier.area.description, #"0x2710 (area (square metres))"#) + + // volume (cubic metres) + XCTAssertEqual(UnitIdentifier.volume.rawValue, 0x2711) + XCTAssertEqual(UnitIdentifier.volume.type, #"org.bluetooth.unit.volume.cubic_metres"#) + XCTAssertEqual(UnitIdentifier.volume.name, #"volume (cubic metres)"#) + XCTAssertEqual(UnitIdentifier.volume.description, #"0x2711 (volume (cubic metres))"#) + + // velocity (metres per second) + XCTAssertEqual(UnitIdentifier.velocity.rawValue, 0x2712) + XCTAssertEqual(UnitIdentifier.velocity.type, #"org.bluetooth.unit.velocity.metres_per_second"#) + XCTAssertEqual(UnitIdentifier.velocity.name, #"velocity (metres per second)"#) + XCTAssertEqual(UnitIdentifier.velocity.description, #"0x2712 (velocity (metres per second))"#) + + // acceleration (metres per second squared) + XCTAssertEqual(UnitIdentifier.acceleration.rawValue, 0x2713) + XCTAssertEqual(UnitIdentifier.acceleration.type, #"org.bluetooth.unit.acceleration.metres_per_second_squared"#) + XCTAssertEqual(UnitIdentifier.acceleration.name, #"acceleration (metres per second squared)"#) + XCTAssertEqual(UnitIdentifier.acceleration.description, #"0x2713 (acceleration (metres per second squared))"#) + + // wavenumber (reciprocal metre) + XCTAssertEqual(UnitIdentifier.wavenumber.rawValue, 0x2714) + XCTAssertEqual(UnitIdentifier.wavenumber.type, #"org.bluetooth.unit.wavenumber.reciprocal_metre"#) + XCTAssertEqual(UnitIdentifier.wavenumber.name, #"wavenumber (reciprocal metre)"#) + XCTAssertEqual(UnitIdentifier.wavenumber.description, #"0x2714 (wavenumber (reciprocal metre))"#) + + // density (kilogram per cubic metre) + XCTAssertEqual(UnitIdentifier.density.rawValue, 0x2715) + XCTAssertEqual(UnitIdentifier.density.type, #"org.bluetooth.unit.density.kilogram_per_cubic_metre"#) + XCTAssertEqual(UnitIdentifier.density.name, #"density (kilogram per cubic metre)"#) + XCTAssertEqual(UnitIdentifier.density.description, #"0x2715 (density (kilogram per cubic metre))"#) + + // surface density (kilogram per square metre) + XCTAssertEqual(UnitIdentifier.surfaceDensity.rawValue, 0x2716) + XCTAssertEqual(UnitIdentifier.surfaceDensity.type, #"org.bluetooth.unit.surface_density.kilogram_per_square_metre"#) + XCTAssertEqual(UnitIdentifier.surfaceDensity.name, #"surface density (kilogram per square metre)"#) + XCTAssertEqual(UnitIdentifier.surfaceDensity.description, #"0x2716 (surface density (kilogram per square metre))"#) + + // specific volume (cubic metre per kilogram) + XCTAssertEqual(UnitIdentifier.specificVolume.rawValue, 0x2717) + XCTAssertEqual(UnitIdentifier.specificVolume.type, #"org.bluetooth.unit.specific_volume.cubic_metre_per_kilogram"#) + XCTAssertEqual(UnitIdentifier.specificVolume.name, #"specific volume (cubic metre per kilogram)"#) + XCTAssertEqual(UnitIdentifier.specificVolume.description, #"0x2717 (specific volume (cubic metre per kilogram))"#) + + // current density (ampere per square metre) + XCTAssertEqual(UnitIdentifier.currentDensity.rawValue, 0x2718) + XCTAssertEqual(UnitIdentifier.currentDensity.type, #"org.bluetooth.unit.current_density.ampere_per_square_metre"#) + XCTAssertEqual(UnitIdentifier.currentDensity.name, #"current density (ampere per square metre)"#) + XCTAssertEqual(UnitIdentifier.currentDensity.description, #"0x2718 (current density (ampere per square metre))"#) + + // magnetic field strength (ampere per metre) + XCTAssertEqual(UnitIdentifier.magneticFieldStrengh.rawValue, 0x2719) + XCTAssertEqual(UnitIdentifier.magneticFieldStrengh.type, #"org.bluetooth.unit.magnetic_field_strength.ampere_per_metre"#) + XCTAssertEqual(UnitIdentifier.magneticFieldStrengh.name, #"magnetic field strength (ampere per metre)"#) + XCTAssertEqual(UnitIdentifier.magneticFieldStrengh.description, #"0x2719 (magnetic field strength (ampere per metre))"#) + + // amount concentration (mole per cubic metre) + XCTAssertEqual(UnitIdentifier.amountConcentration.rawValue, 0x271A) + XCTAssertEqual(UnitIdentifier.amountConcentration.type, #"org.bluetooth.unit.amount_concentration.mole_per_cubic_metre"#) + XCTAssertEqual(UnitIdentifier.amountConcentration.name, #"amount concentration (mole per cubic metre)"#) + XCTAssertEqual(UnitIdentifier.amountConcentration.description, #"0x271A (amount concentration (mole per cubic metre))"#) + + // mass concentration (kilogram per cubic metre) + XCTAssertEqual(UnitIdentifier.massConcentration.rawValue, 0x271B) + XCTAssertEqual(UnitIdentifier.massConcentration.type, #"org.bluetooth.unit.mass_concentration.kilogram_per_cubic_metre"#) + XCTAssertEqual(UnitIdentifier.massConcentration.name, #"mass concentration (kilogram per cubic metre)"#) + XCTAssertEqual(UnitIdentifier.massConcentration.description, #"0x271B (mass concentration (kilogram per cubic metre))"#) + + // luminance (candela per square metre) + XCTAssertEqual(UnitIdentifier.luminance.rawValue, 0x271C) + XCTAssertEqual(UnitIdentifier.luminance.type, #"org.bluetooth.unit.luminance.candela_per_square_metre"#) + XCTAssertEqual(UnitIdentifier.luminance.name, #"luminance (candela per square metre)"#) + XCTAssertEqual(UnitIdentifier.luminance.description, #"0x271C (luminance (candela per square metre))"#) + + // refractive index + XCTAssertEqual(UnitIdentifier.refractiveIndex.rawValue, 0x271D) + XCTAssertEqual(UnitIdentifier.refractiveIndex.type, #"org.bluetooth.unit.refractive_index"#) + XCTAssertEqual(UnitIdentifier.refractiveIndex.name, #"refractive index"#) + XCTAssertEqual(UnitIdentifier.refractiveIndex.description, #"0x271D (refractive index)"#) + + // relative permeability + XCTAssertEqual(UnitIdentifier.relativePermeability.rawValue, 0x271E) + XCTAssertEqual(UnitIdentifier.relativePermeability.type, #"org.bluetooth.unit.relative_permeability"#) + XCTAssertEqual(UnitIdentifier.relativePermeability.name, #"relative permeability"#) + XCTAssertEqual(UnitIdentifier.relativePermeability.description, #"0x271E (relative permeability)"#) + + // plane angle (radian) + XCTAssertEqual(UnitIdentifier.planeAngle.rawValue, 0x2720) + XCTAssertEqual(UnitIdentifier.planeAngle.type, #"org.bluetooth.unit.plane_angle.radian"#) + XCTAssertEqual(UnitIdentifier.planeAngle.name, #"plane angle (radian)"#) + XCTAssertEqual(UnitIdentifier.planeAngle.description, #"0x2720 (plane angle (radian))"#) + + // solid angle (steradian) + XCTAssertEqual(UnitIdentifier.solidAngle.rawValue, 0x2721) + XCTAssertEqual(UnitIdentifier.solidAngle.type, #"org.bluetooth.unit.solid_angle.steradian"#) + XCTAssertEqual(UnitIdentifier.solidAngle.name, #"solid angle (steradian)"#) + XCTAssertEqual(UnitIdentifier.solidAngle.description, #"0x2721 (solid angle (steradian))"#) + + // frequency (hertz) + XCTAssertEqual(UnitIdentifier.frequency.rawValue, 0x2722) + XCTAssertEqual(UnitIdentifier.frequency.type, #"org.bluetooth.unit.frequency.hertz"#) + XCTAssertEqual(UnitIdentifier.frequency.name, #"frequency (hertz)"#) + XCTAssertEqual(UnitIdentifier.frequency.description, #"0x2722 (frequency (hertz))"#) + + // force (newton) + XCTAssertEqual(UnitIdentifier.force.rawValue, 0x2723) + XCTAssertEqual(UnitIdentifier.force.type, #"org.bluetooth.unit.force.newton"#) + XCTAssertEqual(UnitIdentifier.force.name, #"force (newton)"#) + XCTAssertEqual(UnitIdentifier.force.description, #"0x2723 (force (newton))"#) + + // pressure (pascal) + XCTAssertEqual(UnitIdentifier.pascalPressure.rawValue, 0x2724) + XCTAssertEqual(UnitIdentifier.pascalPressure.type, #"org.bluetooth.unit.pressure.pascal"#) + XCTAssertEqual(UnitIdentifier.pascalPressure.name, #"pressure (pascal)"#) + XCTAssertEqual(UnitIdentifier.pascalPressure.description, #"0x2724 (pressure (pascal))"#) + + // energy (joule) + XCTAssertEqual(UnitIdentifier.energy.rawValue, 0x2725) + XCTAssertEqual(UnitIdentifier.energy.type, #"org.bluetooth.unit.energy.joule"#) + XCTAssertEqual(UnitIdentifier.energy.name, #"energy (joule)"#) + XCTAssertEqual(UnitIdentifier.energy.description, #"0x2725 (energy (joule))"#) + + // power (watt) + XCTAssertEqual(UnitIdentifier.power.rawValue, 0x2726) + XCTAssertEqual(UnitIdentifier.power.type, #"org.bluetooth.unit.power.watt"#) + XCTAssertEqual(UnitIdentifier.power.name, #"power (watt)"#) + XCTAssertEqual(UnitIdentifier.power.description, #"0x2726 (power (watt))"#) + + // electric charge (coulomb) + XCTAssertEqual(UnitIdentifier.coulomb.rawValue, 0x2727) + XCTAssertEqual(UnitIdentifier.coulomb.type, #"org.bluetooth.unit.electric_charge.coulomb"#) + XCTAssertEqual(UnitIdentifier.coulomb.name, #"electric charge (coulomb)"#) + XCTAssertEqual(UnitIdentifier.coulomb.description, #"0x2727 (electric charge (coulomb))"#) + + // electric potential difference (volt) + XCTAssertEqual(UnitIdentifier.electricPotential.rawValue, 0x2728) + XCTAssertEqual(UnitIdentifier.electricPotential.type, #"org.bluetooth.unit.electric_potential_difference.volt"#) + XCTAssertEqual(UnitIdentifier.electricPotential.name, #"electric potential difference (volt)"#) + XCTAssertEqual(UnitIdentifier.electricPotential.description, #"0x2728 (electric potential difference (volt))"#) + + // capacitance (farad) + XCTAssertEqual(UnitIdentifier.capitance.rawValue, 0x2729) + XCTAssertEqual(UnitIdentifier.capitance.type, #"org.bluetooth.unit.capacitance.farad"#) + XCTAssertEqual(UnitIdentifier.capitance.name, #"capacitance (farad)"#) + XCTAssertEqual(UnitIdentifier.capitance.description, #"0x2729 (capacitance (farad))"#) + + // electric resistance (ohm) + XCTAssertEqual(UnitIdentifier.electricResistance.rawValue, 0x272A) + XCTAssertEqual(UnitIdentifier.electricResistance.type, #"org.bluetooth.unit.electric_resistance.ohm"#) + XCTAssertEqual(UnitIdentifier.electricResistance.name, #"electric resistance (ohm)"#) + XCTAssertEqual(UnitIdentifier.electricResistance.description, #"0x272A (electric resistance (ohm))"#) + + // electric conductance (siemens) + XCTAssertEqual(UnitIdentifier.electricConductance.rawValue, 0x272B) + XCTAssertEqual(UnitIdentifier.electricConductance.type, #"org.bluetooth.unit.electric_conductance.siemens"#) + XCTAssertEqual(UnitIdentifier.electricConductance.name, #"electric conductance (siemens)"#) + XCTAssertEqual(UnitIdentifier.electricConductance.description, #"0x272B (electric conductance (siemens))"#) + + // magnetic flux (weber) + XCTAssertEqual(UnitIdentifier.magneticFlux.rawValue, 0x272C) + XCTAssertEqual(UnitIdentifier.magneticFlux.type, #"org.bluetooth.unit.magnetic_flux.weber"#) + XCTAssertEqual(UnitIdentifier.magneticFlux.name, #"magnetic flux (weber)"#) + XCTAssertEqual(UnitIdentifier.magneticFlux.description, #"0x272C (magnetic flux (weber))"#) + + // magnetic flux density (tesla) + XCTAssertEqual(UnitIdentifier.magneticFluxDensity.rawValue, 0x272D) + XCTAssertEqual(UnitIdentifier.magneticFluxDensity.type, #"org.bluetooth.unit.magnetic_flux_density.tesla"#) + XCTAssertEqual(UnitIdentifier.magneticFluxDensity.name, #"magnetic flux density (tesla)"#) + XCTAssertEqual(UnitIdentifier.magneticFluxDensity.description, #"0x272D (magnetic flux density (tesla))"#) + + // inductance (henry) + XCTAssertEqual(UnitIdentifier.inductance.rawValue, 0x272E) + XCTAssertEqual(UnitIdentifier.inductance.type, #"org.bluetooth.unit.inductance.henry"#) + XCTAssertEqual(UnitIdentifier.inductance.name, #"inductance (henry)"#) + XCTAssertEqual(UnitIdentifier.inductance.description, #"0x272E (inductance (henry))"#) + + // Celsius temperature (degree Celsius) + XCTAssertEqual(UnitIdentifier.celsius.rawValue, 0x272F) + XCTAssertEqual(UnitIdentifier.celsius.type, #"org.bluetooth.unit.thermodynamic_temperature.degree_celsius"#) + XCTAssertEqual(UnitIdentifier.celsius.name, #"Celsius temperature (degree Celsius)"#) + XCTAssertEqual(UnitIdentifier.celsius.description, #"0x272F (Celsius temperature (degree Celsius))"#) + + // luminous flux (lumen) + XCTAssertEqual(UnitIdentifier.luminousFlux.rawValue, 0x2730) + XCTAssertEqual(UnitIdentifier.luminousFlux.type, #"org.bluetooth.unit.luminous_flux.lumen"#) + XCTAssertEqual(UnitIdentifier.luminousFlux.name, #"luminous flux (lumen)"#) + XCTAssertEqual(UnitIdentifier.luminousFlux.description, #"0x2730 (luminous flux (lumen))"#) + + // illuminance (lux) + XCTAssertEqual(UnitIdentifier.illuminance.rawValue, 0x2731) + XCTAssertEqual(UnitIdentifier.illuminance.type, #"org.bluetooth.unit.illuminance.lux"#) + XCTAssertEqual(UnitIdentifier.illuminance.name, #"illuminance (lux)"#) + XCTAssertEqual(UnitIdentifier.illuminance.description, #"0x2731 (illuminance (lux))"#) + + // activity referred to a radionuclide (becquerel) + XCTAssertEqual(UnitIdentifier.becquerel.rawValue, 0x2732) + XCTAssertEqual(UnitIdentifier.becquerel.type, #"org.bluetooth.unit.activity_referred_to_a_radionuclide.becquerel"#) + XCTAssertEqual(UnitIdentifier.becquerel.name, #"activity referred to a radionuclide (becquerel)"#) + XCTAssertEqual(UnitIdentifier.becquerel.description, #"0x2732 (activity referred to a radionuclide (becquerel))"#) + + // absorbed dose (gray) + XCTAssertEqual(UnitIdentifier.absorbedDose.rawValue, 0x2733) + XCTAssertEqual(UnitIdentifier.absorbedDose.type, #"org.bluetooth.unit.absorbed_dose.gray"#) + XCTAssertEqual(UnitIdentifier.absorbedDose.name, #"absorbed dose (gray)"#) + XCTAssertEqual(UnitIdentifier.absorbedDose.description, #"0x2733 (absorbed dose (gray))"#) + + // dose equivalent (sievert) + XCTAssertEqual(UnitIdentifier.sievert.rawValue, 0x2734) + XCTAssertEqual(UnitIdentifier.sievert.type, #"org.bluetooth.unit.dose_equivalent.sievert"#) + XCTAssertEqual(UnitIdentifier.sievert.name, #"dose equivalent (sievert)"#) + XCTAssertEqual(UnitIdentifier.sievert.description, #"0x2734 (dose equivalent (sievert))"#) + + // catalytic activity (katal) + XCTAssertEqual(UnitIdentifier.katal.rawValue, 0x2735) + XCTAssertEqual(UnitIdentifier.katal.type, #"org.bluetooth.unit.catalytic_activity.katal"#) + XCTAssertEqual(UnitIdentifier.katal.name, #"catalytic activity (katal)"#) + XCTAssertEqual(UnitIdentifier.katal.description, #"0x2735 (catalytic activity (katal))"#) + + // dynamic viscosity (pascal second) + XCTAssertEqual(UnitIdentifier.pascalSecond.rawValue, 0x2740) + XCTAssertEqual(UnitIdentifier.pascalSecond.type, #"org.bluetooth.unit.dynamic_viscosity.pascal_second"#) + XCTAssertEqual(UnitIdentifier.pascalSecond.name, #"dynamic viscosity (pascal second)"#) + XCTAssertEqual(UnitIdentifier.pascalSecond.description, #"0x2740 (dynamic viscosity (pascal second))"#) + + // moment of force (newton metre) + XCTAssertEqual(UnitIdentifier.newtonMetre.rawValue, 0x2741) + XCTAssertEqual(UnitIdentifier.newtonMetre.type, #"org.bluetooth.unit.moment_of_force.newton_metre"#) + XCTAssertEqual(UnitIdentifier.newtonMetre.name, #"moment of force (newton metre)"#) + XCTAssertEqual(UnitIdentifier.newtonMetre.description, #"0x2741 (moment of force (newton metre))"#) + + // surface tension (newton per metre) + XCTAssertEqual(UnitIdentifier.surfaceTension.rawValue, 0x2742) + XCTAssertEqual(UnitIdentifier.surfaceTension.type, #"org.bluetooth.unit.surface_tension.newton_per_metre"#) + XCTAssertEqual(UnitIdentifier.surfaceTension.name, #"surface tension (newton per metre)"#) + XCTAssertEqual(UnitIdentifier.surfaceTension.description, #"0x2742 (surface tension (newton per metre))"#) + + // angular velocity (radian per second) + XCTAssertEqual(UnitIdentifier.angularVelocity.rawValue, 0x2743) + XCTAssertEqual(UnitIdentifier.angularVelocity.type, #"org.bluetooth.unit.angular_velocity.radian_per_second"#) + XCTAssertEqual(UnitIdentifier.angularVelocity.name, #"angular velocity (radian per second)"#) + XCTAssertEqual(UnitIdentifier.angularVelocity.description, #"0x2743 (angular velocity (radian per second))"#) + + // angular acceleration (radian per second squared) + XCTAssertEqual(UnitIdentifier.angularAcceleration.rawValue, 0x2744) + XCTAssertEqual(UnitIdentifier.angularAcceleration.type, #"org.bluetooth.unit.angular_acceleration.radian_per_second_squared"#) + XCTAssertEqual(UnitIdentifier.angularAcceleration.name, #"angular acceleration (radian per second squared)"#) + XCTAssertEqual(UnitIdentifier.angularAcceleration.description, #"0x2744 (angular acceleration (radian per second squared))"#) + + // heat flux density (watt per square metre) + XCTAssertEqual(UnitIdentifier.heatFluxDensity.rawValue, 0x2745) + XCTAssertEqual(UnitIdentifier.heatFluxDensity.type, #"org.bluetooth.unit.heat_flux_density.watt_per_square_metre"#) + XCTAssertEqual(UnitIdentifier.heatFluxDensity.name, #"heat flux density (watt per square metre)"#) + XCTAssertEqual(UnitIdentifier.heatFluxDensity.description, #"0x2745 (heat flux density (watt per square metre))"#) + + // heat capacity (joule per kelvin) + XCTAssertEqual(UnitIdentifier.heatCapacity.rawValue, 0x2746) + XCTAssertEqual(UnitIdentifier.heatCapacity.type, #"org.bluetooth.unit.heat_capacity.joule_per_kelvin"#) + XCTAssertEqual(UnitIdentifier.heatCapacity.name, #"heat capacity (joule per kelvin)"#) + XCTAssertEqual(UnitIdentifier.heatCapacity.description, #"0x2746 (heat capacity (joule per kelvin))"#) + + // specific heat capacity (joule per kilogram kelvin) + XCTAssertEqual(UnitIdentifier.specificHeatCapacity.rawValue, 0x2747) + XCTAssertEqual(UnitIdentifier.specificHeatCapacity.type, #"org.bluetooth.unit.specific_heat_capacity.joule_per_kilogram_kelvin"#) + XCTAssertEqual(UnitIdentifier.specificHeatCapacity.name, #"specific heat capacity (joule per kilogram kelvin)"#) + XCTAssertEqual(UnitIdentifier.specificHeatCapacity.description, #"0x2747 (specific heat capacity (joule per kilogram kelvin))"#) + + // specific energy (joule per kilogram) + XCTAssertEqual(UnitIdentifier.specificEnergy.rawValue, 0x2748) + XCTAssertEqual(UnitIdentifier.specificEnergy.type, #"org.bluetooth.unit.specific_energy.joule_per_kilogram"#) + XCTAssertEqual(UnitIdentifier.specificEnergy.name, #"specific energy (joule per kilogram)"#) + XCTAssertEqual(UnitIdentifier.specificEnergy.description, #"0x2748 (specific energy (joule per kilogram))"#) + + // thermal conductivity (watt per metre kelvin) + XCTAssertEqual(UnitIdentifier.thermalConductivity.rawValue, 0x2749) + XCTAssertEqual(UnitIdentifier.thermalConductivity.type, #"org.bluetooth.unit.thermal_conductivity.watt_per_metre_kelvin"#) + XCTAssertEqual(UnitIdentifier.thermalConductivity.name, #"thermal conductivity (watt per metre kelvin)"#) + XCTAssertEqual(UnitIdentifier.thermalConductivity.description, #"0x2749 (thermal conductivity (watt per metre kelvin))"#) + + // energy density (joule per cubic metre) + XCTAssertEqual(UnitIdentifier.energyDensity.rawValue, 0x274A) + XCTAssertEqual(UnitIdentifier.energyDensity.type, #"org.bluetooth.unit.energy_density.joule_per_cubic_metre"#) + XCTAssertEqual(UnitIdentifier.energyDensity.name, #"energy density (joule per cubic metre)"#) + XCTAssertEqual(UnitIdentifier.energyDensity.description, #"0x274A (energy density (joule per cubic metre))"#) + + // electric field strength (volt per metre) + XCTAssertEqual(UnitIdentifier.electricFieldStrength.rawValue, 0x274B) + XCTAssertEqual(UnitIdentifier.electricFieldStrength.type, #"org.bluetooth.unit.electric_field_strength.volt_per_metre"#) + XCTAssertEqual(UnitIdentifier.electricFieldStrength.name, #"electric field strength (volt per metre)"#) + XCTAssertEqual(UnitIdentifier.electricFieldStrength.description, #"0x274B (electric field strength (volt per metre))"#) + + // electric charge density (coulomb per cubic metre) + XCTAssertEqual(UnitIdentifier.electricChargeDensity.rawValue, 0x274C) + XCTAssertEqual(UnitIdentifier.electricChargeDensity.type, #"org.bluetooth.unit.electric_charge_density.coulomb_per_cubic_metre"#) + XCTAssertEqual(UnitIdentifier.electricChargeDensity.name, #"electric charge density (coulomb per cubic metre)"#) + XCTAssertEqual(UnitIdentifier.electricChargeDensity.description, #"0x274C (electric charge density (coulomb per cubic metre))"#) + + // surface charge density (coulomb per square metre) + XCTAssertEqual(UnitIdentifier.surfaceChargeDensity.rawValue, 0x274D) + XCTAssertEqual(UnitIdentifier.surfaceChargeDensity.type, #"org.bluetooth.unit.surface_charge_density.coulomb_per_square_metre"#) + XCTAssertEqual(UnitIdentifier.surfaceChargeDensity.name, #"surface charge density (coulomb per square metre)"#) + XCTAssertEqual(UnitIdentifier.surfaceChargeDensity.description, #"0x274D (surface charge density (coulomb per square metre))"#) + + // electric flux density (coulomb per square metre) + XCTAssertEqual(UnitIdentifier.electricFluxDensity.rawValue, 0x274E) + XCTAssertEqual(UnitIdentifier.electricFluxDensity.type, #"org.bluetooth.unit.electric_flux_density.coulomb_per_square_metre"#) + XCTAssertEqual(UnitIdentifier.electricFluxDensity.name, #"electric flux density (coulomb per square metre)"#) + XCTAssertEqual(UnitIdentifier.electricFluxDensity.description, #"0x274E (electric flux density (coulomb per square metre))"#) + + // permittivity (farad per metre) + XCTAssertEqual(UnitIdentifier.permittivity.rawValue, 0x274F) + XCTAssertEqual(UnitIdentifier.permittivity.type, #"org.bluetooth.unit.permittivity.farad_per_metre"#) + XCTAssertEqual(UnitIdentifier.permittivity.name, #"permittivity (farad per metre)"#) + XCTAssertEqual(UnitIdentifier.permittivity.description, #"0x274F (permittivity (farad per metre))"#) + + // permeability (henry per metre) + XCTAssertEqual(UnitIdentifier.permeability.rawValue, 0x2750) + XCTAssertEqual(UnitIdentifier.permeability.type, #"org.bluetooth.unit.permeability.henry_per_metre"#) + XCTAssertEqual(UnitIdentifier.permeability.name, #"permeability (henry per metre)"#) + XCTAssertEqual(UnitIdentifier.permeability.description, #"0x2750 (permeability (henry per metre))"#) + + // molar energy (joule per mole) + XCTAssertEqual(UnitIdentifier.molarEnergy.rawValue, 0x2751) + XCTAssertEqual(UnitIdentifier.molarEnergy.type, #"org.bluetooth.unit.molar_energy.joule_per_mole"#) + XCTAssertEqual(UnitIdentifier.molarEnergy.name, #"molar energy (joule per mole)"#) + XCTAssertEqual(UnitIdentifier.molarEnergy.description, #"0x2751 (molar energy (joule per mole))"#) + + // molar entropy (joule per mole kelvin) + XCTAssertEqual(UnitIdentifier.molarEntropy.rawValue, 0x2752) + XCTAssertEqual(UnitIdentifier.molarEntropy.type, #"org.bluetooth.unit.molar_entropy.joule_per_mole_kelvin"#) + XCTAssertEqual(UnitIdentifier.molarEntropy.name, #"molar entropy (joule per mole kelvin)"#) + XCTAssertEqual(UnitIdentifier.molarEntropy.description, #"0x2752 (molar entropy (joule per mole kelvin))"#) + + // exposure (coulomb per kilogram) + XCTAssertEqual(UnitIdentifier.exposure.rawValue, 0x2753) + XCTAssertEqual(UnitIdentifier.exposure.type, #"org.bluetooth.unit.exposure.coulomb_per_kilogram"#) + XCTAssertEqual(UnitIdentifier.exposure.name, #"exposure (coulomb per kilogram)"#) + XCTAssertEqual(UnitIdentifier.exposure.description, #"0x2753 (exposure (coulomb per kilogram))"#) + + // absorbed dose rate (gray per second) + XCTAssertEqual(UnitIdentifier.absorbedDoseRate.rawValue, 0x2754) + XCTAssertEqual(UnitIdentifier.absorbedDoseRate.type, #"org.bluetooth.unit.absorbed_dose_rate.gray_per_second"#) + XCTAssertEqual(UnitIdentifier.absorbedDoseRate.name, #"absorbed dose rate (gray per second)"#) + XCTAssertEqual(UnitIdentifier.absorbedDoseRate.description, #"0x2754 (absorbed dose rate (gray per second))"#) + + // radiant intensity (watt per steradian) + XCTAssertEqual(UnitIdentifier.radradiantIntensityiance.rawValue, 0x2755) + XCTAssertEqual(UnitIdentifier.radradiantIntensityiance.type, #"org.bluetooth.unit.radiant_intensity.watt_per_steradian"#) + XCTAssertEqual(UnitIdentifier.radradiantIntensityiance.name, #"radiant intensity (watt per steradian)"#) + XCTAssertEqual(UnitIdentifier.radradiantIntensityiance.description, #"0x2755 (radiant intensity (watt per steradian))"#) + + // radiance (watt per square metre steradian) + XCTAssertEqual(UnitIdentifier.radiance.rawValue, 0x2756) + XCTAssertEqual(UnitIdentifier.radiance.type, #"org.bluetooth.unit.radiance.watt_per_square_metre_steradian"#) + XCTAssertEqual(UnitIdentifier.radiance.name, #"radiance (watt per square metre steradian)"#) + XCTAssertEqual(UnitIdentifier.radiance.description, #"0x2756 (radiance (watt per square metre steradian))"#) + + // catalytic activity concentration (katal per cubic metre) + XCTAssertEqual(UnitIdentifier.catalyticActivity.rawValue, 0x2757) + XCTAssertEqual(UnitIdentifier.catalyticActivity.type, #"org.bluetooth.unit.catalytic_activity_concentration.katal_per_cubic_metre"#) + XCTAssertEqual(UnitIdentifier.catalyticActivity.name, #"catalytic activity concentration (katal per cubic metre)"#) + XCTAssertEqual(UnitIdentifier.catalyticActivity.description, #"0x2757 (catalytic activity concentration (katal per cubic metre))"#) + + // time (minute) + XCTAssertEqual(UnitIdentifier.minute.rawValue, 0x2760) + XCTAssertEqual(UnitIdentifier.minute.type, #"org.bluetooth.unit.time.minute"#) + XCTAssertEqual(UnitIdentifier.minute.name, #"time (minute)"#) + XCTAssertEqual(UnitIdentifier.minute.description, #"0x2760 (time (minute))"#) + + // time (hour) + XCTAssertEqual(UnitIdentifier.hour.rawValue, 0x2761) + XCTAssertEqual(UnitIdentifier.hour.type, #"org.bluetooth.unit.time.hour"#) + XCTAssertEqual(UnitIdentifier.hour.name, #"time (hour)"#) + XCTAssertEqual(UnitIdentifier.hour.description, #"0x2761 (time (hour))"#) + + // time (day) + XCTAssertEqual(UnitIdentifier.day.rawValue, 0x2762) + XCTAssertEqual(UnitIdentifier.day.type, #"org.bluetooth.unit.time.day"#) + XCTAssertEqual(UnitIdentifier.day.name, #"time (day)"#) + XCTAssertEqual(UnitIdentifier.day.description, #"0x2762 (time (day))"#) + + // plane angle (degree) + XCTAssertEqual(UnitIdentifier.degree.rawValue, 0x2763) + XCTAssertEqual(UnitIdentifier.degree.type, #"org.bluetooth.unit.plane_angle.degree"#) + XCTAssertEqual(UnitIdentifier.degree.name, #"plane angle (degree)"#) + XCTAssertEqual(UnitIdentifier.degree.description, #"0x2763 (plane angle (degree))"#) + + // plane angle (minute) + XCTAssertEqual(UnitIdentifier.planeAngleMinute.rawValue, 0x2764) + XCTAssertEqual(UnitIdentifier.planeAngleMinute.type, #"org.bluetooth.unit.plane_angle.minute"#) + XCTAssertEqual(UnitIdentifier.planeAngleMinute.name, #"plane angle (minute)"#) + XCTAssertEqual(UnitIdentifier.planeAngleMinute.description, #"0x2764 (plane angle (minute))"#) + + // plane angle (second) + XCTAssertEqual(UnitIdentifier.planeAngleSecond.rawValue, 0x2765) + XCTAssertEqual(UnitIdentifier.planeAngleSecond.type, #"org.bluetooth.unit.plane_angle.second"#) + XCTAssertEqual(UnitIdentifier.planeAngleSecond.name, #"plane angle (second)"#) + XCTAssertEqual(UnitIdentifier.planeAngleSecond.description, #"0x2765 (plane angle (second))"#) + + // area (hectare) + XCTAssertEqual(UnitIdentifier.hectare.rawValue, 0x2766) + XCTAssertEqual(UnitIdentifier.hectare.type, #"org.bluetooth.unit.area.hectare"#) + XCTAssertEqual(UnitIdentifier.hectare.name, #"area (hectare)"#) + XCTAssertEqual(UnitIdentifier.hectare.description, #"0x2766 (area (hectare))"#) + + // volume (litre) + XCTAssertEqual(UnitIdentifier.litre.rawValue, 0x2767) + XCTAssertEqual(UnitIdentifier.litre.type, #"org.bluetooth.unit.volume.litre"#) + XCTAssertEqual(UnitIdentifier.litre.name, #"volume (litre)"#) + XCTAssertEqual(UnitIdentifier.litre.description, #"0x2767 (volume (litre))"#) + + // mass (tonne) + XCTAssertEqual(UnitIdentifier.tonne.rawValue, 0x2768) + XCTAssertEqual(UnitIdentifier.tonne.type, #"org.bluetooth.unit.mass.tonne"#) + XCTAssertEqual(UnitIdentifier.tonne.name, #"mass (tonne)"#) + XCTAssertEqual(UnitIdentifier.tonne.description, #"0x2768 (mass (tonne))"#) + + // pressure (bar) + XCTAssertEqual(UnitIdentifier.bar.rawValue, 0x2780) + XCTAssertEqual(UnitIdentifier.bar.type, #"org.bluetooth.unit.pressure.bar"#) + XCTAssertEqual(UnitIdentifier.bar.name, #"pressure (bar)"#) + XCTAssertEqual(UnitIdentifier.bar.description, #"0x2780 (pressure (bar))"#) + + // pressure (millimetre of mercury) + XCTAssertEqual(UnitIdentifier.millimetreOfMercury.rawValue, 0x2781) + XCTAssertEqual(UnitIdentifier.millimetreOfMercury.type, #"org.bluetooth.unit.pressure.millimetre_of_mercury"#) + XCTAssertEqual(UnitIdentifier.millimetreOfMercury.name, #"pressure (millimetre of mercury)"#) + XCTAssertEqual(UnitIdentifier.millimetreOfMercury.description, #"0x2781 (pressure (millimetre of mercury))"#) + + // length (ångström) + XCTAssertEqual(UnitIdentifier.ngstrm.rawValue, 0x2782) + XCTAssertEqual(UnitIdentifier.ngstrm.type, #"org.bluetooth.unit.length.ångström"#) + XCTAssertEqual(UnitIdentifier.ngstrm.name, #"length (ångström)"#) + XCTAssertEqual(UnitIdentifier.ngstrm.description, #"0x2782 (length (ångström))"#) + + // length (nautical mile) + XCTAssertEqual(UnitIdentifier.nauticalMile.rawValue, 0x2783) + XCTAssertEqual(UnitIdentifier.nauticalMile.type, #"org.bluetooth.unit.length.nautical_mile"#) + XCTAssertEqual(UnitIdentifier.nauticalMile.name, #"length (nautical mile)"#) + XCTAssertEqual(UnitIdentifier.nauticalMile.description, #"0x2783 (length (nautical mile))"#) + + // area (barn) + XCTAssertEqual(UnitIdentifier.barn.rawValue, 0x2784) + XCTAssertEqual(UnitIdentifier.barn.type, #"org.bluetooth.unit.area.barn"#) + XCTAssertEqual(UnitIdentifier.barn.name, #"area (barn)"#) + XCTAssertEqual(UnitIdentifier.barn.description, #"0x2784 (area (barn))"#) + + // velocity (knot) + XCTAssertEqual(UnitIdentifier.velocityKnot.rawValue, 0x2785) + XCTAssertEqual(UnitIdentifier.velocityKnot.type, #"org.bluetooth.unit.velocity.knot"#) + XCTAssertEqual(UnitIdentifier.velocityKnot.name, #"velocity (knot)"#) + XCTAssertEqual(UnitIdentifier.velocityKnot.description, #"0x2785 (velocity (knot))"#) + + // logarithmic radio quantity (neper) + XCTAssertEqual(UnitIdentifier.neper.rawValue, 0x2786) + XCTAssertEqual(UnitIdentifier.neper.type, #"org.bluetooth.unit.logarithmic_radio_quantity.neper"#) + XCTAssertEqual(UnitIdentifier.neper.name, #"logarithmic radio quantity (neper)"#) + XCTAssertEqual(UnitIdentifier.neper.description, #"0x2786 (logarithmic radio quantity (neper))"#) + + // logarithmic radio quantity (bel) + XCTAssertEqual(UnitIdentifier.bel.rawValue, 0x2787) + XCTAssertEqual(UnitIdentifier.bel.type, #"org.bluetooth.unit.logarithmic_radio_quantity.bel"#) + XCTAssertEqual(UnitIdentifier.bel.name, #"logarithmic radio quantity (bel)"#) + XCTAssertEqual(UnitIdentifier.bel.description, #"0x2787 (logarithmic radio quantity (bel))"#) + + // length (yard) + XCTAssertEqual(UnitIdentifier.yard.rawValue, 0x27A0) + XCTAssertEqual(UnitIdentifier.yard.type, #"org.bluetooth.unit.length.yard"#) + XCTAssertEqual(UnitIdentifier.yard.name, #"length (yard)"#) + XCTAssertEqual(UnitIdentifier.yard.description, #"0x27A0 (length (yard))"#) + + // length (parsec) + XCTAssertEqual(UnitIdentifier.parsec.rawValue, 0x27A1) + XCTAssertEqual(UnitIdentifier.parsec.type, #"org.bluetooth.unit.length.parsec"#) + XCTAssertEqual(UnitIdentifier.parsec.name, #"length (parsec)"#) + XCTAssertEqual(UnitIdentifier.parsec.description, #"0x27A1 (length (parsec))"#) + + // length (inch) + XCTAssertEqual(UnitIdentifier.inch.rawValue, 0x27A2) + XCTAssertEqual(UnitIdentifier.inch.type, #"org.bluetooth.unit.length.inch"#) + XCTAssertEqual(UnitIdentifier.inch.name, #"length (inch)"#) + XCTAssertEqual(UnitIdentifier.inch.description, #"0x27A2 (length (inch))"#) + + // length (foot) + XCTAssertEqual(UnitIdentifier.foot.rawValue, 0x27A3) + XCTAssertEqual(UnitIdentifier.foot.type, #"org.bluetooth.unit.length.foot"#) + XCTAssertEqual(UnitIdentifier.foot.name, #"length (foot)"#) + XCTAssertEqual(UnitIdentifier.foot.description, #"0x27A3 (length (foot))"#) + + // length (mile) + XCTAssertEqual(UnitIdentifier.mile.rawValue, 0x27A4) + XCTAssertEqual(UnitIdentifier.mile.type, #"org.bluetooth.unit.length.mile"#) + XCTAssertEqual(UnitIdentifier.mile.name, #"length (mile)"#) + XCTAssertEqual(UnitIdentifier.mile.description, #"0x27A4 (length (mile))"#) + + // pressure (pound-force per square inch) + XCTAssertEqual(UnitIdentifier.pressurePoundForce.rawValue, 0x27A5) + XCTAssertEqual(UnitIdentifier.pressurePoundForce.type, #"org.bluetooth.unit.pressure.pound_force_per_square_inch"#) + XCTAssertEqual(UnitIdentifier.pressurePoundForce.name, #"pressure (pound-force per square inch)"#) + XCTAssertEqual(UnitIdentifier.pressurePoundForce.description, #"0x27A5 (pressure (pound-force per square inch))"#) + + // velocity (kilometre per hour) + XCTAssertEqual(UnitIdentifier.kilometrePerHour.rawValue, 0x27A6) + XCTAssertEqual(UnitIdentifier.kilometrePerHour.type, #"org.bluetooth.unit.velocity.kilometre_per_hour"#) + XCTAssertEqual(UnitIdentifier.kilometrePerHour.name, #"velocity (kilometre per hour)"#) + XCTAssertEqual(UnitIdentifier.kilometrePerHour.description, #"0x27A6 (velocity (kilometre per hour))"#) + + // velocity (mile per hour) + XCTAssertEqual(UnitIdentifier.milePerHour.rawValue, 0x27A7) + XCTAssertEqual(UnitIdentifier.milePerHour.type, #"org.bluetooth.unit.velocity.mile_per_hour"#) + XCTAssertEqual(UnitIdentifier.milePerHour.name, #"velocity (mile per hour)"#) + XCTAssertEqual(UnitIdentifier.milePerHour.description, #"0x27A7 (velocity (mile per hour))"#) + + // angular velocity (revolution per minute) + XCTAssertEqual(UnitIdentifier.revolutionPerMinute.rawValue, 0x27A8) + XCTAssertEqual(UnitIdentifier.revolutionPerMinute.type, #"org.bluetooth.unit.angular_velocity.revolution_per_minute"#) + XCTAssertEqual(UnitIdentifier.revolutionPerMinute.name, #"angular velocity (revolution per minute)"#) + XCTAssertEqual(UnitIdentifier.revolutionPerMinute.description, #"0x27A8 (angular velocity (revolution per minute))"#) + + // energy (gram calorie) + XCTAssertEqual(UnitIdentifier.gramCalorie.rawValue, 0x27A9) + XCTAssertEqual(UnitIdentifier.gramCalorie.type, #"org.bluetooth.unit.energy.gram_calorie"#) + XCTAssertEqual(UnitIdentifier.gramCalorie.name, #"energy (gram calorie)"#) + XCTAssertEqual(UnitIdentifier.gramCalorie.description, #"0x27A9 (energy (gram calorie))"#) + + // energy (kilogram calorie) + XCTAssertEqual(UnitIdentifier.kilogramCalorie.rawValue, 0x27AA) + XCTAssertEqual(UnitIdentifier.kilogramCalorie.type, #"org.bluetooth.unit.energy.kilogram_calorie"#) + XCTAssertEqual(UnitIdentifier.kilogramCalorie.name, #"energy (kilogram calorie)"#) + XCTAssertEqual(UnitIdentifier.kilogramCalorie.description, #"0x27AA (energy (kilogram calorie))"#) + + // energy (kilowatt hour) + XCTAssertEqual(UnitIdentifier.kilowattHour.rawValue, 0x27AB) + XCTAssertEqual(UnitIdentifier.kilowattHour.type, #"org.bluetooth.unit.energy.kilowatt_hour"#) + XCTAssertEqual(UnitIdentifier.kilowattHour.name, #"energy (kilowatt hour)"#) + XCTAssertEqual(UnitIdentifier.kilowattHour.description, #"0x27AB (energy (kilowatt hour))"#) + + // thermodynamic temperature (degree Fahrenheit) + XCTAssertEqual(UnitIdentifier.degreeFahrenheit.rawValue, 0x27AC) + XCTAssertEqual(UnitIdentifier.degreeFahrenheit.type, #"org.bluetooth.unit.thermodynamic_temperature.degree_fahrenheit"#) + XCTAssertEqual(UnitIdentifier.degreeFahrenheit.name, #"thermodynamic temperature (degree Fahrenheit)"#) + XCTAssertEqual(UnitIdentifier.degreeFahrenheit.description, #"0x27AC (thermodynamic temperature (degree Fahrenheit))"#) + + // percentage + XCTAssertEqual(UnitIdentifier.percentage.rawValue, 0x27AD) + XCTAssertEqual(UnitIdentifier.percentage.type, #"org.bluetooth.unit.percentage"#) + XCTAssertEqual(UnitIdentifier.percentage.name, #"percentage"#) + XCTAssertEqual(UnitIdentifier.percentage.description, #"0x27AD (percentage)"#) + + // per mille + XCTAssertEqual(UnitIdentifier.perMille.rawValue, 0x27AE) + XCTAssertEqual(UnitIdentifier.perMille.type, #"org.bluetooth.unit.per_mille"#) + XCTAssertEqual(UnitIdentifier.perMille.name, #"per mille"#) + XCTAssertEqual(UnitIdentifier.perMille.description, #"0x27AE (per mille)"#) + + // period (beats per minute) + XCTAssertEqual(UnitIdentifier.beatsPerMinute.rawValue, 0x27AF) + XCTAssertEqual(UnitIdentifier.beatsPerMinute.type, #"org.bluetooth.unit.period.beats_per_minute"#) + XCTAssertEqual(UnitIdentifier.beatsPerMinute.name, #"period (beats per minute)"#) + XCTAssertEqual(UnitIdentifier.beatsPerMinute.description, #"0x27AF (period (beats per minute))"#) + + // electric charge (ampere hours) + XCTAssertEqual(UnitIdentifier.ampereHours.rawValue, 0x27B0) + XCTAssertEqual(UnitIdentifier.ampereHours.type, #"org.bluetooth.unit.electric_charge.ampere_hours"#) + XCTAssertEqual(UnitIdentifier.ampereHours.name, #"electric charge (ampere hours)"#) + XCTAssertEqual(UnitIdentifier.ampereHours.description, #"0x27B0 (electric charge (ampere hours))"#) + + // mass density (milligram per decilitre) + XCTAssertEqual(UnitIdentifier.milligramPerDecilitre.rawValue, 0x27B1) + XCTAssertEqual(UnitIdentifier.milligramPerDecilitre.type, #"org.bluetooth.unit.mass_density.milligram_per_decilitre"#) + XCTAssertEqual(UnitIdentifier.milligramPerDecilitre.name, #"mass density (milligram per decilitre)"#) + XCTAssertEqual(UnitIdentifier.milligramPerDecilitre.description, #"0x27B1 (mass density (milligram per decilitre))"#) + + // mass density (millimole per litre) + XCTAssertEqual(UnitIdentifier.millimolePerLitre.rawValue, 0x27B2) + XCTAssertEqual(UnitIdentifier.millimolePerLitre.type, #"org.bluetooth.unit.mass_density.millimole_per_litre"#) + XCTAssertEqual(UnitIdentifier.millimolePerLitre.name, #"mass density (millimole per litre)"#) + XCTAssertEqual(UnitIdentifier.millimolePerLitre.description, #"0x27B2 (mass density (millimole per litre))"#) + + // time (year) + XCTAssertEqual(UnitIdentifier.year.rawValue, 0x27B3) + XCTAssertEqual(UnitIdentifier.year.type, #"org.bluetooth.unit.time.year"#) + XCTAssertEqual(UnitIdentifier.year.name, #"time (year)"#) + XCTAssertEqual(UnitIdentifier.year.description, #"0x27B3 (time (year))"#) + + // time (month) + XCTAssertEqual(UnitIdentifier.month.rawValue, 0x27B4) + XCTAssertEqual(UnitIdentifier.month.type, #"org.bluetooth.unit.time.month"#) + XCTAssertEqual(UnitIdentifier.month.name, #"time (month)"#) + XCTAssertEqual(UnitIdentifier.month.description, #"0x27B4 (time (month))"#) + + // concentration (count per cubic metre) + XCTAssertEqual(UnitIdentifier.concentration.rawValue, 0x27B5) + XCTAssertEqual(UnitIdentifier.concentration.type, #"org.bluetooth.unit.concentration.count_per_cubic_metre"#) + XCTAssertEqual(UnitIdentifier.concentration.name, #"concentration (count per cubic metre)"#) + XCTAssertEqual(UnitIdentifier.concentration.description, #"0x27B5 (concentration (count per cubic metre))"#) + + // irradiance (watt per square metre) + XCTAssertEqual(UnitIdentifier.irrandiance.rawValue, 0x27B6) + XCTAssertEqual(UnitIdentifier.irrandiance.type, #"org.bluetooth.unit.irradiance.watt_per_square_metre"#) + XCTAssertEqual(UnitIdentifier.irrandiance.name, #"irradiance (watt per square metre)"#) + XCTAssertEqual(UnitIdentifier.irrandiance.description, #"0x27B6 (irradiance (watt per square metre))"#) + + // milliliter (per kilogram per minute) + XCTAssertEqual(UnitIdentifier.millilitre.rawValue, 0x27B7) + XCTAssertEqual(UnitIdentifier.millilitre.type, #"org.bluetooth.unit.transfer_rate.milliliter_per_kilogram_per_minute"#) + XCTAssertEqual(UnitIdentifier.millilitre.name, #"milliliter (per kilogram per minute)"#) + XCTAssertEqual(UnitIdentifier.millilitre.description, #"0x27B7 (milliliter (per kilogram per minute))"#) + + // mass (pound) + XCTAssertEqual(UnitIdentifier.pound.rawValue, 0x27B8) + XCTAssertEqual(UnitIdentifier.pound.type, #"org.bluetooth.unit.mass.pound"#) + XCTAssertEqual(UnitIdentifier.pound.name, #"mass (pound)"#) + XCTAssertEqual(UnitIdentifier.pound.description, #"0x27B8 (mass (pound))"#) + + // metabolic equivalent + XCTAssertEqual(UnitIdentifier.metabolicEquivalent.rawValue, 0x27B9) + XCTAssertEqual(UnitIdentifier.metabolicEquivalent.type, #"org.bluetooth.unit.metabolic_equivalent"#) + XCTAssertEqual(UnitIdentifier.metabolicEquivalent.name, #"metabolic equivalent"#) + XCTAssertEqual(UnitIdentifier.metabolicEquivalent.description, #"0x27B9 (metabolic equivalent)"#) + + // step (per minute) + XCTAssertEqual(UnitIdentifier.step.rawValue, 0x27BA) + XCTAssertEqual(UnitIdentifier.step.type, #"org.bluetooth.unit.step_per_minute"#) + XCTAssertEqual(UnitIdentifier.step.name, #"step (per minute)"#) + XCTAssertEqual(UnitIdentifier.step.description, #"0x27BA (step (per minute))"#) + + // stroke (per minute) + XCTAssertEqual(UnitIdentifier.stroke.rawValue, 0x27BC) + XCTAssertEqual(UnitIdentifier.stroke.type, #"org.bluetooth.unit.stroke_per_minute"#) + XCTAssertEqual(UnitIdentifier.stroke.name, #"stroke (per minute)"#) + XCTAssertEqual(UnitIdentifier.stroke.description, #"0x27BC (stroke (per minute))"#) + + // pace (kilometre per minute) + XCTAssertEqual(UnitIdentifier.pace.rawValue, 0x27BD) + XCTAssertEqual(UnitIdentifier.pace.type, #"org.bluetooth.unit.velocity.kilometer_per_minute"#) + XCTAssertEqual(UnitIdentifier.pace.name, #"pace (kilometre per minute)"#) + XCTAssertEqual(UnitIdentifier.pace.description, #"0x27BD (pace (kilometre per minute))"#) + + // luminous efficacy (lumen per watt) + XCTAssertEqual(UnitIdentifier.luminousEfficacy.rawValue, 0x27BE) + XCTAssertEqual(UnitIdentifier.luminousEfficacy.type, #"org.bluetooth.unit.luminous_efficacy.lumen_per_watt"#) + XCTAssertEqual(UnitIdentifier.luminousEfficacy.name, #"luminous efficacy (lumen per watt)"#) + XCTAssertEqual(UnitIdentifier.luminousEfficacy.description, #"0x27BE (luminous efficacy (lumen per watt))"#) + + // luminous energy (lumen hour) + XCTAssertEqual(UnitIdentifier.luminousEnergy.rawValue, 0x27BF) + XCTAssertEqual(UnitIdentifier.luminousEnergy.type, #"org.bluetooth.unit.luminous_energy.lumen_hour"#) + XCTAssertEqual(UnitIdentifier.luminousEnergy.name, #"luminous energy (lumen hour)"#) + XCTAssertEqual(UnitIdentifier.luminousEnergy.description, #"0x27BF (luminous energy (lumen hour))"#) + + // luminous exposure (lux hour) + XCTAssertEqual(UnitIdentifier.luminousExposure.rawValue, 0x27C0) + XCTAssertEqual(UnitIdentifier.luminousExposure.type, #"org.bluetooth.unit.luminous_exposure.lux_hour"#) + XCTAssertEqual(UnitIdentifier.luminousExposure.name, #"luminous exposure (lux hour)"#) + XCTAssertEqual(UnitIdentifier.luminousExposure.description, #"0x27C0 (luminous exposure (lux hour))"#) + + // mass flow (gram per second) + XCTAssertEqual(UnitIdentifier.massFlow.rawValue, 0x27C1) + XCTAssertEqual(UnitIdentifier.massFlow.type, #"org.bluetooth.unit.mass_flow.gram_per_second"#) + XCTAssertEqual(UnitIdentifier.massFlow.name, #"mass flow (gram per second)"#) + XCTAssertEqual(UnitIdentifier.massFlow.description, #"0x27C1 (mass flow (gram per second))"#) + + // volume flow (litre per second) + XCTAssertEqual(UnitIdentifier.volumeFlow.rawValue, 0x27C2) + XCTAssertEqual(UnitIdentifier.volumeFlow.type, #"org.bluetooth.unit.volume_flow.litre_per_second"#) + XCTAssertEqual(UnitIdentifier.volumeFlow.name, #"volume flow (litre per second)"#) + XCTAssertEqual(UnitIdentifier.volumeFlow.description, #"0x27C2 (volume flow (litre per second))"#) + + // sound pressure (decibel) + XCTAssertEqual(UnitIdentifier.soundPressure.rawValue, 0x27C3) + XCTAssertEqual(UnitIdentifier.soundPressure.type, #"org.bluetooth.unit.sound_pressure.decibel_spl"#) + XCTAssertEqual(UnitIdentifier.soundPressure.name, #"sound pressure (decibel)"#) + XCTAssertEqual(UnitIdentifier.soundPressure.description, #"0x27C3 (sound pressure (decibel))"#) + + // parts per million + XCTAssertEqual(UnitIdentifier.partsPerMillion.rawValue, 0x27C4) + XCTAssertEqual(UnitIdentifier.partsPerMillion.type, #"org.bluetooth.unit.ppm"#) + XCTAssertEqual(UnitIdentifier.partsPerMillion.name, #"parts per million"#) + XCTAssertEqual(UnitIdentifier.partsPerMillion.description, #"0x27C4 (parts per million)"#) + + // parts per billion + XCTAssertEqual(UnitIdentifier.partsPerBillion.rawValue, 0x27C5) + XCTAssertEqual(UnitIdentifier.partsPerBillion.type, #"org.bluetooth.unit.ppb"#) + XCTAssertEqual(UnitIdentifier.partsPerBillion.name, #"parts per billion"#) + XCTAssertEqual(UnitIdentifier.partsPerBillion.description, #"0x27C5 (parts per billion)"#) + + // mass density rate ((milligram per decilitre) per minute) + XCTAssertEqual(UnitIdentifier.massDensityRate.rawValue, 0x27C6) + XCTAssertEqual(UnitIdentifier.massDensityRate.type, #"org.bluetooth.unit.mass_density_rate.milligram_per_decilitre_per_minute"#) + XCTAssertEqual(UnitIdentifier.massDensityRate.name, #"mass density rate ((milligram per decilitre) per minute)"#) + XCTAssertEqual(UnitIdentifier.massDensityRate.description, #"0x27C6 (mass density rate ((milligram per decilitre) per minute))"#) + + // Electrical Apparent Energy (kilovolt ampere hour) + XCTAssertEqual(UnitIdentifier.kilovoltAmpereHour.rawValue, 0x27C7) + XCTAssertEqual(UnitIdentifier.kilovoltAmpereHour.type, #"org.bluetooth.unit.energy.kilovolt_ampere_hour"#) + XCTAssertEqual(UnitIdentifier.kilovoltAmpereHour.name, #"Electrical Apparent Energy (kilovolt ampere hour)"#) + XCTAssertEqual(UnitIdentifier.kilovoltAmpereHour.description, #"0x27C7 (Electrical Apparent Energy (kilovolt ampere hour))"#) + + // Electrical Apparent Power (volt ampere) + XCTAssertEqual(UnitIdentifier.voltAmpere.rawValue, 0x27C8) + XCTAssertEqual(UnitIdentifier.voltAmpere.type, #"org.bluetooth.unit.power.volt_ampere"#) + XCTAssertEqual(UnitIdentifier.voltAmpere.name, #"Electrical Apparent Power (volt ampere)"#) + XCTAssertEqual(UnitIdentifier.voltAmpere.description, #"0x27C8 (Electrical Apparent Power (volt ampere))"#) + + } + +} +#endif +// swiftlint:enable type_body_length diff --git a/Tests/BluetoothTests/UnitIdentifierTests.swift b/Tests/BluetoothTests/UnitIdentifierTests.swift deleted file mode 100644 index b4d5eb4a7..000000000 --- a/Tests/BluetoothTests/UnitIdentifierTests.swift +++ /dev/null @@ -1,742 +0,0 @@ -// -// UnitIdentifierTests.swift -// Bluetooth -// -// Generated by Carlos Duclos on 5/29/20. -// - -import XCTest -import Foundation -@testable import Bluetooth - -#if !os(WASI) -// swiftlint:disable type_body_length -final class UnitIdentifierTests: XCTestCase { - - func testUnits() { - - /// unitless - XCTAssertEqual(UnitIdentifier.unitless.rawValue, 0x2700) - XCTAssertEqual(UnitIdentifier.unitless.type, "org.bluetooth.unit.unitless") - XCTAssertEqual(UnitIdentifier.unitless.name, "unitless") - XCTAssertEqual(UnitIdentifier.unitless.description, "2700 (unitless)") - - /// length (metre) - XCTAssertEqual(UnitIdentifier.metre.rawValue, 0x2701) - XCTAssertEqual(UnitIdentifier.metre.type, "org.bluetooth.unit.length.metre") - XCTAssertEqual(UnitIdentifier.metre.name, "length (metre)") - XCTAssertEqual(UnitIdentifier.metre.description, "2701 (length (metre))") - - /// mass (kilogram) - XCTAssertEqual(UnitIdentifier.kilogram.rawValue, 0x2702) - XCTAssertEqual(UnitIdentifier.kilogram.type, "org.bluetooth.unit.mass.kilogram") - XCTAssertEqual(UnitIdentifier.kilogram.name, "mass (kilogram)") - XCTAssertEqual(UnitIdentifier.kilogram.description, "2702 (mass (kilogram))") - - /// time (second) - XCTAssertEqual(UnitIdentifier.second.rawValue, 0x2703) - XCTAssertEqual(UnitIdentifier.second.type, "org.bluetooth.unit.time.second") - XCTAssertEqual(UnitIdentifier.second.name, "time (second)") - XCTAssertEqual(UnitIdentifier.second.description, "2703 (time (second))") - - /// electric current (ampere) - XCTAssertEqual(UnitIdentifier.ampere.rawValue, 0x2704) - XCTAssertEqual(UnitIdentifier.ampere.type, "org.bluetooth.unit.electric_current.ampere") - XCTAssertEqual(UnitIdentifier.ampere.name, "electric current (ampere)") - XCTAssertEqual(UnitIdentifier.ampere.description, "2704 (electric current (ampere))") - - /// thermodynamic temperature (kelvin) - XCTAssertEqual(UnitIdentifier.kelvin.rawValue, 0x2705) - XCTAssertEqual(UnitIdentifier.kelvin.type, "org.bluetooth.unit.thermodynamic_temperature.kelvin") - XCTAssertEqual(UnitIdentifier.kelvin.name, "thermodynamic temperature (kelvin)") - XCTAssertEqual(UnitIdentifier.kelvin.description, "2705 (thermodynamic temperature (kelvin))") - - /// amount of substance (mole) - XCTAssertEqual(UnitIdentifier.mole.rawValue, 0x2706) - XCTAssertEqual(UnitIdentifier.mole.type, "org.bluetooth.unit.amount_of_substance.mole") - XCTAssertEqual(UnitIdentifier.mole.name, "amount of substance (mole)") - XCTAssertEqual(UnitIdentifier.mole.description, "2706 (amount of substance (mole))") - - /// luminous intensity (candela) - XCTAssertEqual(UnitIdentifier.candela.rawValue, 0x2707) - XCTAssertEqual(UnitIdentifier.candela.type, "org.bluetooth.unit.luminous_intensity.candela") - XCTAssertEqual(UnitIdentifier.candela.name, "luminous intensity (candela)") - XCTAssertEqual(UnitIdentifier.candela.description, "2707 (luminous intensity (candela))") - - /// area (square metres) - XCTAssertEqual(UnitIdentifier.area.rawValue, 0x2710) - XCTAssertEqual(UnitIdentifier.area.type, "org.bluetooth.unit.area.square_metres") - XCTAssertEqual(UnitIdentifier.area.name, "area (square metres)") - XCTAssertEqual(UnitIdentifier.area.description, "2710 (area (square metres))") - - /// volume (cubic metres) - XCTAssertEqual(UnitIdentifier.volume.rawValue, 0x2711) - XCTAssertEqual(UnitIdentifier.volume.type, "org.bluetooth.unit.volume.cubic_metres") - XCTAssertEqual(UnitIdentifier.volume.name, "volume (cubic metres)") - XCTAssertEqual(UnitIdentifier.volume.description, "2711 (volume (cubic metres))") - - /// velocity (metres per second) - XCTAssertEqual(UnitIdentifier.velocity.rawValue, 0x2712) - XCTAssertEqual(UnitIdentifier.velocity.type, "org.bluetooth.unit.velocity.metres_per_second") - XCTAssertEqual(UnitIdentifier.velocity.name, "velocity (metres per second)") - XCTAssertEqual(UnitIdentifier.velocity.description, "2712 (velocity (metres per second))") - - /// acceleration (metres per second squared) - XCTAssertEqual(UnitIdentifier.acceleration.rawValue, 0x2713) - XCTAssertEqual(UnitIdentifier.acceleration.type, "org.bluetooth.unit.acceleration.metres_per_second_squared") - XCTAssertEqual(UnitIdentifier.acceleration.name, "acceleration (metres per second squared)") - XCTAssertEqual(UnitIdentifier.acceleration.description, "2713 (acceleration (metres per second squared))") - - /// wavenumber (reciprocal metre) - XCTAssertEqual(UnitIdentifier.wavenumber.rawValue, 0x2714) - XCTAssertEqual(UnitIdentifier.wavenumber.type, "org.bluetooth.unit.wavenumber.reciprocal_metre") - XCTAssertEqual(UnitIdentifier.wavenumber.name, "wavenumber (reciprocal metre)") - XCTAssertEqual(UnitIdentifier.wavenumber.description, "2714 (wavenumber (reciprocal metre))") - - /// density (kilogram per cubic metre) - XCTAssertEqual(UnitIdentifier.density.rawValue, 0x2715) - XCTAssertEqual(UnitIdentifier.density.type, "org.bluetooth.unit.density.kilogram_per_cubic_metre") - XCTAssertEqual(UnitIdentifier.density.name, "density (kilogram per cubic metre)") - XCTAssertEqual(UnitIdentifier.density.description, "2715 (density (kilogram per cubic metre))") - - /// surface density (kilogram per square metre) - XCTAssertEqual(UnitIdentifier.surfaceDensity.rawValue, 0x2716) - XCTAssertEqual(UnitIdentifier.surfaceDensity.type, "org.bluetooth.unit.surface_density.kilogram_per_square_metre") - XCTAssertEqual(UnitIdentifier.surfaceDensity.name, "surface density (kilogram per square metre)") - XCTAssertEqual(UnitIdentifier.surfaceDensity.description, "2716 (surface density (kilogram per square metre))") - - /// specific volume (cubic metre per kilogram) - XCTAssertEqual(UnitIdentifier.specificVolume.rawValue, 0x2717) - XCTAssertEqual(UnitIdentifier.specificVolume.type, "org.bluetooth.unit.specific_volume.cubic_metre_per_kilogram") - XCTAssertEqual(UnitIdentifier.specificVolume.name, "specific volume (cubic metre per kilogram)") - XCTAssertEqual(UnitIdentifier.specificVolume.description, "2717 (specific volume (cubic metre per kilogram))") - - /// current density (ampere per square metre) - XCTAssertEqual(UnitIdentifier.currentDensity.rawValue, 0x2718) - XCTAssertEqual(UnitIdentifier.currentDensity.type, "org.bluetooth.unit.current_density.ampere_per_square_metre") - XCTAssertEqual(UnitIdentifier.currentDensity.name, "current density (ampere per square metre)") - XCTAssertEqual(UnitIdentifier.currentDensity.description, "2718 (current density (ampere per square metre))") - - /// magnetic field strength (ampere per metre) - XCTAssertEqual(UnitIdentifier.magneticFieldStrengh.rawValue, 0x2719) - XCTAssertEqual(UnitIdentifier.magneticFieldStrengh.type, "org.bluetooth.unit.magnetic_field_strength.ampere_per_metre") - XCTAssertEqual(UnitIdentifier.magneticFieldStrengh.name, "magnetic field strength (ampere per metre)") - XCTAssertEqual(UnitIdentifier.magneticFieldStrengh.description, "2719 (magnetic field strength (ampere per metre))") - - /// amount concentration (mole per cubic metre) - XCTAssertEqual(UnitIdentifier.amountConcentration.rawValue, 0x271A) - XCTAssertEqual(UnitIdentifier.amountConcentration.type, "org.bluetooth.unit.amount_concentration.mole_per_cubic_metre") - XCTAssertEqual(UnitIdentifier.amountConcentration.name, "amount concentration (mole per cubic metre)") - XCTAssertEqual(UnitIdentifier.amountConcentration.description, "271A (amount concentration (mole per cubic metre))") - - /// mass concentration (kilogram per cubic metre) - XCTAssertEqual(UnitIdentifier.massConcentration.rawValue, 0x271B) - XCTAssertEqual(UnitIdentifier.massConcentration.type, "org.bluetooth.unit.mass_concentration.kilogram_per_cubic_metre") - XCTAssertEqual(UnitIdentifier.massConcentration.name, "mass concentration (kilogram per cubic metre)") - XCTAssertEqual(UnitIdentifier.massConcentration.description, "271B (mass concentration (kilogram per cubic metre))") - - /// luminance (candela per square metre) - XCTAssertEqual(UnitIdentifier.luminance.rawValue, 0x271C) - XCTAssertEqual(UnitIdentifier.luminance.type, "org.bluetooth.unit.luminance.candela_per_square_metre") - XCTAssertEqual(UnitIdentifier.luminance.name, "luminance (candela per square metre)") - XCTAssertEqual(UnitIdentifier.luminance.description, "271C (luminance (candela per square metre))") - - /// refractive index - XCTAssertEqual(UnitIdentifier.refractiveIndex.rawValue, 0x271D) - XCTAssertEqual(UnitIdentifier.refractiveIndex.type, "org.bluetooth.unit.refractive_index") - XCTAssertEqual(UnitIdentifier.refractiveIndex.name, "refractive index") - XCTAssertEqual(UnitIdentifier.refractiveIndex.description, "271D (refractive index)") - - /// relative permeability - XCTAssertEqual(UnitIdentifier.relativePermeability.rawValue, 0x271E) - XCTAssertEqual(UnitIdentifier.relativePermeability.type, "org.bluetooth.unit.relative_permeability") - XCTAssertEqual(UnitIdentifier.relativePermeability.name, "relative permeability") - XCTAssertEqual(UnitIdentifier.relativePermeability.description, "271E (relative permeability)") - - /// plane angle (radian) - XCTAssertEqual(UnitIdentifier.planeAngle.rawValue, 0x2720) - XCTAssertEqual(UnitIdentifier.planeAngle.type, "org.bluetooth.unit.plane_angle.radian") - XCTAssertEqual(UnitIdentifier.planeAngle.name, "plane angle (radian)") - XCTAssertEqual(UnitIdentifier.planeAngle.description, "2720 (plane angle (radian))") - - /// solid angle (steradian) - XCTAssertEqual(UnitIdentifier.solidAngle.rawValue, 0x2721) - XCTAssertEqual(UnitIdentifier.solidAngle.type, "org.bluetooth.unit.solid_angle.steradian") - XCTAssertEqual(UnitIdentifier.solidAngle.name, "solid angle (steradian)") - XCTAssertEqual(UnitIdentifier.solidAngle.description, "2721 (solid angle (steradian))") - - /// frequency (hertz) - XCTAssertEqual(UnitIdentifier.frequency.rawValue, 0x2722) - XCTAssertEqual(UnitIdentifier.frequency.type, "org.bluetooth.unit.frequency.hertz") - XCTAssertEqual(UnitIdentifier.frequency.name, "frequency (hertz)") - XCTAssertEqual(UnitIdentifier.frequency.description, "2722 (frequency (hertz))") - - /// force (newton) - XCTAssertEqual(UnitIdentifier.force.rawValue, 0x2723) - XCTAssertEqual(UnitIdentifier.force.type, "org.bluetooth.unit.force.newton") - XCTAssertEqual(UnitIdentifier.force.name, "force (newton)") - XCTAssertEqual(UnitIdentifier.force.description, "2723 (force (newton))") - - /// pressure (pascal) - XCTAssertEqual(UnitIdentifier.pascalPressure.rawValue, 0x2724) - XCTAssertEqual(UnitIdentifier.pascalPressure.type, "org.bluetooth.unit.pressure.pascal") - XCTAssertEqual(UnitIdentifier.pascalPressure.name, "pressure (pascal)") - XCTAssertEqual(UnitIdentifier.pascalPressure.description, "2724 (pressure (pascal))") - - /// energy (joule) - XCTAssertEqual(UnitIdentifier.energy.rawValue, 0x2725) - XCTAssertEqual(UnitIdentifier.energy.type, "org.bluetooth.unit.energy.joule") - XCTAssertEqual(UnitIdentifier.energy.name, "energy (joule)") - XCTAssertEqual(UnitIdentifier.energy.description, "2725 (energy (joule))") - - /// power (watt) - XCTAssertEqual(UnitIdentifier.power.rawValue, 0x2726) - XCTAssertEqual(UnitIdentifier.power.type, "org.bluetooth.unit.power.watt") - XCTAssertEqual(UnitIdentifier.power.name, "power (watt)") - XCTAssertEqual(UnitIdentifier.power.description, "2726 (power (watt))") - - /// electric charge (coulomb) - XCTAssertEqual(UnitIdentifier.coulomb.rawValue, 0x2727) - XCTAssertEqual(UnitIdentifier.coulomb.type, "org.bluetooth.unit.electric_charge.coulomb") - XCTAssertEqual(UnitIdentifier.coulomb.name, "electric charge (coulomb)") - XCTAssertEqual(UnitIdentifier.coulomb.description, "2727 (electric charge (coulomb))") - - /// electric potential difference (volt) - XCTAssertEqual(UnitIdentifier.electricPotential.rawValue, 0x2728) - XCTAssertEqual(UnitIdentifier.electricPotential.type, "org.bluetooth.unit.electric_potential_difference.volt") - XCTAssertEqual(UnitIdentifier.electricPotential.name, "electric potential difference (volt)") - XCTAssertEqual(UnitIdentifier.electricPotential.description, "2728 (electric potential difference (volt))") - - /// capacitance (farad) - XCTAssertEqual(UnitIdentifier.capitance.rawValue, 0x2729) - XCTAssertEqual(UnitIdentifier.capitance.type, "org.bluetooth.unit.capacitance.farad") - XCTAssertEqual(UnitIdentifier.capitance.name, "capacitance (farad)") - XCTAssertEqual(UnitIdentifier.capitance.description, "2729 (capacitance (farad))") - - /// electric resistance (ohm) - XCTAssertEqual(UnitIdentifier.electricResistance.rawValue, 0x272A) - XCTAssertEqual(UnitIdentifier.electricResistance.type, "org.bluetooth.unit.electric_resistance.ohm") - XCTAssertEqual(UnitIdentifier.electricResistance.name, "electric resistance (ohm)") - XCTAssertEqual(UnitIdentifier.electricResistance.description, "272A (electric resistance (ohm))") - - /// electric conductance (siemens) - XCTAssertEqual(UnitIdentifier.electricConductance.rawValue, 0x272B) - XCTAssertEqual(UnitIdentifier.electricConductance.type, "org.bluetooth.unit.electric_conductance.siemens") - XCTAssertEqual(UnitIdentifier.electricConductance.name, "electric conductance (siemens)") - XCTAssertEqual(UnitIdentifier.electricConductance.description, "272B (electric conductance (siemens))") - - /// magnetic flux (weber) - XCTAssertEqual(UnitIdentifier.magneticFlux.rawValue, 0x272C) - XCTAssertEqual(UnitIdentifier.magneticFlux.type, "org.bluetooth.unit.magnetic_flux.weber") - XCTAssertEqual(UnitIdentifier.magneticFlux.name, "magnetic flux (weber)") - XCTAssertEqual(UnitIdentifier.magneticFlux.description, "272C (magnetic flux (weber))") - - /// magnetic flux density (tesla) - XCTAssertEqual(UnitIdentifier.magneticFluxDensity.rawValue, 0x272D) - XCTAssertEqual(UnitIdentifier.magneticFluxDensity.type, "org.bluetooth.unit.magnetic_flux_density.tesla") - XCTAssertEqual(UnitIdentifier.magneticFluxDensity.name, "magnetic flux density (tesla)") - XCTAssertEqual(UnitIdentifier.magneticFluxDensity.description, "272D (magnetic flux density (tesla))") - - /// inductance (henry) - XCTAssertEqual(UnitIdentifier.inductance.rawValue, 0x272E) - XCTAssertEqual(UnitIdentifier.inductance.type, "org.bluetooth.unit.inductance.henry") - XCTAssertEqual(UnitIdentifier.inductance.name, "inductance (henry)") - XCTAssertEqual(UnitIdentifier.inductance.description, "272E (inductance (henry))") - - /// Celsius temperature (degree Celsius) - XCTAssertEqual(UnitIdentifier.celsius.rawValue, 0x272F) - XCTAssertEqual(UnitIdentifier.celsius.type, "org.bluetooth.unit.thermodynamic_temperature.degree_celsius") - XCTAssertEqual(UnitIdentifier.celsius.name, "Celsius temperature (degree Celsius)") - XCTAssertEqual(UnitIdentifier.celsius.description, "272F (Celsius temperature (degree Celsius))") - - /// luminous flux (lumen) - XCTAssertEqual(UnitIdentifier.luminousFlux.rawValue, 0x2730) - XCTAssertEqual(UnitIdentifier.luminousFlux.type, "org.bluetooth.unit.luminous_flux.lumen") - XCTAssertEqual(UnitIdentifier.luminousFlux.name, "luminous flux (lumen)") - XCTAssertEqual(UnitIdentifier.luminousFlux.description, "2730 (luminous flux (lumen))") - - /// illuminance (lux) - XCTAssertEqual(UnitIdentifier.illuminance.rawValue, 0x2731) - XCTAssertEqual(UnitIdentifier.illuminance.type, "org.bluetooth.unit.illuminance.lux") - XCTAssertEqual(UnitIdentifier.illuminance.name, "illuminance (lux)") - XCTAssertEqual(UnitIdentifier.illuminance.description, "2731 (illuminance (lux))") - - /// activity referred to a radionuclide (becquerel) - XCTAssertEqual(UnitIdentifier.becquerel.rawValue, 0x2732) - XCTAssertEqual(UnitIdentifier.becquerel.type, "org.bluetooth.unit.activity_referred_to_a_radionuclide.becquerel") - XCTAssertEqual(UnitIdentifier.becquerel.name, "activity referred to a radionuclide (becquerel)") - XCTAssertEqual(UnitIdentifier.becquerel.description, "2732 (activity referred to a radionuclide (becquerel))") - - /// absorbed dose (gray) - XCTAssertEqual(UnitIdentifier.absorbedDose.rawValue, 0x2733) - XCTAssertEqual(UnitIdentifier.absorbedDose.type, "org.bluetooth.unit.absorbed_dose.gray") - XCTAssertEqual(UnitIdentifier.absorbedDose.name, "absorbed dose (gray)") - XCTAssertEqual(UnitIdentifier.absorbedDose.description, "2733 (absorbed dose (gray))") - - /// dose equivalent (sievert) - XCTAssertEqual(UnitIdentifier.sievert.rawValue, 0x2734) - XCTAssertEqual(UnitIdentifier.sievert.type, "org.bluetooth.unit.dose_equivalent.sievert") - XCTAssertEqual(UnitIdentifier.sievert.name, "dose equivalent (sievert)") - XCTAssertEqual(UnitIdentifier.sievert.description, "2734 (dose equivalent (sievert))") - - /// catalytic activity (katal) - XCTAssertEqual(UnitIdentifier.katal.rawValue, 0x2735) - XCTAssertEqual(UnitIdentifier.katal.type, "org.bluetooth.unit.catalytic_activity.katal") - XCTAssertEqual(UnitIdentifier.katal.name, "catalytic activity (katal)") - XCTAssertEqual(UnitIdentifier.katal.description, "2735 (catalytic activity (katal))") - - /// dynamic viscosity (pascal second) - XCTAssertEqual(UnitIdentifier.pascalSecond.rawValue, 0x2740) - XCTAssertEqual(UnitIdentifier.pascalSecond.type, "org.bluetooth.unit.dynamic_viscosity.pascal_second") - XCTAssertEqual(UnitIdentifier.pascalSecond.name, "dynamic viscosity (pascal second)") - XCTAssertEqual(UnitIdentifier.pascalSecond.description, "2740 (dynamic viscosity (pascal second))") - - /// moment of force (newton metre) - XCTAssertEqual(UnitIdentifier.newtonMetre.rawValue, 0x2741) - XCTAssertEqual(UnitIdentifier.newtonMetre.type, "org.bluetooth.unit.moment_of_force.newton_metre") - XCTAssertEqual(UnitIdentifier.newtonMetre.name, "moment of force (newton metre)") - XCTAssertEqual(UnitIdentifier.newtonMetre.description, "2741 (moment of force (newton metre))") - - /// surface tension (newton per metre) - XCTAssertEqual(UnitIdentifier.surfaceTension.rawValue, 0x2742) - XCTAssertEqual(UnitIdentifier.surfaceTension.type, "org.bluetooth.unit.surface_tension.newton_per_metre") - XCTAssertEqual(UnitIdentifier.surfaceTension.name, "surface tension (newton per metre)") - XCTAssertEqual(UnitIdentifier.surfaceTension.description, "2742 (surface tension (newton per metre))") - - /// angular velocity (radian per second) - XCTAssertEqual(UnitIdentifier.angularVelocity.rawValue, 0x2743) - XCTAssertEqual(UnitIdentifier.angularVelocity.type, "org.bluetooth.unit.angular_velocity.radian_per_second") - XCTAssertEqual(UnitIdentifier.angularVelocity.name, "angular velocity (radian per second)") - XCTAssertEqual(UnitIdentifier.angularVelocity.description, "2743 (angular velocity (radian per second))") - - /// angular acceleration (radian per second squared) - XCTAssertEqual(UnitIdentifier.angularAcceleration.rawValue, 0x2744) - XCTAssertEqual(UnitIdentifier.angularAcceleration.type, "org.bluetooth.unit.angular_acceleration.radian_per_second_squared") - XCTAssertEqual(UnitIdentifier.angularAcceleration.name, "angular acceleration (radian per second squared)") - XCTAssertEqual(UnitIdentifier.angularAcceleration.description, "2744 (angular acceleration (radian per second squared))") - - /// heat flux density (watt per square metre) - XCTAssertEqual(UnitIdentifier.heatFluxDensity.rawValue, 0x2745) - XCTAssertEqual(UnitIdentifier.heatFluxDensity.type, "org.bluetooth.unit.heat_flux_density.watt_per_square_metre") - XCTAssertEqual(UnitIdentifier.heatFluxDensity.name, "heat flux density (watt per square metre)") - XCTAssertEqual(UnitIdentifier.heatFluxDensity.description, "2745 (heat flux density (watt per square metre))") - - /// heat capacity (joule per kelvin) - XCTAssertEqual(UnitIdentifier.heatCapacity.rawValue, 0x2746) - XCTAssertEqual(UnitIdentifier.heatCapacity.type, "org.bluetooth.unit.heat_capacity.joule_per_kelvin") - XCTAssertEqual(UnitIdentifier.heatCapacity.name, "heat capacity (joule per kelvin)") - XCTAssertEqual(UnitIdentifier.heatCapacity.description, "2746 (heat capacity (joule per kelvin))") - - /// specific heat capacity (joule per kilogram kelvin) - XCTAssertEqual(UnitIdentifier.specificHeatCapacity.rawValue, 0x2747) - XCTAssertEqual(UnitIdentifier.specificHeatCapacity.type, "org.bluetooth.unit.specific_heat_capacity.joule_per_kilogram_kelvin") - XCTAssertEqual(UnitIdentifier.specificHeatCapacity.name, "specific heat capacity (joule per kilogram kelvin)") - XCTAssertEqual(UnitIdentifier.specificHeatCapacity.description, "2747 (specific heat capacity (joule per kilogram kelvin))") - - /// specific energy (joule per kilogram) - XCTAssertEqual(UnitIdentifier.specificEnergy.rawValue, 0x2748) - XCTAssertEqual(UnitIdentifier.specificEnergy.type, "org.bluetooth.unit.specific_energy.joule_per_kilogram") - XCTAssertEqual(UnitIdentifier.specificEnergy.name, "specific energy (joule per kilogram)") - XCTAssertEqual(UnitIdentifier.specificEnergy.description, "2748 (specific energy (joule per kilogram))") - - /// thermal conductivity (watt per metre kelvin) - XCTAssertEqual(UnitIdentifier.thermalConductivity.rawValue, 0x2749) - XCTAssertEqual(UnitIdentifier.thermalConductivity.type, "org.bluetooth.unit.thermal_conductivity.watt_per_metre_kelvin") - XCTAssertEqual(UnitIdentifier.thermalConductivity.name, "thermal conductivity (watt per metre kelvin)") - XCTAssertEqual(UnitIdentifier.thermalConductivity.description, "2749 (thermal conductivity (watt per metre kelvin))") - - /// energy density (joule per cubic metre) - XCTAssertEqual(UnitIdentifier.energyDensity.rawValue, 0x274A) - XCTAssertEqual(UnitIdentifier.energyDensity.type, "org.bluetooth.unit.energy_density.joule_per_cubic_metre") - XCTAssertEqual(UnitIdentifier.energyDensity.name, "energy density (joule per cubic metre)") - XCTAssertEqual(UnitIdentifier.energyDensity.description, "274A (energy density (joule per cubic metre))") - - /// electric field strength (volt per metre) - XCTAssertEqual(UnitIdentifier.electricFieldStrength.rawValue, 0x274B) - XCTAssertEqual(UnitIdentifier.electricFieldStrength.type, "org.bluetooth.unit.electric_field_strength.volt_per_metre") - XCTAssertEqual(UnitIdentifier.electricFieldStrength.name, "electric field strength (volt per metre)") - XCTAssertEqual(UnitIdentifier.electricFieldStrength.description, "274B (electric field strength (volt per metre))") - - /// electric charge density (coulomb per cubic metre) - XCTAssertEqual(UnitIdentifier.electricChargeDensity.rawValue, 0x274C) - XCTAssertEqual(UnitIdentifier.electricChargeDensity.type, "org.bluetooth.unit.electric_charge_density.coulomb_per_cubic_metre") - XCTAssertEqual(UnitIdentifier.electricChargeDensity.name, "electric charge density (coulomb per cubic metre)") - XCTAssertEqual(UnitIdentifier.electricChargeDensity.description, "274C (electric charge density (coulomb per cubic metre))") - - /// surface charge density (coulomb per square metre) - XCTAssertEqual(UnitIdentifier.surfaceChargeDensity.rawValue, 0x274D) - XCTAssertEqual(UnitIdentifier.surfaceChargeDensity.type, "org.bluetooth.unit.surface_charge_density.coulomb_per_square_metre") - XCTAssertEqual(UnitIdentifier.surfaceChargeDensity.name, "surface charge density (coulomb per square metre)") - XCTAssertEqual(UnitIdentifier.surfaceChargeDensity.description, "274D (surface charge density (coulomb per square metre))") - - /// electric flux density (coulomb per square metre) - XCTAssertEqual(UnitIdentifier.electricFluxDensity.rawValue, 0x274E) - XCTAssertEqual(UnitIdentifier.electricFluxDensity.type, "org.bluetooth.unit.electric_flux_density.coulomb_per_square_metre") - XCTAssertEqual(UnitIdentifier.electricFluxDensity.name, "electric flux density (coulomb per square metre)") - XCTAssertEqual(UnitIdentifier.electricFluxDensity.description, "274E (electric flux density (coulomb per square metre))") - - /// permittivity (farad per metre) - XCTAssertEqual(UnitIdentifier.permittivity.rawValue, 0x274F) - XCTAssertEqual(UnitIdentifier.permittivity.type, "org.bluetooth.unit.permittivity.farad_per_metre") - XCTAssertEqual(UnitIdentifier.permittivity.name, "permittivity (farad per metre)") - XCTAssertEqual(UnitIdentifier.permittivity.description, "274F (permittivity (farad per metre))") - - /// permeability (henry per metre) - XCTAssertEqual(UnitIdentifier.permeability.rawValue, 0x2750) - XCTAssertEqual(UnitIdentifier.permeability.type, "org.bluetooth.unit.permeability.henry_per_metre") - XCTAssertEqual(UnitIdentifier.permeability.name, "permeability (henry per metre)") - XCTAssertEqual(UnitIdentifier.permeability.description, "2750 (permeability (henry per metre))") - - /// molar energy (joule per mole) - XCTAssertEqual(UnitIdentifier.molarEnergy.rawValue, 0x2751) - XCTAssertEqual(UnitIdentifier.molarEnergy.type, "org.bluetooth.unit.molar_energy.joule_per_mole") - XCTAssertEqual(UnitIdentifier.molarEnergy.name, "molar energy (joule per mole)") - XCTAssertEqual(UnitIdentifier.molarEnergy.description, "2751 (molar energy (joule per mole))") - - /// molar entropy (joule per mole kelvin) - XCTAssertEqual(UnitIdentifier.molarEntropy.rawValue, 0x2752) - XCTAssertEqual(UnitIdentifier.molarEntropy.type, "org.bluetooth.unit.molar_entropy.joule_per_mole_kelvin") - XCTAssertEqual(UnitIdentifier.molarEntropy.name, "molar entropy (joule per mole kelvin)") - XCTAssertEqual(UnitIdentifier.molarEntropy.description, "2752 (molar entropy (joule per mole kelvin))") - - /// exposure (coulomb per kilogram) - XCTAssertEqual(UnitIdentifier.exposure.rawValue, 0x2753) - XCTAssertEqual(UnitIdentifier.exposure.type, "org.bluetooth.unit.exposure.coulomb_per_kilogram") - XCTAssertEqual(UnitIdentifier.exposure.name, "exposure (coulomb per kilogram)") - XCTAssertEqual(UnitIdentifier.exposure.description, "2753 (exposure (coulomb per kilogram))") - - /// absorbed dose rate (gray per second) - XCTAssertEqual(UnitIdentifier.absorbedDoseRate.rawValue, 0x2754) - XCTAssertEqual(UnitIdentifier.absorbedDoseRate.type, "org.bluetooth.unit.absorbed_dose_rate.gray_per_second") - XCTAssertEqual(UnitIdentifier.absorbedDoseRate.name, "absorbed dose rate (gray per second)") - XCTAssertEqual(UnitIdentifier.absorbedDoseRate.description, "2754 (absorbed dose rate (gray per second))") - - /// radiant intensity (watt per steradian) - XCTAssertEqual(UnitIdentifier.radradiantIntensityiance.rawValue, 0x2755) - XCTAssertEqual(UnitIdentifier.radradiantIntensityiance.type, "org.bluetooth.unit.radiant_intensity.watt_per_steradian") - XCTAssertEqual(UnitIdentifier.radradiantIntensityiance.name, "radiant intensity (watt per steradian)") - XCTAssertEqual(UnitIdentifier.radradiantIntensityiance.description, "2755 (radiant intensity (watt per steradian))") - - /// radiance (watt per square metre steradian) - XCTAssertEqual(UnitIdentifier.radiance.rawValue, 0x2756) - XCTAssertEqual(UnitIdentifier.radiance.type, "org.bluetooth.unit.radiance.watt_per_square_metre_steradian") - XCTAssertEqual(UnitIdentifier.radiance.name, "radiance (watt per square metre steradian)") - XCTAssertEqual(UnitIdentifier.radiance.description, "2756 (radiance (watt per square metre steradian))") - - /// catalytic activity concentration (katal per cubic metre) - XCTAssertEqual(UnitIdentifier.catalyticActivity.rawValue, 0x2757) - XCTAssertEqual(UnitIdentifier.catalyticActivity.type, "org.bluetooth.unit.catalytic_activity_concentration.katal_per_cubic_metre") - XCTAssertEqual(UnitIdentifier.catalyticActivity.name, "catalytic activity concentration (katal per cubic metre)") - XCTAssertEqual(UnitIdentifier.catalyticActivity.description, "2757 (catalytic activity concentration (katal per cubic metre))") - - /// time (minute) - XCTAssertEqual(UnitIdentifier.minute.rawValue, 0x2760) - XCTAssertEqual(UnitIdentifier.minute.type, "org.bluetooth.unit.time.minute") - XCTAssertEqual(UnitIdentifier.minute.name, "time (minute)") - XCTAssertEqual(UnitIdentifier.minute.description, "2760 (time (minute))") - - /// time (hour) - XCTAssertEqual(UnitIdentifier.hour.rawValue, 0x2761) - XCTAssertEqual(UnitIdentifier.hour.type, "org.bluetooth.unit.time.hour") - XCTAssertEqual(UnitIdentifier.hour.name, "time (hour)") - XCTAssertEqual(UnitIdentifier.hour.description, "2761 (time (hour))") - - /// time (day) - XCTAssertEqual(UnitIdentifier.day.rawValue, 0x2762) - XCTAssertEqual(UnitIdentifier.day.type, "org.bluetooth.unit.time.day") - XCTAssertEqual(UnitIdentifier.day.name, "time (day)") - XCTAssertEqual(UnitIdentifier.day.description, "2762 (time (day))") - - /// plane angle (degree) - XCTAssertEqual(UnitIdentifier.degree.rawValue, 0x2763) - XCTAssertEqual(UnitIdentifier.degree.type, "org.bluetooth.unit.plane_angle.degree") - XCTAssertEqual(UnitIdentifier.degree.name, "plane angle (degree)") - XCTAssertEqual(UnitIdentifier.degree.description, "2763 (plane angle (degree))") - - /// plane angle (minute) - XCTAssertEqual(UnitIdentifier.planeAngleMinute.rawValue, 0x2764) - XCTAssertEqual(UnitIdentifier.planeAngleMinute.type, "org.bluetooth.unit.plane_angle.minute") - XCTAssertEqual(UnitIdentifier.planeAngleMinute.name, "plane angle (minute)") - XCTAssertEqual(UnitIdentifier.planeAngleMinute.description, "2764 (plane angle (minute))") - - /// plane angle (second) - XCTAssertEqual(UnitIdentifier.planeAngleSecond.rawValue, 0x2765) - XCTAssertEqual(UnitIdentifier.planeAngleSecond.type, "org.bluetooth.unit.plane_angle.second") - XCTAssertEqual(UnitIdentifier.planeAngleSecond.name, "plane angle (second)") - XCTAssertEqual(UnitIdentifier.planeAngleSecond.description, "2765 (plane angle (second))") - - /// area (hectare) - XCTAssertEqual(UnitIdentifier.hectare.rawValue, 0x2766) - XCTAssertEqual(UnitIdentifier.hectare.type, "org.bluetooth.unit.area.hectare") - XCTAssertEqual(UnitIdentifier.hectare.name, "area (hectare)") - XCTAssertEqual(UnitIdentifier.hectare.description, "2766 (area (hectare))") - - /// volume (litre) - XCTAssertEqual(UnitIdentifier.litre.rawValue, 0x2767) - XCTAssertEqual(UnitIdentifier.litre.type, "org.bluetooth.unit.volume.litre") - XCTAssertEqual(UnitIdentifier.litre.name, "volume (litre)") - XCTAssertEqual(UnitIdentifier.litre.description, "2767 (volume (litre))") - - /// mass (tonne) - XCTAssertEqual(UnitIdentifier.tonne.rawValue, 0x2768) - XCTAssertEqual(UnitIdentifier.tonne.type, "org.bluetooth.unit.mass.tonne") - XCTAssertEqual(UnitIdentifier.tonne.name, "mass (tonne)") - XCTAssertEqual(UnitIdentifier.tonne.description, "2768 (mass (tonne))") - - /// pressure (bar) - XCTAssertEqual(UnitIdentifier.bar.rawValue, 0x2780) - XCTAssertEqual(UnitIdentifier.bar.type, "org.bluetooth.unit.pressure.bar") - XCTAssertEqual(UnitIdentifier.bar.name, "pressure (bar)") - XCTAssertEqual(UnitIdentifier.bar.description, "2780 (pressure (bar))") - - /// pressure (millimetre of mercury) - XCTAssertEqual(UnitIdentifier.millimetreOfMercury.rawValue, 0x2781) - XCTAssertEqual(UnitIdentifier.millimetreOfMercury.type, "org.bluetooth.unit.pressure.millimetre_of_mercury") - XCTAssertEqual(UnitIdentifier.millimetreOfMercury.name, "pressure (millimetre of mercury)") - XCTAssertEqual(UnitIdentifier.millimetreOfMercury.description, "2781 (pressure (millimetre of mercury))") - - /// length (ngstrm) - XCTAssertEqual(UnitIdentifier.ngstrm.rawValue, 0x2782) - XCTAssertEqual(UnitIdentifier.ngstrm.type, "org.bluetooth.unit.length.ngstrm") - XCTAssertEqual(UnitIdentifier.ngstrm.name, "length (ngstrm)") - XCTAssertEqual(UnitIdentifier.ngstrm.description, "2782 (length (ngstrm))") - - /// length (nautical mile) - XCTAssertEqual(UnitIdentifier.nauticalMile.rawValue, 0x2783) - XCTAssertEqual(UnitIdentifier.nauticalMile.type, "org.bluetooth.unit.length.nautical_mile") - XCTAssertEqual(UnitIdentifier.nauticalMile.name, "length (nautical mile)") - XCTAssertEqual(UnitIdentifier.nauticalMile.description, "2783 (length (nautical mile))") - - /// area (barn) - XCTAssertEqual(UnitIdentifier.barn.rawValue, 0x2784) - XCTAssertEqual(UnitIdentifier.barn.type, "org.bluetooth.unit.area.barn") - XCTAssertEqual(UnitIdentifier.barn.name, "area (barn)") - XCTAssertEqual(UnitIdentifier.barn.description, "2784 (area (barn))") - - /// velocity (knot) - XCTAssertEqual(UnitIdentifier.velocityKnot.rawValue, 0x2785) - XCTAssertEqual(UnitIdentifier.velocityKnot.type, "org.bluetooth.unit.velocity.knot") - XCTAssertEqual(UnitIdentifier.velocityKnot.name, "velocity (knot)") - XCTAssertEqual(UnitIdentifier.velocityKnot.description, "2785 (velocity (knot))") - - /// logarithmic radio quantity (neper) - XCTAssertEqual(UnitIdentifier.neper.rawValue, 0x2786) - XCTAssertEqual(UnitIdentifier.neper.type, "org.bluetooth.unit.logarithmic_radio_quantity.neper") - XCTAssertEqual(UnitIdentifier.neper.name, "logarithmic radio quantity (neper)") - XCTAssertEqual(UnitIdentifier.neper.description, "2786 (logarithmic radio quantity (neper))") - - /// logarithmic radio quantity (bel) - XCTAssertEqual(UnitIdentifier.bel.rawValue, 0x2787) - XCTAssertEqual(UnitIdentifier.bel.type, "org.bluetooth.unit.logarithmic_radio_quantity.bel") - XCTAssertEqual(UnitIdentifier.bel.name, "logarithmic radio quantity (bel)") - XCTAssertEqual(UnitIdentifier.bel.description, "2787 (logarithmic radio quantity (bel))") - - /// length (yard) - XCTAssertEqual(UnitIdentifier.yard.rawValue, 0x27A0) - XCTAssertEqual(UnitIdentifier.yard.type, "org.bluetooth.unit.length.yard") - XCTAssertEqual(UnitIdentifier.yard.name, "length (yard)") - XCTAssertEqual(UnitIdentifier.yard.description, "27A0 (length (yard))") - - /// length (parsec) - XCTAssertEqual(UnitIdentifier.parsec.rawValue, 0x27A1) - XCTAssertEqual(UnitIdentifier.parsec.type, "org.bluetooth.unit.length.parsec") - XCTAssertEqual(UnitIdentifier.parsec.name, "length (parsec)") - XCTAssertEqual(UnitIdentifier.parsec.description, "27A1 (length (parsec))") - - /// length (inch) - XCTAssertEqual(UnitIdentifier.inch.rawValue, 0x27A2) - XCTAssertEqual(UnitIdentifier.inch.type, "org.bluetooth.unit.length.inch") - XCTAssertEqual(UnitIdentifier.inch.name, "length (inch)") - XCTAssertEqual(UnitIdentifier.inch.description, "27A2 (length (inch))") - - /// length (foot) - XCTAssertEqual(UnitIdentifier.foot.rawValue, 0x27A3) - XCTAssertEqual(UnitIdentifier.foot.type, "org.bluetooth.unit.length.foot") - XCTAssertEqual(UnitIdentifier.foot.name, "length (foot)") - XCTAssertEqual(UnitIdentifier.foot.description, "27A3 (length (foot))") - - /// length (mile) - XCTAssertEqual(UnitIdentifier.mile.rawValue, 0x27A4) - XCTAssertEqual(UnitIdentifier.mile.type, "org.bluetooth.unit.length.mile") - XCTAssertEqual(UnitIdentifier.mile.name, "length (mile)") - XCTAssertEqual(UnitIdentifier.mile.description, "27A4 (length (mile))") - - /// pressure (pound-force per square inch) - XCTAssertEqual(UnitIdentifier.pressurePoundForce.rawValue, 0x27A5) - XCTAssertEqual(UnitIdentifier.pressurePoundForce.type, "org.bluetooth.unit.pressure.pound_force_per_square_inch") - XCTAssertEqual(UnitIdentifier.pressurePoundForce.name, "pressure (pound-force per square inch)") - XCTAssertEqual(UnitIdentifier.pressurePoundForce.description, "27A5 (pressure (pound-force per square inch))") - - /// velocity (kilometre per hour) - XCTAssertEqual(UnitIdentifier.kilometrePerHour.rawValue, 0x27A6) - XCTAssertEqual(UnitIdentifier.kilometrePerHour.type, "org.bluetooth.unit.velocity.kilometre_per_hour") - XCTAssertEqual(UnitIdentifier.kilometrePerHour.name, "velocity (kilometre per hour)") - XCTAssertEqual(UnitIdentifier.kilometrePerHour.description, "27A6 (velocity (kilometre per hour))") - - /// velocity (mile per hour) - XCTAssertEqual(UnitIdentifier.milePerHour.rawValue, 0x27A7) - XCTAssertEqual(UnitIdentifier.milePerHour.type, "org.bluetooth.unit.velocity.mile_per_hour") - XCTAssertEqual(UnitIdentifier.milePerHour.name, "velocity (mile per hour)") - XCTAssertEqual(UnitIdentifier.milePerHour.description, "27A7 (velocity (mile per hour))") - - /// angular velocity (revolution per minute) - XCTAssertEqual(UnitIdentifier.revolutionPerMinute.rawValue, 0x27A8) - XCTAssertEqual(UnitIdentifier.revolutionPerMinute.type, "org.bluetooth.unit.angular_velocity.revolution_per_minute") - XCTAssertEqual(UnitIdentifier.revolutionPerMinute.name, "angular velocity (revolution per minute)") - XCTAssertEqual(UnitIdentifier.revolutionPerMinute.description, "27A8 (angular velocity (revolution per minute))") - - /// energy (gram calorie) - XCTAssertEqual(UnitIdentifier.gramCalorie.rawValue, 0x27A9) - XCTAssertEqual(UnitIdentifier.gramCalorie.type, "org.bluetooth.unit.energy.gram_calorie") - XCTAssertEqual(UnitIdentifier.gramCalorie.name, "energy (gram calorie)") - XCTAssertEqual(UnitIdentifier.gramCalorie.description, "27A9 (energy (gram calorie))") - - /// energy (kilogram calorie) - XCTAssertEqual(UnitIdentifier.kilogramCalorie.rawValue, 0x27AA) - XCTAssertEqual(UnitIdentifier.kilogramCalorie.type, "org.bluetooth.unit.energy.kilogram_calorie") - XCTAssertEqual(UnitIdentifier.kilogramCalorie.name, "energy (kilogram calorie)") - XCTAssertEqual(UnitIdentifier.kilogramCalorie.description, "27AA (energy (kilogram calorie))") - - /// energy (kilowatt hour) - XCTAssertEqual(UnitIdentifier.kilowattHour.rawValue, 0x27AB) - XCTAssertEqual(UnitIdentifier.kilowattHour.type, "org.bluetooth.unit.energy.kilowatt_hour") - XCTAssertEqual(UnitIdentifier.kilowattHour.name, "energy (kilowatt hour)") - XCTAssertEqual(UnitIdentifier.kilowattHour.description, "27AB (energy (kilowatt hour))") - - /// thermodynamic temperature (degree Fahrenheit) - XCTAssertEqual(UnitIdentifier.degreeFahrenheit.rawValue, 0x27AC) - XCTAssertEqual(UnitIdentifier.degreeFahrenheit.type, "org.bluetooth.unit.thermodynamic_temperature.degree_fahrenheit") - XCTAssertEqual(UnitIdentifier.degreeFahrenheit.name, "thermodynamic temperature (degree Fahrenheit)") - XCTAssertEqual(UnitIdentifier.degreeFahrenheit.description, "27AC (thermodynamic temperature (degree Fahrenheit))") - - /// percentage - XCTAssertEqual(UnitIdentifier.percentage.rawValue, 0x27AD) - XCTAssertEqual(UnitIdentifier.percentage.type, "org.bluetooth.unit.percentage") - XCTAssertEqual(UnitIdentifier.percentage.name, "percentage") - XCTAssertEqual(UnitIdentifier.percentage.description, "27AD (percentage)") - - /// per mille - XCTAssertEqual(UnitIdentifier.perMille.rawValue, 0x27AE) - XCTAssertEqual(UnitIdentifier.perMille.type, "org.bluetooth.unit.per_mille") - XCTAssertEqual(UnitIdentifier.perMille.name, "per mille") - XCTAssertEqual(UnitIdentifier.perMille.description, "27AE (per mille)") - - /// period (beats per minute) - XCTAssertEqual(UnitIdentifier.beatsPerMinute.rawValue, 0x27AF) - XCTAssertEqual(UnitIdentifier.beatsPerMinute.type, "org.bluetooth.unit.period.beats_per_minute") - XCTAssertEqual(UnitIdentifier.beatsPerMinute.name, "period (beats per minute)") - XCTAssertEqual(UnitIdentifier.beatsPerMinute.description, "27AF (period (beats per minute))") - - /// electric charge (ampere hours) - XCTAssertEqual(UnitIdentifier.ampereHours.rawValue, 0x27B0) - XCTAssertEqual(UnitIdentifier.ampereHours.type, "org.bluetooth.unit.electric_charge.ampere_hours") - XCTAssertEqual(UnitIdentifier.ampereHours.name, "electric charge (ampere hours)") - XCTAssertEqual(UnitIdentifier.ampereHours.description, "27B0 (electric charge (ampere hours))") - - /// mass density (milligram per decilitre) - XCTAssertEqual(UnitIdentifier.milligramPerDecilitre.rawValue, 0x27B1) - XCTAssertEqual(UnitIdentifier.milligramPerDecilitre.type, "org.bluetooth.unit.mass_density.milligram_per_decilitre") - XCTAssertEqual(UnitIdentifier.milligramPerDecilitre.name, "mass density (milligram per decilitre)") - XCTAssertEqual(UnitIdentifier.milligramPerDecilitre.description, "27B1 (mass density (milligram per decilitre))") - - /// mass density (millimole per litre) - XCTAssertEqual(UnitIdentifier.millimolePerLitre.rawValue, 0x27B2) - XCTAssertEqual(UnitIdentifier.millimolePerLitre.type, "org.bluetooth.unit.mass_density.millimole_per_litre") - XCTAssertEqual(UnitIdentifier.millimolePerLitre.name, "mass density (millimole per litre)") - XCTAssertEqual(UnitIdentifier.millimolePerLitre.description, "27B2 (mass density (millimole per litre))") - - /// time (year) - XCTAssertEqual(UnitIdentifier.year.rawValue, 0x27B3) - XCTAssertEqual(UnitIdentifier.year.type, "org.bluetooth.unit.time.year") - XCTAssertEqual(UnitIdentifier.year.name, "time (year)") - XCTAssertEqual(UnitIdentifier.year.description, "27B3 (time (year))") - - /// time (month) - XCTAssertEqual(UnitIdentifier.month.rawValue, 0x27B4) - XCTAssertEqual(UnitIdentifier.month.type, "org.bluetooth.unit.time.month") - XCTAssertEqual(UnitIdentifier.month.name, "time (month)") - XCTAssertEqual(UnitIdentifier.month.description, "27B4 (time (month))") - - /// concentration (count per cubic metre) - XCTAssertEqual(UnitIdentifier.concentration.rawValue, 0x27B5) - XCTAssertEqual(UnitIdentifier.concentration.type, "org.bluetooth.unit.concentration.count_per_cubic_metre") - XCTAssertEqual(UnitIdentifier.concentration.name, "concentration (count per cubic metre)") - XCTAssertEqual(UnitIdentifier.concentration.description, "27B5 (concentration (count per cubic metre))") - - /// irradiance (watt per square metre) - XCTAssertEqual(UnitIdentifier.irrandiance.rawValue, 0x27B6) - XCTAssertEqual(UnitIdentifier.irrandiance.type, "org.bluetooth.unit.irradiance.watt_per_square_metre") - XCTAssertEqual(UnitIdentifier.irrandiance.name, "irradiance (watt per square metre)") - XCTAssertEqual(UnitIdentifier.irrandiance.description, "27B6 (irradiance (watt per square metre))") - - /// milliliter (per kilogram per minute) - XCTAssertEqual(UnitIdentifier.millilitre.rawValue, 0x27B7) - XCTAssertEqual(UnitIdentifier.millilitre.type, "org.bluetooth.unit.transfer_rate.milliliter_per_kilogram_per_minute") - XCTAssertEqual(UnitIdentifier.millilitre.name, "milliliter (per kilogram per minute)") - XCTAssertEqual(UnitIdentifier.millilitre.description, "27B7 (milliliter (per kilogram per minute))") - - /// mass (pound) - XCTAssertEqual(UnitIdentifier.pound.rawValue, 0x27B8) - XCTAssertEqual(UnitIdentifier.pound.type, "org.bluetooth.unit.mass.pound") - XCTAssertEqual(UnitIdentifier.pound.name, "mass (pound)") - XCTAssertEqual(UnitIdentifier.pound.description, "27B8 (mass (pound))") - - /// metabolic equivalent - XCTAssertEqual(UnitIdentifier.metabolicEquivalent.rawValue, 0x27B9) - XCTAssertEqual(UnitIdentifier.metabolicEquivalent.type, "org.bluetooth.unit.metabolic_equivalent") - XCTAssertEqual(UnitIdentifier.metabolicEquivalent.name, "metabolic equivalent") - XCTAssertEqual(UnitIdentifier.metabolicEquivalent.description, "27B9 (metabolic equivalent)") - - /// step (per minute) - XCTAssertEqual(UnitIdentifier.step.rawValue, 0x27BA) - XCTAssertEqual(UnitIdentifier.step.type, "org.bluetooth.unit.step_per_minute") - XCTAssertEqual(UnitIdentifier.step.name, "step (per minute)") - XCTAssertEqual(UnitIdentifier.step.description, "27BA (step (per minute))") - - /// stroke (per minute) - XCTAssertEqual(UnitIdentifier.stroke.rawValue, 0x27BC) - XCTAssertEqual(UnitIdentifier.stroke.type, "org.bluetooth.unit.stroke_per_minute") - XCTAssertEqual(UnitIdentifier.stroke.name, "stroke (per minute)") - XCTAssertEqual(UnitIdentifier.stroke.description, "27BC (stroke (per minute))") - - /// pace (kilometre per minute) - XCTAssertEqual(UnitIdentifier.pace.rawValue, 0x27BD) - XCTAssertEqual(UnitIdentifier.pace.type, "org.bluetooth.unit.velocity.kilometer_per_minute") - XCTAssertEqual(UnitIdentifier.pace.name, "pace (kilometre per minute)") - XCTAssertEqual(UnitIdentifier.pace.description, "27BD (pace (kilometre per minute))") - - /// luminous efficacy (lumen per watt) - XCTAssertEqual(UnitIdentifier.luminousEfficacy.rawValue, 0x27BE) - XCTAssertEqual(UnitIdentifier.luminousEfficacy.type, "org.bluetooth.unit.luminous_efficacy.lumen_per_watt") - XCTAssertEqual(UnitIdentifier.luminousEfficacy.name, "luminous efficacy (lumen per watt)") - XCTAssertEqual(UnitIdentifier.luminousEfficacy.description, "27BE (luminous efficacy (lumen per watt))") - - /// luminous energy (lumen hour) - XCTAssertEqual(UnitIdentifier.luminousEnergy.rawValue, 0x27BF) - XCTAssertEqual(UnitIdentifier.luminousEnergy.type, "org.bluetooth.unit.luminous_energy.lumen_hour") - XCTAssertEqual(UnitIdentifier.luminousEnergy.name, "luminous energy (lumen hour)") - XCTAssertEqual(UnitIdentifier.luminousEnergy.description, "27BF (luminous energy (lumen hour))") - - /// luminous exposure (lux hour) - XCTAssertEqual(UnitIdentifier.luminousExposure.rawValue, 0x27C0) - XCTAssertEqual(UnitIdentifier.luminousExposure.type, "org.bluetooth.unit.luminous_exposure.lux_hour") - XCTAssertEqual(UnitIdentifier.luminousExposure.name, "luminous exposure (lux hour)") - XCTAssertEqual(UnitIdentifier.luminousExposure.description, "27C0 (luminous exposure (lux hour))") - - /// mass flow (gram per second) - XCTAssertEqual(UnitIdentifier.massFlow.rawValue, 0x27C1) - XCTAssertEqual(UnitIdentifier.massFlow.type, "org.bluetooth.unit.mass_flow.gram_per_second") - XCTAssertEqual(UnitIdentifier.massFlow.name, "mass flow (gram per second)") - XCTAssertEqual(UnitIdentifier.massFlow.description, "27C1 (mass flow (gram per second))") - - /// volume flow (litre per second) - XCTAssertEqual(UnitIdentifier.volumeFlow.rawValue, 0x27C2) - XCTAssertEqual(UnitIdentifier.volumeFlow.type, "org.bluetooth.unit.volume_flow.litre_per_second") - XCTAssertEqual(UnitIdentifier.volumeFlow.name, "volume flow (litre per second)") - XCTAssertEqual(UnitIdentifier.volumeFlow.description, "27C2 (volume flow (litre per second))") - - } - -} -// swiftlint:enable type_body_length -#endif