Splits a device parameter ID string into its components: index, subindex, and device serial number.
The expected format of the ID must match deviceParameterIdRegExp. If the ID does not match the expected format, an error is thrown.
deviceParameterIdRegExp
A tuple [index, subindex, deviceSerial] where:
[index, subindex, deviceSerial]
index
subindex
deviceSerial
If the provided ID does not match the expected regular expression.
const id = "0x6040:00.123-ABC";const [deviceSerial, index, subindex] = splitDeviceParameterId(id);// deviceSerial = "123-ABC"// index = 0x6040// subindex = 0x00
The device parameter ID string to split.
Generated using TypeDoc
Splits a device parameter ID string into its components: index, subindex, and device serial number.
The expected format of the ID must match
deviceParameterIdRegExp. If the ID does not match the expected format, an error is thrown.Returns
A tuple
[index, subindex, deviceSerial]where:indexis the 16-bit parameter index (parsed from hexadecimal),subindexis the 8-bit parameter subindex (parsed from hexadecimal),deviceSerialis the device serial number as a string.Throws
If the provided ID does not match the expected regular expression.
Example