@kvaser/canking-api
Version:
CanKing API to communicate with the CanKing service using Node.js.
2 lines (1 loc) • 3.83 kB
JavaScript
;var p=Object.defineProperty;var g=(e,s,n)=>s in e?p(e,s,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[s]=n;var i=(e,s,n)=>g(e,typeof s!="symbol"?s+"":s,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("long");const m=require("./ElectronAPIFake.js"),l=require("./measurement_settings.js"),a=window.electron??m.electronApiFake,c=e=>e&&e.message!==void 0,r=(e,s,n)=>{a.ipcRenderer.invoke("app-add-log-message",{time:Date.now(),logLevel:e,categoryName:s,message:n})};class u{constructor(s){i(this,"categoryName");this.categoryName=s}trace(s){r(0,this.categoryName,s)}debug(s){r(1,this.categoryName,s)}info(s){r(2,this.categoryName,s)}warn(s){r(3,this.categoryName,s)}error(s,n){typeof s=="string"?r(4,this.categoryName,s):c(s)&&r(4,this.categoryName,s.message),c(n)&&r(4,this.categoryName,n.message)}critical(s){r(5,this.categoryName,s)}}const y=e=>new u(e),w=async(e,s)=>{await a.ipcRenderer.invoke("app-show-message-box",e,s)},R=async(e,s,n,t,o)=>await a.ipcRenderer.invoke("app-show-question-box",e,s,n,t,o),k=async()=>{await a.ipcRenderer.invoke("rpc-start-measurement")},v=async()=>{await a.ipcRenderer.invoke("rpc-stop-measurement")},f=async e=>{await a.ipcRenderer.invoke("rpc-add-source",e)},M=async e=>{await a.ipcRenderer.invoke("rpc-update-source",e)},N=async e=>{await a.ipcRenderer.invoke("rpc-delete-source",e)},L=async(e,s,n)=>{await a.ipcRenderer.invoke("rpc-add-data-processor",e,s,n)},h=async e=>{await a.ipcRenderer.invoke("rpc-update-data-processor",e)},F=async e=>{await a.ipcRenderer.invoke("rpc-delete-data-processor",e)},P=async e=>{await a.ipcRenderer.invoke("rpc-add-target",e)},T=async e=>{await a.ipcRenderer.invoke("rpc-update-target",e)},b=async e=>{await a.ipcRenderer.invoke("rpc-delete-target",e)},D=async(e,s)=>{await a.ipcRenderer.invoke("rpc-connect-nodes",e,s)},S=async(e,s)=>{await a.ipcRenderer.invoke("rpc-disconnect-nodes",e,s)},q=async e=>{await a.ipcRenderer.invoke("rpc-enable-node",e)},x=async e=>{await a.ipcRenderer.invoke("rpc-disable-node",e)},d=async(e,s)=>{await a.ipcRenderer.invoke("rpc-send-message",e,s)},B=async(e,s,n,...t)=>{const o=l.WriteFrame.fromPartial({id:s,data:n,canFrameFlags:{flags:t}});await d(e,o)},I=async(e,s)=>{await a.ipcRenderer.invoke("rpc-update-lin-message",e,s)},A=async(e,s)=>{await a.ipcRenderer.invoke("rpc-clear-lin-message",e,s)},C=async(e,s)=>{await a.ipcRenderer.invoke("rpc-request-lin-message",e,s)},E=async e=>await a.ipcRenderer.invoke("rpc-start-periodic-transmission",e),Q=async(e,s)=>{await a.ipcRenderer.invoke("rpc-update-periodic-transmission",e,s)},j=async e=>{await a.ipcRenderer.invoke("rpc-stop-periodic-transmission",e)},O=async e=>{await a.ipcRenderer.invoke("rpc-start-log-replay",e)},W=async e=>{await a.ipcRenderer.invoke("rpc-stop-log-replay",e)},_=async()=>await a.ipcRenderer.invoke("rpc-get-message-log-file-formats"),z=async()=>await a.ipcRenderer.invoke("rpc-get-signal-log-file-formats"),G=async e=>await a.ipcRenderer.invoke("rpc-get-frame-definitions",e);exports.addDataProcessor=L;exports.addSource=f;exports.addTarget=P;exports.clearLinMessage=A;exports.connectNodes=D;exports.deleteDataProcessor=F;exports.deleteSource=N;exports.deleteTarget=b;exports.disableNode=x;exports.disconnectNodes=S;exports.enableNode=q;exports.getFrameDefinitions=G;exports.getLogger=y;exports.getMessageLogFileFormats=_;exports.getSignalLogFileFormats=z;exports.requestLinMessage=C;exports.sendCanMessage=B;exports.sendMessage=d;exports.showMessageBox=w;exports.showQuestionBox=R;exports.startLogReplay=O;exports.startMeasurement=k;exports.startPeriodicTransmission=E;exports.stopLogReplay=W;exports.stopMeasurement=v;exports.stopPeriodicTransmission=j;exports.updateDataProcessor=h;exports.updateLinMessage=I;exports.updatePeriodicTransmission=Q;exports.updateSource=M;exports.updateTarget=T;