CANUtils
public class CANUtils
CANデータの変換に関するユーティリティクラス。
-
バイト配列から一部を切り出して、CANの定義に沿ってUInt型に変換します。
Throws
IntdashParserErrorDeclaration
Swift
public static func bitfieldToUnsignedNumber(bytes: [UInt8], startBit: Int, byteOrder: Endian, bitLength: Int) throws -> UIntParameters
bytesバイト配列
startBit最初のビットインデックス位置
byteOrderエンディアン
bitLengthビット長
Return Value
変換後の数値
-
UInt値をInt型に変換します。
Throws
IntdashParserErrorDeclaration
Swift
public static func signedNumber(unsignedNumber: UInt, bitLength: Int) -> IntParameters
unsignedNumber変換するUInt値
bitLengthビット長
Return Value
変換後の数値
-
特定の数値をある係数(スケールとオフセット)で変換します。
Throws
IntdashParserErrorDeclaration
Swift
public static func applyFactorNumber(number: Any, scale: Double, offset: Double) -> AnyParameters
number変換する数値
scale変換に利用する係数
offset変換数値へのオフセット
Return Value
変換後の数値 ( number * scale + offset )
CANUtils Class Reference