@catchpower/device-config-interaction 0.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catchpower-device-config-interaction.mjs","sources":["../../../projects/device-config-interaction/src/lib/device-config-interaction.service.ts","../../../projects/device-config-interaction/src/lib/dataset-processing.service.ts","../../../projects/device-config-interaction/src/lib/crc-check.service.ts","../../../projects/device-config-interaction/src/lib/command.service.ts","../../../projects/device-config-interaction/src/lib/device-config-dataset.service.ts","../../../projects/device-config-interaction/src/lib/device-live-dataset.service.ts","../../../projects/device-config-interaction/src/lib/device-config-interaction.module.ts","../../../projects/device-config-interaction/src/public-api.ts","../../../projects/device-config-interaction/src/catchpower-device-config-interaction.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport {\n IConfig,\n IDevicesList,\n IDisplay,\n IOtherDataObj,\n IRawDataObj,\n} from '../public-api';\nimport { AxiosResponse } from 'axios';\nimport * as axios from 'axios';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class CpDevicesListService {\n //constructor() {}\n\n async getDevicesList(\n _url: string,\n auth: string,\n listVersion = '-1'\n ): Promise<IDevicesList | Error> {\n //console.log('getDevicesList function TRIGGERED ', _url);\n const headers = {\n Authorization: 'Basic ' + btoa(auth),\n 'list-version': listVersion,\n };\n const response = await axios.default\n .request({\n method: 'get',\n url: _url,\n headers: headers,\n })\n .then(\n (res: AxiosResponse) => {\n if (res.status == 200) {\n //console.log( 'get DL function SUCCESS ', JSON.stringify(res));\n return res.data as IDevicesList;\n } else {\n return new Error(\n 'ERROR getting Devices List. ' + JSON.stringify(res)\n );\n }\n },\n (error: AxiosResponse) => {\n return new Error(\n 'ERROR getting Devices List. ' + JSON.stringify(error)\n );\n }\n );\n\n return response;\n }\n\n getValueFromObj(\n element: IDisplay | IConfig,\n name: string\n ): (string | number) | null {\n let value = null;\n let notInOther = true;\n element.otherData.forEach((other: IOtherDataObj) => {\n if (other.name == name) {\n value = other.value;\n notInOther = false;\n }\n });\n if (notInOther) {\n element.rawData.forEach((raw: IRawDataObj) => {\n if (raw.name == name) {\n value = raw.value;\n }\n });\n }\n return value;\n }\n}\n","import { Injectable } from '@angular/core';\nimport {\n IBufferObj,\n IProcessDataObj,\n IProcessDataStep,\n IRawDataObj,\n IOtherDataObj,\n IConfig,\n IDisplay,\n} from '../lib/interfaces/devices-list';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DatasetProcessingService {\n //constructor() {}\n /*\n * For use with DataView\n *\n */\n getValuefromBuffer(obj: IBufferObj, buffer: DataView) {\n let value = 0;\n if (obj.signed) {\n switch (obj.length) {\n case 8:\n value = buffer.getInt8(obj.position);\n break;\n case 16:\n value = buffer.getInt16(obj.position, obj.little);\n break;\n case 32:\n value = buffer.getInt32(obj.position, obj.little);\n break;\n }\n } else {\n switch (obj.length) {\n case 8:\n value = buffer.getUint8(obj.position);\n break;\n case 16:\n value = buffer.getUint16(obj.position, obj.little);\n break;\n case 32:\n value = buffer.getUint32(obj.position, obj.little);\n break;\n }\n }\n return value;\n }\n\n /*\n * For use with DataView\n *\n *\n */\n writeValueToBuffer(obj: IBufferObj, value: number, buffer: DataView) {\n if (obj.signed) {\n switch (obj.length) {\n case 8:\n buffer.setInt8(obj.position, value);\n break;\n case 16:\n buffer.setInt16(obj.position, value, obj.little);\n break;\n case 32:\n buffer.setInt32(obj.position, value, obj.little);\n break;\n }\n } else {\n switch (obj.length) {\n case 8:\n buffer.setUint8(obj.position, value);\n break;\n case 16:\n buffer.setUint16(obj.position, value, obj.little);\n break;\n case 32:\n buffer.setUint32(obj.position, value, obj.little);\n break;\n }\n }\n }\n\n runProcess(\n process: IProcessDataObj,\n rawData: IRawDataObj[],\n otherData: IOtherDataObj[]\n ) {\n const values: (string | number)[] = this.getChunkValues(\n process.data,\n rawData,\n otherData\n );\n //console.log('process values ', values);\n let pVal: string | number | boolean = 0;\n switch (process.type) {\n case 'ass':\n pVal = this.assembleProcess(values);\n process.value = pVal;\n return;\n case 'com':\n pVal = this.compareProcess(\n values as [number, '<' | '<=' | '==' | '>=' | '>', number],\n process\n );\n process.value = pVal;\n return;\n case 'cal':\n pVal = this.calculateProcess(\n values as [number, '+' | '-' | '/' | '*', number]\n );\n process.value = pVal;\n return;\n case 'tfm':\n pVal = this.tfmProcess(values as number[]);\n process.value = pVal;\n return;\n case 'cdt':\n pVal = this.cdtProcess(values as string[]);\n process.value = pVal;\n return;\n case 'itd':\n pVal = this.itdProcess(values as number[]);\n process.value = pVal;\n return;\n case 'its':\n pVal = this.itsProcess(values as number[]);\n process.value = pVal;\n return;\n case 'bsv':\n pVal = this.bsvProcess(values);\n process.value = pVal;\n return;\n case 'vfa':\n pVal = this.vfaProcess(values as number[], process);\n process.value = pVal;\n return;\n case 'cts':\n pVal = this.ctsProcess(values as number[]);\n process.value = pVal;\n return;\n }\n }\n\n assembleProcess(values: (string | number)[]) {\n let result = '';\n values.forEach((v) => {\n result += v;\n });\n return result;\n }\n\n disassembleProcess(string: string, values: IProcessDataStep[]) {\n const result: { [key: string]: number } = {};\n let i = 0;\n let length = 0;\n values.forEach((val) => {\n if (Object.prototype.hasOwnProperty.call(val, 'strLength')) {\n length = val.strLength as number;\n } else {\n const str = val.value as string;\n length = str.length;\n }\n if (val.fromData == 'raw') {\n result[val.value] = Number(string.substring(i, i + length));\n }\n i = i + length;\n });\n //console.log('Disassemble Result ', JSON.stringify(result));\n return result;\n }\n\n compareProcess(\n values: [number, '<' | '<=' | '==' | '>=' | '>', number],\n process: IProcessDataObj\n ) {\n const result: boolean = this.compareValues(values[0], values[1], values[2]);\n let text = 'N/A';\n if ('comTxt' in process) {\n if (process.comTxt !== undefined) {\n if (result) {\n text = process.comTxt[0];\n } else {\n return process.comTxt[1];\n }\n }\n }\n return text;\n }\n\n compareValues(v1: number, op: '<' | '<=' | '==' | '>=' | '>', v2: number) {\n switch (op) {\n case '<':\n return v1 < v2;\n case '<=':\n return v1 <= v2;\n case '==':\n return v1 == v2;\n case '>=':\n return v1 >= v2;\n case '>':\n return v1 > v2;\n default:\n return false;\n }\n }\n\n calculateProcess(values: [number, '+' | '-' | '/' | '*', number]) {\n return this.calculateValues(values[0], values[1], values[2]);\n }\n\n calculateValues(v1: number, op: '+' | '-' | '/' | '*', v2: number) {\n switch (op) {\n case '+':\n return v1 + v2;\n case '-':\n return v1 - v2;\n case '/':\n return v1 / v2;\n case '*':\n return v1 * v2;\n default:\n return 0;\n }\n }\n\n tfmProcess(values: number[]) {\n const hours: number = Math.floor((values[0] * 60) / 3600);\n const mins: number = Math.floor((values[0] * 60 - hours * 3600) / 60);\n return this.displayTime(hours, mins);\n }\n\n cdtProcess(values: string[]) {\n const hours: number = parseInt(values[0].substring(11, 13));\n const mins: number = parseInt(values[0].substring(14, 16));\n return this.displayTime(hours, mins);\n }\n\n //New process to pick value from array based on interger value\n vfaProcess(values: number[], process: IProcessDataObj) {\n const value = values[0];\n if (process.valuesList !== undefined) {\n if (value < process.valuesList.length) {\n return process.valuesList[value];\n } else {\n return 'nip';\n }\n } else {\n return 'n/a';\n }\n }\n\n itdProcess(values: number[]) {\n let hours: number = Math.floor((values[0] * 60) / 3600);\n //console.log(\"hours \", hours);\n const mins: number = Math.floor((values[0] * 60 - hours * 3600) / 60);\n //console.log(\"mins \", mins);\n let h: number | string;\n let m: number | string;\n if (hours > 23) {\n hours = hours - 24;\n }\n if (hours < 10) {\n h = '0' + hours;\n } else {\n h = hours;\n }\n if (mins < 10) {\n m = '0' + mins;\n } else {\n m = mins;\n }\n const string: string = '0000-00-00T' + h + ':' + m;\n //console.log(\"$%^&&^%%$$%^&&&^%%%%^^^&&&^^%^%%%^^^& dt string \", string);\n return string;\n }\n\n dtiProcess(string: string, values: IProcessDataStep[]) {\n //console.log(\"dtiProcess inputs string: \", string, \" Values: \", values);\n const result: { [key: string | number]: number } = {};\n let h: number;\n let m: number;\n values.forEach((val) => {\n // h = Number(string.substr(11, 2));\n // m = Number(string.substr(14, 2));\n h = Number(string.substring(11, 13));\n m = Number(string.substring(14, 16));\n result[val.value] = h * 60 + m;\n });\n //console.log(\"date to integer Result \", JSON.stringify(result));\n return result;\n }\n\n itsProcess(values: number[]) {\n //console.log('itsProcess values', JSON.stringify(values));\n const str: string = values[0].toString();\n return str;\n }\n\n stiProcess(string: string, values: IProcessDataStep[]) {\n const result: { [key: string | number]: number } = {};\n values.forEach((val) => {\n result[val.value] = Number(string);\n });\n //console.log(\"string to integer Result \", JSON.stringify(result));\n return result;\n }\n\n bsvProcess(values: (number | string)[]) {\n const startValue: string = values[0] as string;\n const pos1: number = values[1] as number;\n const pos2: number = pos1 + 1;\n const binaryStr: string = parseInt(startValue, 10)\n .toString(2)\n .padStart(4, '0');\n return binaryStr.substring(pos1, pos2);\n }\n\n bsvRevert(\n string: string,\n values: IProcessDataStep[],\n bssObj: { [key: string]: string | number }\n ) {\n if (Object.prototype.hasOwnProperty.call(bssObj, values[0].value)) {\n bssObj[values[0].value] = this.replaceCharAt(\n bssObj[values[0].value] as string,\n values[1].value as number,\n string\n );\n } else {\n bssObj[values[0].value] = '0000';\n bssObj[values[0].value] = this.replaceCharAt(\n bssObj[values[0].value] as string,\n values[1].value as number,\n string\n );\n }\n return bssObj;\n }\n\n stcProcess(value: string) {\n const initArray = value.split('');\n const resultArray: number[] = [];\n initArray.forEach((v) => {\n resultArray.push(v.charCodeAt(0));\n });\n return resultArray;\n }\n\n ctsProcess(values: number[]) {\n // let result: string = \"\";\n const ary: number[] = [];\n values.forEach((v) => {\n if (v >= 0) {\n ary.push(v);\n } else {\n ary.push(0);\n }\n });\n //console.log(\"CTS PROCESS INPUT VALUES \", values);\n let str = String.fromCharCode(...ary);\n // eslint-disable-next-line no-control-regex\n str = str.replace(/[\\u0000]/g, '');\n //str = str.replace(/[^\\x20-\\x7E]/g, \"\");\n return str;\n }\n\n ctsRevert(\n otherObj: IOtherDataObj,\n results: { [key: string | number]: string | number }\n ) {\n const valAry = this.stcProcess(<string>otherObj.value);\n //console.log(\"VAL ARRAY\", valAry);\n //console.log(\"PROCESS DATA\", JSON.stringify(otherObj.processData));\n let progress = 0;\n otherObj.processData[0].data.forEach((process) => {\n const res: { [key: string | number]: string | number } = {};\n\n if (valAry.length >= progress) {\n res[process.value] = valAry[progress];\n } else {\n res[process.value] = 0;\n }\n results = Object.assign(results, res);\n ++progress;\n });\n return results;\n }\n\n binaryStrToDecimal(str: string) {\n return parseInt(str, 2);\n }\n\n replaceCharAt(string: string, index: number, char: string) {\n return (\n string.substring(0, index) + char + string.substring(index + char.length)\n );\n //return string.substr(0, index) + char + string.substr(index + char.length);\n }\n\n writeFormValuesToRawObj(\n formValues: { [key: string]: string | number },\n rawObj: IRawDataObj[]\n ) {\n // rawObj.forEach((raw) => {\n // if (formValues.hasOwnProperty(raw.name)) {\n // raw.value = Math.round(formValues[raw.name] / raw.multi);\n // }\n // });\n for (let i = 0; i < rawObj.length; i++) {\n if (Object.prototype.hasOwnProperty.call(formValues, rawObj[i].name)) {\n rawObj[i].value = Math.round(\n (formValues[rawObj[i].name] as number) / rawObj[i].multi\n );\n }\n }\n return rawObj;\n }\n\n getPwd(rawValues: IRawDataObj[]) {\n const pwdArray: number[] = [];\n let i: number;\n let name: string;\n\n for (i = 0; i < 16; i++) {\n if (i < 10) {\n name = 'pass_0' + i;\n } else {\n name = 'pass_' + i;\n }\n rawValues.forEach((v) => {\n if (v.name == name) {\n pwdArray.push(v.value);\n }\n });\n }\n\n return pwdArray;\n }\n\n strToPwd(string: string) {\n const pwdArray: number[] = [];\n let i: number;\n\n if (string == null) {\n string = '';\n }\n\n for (i = 0; i < 16; i++) {\n if (i < string.length) {\n pwdArray.push(string.charCodeAt(i));\n } else {\n pwdArray.push(0);\n }\n }\n\n return pwdArray;\n }\n\n chkPwd(arr1: number[], arr2: number[]) {\n if (\n !Array.isArray(arr1) ||\n !Array.isArray(arr2) ||\n arr1.length !== arr2.length\n )\n return false;\n\n for (let i = 0; i < arr1.length; i++) {\n if (arr1[i] !== arr2[i]) return false;\n }\n\n return true;\n }\n\n writePwdToConfig(passArray: number[], rawObj: IRawDataObj[]) {\n let i: number;\n let name: string;\n\n //console.log(\"Before write password \", JSON.stringify(rawObj));\n\n for (i = 0; i < 16; i++) {\n if (i < 10) {\n name = 'pass_0' + i;\n } else {\n name = 'pass_' + i;\n }\n rawObj.forEach((v) => {\n if (v.name == name) {\n v.value = passArray[i];\n }\n });\n }\n\n //console.log(\"After write password \", JSON.stringify(rawObj));\n\n return rawObj;\n }\n\n displayTime(hours: number, mins: number) {\n //console.log(\"hours = \", hours, \" mins = \", mins);\n let m: number | string = mins;\n let p = 'am';\n if (mins < 10) {\n m = '0' + mins;\n }\n if (hours > 11) {\n p = 'pm';\n }\n if (hours == 0) {\n hours = 12;\n }\n if (hours > 12) {\n hours -= 12;\n }\n return hours + ':' + m + ' ' + p;\n }\n\n getChunkValues(\n processData: IProcessDataStep[],\n rawData: IRawDataObj[],\n otherData: IOtherDataObj[]\n ) {\n // console.log(\n // 'GET CHUNK VALUES ',\n // JSON.stringify(rawData),\n // ' ',\n // JSON.stringify(otherData)\n // );\n let v: string | number;\n const values: (string | number)[] = [];\n processData.forEach((chunk) => {\n //console.log('Process Raw chunk ', JSON.stringify(chunk));\n switch (chunk.fromData) {\n case 'raw':\n rawData.forEach((rd) => {\n if (rd.name == chunk.value) {\n //console.log('RAW chunk name: ', rd.name);\n v = rd.value;\n }\n });\n break;\n case 'other':\n otherData.forEach((od) => {\n if (od.name == chunk.value) {\n v = od.value;\n }\n });\n break;\n case 'no':\n v = chunk.value;\n break;\n }\n\n if (typeof chunk.strLength === 'undefined') {\n values.push(v);\n } else {\n const pad = v.toString().padStart(chunk.strLength, '0');\n values.push(pad);\n }\n });\n return values;\n }\n\n uint8ArrayToArray(uint8: Uint8Array): number[] {\n return Array.from(uint8);\n }\n\n arrayToUint8Array(array: number[]): Uint8Array {\n return Uint8Array.from(array);\n }\n\n isUint8Array(v: number[] | Uint8Array) {\n const isStr = Object.prototype.toString;\n return isStr.call(v) === '[object Uint8Array]';\n }\n\n processRaw(input: number[] | Uint8Array, configObj: IConfig | IDisplay) {\n let buffer: Uint8Array;\n if (this.isUint8Array(input)) {\n buffer = input as Uint8Array;\n } else {\n buffer = this.arrayToUint8Array(input as number[]);\n }\n const rawDataBuffer = new DataView(buffer.buffer, 0, 254);\n //console.log('PROCESS RAW CONFIG ', rawDataBuffer);\n configObj.rawData.forEach((datapoint) => {\n datapoint.value =\n this.getValuefromBuffer(datapoint.buffer, rawDataBuffer) *\n datapoint.multi;\n });\n }\n\n processOther(configObj: IConfig | IDisplay) {\n configObj.otherData.forEach((dataPoint) => {\n dataPoint.processData.forEach((process) => {\n this.runProcess(process, configObj.rawData, configObj.otherData);\n dataPoint.value = process.value;\n });\n });\n }\n}\n","import { Injectable } from '@angular/core';\nimport { ICommandData } from '../public-api';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class CrcCheckService {\n // checksum arrays\n auchCRCHi = [\n 0x00, 0xc1, 0x81, 0x40, 0x01, 0xc0, 0x80, 0x41, 0x01, 0xc0, 0x80, 0x41,\n 0x00, 0xc1, 0x81, 0x40, 0x01, 0xc0, 0x80, 0x41, 0x00, 0xc1, 0x81, 0x40,\n 0x00, 0xc1, 0x81, 0x40, 0x01, 0xc0, 0x80, 0x41, 0x01, 0xc0, 0x80, 0x41,\n 0x00, 0xc1, 0x81, 0x40, 0x00, 0xc1, 0x81, 0x40, 0x01, 0xc0, 0x80, 0x41,\n 0x00, 0xc1, 0x81, 0x40, 0x01, 0xc0, 0x80, 0x41, 0x01, 0xc0, 0x80, 0x41,\n 0x00, 0xc1, 0x81, 0x40, 0x01, 0xc0, 0x80, 0x41, 0x00, 0xc1, 0x81, 0x40,\n 0x00, 0xc1, 0x81, 0x40, 0x01, 0xc0, 0x80, 0x41, 0x00, 0xc1, 0x81, 0x40,\n 0x01, 0xc0, 0x80, 0x41, 0x01, 0xc0, 0x80, 0x41, 0x00, 0xc1, 0x81, 0x40,\n 0x00, 0xc1, 0x81, 0x40, 0x01, 0xc0, 0x80, 0x41, 0x01, 0xc0, 0x80, 0x41,\n 0x00, 0xc1, 0x81, 0x40, 0x01, 0xc0, 0x80, 0x41, 0x00, 0xc1, 0x81, 0x40,\n 0x00, 0xc1, 0x81, 0x40, 0x01, 0xc0, 0x80, 0x41, 0x01, 0xc0, 0x80, 0x41,\n 0x00, 0xc1, 0x81, 0x40, 0x00, 0xc1, 0x81, 0x40, 0x01, 0xc0, 0x80, 0x41,\n 0x00, 0xc1, 0x81, 0x40, 0x01, 0xc0, 0x80, 0x41, 0x01, 0xc0, 0x80, 0x41,\n 0x00, 0xc1, 0x81, 0x40, 0x00, 0xc1, 0x81, 0x40, 0x01, 0xc0, 0x80, 0x41,\n 0x01, 0xc0, 0x80, 0x41, 0x00, 0xc1, 0x81, 0x40, 0x01, 0xc0, 0x80, 0x41,\n 0x00, 0xc1, 0x81, 0x40, 0x00, 0xc1, 0x81, 0x40, 0x01, 0xc0, 0x80, 0x41,\n 0x00, 0xc1, 0x81, 0x40, 0x01, 0xc0, 0x80, 0x41, 0x01, 0xc0, 0x80, 0x41,\n 0x00, 0xc1, 0x81, 0x40, 0x01, 0xc0, 0x80, 0x41, 0x00, 0xc1, 0x81, 0x40,\n 0x00, 0xc1, 0x81, 0x40, 0x01, 0xc0, 0x80, 0x41, 0x01, 0xc0, 0x80, 0x41,\n 0x00, 0xc1, 0x81, 0x40, 0x00, 0xc1, 0x81, 0x40, 0x01, 0xc0, 0x80, 0x41,\n 0x00, 0xc1, 0x81, 0x40, 0x01, 0xc0, 0x80, 0x41, 0x01, 0xc0, 0x80, 0x41,\n 0x00, 0xc1, 0x81, 0x40,\n ];\n auchCRCLo = [\n 0x00, 0xc0, 0xc1, 0x01, 0xc3, 0x03, 0x02, 0xc2, 0xc6, 0x06, 0x07, 0xc7,\n 0x05, 0xc5, 0xc4, 0x04, 0xcc, 0x0c, 0x0d, 0xcd, 0x0f, 0xcf, 0xce, 0x0e,\n 0x0a, 0xca, 0x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0x95, 0x94, 0x54, 0x9c, 0x5c, 0x5d, 0x9d, 0x5f, 0x9f, 0x9e, 0x5e,\n 0x5a, 0x9a, 0x9b, 0x5b, 0x99, 0x59, 0x58, 0x98, 0x88, 0x48, 0x49, 0x89,\n 0x4b, 0x8b, 0x8a, 0x4a, 0x4e, 0x8e, 0x8f, 0x4f, 0x8d, 0x4d, 0x4c, 0x8c,\n 0x44, 0x84, 0x85, 0x45, 0x87, 0x47, 0x46, 0x86, 0x82, 0x42, 0x43, 0x83,\n 0x41, 0x81, 0x80, 0x40,\n ];\n\n //constructor() {}\n\n _buildCRC(\n puchMsg: Uint8Array,\n usDataLen: number,\n startIndex = 0\n ): [number, number] {\n console.log('Start of CRC check generation.');\n let uchCRCHi = 0xff; /* high byte of CRC initialized */\n let uchCRCLo = 0xff; /* low byte of CRC initialized */\n let uIndex; /* will index into CRC lookup table */\n let bufferIndex = startIndex;\n\n while (usDataLen--) {\n uIndex = uchCRCLo ^ puchMsg[bufferIndex]; /* calculate the CRC */\n\n bufferIndex++;\n uchCRCLo = uchCRCHi ^ this.auchCRCHi[uIndex];\n uchCRCHi = this.auchCRCLo[uIndex];\n }\n\n return [uchCRCHi, uchCRCLo];\n }\n\n /**\n *\n * @param sentValuePair\n * @param receivedValuePair\n * @returns\n */\n saveCheck(\n sentValuePair: [number, number],\n receivedValuePair: [number, number]\n ): boolean {\n console.log(\n 'CRC save check sent ',\n sentValuePair,\n ' recieved ',\n receivedValuePair\n );\n if (\n sentValuePair[0] === receivedValuePair[0] &&\n sentValuePair[1] === receivedValuePair[1]\n ) {\n console.log('CRC compare check TRUE');\n return true;\n } else {\n console.log('CRC compare check FALSE');\n return false;\n }\n }\n\n async writeCrcToCommand(commandData: ICommandData) {\n console.log('WRITE CRC TO COMMAND TRIGGERED ');\n const checkSum = this._buildCRC(\n commandData.byteData,\n commandData.byteData.length - 2\n );\n\n console.log('###### ####### CRC16 values ', checkSum);\n\n commandData.byteData[253] = checkSum[0];\n commandData.byteData[254] = checkSum[1];\n\n return commandData;\n }\n}\n","import { Injectable } from '@angular/core';\nimport { ICommandDataApi, IDevice, IRawDataObj } from '../public-api';\nimport { DatasetProcessingService } from './dataset-processing.service';\nimport { CrcCheckService } from './crc-check.service';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class CommandService {\n constructor(\n private dps: DatasetProcessingService,\n private crcService: CrcCheckService\n ) {}\n\n /**\n * For Bluetooth command send\n * @param currentDevice\n * @param command\n * @param rawDataObj\n * @returns\n */\n async createCommandData(\n currentDevice: IDevice,\n command: string,\n rawDataObj?: IRawDataObj[]\n ) {\n let opCode = 0;\n const comandBuffer = new ArrayBuffer(currentDevice.write.bufferSize);\n\n currentDevice.commands.forEach((commandObj) => {\n //console.log('Command Name', commandObj.name);\n if (command == commandObj.name) {\n opCode = parseInt(commandObj.opCode);\n }\n });\n\n //console.log('########### $$$$$$$$$$$$ Op Code ', opCode);\n if (rawDataObj !== undefined) {\n //console.log('create Command Data, Raw Data Object is present.');\n const dataView = new DataView(comandBuffer);\n rawDataObj.forEach((raw) => {\n this.dps.writeValueToBuffer(raw.buffer, raw.value, dataView);\n });\n }\n\n let commandData = {\n opCode: opCode,\n service: currentDevice.write.service,\n characteristic: currentDevice.write.characteristic,\n byteData: new Uint8Array(comandBuffer),\n };\n commandData.byteData[0] = commandData.opCode;\n\n commandData = await this.crcService.writeCrcToCommand(commandData);\n\n return commandData;\n }\n\n async createCommandDataForApi(\n currentDevice: IDevice,\n command: string,\n rawDataObj?: IRawDataObj[]\n ): Promise<ICommandDataApi> {\n let raw = undefined;\n if (rawDataObj !== undefined) {\n raw = rawDataObj;\n }\n const commandBt = this.createCommandData(currentDevice, command, raw);\n const send = {\n serialNumber: currentDevice.serial.toString(),\n data: this.dps.uint8ArrayToArray((await commandBt).byteData),\n };\n //console.log(JSON.stringify(send));\n return send;\n }\n}\n","import { Injectable } from '@angular/core';\nimport {\n UntypedFormGroup,\n UntypedFormBuilder,\n UntypedFormControl,\n Validators,\n} from '@angular/forms';\nimport { DatasetProcessingService } from './dataset-processing.service';\n\nimport { IConfig, IFormDataObj } from '../lib/interfaces/devices-list';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DeviceConfigDatasetService {\n constructor(\n private dps: DatasetProcessingService,\n public formBuilder: UntypedFormBuilder\n ) {}\n\n processConfig(buffer: number[] | Uint8Array, config: IConfig) {\n this.dps.processRaw(buffer, config);\n this.dps.processOther(config);\n this.processForm(config);\n return config;\n }\n\n processForm(config: IConfig) {\n //console.log(\"Starting to process form data\");\n config.formData.forEach((formSection) => {\n formSection.dataObjs.forEach((formControl) => {\n config.rawData.forEach((dp) => {\n if (formControl.dataId == dp.name) {\n formControl.value = dp.value;\n }\n });\n config.otherData.forEach((dp) => {\n if (formControl.dataId == dp.name) {\n formControl.value = dp.value;\n }\n });\n });\n });\n }\n\n processResultsToFormData(\n formResults: { [key: string]: string | number },\n config: IConfig\n ) {\n for (let i = 0; i < config.formData.length; i++) {\n for (let x = 0; x < config.formData[i].dataObjs.length; x++) {\n if (\n Object.prototype.hasOwnProperty.call(\n formResults,\n config.formData[i].dataObjs[x].dataId\n )\n ) {\n config.formData[i].dataObjs[x].value =\n formResults[config.formData[i].dataObjs[x].dataId];\n }\n\n if (\n Object.prototype.hasOwnProperty.call(\n config.formData[i].dataObjs[x],\n 'autoInput'\n )\n ) {\n if (config.formData[i].dataObjs[x].autoInput == true) {\n //console.log(\"auto date condition met\");\n config.formData[i].dataObjs[x].value = this.currentDateTimeStr();\n }\n }\n }\n }\n\n //console.log(\"formdata object updated\", JSON.stringify(config.formData));\n return config;\n }\n\n currentDateTimeStr() {\n const date = new Date();\n const str =\n date.getFullYear() +\n '-' +\n (date.getMonth() + 1).toString().padStart(2, '0') +\n '-' +\n date.getDate().toString().padStart(2, '0') +\n 'T' +\n date.getHours().toString().padStart(2, '0') +\n ':' +\n date.getMinutes().toString().padStart(2, '0');\n return str;\n }\n\n extractBackToRaw(config: IConfig): IConfig {\n const otherToProcess: { [key: string]: number | string } = {};\n let valuesToRaw: { [key: string]: number | string } = {};\n let bss: { [key: string]: number | string } = {};\n\n if (Object.prototype.hasOwnProperty.call(config, 'formData')) {\n for (let i = 0; i < config.formData.length; i++) {\n for (let x = 0; x < config.formData[i].dataObjs.length; x++) {\n let isRawData = false;\n for (let z = 0; z < config.rawData.length; z++) {\n if (\n config.rawData[z].name == config.formData[i].dataObjs[x].dataId\n ) {\n valuesToRaw[config.formData[i].dataObjs[x].dataId] =\n config.formData[i].dataObjs[x].value;\n isRawData = true;\n }\n }\n if (isRawData == false) {\n otherToProcess[config.formData[i].dataObjs[x].dataId] =\n config.formData[i].dataObjs[x].value;\n }\n }\n }\n } else {\n config.otherData.forEach((otherObj) => {\n otherToProcess[otherObj.name] = otherObj.value;\n });\n }\n\n //console.log('Other to Process ', JSON.stringify(otherToProcess));\n\n config.otherData.forEach((otherObj) => {\n const value = otherToProcess[otherObj.name];\n // console.log(\n // 'EXTRACT BACK TO RAW ',\n // ' ',\n // otherObj.name,\n // ' ',\n // JSON.stringify(value)\n // );\n otherObj.processData.forEach((pdo) => {\n switch (pdo.type) {\n case 'ass':\n valuesToRaw = Object.assign(\n valuesToRaw,\n this.dps.disassembleProcess(value as string, pdo.data)\n );\n return;\n case 'itd':\n valuesToRaw = Object.assign(\n valuesToRaw,\n this.dps.dtiProcess(value as string, pdo.data)\n );\n return;\n case 'its':\n valuesToRaw = Object.assign(\n valuesToRaw,\n this.dps.stiProcess(value as string, pdo.data)\n );\n return;\n case 'bsv':\n bss = this.dps.bsvRevert(value as string, pdo.data, bss);\n return;\n }\n });\n });\n\n if (Object.keys(bss).length > 0) {\n for (const str in bss) {\n valuesToRaw[str] = this.dps.binaryStrToDecimal(bss[str] as string);\n }\n }\n config.rawData = this.dps.writeFormValuesToRawObj(\n valuesToRaw,\n config.rawData\n );\n //console.log(\"rawData Obj \", JSON.stringify(config.rawData));\n return config;\n }\n\n generateValidationRules(formField: IFormDataObj) {\n const validators = [];\n\n if (formField.required == true) {\n validators.push(Validators.required);\n }\n if (Object.prototype.hasOwnProperty.call(formField, 'min')) {\n if (formField.min !== undefined)\n validators.push(Validators.min(formField.min));\n }\n if (Object.prototype.hasOwnProperty.call(formField, 'max')) {\n if (formField.max !== undefined)\n validators.push(Validators.max(formField.max));\n }\n if (Object.prototype.hasOwnProperty.call(formField, 'minLength')) {\n if (formField.minLength !== undefined)\n validators.push(Validators.minLength(formField.minLength));\n }\n if (Object.prototype.hasOwnProperty.call(formField, 'maxLength')) {\n if (formField.maxLength !== undefined)\n validators.push(Validators.maxLength(formField.maxLength));\n }\n if (Object.prototype.hasOwnProperty.call(formField, 'rex')) {\n if (formField.rex !== undefined)\n validators.push(Validators.pattern(formField.rex));\n }\n return validators;\n }\n\n generateFormGroup(config: IConfig, blackList: string[]) {\n //console.log('Generate form group TRIGGERED');\n const configForm = new UntypedFormGroup({});\n\n for (let i = 0; i < config.formData.length; i++) {\n //console.log(\"FORM SECTION \", JSON.stringify(config.formData[i]));\n for (let x = 0; x < config.formData[i].dataObjs.length; x++) {\n if (!blackList.includes(config.formData[i].title)) {\n let fieldDisable = false;\n const validators = this.generateValidationRules(\n config.formData[i].dataObjs[x]\n );\n if (!config.formData[i].dataObjs[x].active) {\n fieldDisable = true;\n }\n //console.log('ADD CONTROL');\n configForm.addControl(\n config.formData[i].dataObjs[x].dataId,\n new UntypedFormControl(\n {\n value: config.formData[i].dataObjs[x].value,\n disabled: fieldDisable,\n },\n validators\n )\n );\n }\n }\n }\n //console.log('END OF GENERATE FORMGROUP');\n return configForm;\n }\n}\n","import { Injectable } from '@angular/core';\nimport { DatasetProcessingService } from './dataset-processing.service';\n\nimport { IDisplay, IDevice } from '../lib/interfaces/devices-list';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DeviceLiveDatasetService {\n constructor(private dps: DatasetProcessingService) {}\n\n processDisplay(buffer: number[] | Uint8Array, display: IDisplay) {\n this.dps.processRaw(buffer, display);\n this.dps.processOther(display);\n this.processLayout(display);\n return display;\n }\n\n processLayout(display: IDisplay) {\n display.layout.forEach((section) => {\n section.rows.forEach((row) => {\n row.cols.forEach((col) => {\n let wv: string | number = '';\n if (typeof col.refData !== 'undefined') {\n display.rawData.forEach((raw) => {\n if (raw.name == col.refData) {\n if (typeof col.round !== 'undefined') {\n wv = raw.value.toFixed(col.round);\n } else {\n wv = raw.value;\n }\n }\n });\n display.otherData.forEach((other) => {\n if (other.name == col.refData) {\n wv = other.value;\n }\n });\n if (typeof col.prepend !== 'undefined') {\n wv = col.prepend + wv;\n }\n if (typeof col.append !== 'undefined') {\n wv = wv + col.append;\n }\n col.value = <string>wv;\n }\n });\n });\n });\n }\n\n async rssiData(\n device: IDevice,\n rssiSignal: () => Promise<number>\n ): Promise<{ deviceName: string; rssi: string }> {\n const result = { deviceName: 'N/A', rssi: 'N/A' };\n\n if (device != null) {\n result.deviceName = device.name;\n const rssi = await rssiSignal();\n if (rssi <= 0) {\n result.rssi = rssi.toString() + ' dBa';\n }\n }\n return result;\n }\n}\n","import { NgModule } from '@angular/core';\n\n@NgModule({\n declarations: [],\n imports: [],\n exports: [],\n})\nexport class CpDevicesListModule {}\n","/*\n * Public API Surface of device-config-interaction\n */\n\nexport * from './lib/device-config-interaction.service';\nexport * from './lib/command.service';\nexport * from './lib/crc-check.service';\nexport * from './lib/dataset-processing.service';\nexport * from './lib/device-config-dataset.service';\nexport * from './lib/device-live-dataset.service';\n\nexport * from './lib/device-config-interaction.module';\n\nexport * from './lib/interfaces/devices-list';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.DatasetProcessingService","i2.CrcCheckService"],"mappings":";;;;;;MAca,oBAAoB,CAAA;;IAG/B,MAAM,cAAc,CAClB,IAAY,EACZ,IAAY,EACZ,WAAW,GAAG,IAAI,EAAA;;AAGlB,QAAA,MAAM,OAAO,GAAG;AACd,YAAA,aAAa,EAAE,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC;AACpC,YAAA,cAAc,EAAE,WAAW;S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AAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA,CAAA;;;MCAY,mBAAmB,CAAA;+GAAnB,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA,EAAA;gHAAnB,mBAAmB,EAAA,CAAA,CAAA,EAAA;gHAAnB,mBAAmB,EAAA,CAAA,CAAA,EAAA;;4FAAnB,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAL/B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,EAAE;AAChB,oBAAA,OAAO,EAAE,EAAE;AACX,oBAAA,OAAO,EAAE,EAAE;AACZ,iBAAA,CAAA;;;ACND;;AAEG;;ACFH;;AAEG;;;;"}
package/index.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="@catchpower/device-config-interaction" />
5
+ export * from './public-api';
@@ -0,0 +1,25 @@
1
+ import { ICommandDataApi, IDevice, IRawDataObj } from '../public-api';
2
+ import { DatasetProcessingService } from './dataset-processing.service';
3
+ import { CrcCheckService } from './crc-check.service';
4
+ import * as i0 from "@angular/core";
5
+ export declare class CommandService {
6
+ private dps;
7
+ private crcService;
8
+ constructor(dps: DatasetProcessingService, crcService: CrcCheckService);
9
+ /**
10
+ * For Bluetooth command send
11
+ * @param currentDevice
12
+ * @param command
13
+ * @param rawDataObj
14
+ * @returns
15
+ */
16
+ createCommandData(currentDevice: IDevice, command: string, rawDataObj?: IRawDataObj[]): Promise<{
17
+ opCode: number;
18
+ service: string;
19
+ characteristic: string;
20
+ byteData: Uint8Array;
21
+ }>;
22
+ createCommandDataForApi(currentDevice: IDevice, command: string, rawDataObj?: IRawDataObj[]): Promise<ICommandDataApi>;
23
+ static ɵfac: i0.ɵɵFactoryDeclaration<CommandService, never>;
24
+ static ɵprov: i0.ɵɵInjectableDeclaration<CommandService>;
25
+ }
@@ -0,0 +1,17 @@
1
+ import { ICommandData } from '../public-api';
2
+ import * as i0 from "@angular/core";
3
+ export declare class CrcCheckService {
4
+ auchCRCHi: number[];
5
+ auchCRCLo: number[];
6
+ _buildCRC(puchMsg: Uint8Array, usDataLen: number, startIndex?: number): [number, number];
7
+ /**
8
+ *
9
+ * @param sentValuePair
10
+ * @param receivedValuePair
11
+ * @returns
12
+ */
13
+ saveCheck(sentValuePair: [number, number], receivedValuePair: [number, number]): boolean;
14
+ writeCrcToCommand(commandData: ICommandData): Promise<ICommandData>;
15
+ static ɵfac: i0.ɵɵFactoryDeclaration<CrcCheckService, never>;
16
+ static ɵprov: i0.ɵɵInjectableDeclaration<CrcCheckService>;
17
+ }
@@ -0,0 +1,60 @@
1
+ import { IBufferObj, IProcessDataObj, IProcessDataStep, IRawDataObj, IOtherDataObj, IConfig, IDisplay } from '../lib/interfaces/devices-list';
2
+ import * as i0 from "@angular/core";
3
+ export declare class DatasetProcessingService {
4
+ getValuefromBuffer(obj: IBufferObj, buffer: DataView): number;
5
+ writeValueToBuffer(obj: IBufferObj, value: number, buffer: DataView): void;
6
+ runProcess(process: IProcessDataObj, rawData: IRawDataObj[], otherData: IOtherDataObj[]): void;
7
+ assembleProcess(values: (string | number)[]): string;
8
+ disassembleProcess(string: string, values: IProcessDataStep[]): {
9
+ [key: string]: number;
10
+ };
11
+ compareProcess(values: [number, '<' | '<=' | '==' | '>=' | '>', number], process: IProcessDataObj): string;
12
+ compareValues(v1: number, op: '<' | '<=' | '==' | '>=' | '>', v2: number): boolean;
13
+ calculateProcess(values: [number, '+' | '-' | '/' | '*', number]): number;
14
+ calculateValues(v1: number, op: '+' | '-' | '/' | '*', v2: number): number;
15
+ tfmProcess(values: number[]): string;
16
+ cdtProcess(values: string[]): string;
17
+ vfaProcess(values: number[], process: IProcessDataObj): string;
18
+ itdProcess(values: number[]): string;
19
+ dtiProcess(string: string, values: IProcessDataStep[]): {
20
+ [key: string]: number;
21
+ [key: number]: number;
22
+ };
23
+ itsProcess(values: number[]): string;
24
+ stiProcess(string: string, values: IProcessDataStep[]): {
25
+ [key: string]: number;
26
+ [key: number]: number;
27
+ };
28
+ bsvProcess(values: (number | string)[]): string;
29
+ bsvRevert(string: string, values: IProcessDataStep[], bssObj: {
30
+ [key: string]: string | number;
31
+ }): {
32
+ [key: string]: string | number;
33
+ };
34
+ stcProcess(value: string): number[];
35
+ ctsProcess(values: number[]): string;
36
+ ctsRevert(otherObj: IOtherDataObj, results: {
37
+ [key: string | number]: string | number;
38
+ }): {
39
+ [key: string]: string | number;
40
+ [key: number]: string | number;
41
+ };
42
+ binaryStrToDecimal(str: string): number;
43
+ replaceCharAt(string: string, index: number, char: string): string;
44
+ writeFormValuesToRawObj(formValues: {
45
+ [key: string]: string | number;
46
+ }, rawObj: IRawDataObj[]): IRawDataObj[];
47
+ getPwd(rawValues: IRawDataObj[]): number[];
48
+ strToPwd(string: string): number[];
49
+ chkPwd(arr1: number[], arr2: number[]): boolean;
50
+ writePwdToConfig(passArray: number[], rawObj: IRawDataObj[]): IRawDataObj[];
51
+ displayTime(hours: number, mins: number): string;
52
+ getChunkValues(processData: IProcessDataStep[], rawData: IRawDataObj[], otherData: IOtherDataObj[]): (string | number)[];
53
+ uint8ArrayToArray(uint8: Uint8Array): number[];
54
+ arrayToUint8Array(array: number[]): Uint8Array;
55
+ isUint8Array(v: number[] | Uint8Array): boolean;
56
+ processRaw(input: number[] | Uint8Array, configObj: IConfig | IDisplay): void;
57
+ processOther(configObj: IConfig | IDisplay): void;
58
+ static ɵfac: i0.ɵɵFactoryDeclaration<DatasetProcessingService, never>;
59
+ static ɵprov: i0.ɵɵInjectableDeclaration<DatasetProcessingService>;
60
+ }
@@ -0,0 +1,20 @@
1
+ import { UntypedFormGroup, UntypedFormBuilder, Validators } from '@angular/forms';
2
+ import { DatasetProcessingService } from './dataset-processing.service';
3
+ import { IConfig, IFormDataObj } from '../lib/interfaces/devices-list';
4
+ import * as i0 from "@angular/core";
5
+ export declare class DeviceConfigDatasetService {
6
+ private dps;
7
+ formBuilder: UntypedFormBuilder;
8
+ constructor(dps: DatasetProcessingService, formBuilder: UntypedFormBuilder);
9
+ processConfig(buffer: number[] | Uint8Array, config: IConfig): IConfig;
10
+ processForm(config: IConfig): void;
11
+ processResultsToFormData(formResults: {
12
+ [key: string]: string | number;
13
+ }, config: IConfig): IConfig;
14
+ currentDateTimeStr(): string;
15
+ extractBackToRaw(config: IConfig): IConfig;
16
+ generateValidationRules(formField: IFormDataObj): (typeof Validators.required)[];
17
+ generateFormGroup(config: IConfig, blackList: string[]): UntypedFormGroup;
18
+ static ɵfac: i0.ɵɵFactoryDeclaration<DeviceConfigDatasetService, never>;
19
+ static ɵprov: i0.ɵɵInjectableDeclaration<DeviceConfigDatasetService>;
20
+ }
@@ -0,0 +1,6 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class CpDevicesListModule {
3
+ static ɵfac: i0.ɵɵFactoryDeclaration<CpDevicesListModule, never>;
4
+ static ɵmod: i0.ɵɵNgModuleDeclaration<CpDevicesListModule, never, never, never>;
5
+ static ɵinj: i0.ɵɵInjectorDeclaration<CpDevicesListModule>;
6
+ }
@@ -0,0 +1,8 @@
1
+ import { IConfig, IDevicesList, IDisplay } from '../public-api';
2
+ import * as i0 from "@angular/core";
3
+ export declare class CpDevicesListService {
4
+ getDevicesList(_url: string, auth: string, listVersion?: string): Promise<IDevicesList | Error>;
5
+ getValueFromObj(element: IDisplay | IConfig, name: string): (string | number) | null;
6
+ static ɵfac: i0.ɵɵFactoryDeclaration<CpDevicesListService, never>;
7
+ static ɵprov: i0.ɵɵInjectableDeclaration<CpDevicesListService>;
8
+ }
@@ -0,0 +1,15 @@
1
+ import { DatasetProcessingService } from './dataset-processing.service';
2
+ import { IDisplay, IDevice } from '../lib/interfaces/devices-list';
3
+ import * as i0 from "@angular/core";
4
+ export declare class DeviceLiveDatasetService {
5
+ private dps;
6
+ constructor(dps: DatasetProcessingService);
7
+ processDisplay(buffer: number[] | Uint8Array, display: IDisplay): IDisplay;
8
+ processLayout(display: IDisplay): void;
9
+ rssiData(device: IDevice, rssiSignal: () => Promise<number>): Promise<{
10
+ deviceName: string;
11
+ rssi: string;
12
+ }>;
13
+ static ɵfac: i0.ɵɵFactoryDeclaration<DeviceLiveDatasetService, never>;
14
+ static ɵprov: i0.ɵɵInjectableDeclaration<DeviceLiveDatasetService>;
15
+ }
@@ -0,0 +1,183 @@
1
+ /** The complete devices list */
2
+ export interface IDevicesList {
3
+ /** Version of the devices list */
4
+ listVersion: number;
5
+ timestamp?: string;
6
+ /** List of the currently supported devices */
7
+ devicesList?: IDevice[];
8
+ /** Configuration options that fall outside of a single device (i.e. Site configurations) OR configuration options which are shared across multiple device models. */
9
+ extraConfigOptions?: {
10
+ /** Current key options are wifi, tetherData, tetherConfig, sunspecState, sunspecConfig, sunspecScan, sunspecList, sunspecsetDevices */
11
+ [key: string]: IExtraConfigOption;
12
+ };
13
+ }
14
+ /** All the relevant information for a device model. */
15
+ export interface IDevice {
16
+ /** The model ID of the device */
17
+ id: number;
18
+ /** The Model Name of the device */
19
+ name: string;
20
+ /** The serial number of the device */
21
+ serial: number;
22
+ /** Firmware version information for the device */
23
+ fwVersion: IFwVersionObj;
24
+ address?: string;
25
+ /** A list of commands for the device */
26
+ commands: IDeviceCommand[];
27
+ /** Bluetooth write command information */
28
+ write: IDeviceWn;
29
+ /** Bluetooth notify command information */
30
+ notify: IDeviceWn;
31
+ /** Device configuration object, contains raw byte information raw data value information and form information for the configuration of the device. */
32
+ config?: IConfig;
33
+ /** Device display object, contains information for the live display of the devices data */
34
+ display: IDisplay;
35
+ /** Extra configuration options used for configuration options which are common to multiple devices or configuration options that fall outside of a device (i.e. A site configuration option). */
36
+ extraConfig: {
37
+ /** Current key options are wifi, tetherData, tetherConfig, sunspecState, sunspecConfig, sunspecScan, sunspecList, sunspecsetDevices */
38
+ [key: string]: boolean;
39
+ };
40
+ }
41
+ /** Outlines data required for an extra config option */
42
+ export interface IExtraConfigOption {
43
+ rawData?: IRawDataObj[];
44
+ otherData?: IOtherDataObj[];
45
+ evList?: IEvListItem[];
46
+ }
47
+ /** A raw data object */
48
+ export interface IRawDataObj {
49
+ /** name of the data point */
50
+ name: string;
51
+ /** value of the raw data */
52
+ value: number;
53
+ /** detail the datas location in the raw data buffer */
54
+ buffer: IBufferObj;
55
+ /** Multipler to be used on the value */
56
+ multi: number;
57
+ }
58
+ /** used to process raw data into a usable form and to return the data to a raw form */
59
+ export interface IOtherDataObj {
60
+ name: string;
61
+ value: string | number;
62
+ processData: IProcessDataObj[];
63
+ }
64
+ export interface IEvListItem {
65
+ listName: string;
66
+ deviceName: string;
67
+ phases: 1 | 3;
68
+ connectors: number;
69
+ currentLimit: number;
70
+ implClass: string;
71
+ }
72
+ /** Contains Relevant information for getting and using devices firmware */
73
+ export interface IFwVersionObj {
74
+ version: number;
75
+ url: string;
76
+ files: string[];
77
+ packet: number;
78
+ devId?: number;
79
+ devName?: string;
80
+ devSerial?: number;
81
+ fwAvailable?: boolean;
82
+ currentVersion?: number;
83
+ }
84
+ /** Object describing a bluetooh device command */
85
+ export interface IDeviceCommand {
86
+ name: string;
87
+ opCode: string;
88
+ requestData: boolean;
89
+ response: boolean;
90
+ }
91
+ export interface IDeviceWn {
92
+ service: string;
93
+ characteristic: string;
94
+ bufferSize: number;
95
+ }
96
+ /** All information needed for getting and using configuration data */
97
+ export interface IConfig {
98
+ rawData: IRawDataObj[];
99
+ otherData: IOtherDataObj[];
100
+ formData: IFormSectionObj[];
101
+ }
102
+ export interface IDisplay {
103
+ rawData: IRawDataObj[];
104
+ otherData: IOtherDataObj[];
105
+ layout: IDisSectObj[];
106
+ }
107
+ export interface IBufferObj {
108
+ signed: boolean;
109
+ length: number;
110
+ position: number;
111
+ little: boolean;
112
+ }
113
+ export interface IProcessDataObj {
114
+ /** Currently used "ass" = assemble, join characters / strings together. "com" = compare two values. "cal" = calculate a value. "tfm" = time from minutes. "cdt" = time from datetime string. "itd" = minutes to time in ISO 8601 format. "its" = integer to string. "bsv" = not sure. "vfa" = value from array. "cts" = array of character codes to string.*/
115
+ type: 'ass' | 'com' | 'cal' | 'tfm' | 'cdt' | 'itd' | 'its' | 'bsv' | 'pwd' | 'vfa' | 'cts';
116
+ value: number | string;
117
+ data: IProcessDataStep[];
118
+ comTxt?: [string, string];
119
+ valuesList?: string[];
120
+ }
121
+ export interface IFormSectionObj {
122
+ title: string;
123
+ dataObjs: IFormDataObj[];
124
+ maxHeight?: string;
125
+ expanded?: boolean;
126
+ headDisplayObj?: number;
127
+ }
128
+ export interface IDisSectObj {
129
+ title: string;
130
+ rows: IDisRowObj[];
131
+ }
132
+ export interface IProcessDataStep {
133
+ value: string | number;
134
+ fromData: 'raw' | 'other' | 'no';
135
+ strLength?: number;
136
+ }
137
+ export interface IFormDataObj {
138
+ dataId: string;
139
+ label: string;
140
+ inputType: 'number' | 'text' | 'select' | 'datetime' | 'password' | 'page';
141
+ value: string | number;
142
+ active: boolean;
143
+ required: boolean;
144
+ inputMode?: 'decimal' | 'numeric' | 'text';
145
+ min?: number;
146
+ max?: number;
147
+ minLength?: number;
148
+ maxLength?: number;
149
+ rex?: string;
150
+ selectValues?: ISelectItemObj[];
151
+ dtFormat?: string;
152
+ valMsg?: string;
153
+ compare?: boolean;
154
+ autoInput?: boolean;
155
+ pageId?: string;
156
+ }
157
+ export interface IDisRowObj {
158
+ cols: IDisUnitObj[];
159
+ }
160
+ export interface IDisUnitObj {
161
+ title: boolean;
162
+ value: string;
163
+ size: number;
164
+ refData?: string;
165
+ prepend?: string;
166
+ append?: string;
167
+ isDateTime?: boolean;
168
+ round?: number;
169
+ }
170
+ export interface ISelectItemObj {
171
+ value: string;
172
+ label: string;
173
+ }
174
+ export interface ICommandData {
175
+ opCode: number;
176
+ service: string;
177
+ characteristic: string;
178
+ byteData: Uint8Array;
179
+ }
180
+ export interface ICommandDataApi {
181
+ serialNumber: string;
182
+ data: number[];
183
+ }
package/package.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "@catchpower/device-config-interaction",
3
+ "version": "0.0.13",
4
+ "peerDependencies": {
5
+ "@angular/common": "^16.2.0",
6
+ "@angular/core": "^16.2.0"
7
+ },
8
+ "dependencies": {
9
+ "tslib": "^2.3.0"
10
+ },
11
+ "sideEffects": false,
12
+ "module": "fesm2022/catchpower-device-config-interaction.mjs",
13
+ "typings": "index.d.ts",
14
+ "exports": {
15
+ "./package.json": {
16
+ "default": "./package.json"
17
+ },
18
+ ".": {
19
+ "types": "./index.d.ts",
20
+ "esm2022": "./esm2022/catchpower-device-config-interaction.mjs",
21
+ "esm": "./esm2022/catchpower-device-config-interaction.mjs",
22
+ "default": "./fesm2022/catchpower-device-config-interaction.mjs"
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,8 @@
1
+ export * from './lib/device-config-interaction.service';
2
+ export * from './lib/command.service';
3
+ export * from './lib/crc-check.service';
4
+ export * from './lib/dataset-processing.service';
5
+ export * from './lib/device-config-dataset.service';
6
+ export * from './lib/device-live-dataset.service';
7
+ export * from './lib/device-config-interaction.module';
8
+ export * from './lib/interfaces/devices-list';