@zaber/motion 2.7.1 → 2.8.0
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.
- package/dist/binding/wasm/zaber-motion-lib.wasm +0 -0
- package/dist/lib/ascii/axis.d.ts +18 -0
- package/dist/lib/ascii/axis.js +40 -0
- package/dist/lib/ascii/axis.js.map +1 -1
- package/dist/lib/ascii/connection.js +3 -3
- package/dist/lib/ascii/connection.js.map +1 -1
- package/dist/lib/ascii/device.d.ts +20 -0
- package/dist/lib/ascii/device.js +40 -0
- package/dist/lib/ascii/device.js.map +1 -1
- package/dist/lib/binary/connection.js +3 -3
- package/dist/lib/binary/connection.js.map +1 -1
- package/dist/lib/can_set_state_axis_response.d.ts +16 -0
- package/dist/lib/can_set_state_axis_response.js +18 -0
- package/dist/lib/can_set_state_axis_response.js.map +1 -0
- package/dist/lib/can_set_state_device_response.d.ts +17 -0
- package/dist/lib/can_set_state_device_response.js +19 -0
- package/dist/lib/can_set_state_device_response.js.map +1 -0
- package/dist/lib/exceptions/index.d.ts +4 -0
- package/dist/lib/exceptions/index.js +10 -1
- package/dist/lib/exceptions/index.js.map +1 -1
- package/dist/lib/exceptions/set_device_state_exception_data.d.ts +25 -0
- package/dist/lib/exceptions/set_device_state_exception_data.js +21 -0
- package/dist/lib/exceptions/set_device_state_exception_data.js.map +1 -0
- package/dist/lib/exceptions/set_device_state_failed_exception.d.ts +14 -0
- package/dist/lib/exceptions/set_device_state_failed_exception.js +32 -0
- package/dist/lib/exceptions/set_device_state_failed_exception.js.map +1 -0
- package/dist/lib/exceptions/set_peripheral_state_exception_data.d.ts +20 -0
- package/dist/lib/exceptions/set_peripheral_state_exception_data.js +19 -0
- package/dist/lib/exceptions/set_peripheral_state_exception_data.js.map +1 -0
- package/dist/lib/exceptions/set_peripheral_state_failed_exception.d.ts +14 -0
- package/dist/lib/exceptions/set_peripheral_state_failed_exception.js +32 -0
- package/dist/lib/exceptions/set_peripheral_state_failed_exception.js.map +1 -0
- package/dist/lib/gateway/call.js +7 -7
- package/dist/lib/gateway/call.js.map +1 -1
- package/dist/lib/gateway/convert_exceptions.js +2 -0
- package/dist/lib/gateway/convert_exceptions.js.map +1 -1
- package/dist/lib/gateway/events.js +5 -5
- package/dist/lib/gateway/events.js.map +1 -1
- package/dist/lib/gateway/wasm.js +1 -1
- package/dist/lib/gateway/wasm.js.map +1 -1
- package/dist/lib/index.d.ts +2 -0
- package/dist/lib/index.js +5 -1
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/protobufs/main_pb.d.ts +250 -0
- package/dist/lib/protobufs/main_pb.js +2125 -194
- package/dist/lib/protobufs/main_pb.js.map +1 -1
- package/dist/lib/wasm.js +3 -3
- package/dist/lib/wasm.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection.js","sourceRoot":"","sources":["../../../src/binary/connection.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;AAEtD,+BAAiD;AACjD,8CAA8D;AAC9D,oDAAsC;AACtC,wCAAiD;AACjD,qCAAkC;AAClC,qEAAgE;AAChE,yDAAoD;AAEpD,uCAAoC;AAGpC;;GAEG;AACH,MAAa,UAAU;IAyBrB,YAAY,WAAmB;QAyNvB,kBAAa,GAAG,IAAI,oBAAa,EAAsB,CAAC;QAxN9D,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;QAChC,IAAI,CAAC,UAAU,EAAE,CAAC;IACpB,CAAC;IAXD;;OAEG;IACH,IAAW,WAAW;QACpB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAQD;;;;;;;OAOG;IACI,MAAM,CAAC,KAAK,CAAC,cAAc,CAChC,QAAgB,EAChB,WAAmB,UAAU,CAAC,iBAAiB,EAC/C,gBAAyB,KAAK;QAE9B,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,0BAA0B,EAAE,CAAC;QACzD,OAAO,CA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A6B,CAAC,EACjF,kBAAM,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,WAAW,KAAK,IAAI,CAAC,WAAW,CAAC,EACvD,eAAG,CAAC,KAAK,CAAC,EAAE,CAAC,iCAAc,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CACjD,CAAC;QAEF,gBAAM,CAAC,IAAI,CACT,qBAAW,CAAqC,wBAAwB,CAAC,EACzE,kBAAM,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,WAAW,KAAK,IAAI,CAAC,WAAW,CAAC,EACvD,gBAAI,CAAC,CAAC,CAAC,EACP,eAAG,CAAC,CAAC,EAAE,YAAY,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,kBAAkB,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC,CAC1F,CAAC,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAClC,CAAC;;AAhRH,gCAiRC;AArQC;;GAEG;AACoB,4BAAiB,GAAW,IAAI,CAAC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { Observable, ReplaySubject } from 'rxjs';\nimport { map, filter, takeUntil, take } from 'rxjs/operators';\nimport * as gateway from '../gateway';\nimport { events, filterEvent } from '../gateway';\nimport { Device } from './device';\nimport { UnknownResponseEvent } from './unknown_response_event';\nimport { ReplyOnlyEvent } from './reply_only_event';\nimport { CommandCode } from './command_code';\nimport { Message } from './message';\nimport { MotionLibException } from '../exceptions';\n\n/**\n * Class representing access to particular connection (serial port, TCP connection) using the legacy Binary protocol.\n */\nexport class Connection {\n\n /**\n * Event invoked when a response from a device cannot be matched to any known request.\n */\n public unknownResponse!: Observable<UnknownResponseEvent>;\n\n /**\n * Event invoked when a reply-only command such as a move tracking message is received from a device.\n */\n public replyOnly!: Observable<ReplyOnlyEvent>;\n\n /**\n * Default baud rate for serial connections.\n */\n public static readonly DEFAULT_BAUD_RATE: number = 9600;\n\n /**\n * The interface ID identifies thisConnection instance with the underlying library.\n */\n public get interfaceId(): number {\n return this._interfaceId;\n }\n private _interfaceId: number;\n\n constructor(interfaceId: number) {\n this._interfaceId = interfaceId;\n this._subscribe();\n }\n\n /**\n * Opens a serial port.\n * @param portName Name of the port to open.\n * @param baudRate Optional baud rate (defaults to 9600).\n * @param useMessageIds Enable use of message IDs (defaults to disabled).\n * All your devices must be pre-configured to match.\n * @return An object representing the port.\n */\n public static async openSerialPort(\n portName: string,\n baudRate: number = Connection.DEFAULT_BAUD_RATE,\n useMessageIds: boolean = false\n ): Promise<Connection> {\n const request = new gateway.OpenBinaryInterfaceRequest();\n request.setInterfaceType(gateway.InterfaceType.SERIAL_PORT);\n request.setPortName(portName);\n request.setBaudRate(baudRate);\n request.setUseMessageIds(useMessageIds);\n\n const response = await gateway.callAsync<gateway.OpenInterfaceResponse>(\n 'binary/interface/open',\n request,\n gateway.OpenInterfaceResponse);\n return new Connection(response.getInterfaceId());\n }\n\n /**\n * Opens a TCP connection.\n * @param hostName Hostname or IP address.\n * @param port Optional port number (defaults to 8657).\n * @param useMessageIds Enable use of message IDs (defaults to disabled).\n * All your devices must be pre-configured to match.\n * @return An object representing the connection.\n */\n public static async openTcp(\n hostName: string,\n port: number = 0,\n useMessageIds: boolean = false\n ): Promise<Connection> {\n const request = new gateway.OpenBinaryInterfaceRequest();\n request.setInterfaceType(gateway.InterfaceType.TCP);\n request.setHostName(hostName);\n request.setPort(port);\n request.setUseMessageIds(useMessageIds);\n\n const response = await gateway.callAsync<gateway.OpenInterfaceResponse>(\n 'binary/interface/open',\n request,\n gateway.OpenInterfaceResponse);\n return new Connection(response.getInterfaceId());\n }\n\n /**\n * Close the connection.\n */\n public async close(): Promise<void> {\n const request = new gateway.CloseInterfaceRequest();\n request.setInterfaceId(this.interfaceId);\n\n await gateway.callAsync('interface/close', request);\n }\n\n /**\n * Sends a generic Binary command to this connection.\n * For more information please refer to the\n * [Binary Protocol Manual](https://www.zaber.com/protocol-manual?protocol=Binary#topic_quick_command_reference).\n * @param device Device address to send the command to. Use zero for broadcast.\n * @param command Command to send.\n * @param data Optional data argument to the command. Defaults to zero.\n * @param timeout Number of seconds to wait for a response from the device. 0 or negative defaults to 0.5s.\n * @param checkErrors Controls whether to throw an exception when the device rejects the command.\n * @return A response to the command.\n */\n public async genericCommand(\n device: number,\n command: CommandCode,\n data: number = 0,\n timeout: number = 0.0,\n checkErrors: boolean = true\n ): Promise<Message> {\n const request = new gateway.GenericBinaryRequest();\n request.setInterfaceId(this.interfaceId);\n request.setDevice(device);\n request.setCommand(command as any);\n request.setData(data);\n request.setTimeout(timeout);\n request.setCheckErrors(checkErrors);\n\n const response = await gateway.callAsync<gateway.BinaryMessage>(\n 'binary/interface/generic_command',\n request,\n gateway.BinaryMessage);\n return Message.fromProtobuf(response.toObject());\n }\n\n /**\n * Sends a generic Binary command to this connection without expecting a response.\n * For more information please refer to the\n * [Binary Protocol Manual](https://www.zaber.com/protocol-manual?protocol=Binary#topic_quick_command_reference).\n * @param device Device address to send the command to. Use zero for broadcast.\n * @param command Command to send.\n * @param data Optional data argument to the command. Defaults to zero.\n */\n public async genericCommandNoResponse(\n device: number,\n command: CommandCode,\n data: number = 0\n ): Promise<void> {\n const request = new gateway.GenericBinaryRequest();\n request.setInterfaceId(this.interfaceId);\n request.setDevice(device);\n request.setCommand(command as any);\n request.setData(data);\n\n await gateway.callAsync('binary/interface/generic_command_no_response', request);\n }\n\n /**\n * Sends a generic Binary command to this connection and expects responses from one or more devices.\n * Responses are returned in order of arrival.\n * For more information please refer to the\n * [Binary Protocol Manual](https://www.zaber.com/protocol-manual?protocol=Binary#topic_quick_command_reference).\n * @param command Command to send.\n * @param data Optional data argument to the command. Defaults to zero.\n * @param timeout Number of seconds to wait for all responses from the device chain. 0 or negative defaults to 0.5s.\n * @param checkErrors Controls whether to throw an exception when any device rejects the command.\n * @return All responses to the command.\n */\n public async genericCommandMultiResponse(\n command: CommandCode,\n data: number = 0,\n timeout: number = 0.0,\n checkErrors: boolean = true\n ): Promise<Message[]> {\n const request = new gateway.GenericBinaryRequest();\n request.setInterfaceId(this.interfaceId);\n request.setCommand(command as any);\n request.setData(data);\n request.setTimeout(timeout);\n request.setCheckErrors(checkErrors);\n\n const response = await gateway.callAsync<gateway.BinaryMessageCollection>(\n 'binary/interface/generic_command_multi_response',\n request,\n gateway.BinaryMessageCollection);\n return response.toObject().messagesList.map(resp => Message.fromProtobuf(resp));\n }\n\n /**\n * Renumbers devices present on this connection. After renumbering, you must identify devices again.\n * @return Total number of devices that responded to the renumber.\n */\n public async renumberDevices(): Promise<number> {\n const request = new gateway.BinaryDeviceRenumberRequest();\n request.setInterfaceId(this.interfaceId);\n\n const response = await gateway.callAsync<gateway.BinaryDeviceRenumberResponse>(\n 'binary/device/renumber',\n request,\n gateway.BinaryDeviceRenumberResponse);\n return response.getNumberDevices();\n }\n\n /**\n * Attempts to detect any devices present on this connection.\n * @param identifyDevices Determines whether device identification should be performed as well.\n * @return Array of detected devices.\n */\n public async detectDevices(\n identifyDevices: boolean = true\n ): Promise<Device[]> {\n const request = new gateway.BinaryDeviceDetectRequest();\n request.setInterfaceId(this.interfaceId);\n request.setIdentifyDevices(identifyDevices);\n\n const response = await gateway.callAsync<gateway.BinaryDeviceDetectResponse>(\n 'binary/device/detect',\n request,\n gateway.BinaryDeviceDetectResponse);\n return response.getDevicesList().map(deviceAddress => this.getDevice(deviceAddress));\n }\n\n /**\n * Gets a Device class instance which allows you to control a particular device on this connection.\n * Devices are numbered from 1.\n * @param deviceAddress Address of device intended to control. Address is configured for each device.\n * @return Device instance.\n */\n public getDevice(\n deviceAddress: number\n ): Device {\n if (deviceAddress <= 0) {\n throw new TypeError('Invalid value; physical devices are numbered from 1.');\n }\n return new Device(this, deviceAddress);\n }\n\n /**\n * Returns a string that represents the connection.\n * @return A string that represents the connection.\n */\n public toString(): string {\n const request = new gateway.ToStringRequest();\n request.setInterfaceId(this.interfaceId);\n\n const response = gateway.callSync<gateway.ToStringResponse>(\n 'interface/to_string',\n request,\n gateway.ToStringResponse);\n return response.getToStr();\n }\n\n private _disconnected = new ReplaySubject<MotionLibException>();\n\n /**\n * Event invoked when connection is interrupted or closed.\n */\n public get disconnected(): Observable<MotionLibException> {\n return this._disconnected;\n }\n\n private _subscribe(): void {\n this.unknownResponse = events.pipe(\n takeUntil(this._disconnected),\n filterEvent<gateway.UnknownBinaryResponseEvent.AsObject>('binary/interface/unknown_response'),\n filter(event => event.interfaceId === this.interfaceId),\n map(event => UnknownResponseEvent.fromProtobuf(event))\n );\n\n this.replyOnly = events.pipe(\n takeUntil(this._disconnected),\n filterEvent<gateway.BinaryReplyOnlyEvent.AsObject>('binary/interface/reply_only'),\n filter(event => event.interfaceId === this.interfaceId),\n map(event => ReplyOnlyEvent.fromProtobuf(event))\n );\n\n events.pipe(\n filterEvent<gateway.DisconnectedEvent.AsObject>('interface/disconnected'),\n filter(event => event.interfaceId === this.interfaceId),\n take(1),\n map(({ errorMessage, errorType }) => gateway.convertToException(errorType, errorMessage))\n ).subscribe(this._disconnected);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"connection.js","sourceRoot":"","sources":["../../../src/binary/connection.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;AAEtD,+BAAiD;AACjD,8CAA8D;AAC9D,oDAAsC;AACtC,wCAAiD;AACjD,qCAAkC;AAClC,qEAAgE;AAChE,yDAAoD;AAEpD,uCAAoC;AAGpC;;GAEG;AACH,MAAa,UAAU;IAyBrB,YAAY,WAAmB;QAyNvB,kBAAa,GAAG,IAAI,oBAAa,EAAsB,CAAC;QAxN9D,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;QAChC,IAAI,CAAC,UAAU,EAAE,CAAC;IACpB,CAAC;IAXD;;OAEG;IACH,IAAW,WAAW;QACpB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAQD;;;;;;;OAOG;IAC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AC,KAAK,CAAC,EAAE,CAAC,6CAAoB,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CACvD,CAAC;QAEF,IAAI,CAAC,SAAS,GAAG,gBAAM,CAAC,IAAI,CAC1B,IAAA,qBAAS,EAAC,IAAI,CAAC,aAAa,CAAC,EAC7B,IAAA,qBAAW,EAAwC,6BAA6B,CAAC,EACjF,IAAA,kBAAM,EAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,WAAW,KAAK,IAAI,CAAC,WAAW,CAAC,EACvD,IAAA,eAAG,EAAC,KAAK,CAAC,EAAE,CAAC,iCAAc,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CACjD,CAAC;QAEF,gBAAM,CAAC,IAAI,CACT,IAAA,qBAAW,EAAqC,wBAAwB,CAAC,EACzE,IAAA,kBAAM,EAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,WAAW,KAAK,IAAI,CAAC,WAAW,CAAC,EACvD,IAAA,gBAAI,EAAC,CAAC,CAAC,EACP,IAAA,eAAG,EAAC,CAAC,EAAE,YAAY,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,kBAAkB,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC,CAC1F,CAAC,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAClC,CAAC;;AAhRH,gCAiRC;AArQC;;GAEG;AACoB,4BAAiB,GAAW,IAAI,CAAC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { Observable, ReplaySubject } from 'rxjs';\nimport { map, filter, takeUntil, take } from 'rxjs/operators';\nimport * as gateway from '../gateway';\nimport { events, filterEvent } from '../gateway';\nimport { Device } from './device';\nimport { UnknownResponseEvent } from './unknown_response_event';\nimport { ReplyOnlyEvent } from './reply_only_event';\nimport { CommandCode } from './command_code';\nimport { Message } from './message';\nimport { MotionLibException } from '../exceptions';\n\n/**\n * Class representing access to particular connection (serial port, TCP connection) using the legacy Binary protocol.\n */\nexport class Connection {\n\n /**\n * Event invoked when a response from a device cannot be matched to any known request.\n */\n public unknownResponse!: Observable<UnknownResponseEvent>;\n\n /**\n * Event invoked when a reply-only command such as a move tracking message is received from a device.\n */\n public replyOnly!: Observable<ReplyOnlyEvent>;\n\n /**\n * Default baud rate for serial connections.\n */\n public static readonly DEFAULT_BAUD_RATE: number = 9600;\n\n /**\n * The interface ID identifies thisConnection instance with the underlying library.\n */\n public get interfaceId(): number {\n return this._interfaceId;\n }\n private _interfaceId: number;\n\n constructor(interfaceId: number) {\n this._interfaceId = interfaceId;\n this._subscribe();\n }\n\n /**\n * Opens a serial port.\n * @param portName Name of the port to open.\n * @param baudRate Optional baud rate (defaults to 9600).\n * @param useMessageIds Enable use of message IDs (defaults to disabled).\n * All your devices must be pre-configured to match.\n * @return An object representing the port.\n */\n public static async openSerialPort(\n portName: string,\n baudRate: number = Connection.DEFAULT_BAUD_RATE,\n useMessageIds: boolean = false\n ): Promise<Connection> {\n const request = new gateway.OpenBinaryInterfaceRequest();\n request.setInterfaceType(gateway.InterfaceType.SERIAL_PORT);\n request.setPortName(portName);\n request.setBaudRate(baudRate);\n request.setUseMessageIds(useMessageIds);\n\n const response = await gateway.callAsync<gateway.OpenInterfaceResponse>(\n 'binary/interface/open',\n request,\n gateway.OpenInterfaceResponse);\n return new Connection(response.getInterfaceId());\n }\n\n /**\n * Opens a TCP connection.\n * @param hostName Hostname or IP address.\n * @param port Optional port number (defaults to 8657).\n * @param useMessageIds Enable use of message IDs (defaults to disabled).\n * All your devices must be pre-configured to match.\n * @return An object representing the connection.\n */\n public static async openTcp(\n hostName: string,\n port: number = 0,\n useMessageIds: boolean = false\n ): Promise<Connection> {\n const request = new gateway.OpenBinaryInterfaceRequest();\n request.setInterfaceType(gateway.InterfaceType.TCP);\n request.setHostName(hostName);\n request.setPort(port);\n request.setUseMessageIds(useMessageIds);\n\n const response = await gateway.callAsync<gateway.OpenInterfaceResponse>(\n 'binary/interface/open',\n request,\n gateway.OpenInterfaceResponse);\n return new Connection(response.getInterfaceId());\n }\n\n /**\n * Close the connection.\n */\n public async close(): Promise<void> {\n const request = new gateway.CloseInterfaceRequest();\n request.setInterfaceId(this.interfaceId);\n\n await gateway.callAsync('interface/close', request);\n }\n\n /**\n * Sends a generic Binary command to this connection.\n * For more information please refer to the\n * [Binary Protocol Manual](https://www.zaber.com/protocol-manual?protocol=Binary#topic_quick_command_reference).\n * @param device Device address to send the command to. Use zero for broadcast.\n * @param command Command to send.\n * @param data Optional data argument to the command. Defaults to zero.\n * @param timeout Number of seconds to wait for a response from the device. 0 or negative defaults to 0.5s.\n * @param checkErrors Controls whether to throw an exception when the device rejects the command.\n * @return A response to the command.\n */\n public async genericCommand(\n device: number,\n command: CommandCode,\n data: number = 0,\n timeout: number = 0.0,\n checkErrors: boolean = true\n ): Promise<Message> {\n const request = new gateway.GenericBinaryRequest();\n request.setInterfaceId(this.interfaceId);\n request.setDevice(device);\n request.setCommand(command as any);\n request.setData(data);\n request.setTimeout(timeout);\n request.setCheckErrors(checkErrors);\n\n const response = await gateway.callAsync<gateway.BinaryMessage>(\n 'binary/interface/generic_command',\n request,\n gateway.BinaryMessage);\n return Message.fromProtobuf(response.toObject());\n }\n\n /**\n * Sends a generic Binary command to this connection without expecting a response.\n * For more information please refer to the\n * [Binary Protocol Manual](https://www.zaber.com/protocol-manual?protocol=Binary#topic_quick_command_reference).\n * @param device Device address to send the command to. Use zero for broadcast.\n * @param command Command to send.\n * @param data Optional data argument to the command. Defaults to zero.\n */\n public async genericCommandNoResponse(\n device: number,\n command: CommandCode,\n data: number = 0\n ): Promise<void> {\n const request = new gateway.GenericBinaryRequest();\n request.setInterfaceId(this.interfaceId);\n request.setDevice(device);\n request.setCommand(command as any);\n request.setData(data);\n\n await gateway.callAsync('binary/interface/generic_command_no_response', request);\n }\n\n /**\n * Sends a generic Binary command to this connection and expects responses from one or more devices.\n * Responses are returned in order of arrival.\n * For more information please refer to the\n * [Binary Protocol Manual](https://www.zaber.com/protocol-manual?protocol=Binary#topic_quick_command_reference).\n * @param command Command to send.\n * @param data Optional data argument to the command. Defaults to zero.\n * @param timeout Number of seconds to wait for all responses from the device chain. 0 or negative defaults to 0.5s.\n * @param checkErrors Controls whether to throw an exception when any device rejects the command.\n * @return All responses to the command.\n */\n public async genericCommandMultiResponse(\n command: CommandCode,\n data: number = 0,\n timeout: number = 0.0,\n checkErrors: boolean = true\n ): Promise<Message[]> {\n const request = new gateway.GenericBinaryRequest();\n request.setInterfaceId(this.interfaceId);\n request.setCommand(command as any);\n request.setData(data);\n request.setTimeout(timeout);\n request.setCheckErrors(checkErrors);\n\n const response = await gateway.callAsync<gateway.BinaryMessageCollection>(\n 'binary/interface/generic_command_multi_response',\n request,\n gateway.BinaryMessageCollection);\n return response.toObject().messagesList.map(resp => Message.fromProtobuf(resp));\n }\n\n /**\n * Renumbers devices present on this connection. After renumbering, you must identify devices again.\n * @return Total number of devices that responded to the renumber.\n */\n public async renumberDevices(): Promise<number> {\n const request = new gateway.BinaryDeviceRenumberRequest();\n request.setInterfaceId(this.interfaceId);\n\n const response = await gateway.callAsync<gateway.BinaryDeviceRenumberResponse>(\n 'binary/device/renumber',\n request,\n gateway.BinaryDeviceRenumberResponse);\n return response.getNumberDevices();\n }\n\n /**\n * Attempts to detect any devices present on this connection.\n * @param identifyDevices Determines whether device identification should be performed as well.\n * @return Array of detected devices.\n */\n public async detectDevices(\n identifyDevices: boolean = true\n ): Promise<Device[]> {\n const request = new gateway.BinaryDeviceDetectRequest();\n request.setInterfaceId(this.interfaceId);\n request.setIdentifyDevices(identifyDevices);\n\n const response = await gateway.callAsync<gateway.BinaryDeviceDetectResponse>(\n 'binary/device/detect',\n request,\n gateway.BinaryDeviceDetectResponse);\n return response.getDevicesList().map(deviceAddress => this.getDevice(deviceAddress));\n }\n\n /**\n * Gets a Device class instance which allows you to control a particular device on this connection.\n * Devices are numbered from 1.\n * @param deviceAddress Address of device intended to control. Address is configured for each device.\n * @return Device instance.\n */\n public getDevice(\n deviceAddress: number\n ): Device {\n if (deviceAddress <= 0) {\n throw new TypeError('Invalid value; physical devices are numbered from 1.');\n }\n return new Device(this, deviceAddress);\n }\n\n /**\n * Returns a string that represents the connection.\n * @return A string that represents the connection.\n */\n public toString(): string {\n const request = new gateway.ToStringRequest();\n request.setInterfaceId(this.interfaceId);\n\n const response = gateway.callSync<gateway.ToStringResponse>(\n 'interface/to_string',\n request,\n gateway.ToStringResponse);\n return response.getToStr();\n }\n\n private _disconnected = new ReplaySubject<MotionLibException>();\n\n /**\n * Event invoked when connection is interrupted or closed.\n */\n public get disconnected(): Observable<MotionLibException> {\n return this._disconnected;\n }\n\n private _subscribe(): void {\n this.unknownResponse = events.pipe(\n takeUntil(this._disconnected),\n filterEvent<gateway.UnknownBinaryResponseEvent.AsObject>('binary/interface/unknown_response'),\n filter(event => event.interfaceId === this.interfaceId),\n map(event => UnknownResponseEvent.fromProtobuf(event))\n );\n\n this.replyOnly = events.pipe(\n takeUntil(this._disconnected),\n filterEvent<gateway.BinaryReplyOnlyEvent.AsObject>('binary/interface/reply_only'),\n filter(event => event.interfaceId === this.interfaceId),\n map(event => ReplyOnlyEvent.fromProtobuf(event))\n );\n\n events.pipe(\n filterEvent<gateway.DisconnectedEvent.AsObject>('interface/disconnected'),\n filter(event => event.interfaceId === this.interfaceId),\n take(1),\n map(({ errorMessage, errorType }) => gateway.convertToException(errorType, errorMessage))\n ).subscribe(this._disconnected);\n }\n}\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An object containing any setup issues that will prevent setting a state to a given peripheral.
|
|
3
|
+
*/
|
|
4
|
+
export interface CanSetStateAxisResponse {
|
|
5
|
+
/**
|
|
6
|
+
* The error blocking applying this state to the given axis.
|
|
7
|
+
*/
|
|
8
|
+
error: string;
|
|
9
|
+
/**
|
|
10
|
+
* The number of the axis that cannot be set.
|
|
11
|
+
*/
|
|
12
|
+
axisNumber: number;
|
|
13
|
+
}
|
|
14
|
+
export declare namespace CanSetStateAxisResponse {
|
|
15
|
+
const __type = "CanSetStateAxisResponse";
|
|
16
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //
|
|
3
|
+
// ============= DO NOT EDIT DIRECTLY ============= //
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.CanSetStateAxisResponse = void 0;
|
|
6
|
+
var CanSetStateAxisResponse;
|
|
7
|
+
(function (CanSetStateAxisResponse) {
|
|
8
|
+
CanSetStateAxisResponse.__type = 'CanSetStateAxisResponse';
|
|
9
|
+
/** @internal */
|
|
10
|
+
function fromProtobuf(pbData) {
|
|
11
|
+
return {
|
|
12
|
+
error: pbData.error,
|
|
13
|
+
axisNumber: pbData.axisNumber,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
CanSetStateAxisResponse.fromProtobuf = fromProtobuf;
|
|
17
|
+
})(CanSetStateAxisResponse = exports.CanSetStateAxisResponse || (exports.CanSetStateAxisResponse = {}));
|
|
18
|
+
//# sourceMappingURL=can_set_state_axis_response.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"can_set_state_axis_response.js","sourceRoot":"","sources":["../../src/can_set_state_axis_response.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;AAoBtD,IAAiB,uBAAuB,CAUvC;AAVD,WAAiB,uBAAuB;IACzB,8BAAM,GAAG,yBAAyB,CAAC;IAEhD,gBAAgB;IAChB,SAAgB,YAAY,CAAC,MAAgD;QAC3E,OAAO;YACL,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,UAAU,EAAE,MAAM,CAAC,UAAU;SAC9B,CAAC;IACJ,CAAC;IALe,oCAAY,eAK3B,CAAA;AACH,CAAC,EAVgB,uBAAuB,GAAvB,+BAAuB,KAAvB,+BAAuB,QAUvC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from './gateway';\n\n/**\n * An object containing any setup issues that will prevent setting a state to a given peripheral.\n */\nexport interface CanSetStateAxisResponse {\n /**\n * The error blocking applying this state to the given axis.\n */\n error: string;\n\n /**\n * The number of the axis that cannot be set.\n */\n axisNumber: number;\n\n}\n\nexport namespace CanSetStateAxisResponse {\n export const __type = 'CanSetStateAxisResponse';\n\n /** @internal */\n export function fromProtobuf(pbData: gateway.CanSetStateAxisResponse.AsObject): CanSetStateAxisResponse {\n return {\n error: pbData.error,\n axisNumber: pbData.axisNumber,\n };\n }\n}\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CanSetStateAxisResponse } from './can_set_state_axis_response';
|
|
2
|
+
/**
|
|
3
|
+
* An object containing any setup issues that will prevent setting a state to a given device.
|
|
4
|
+
*/
|
|
5
|
+
export interface CanSetStateDeviceResponse {
|
|
6
|
+
/**
|
|
7
|
+
* The error blocking applying this state to the given device.
|
|
8
|
+
*/
|
|
9
|
+
error: string;
|
|
10
|
+
/**
|
|
11
|
+
* Maps axis numbers to errors that block setting state of that axis.
|
|
12
|
+
*/
|
|
13
|
+
peripheralErrors: CanSetStateAxisResponse[];
|
|
14
|
+
}
|
|
15
|
+
export declare namespace CanSetStateDeviceResponse {
|
|
16
|
+
const __type = "CanSetStateDeviceResponse";
|
|
17
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //
|
|
3
|
+
// ============= DO NOT EDIT DIRECTLY ============= //
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.CanSetStateDeviceResponse = void 0;
|
|
6
|
+
const can_set_state_axis_response_1 = require("./can_set_state_axis_response");
|
|
7
|
+
var CanSetStateDeviceResponse;
|
|
8
|
+
(function (CanSetStateDeviceResponse) {
|
|
9
|
+
CanSetStateDeviceResponse.__type = 'CanSetStateDeviceResponse';
|
|
10
|
+
/** @internal */
|
|
11
|
+
function fromProtobuf(pbData) {
|
|
12
|
+
return {
|
|
13
|
+
error: pbData.error,
|
|
14
|
+
peripheralErrors: pbData.peripheralErrorsList.map(item => can_set_state_axis_response_1.CanSetStateAxisResponse.fromProtobuf(item)),
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
CanSetStateDeviceResponse.fromProtobuf = fromProtobuf;
|
|
18
|
+
})(CanSetStateDeviceResponse = exports.CanSetStateDeviceResponse || (exports.CanSetStateDeviceResponse = {}));
|
|
19
|
+
//# sourceMappingURL=can_set_state_device_response.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"can_set_state_device_response.js","sourceRoot":"","sources":["../../src/can_set_state_device_response.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;AAGtD,+EAAwE;AAkBxE,IAAiB,yBAAyB,CAUzC;AAVD,WAAiB,yBAAyB;IAC3B,gCAAM,GAAG,2BAA2B,CAAC;IAElD,gBAAgB;IAChB,SAAgB,YAAY,CAAC,MAAkD;QAC7E,OAAO;YACL,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,gBAAgB,EAAE,MAAM,CAAC,oBAAoB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,qDAAuB,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;SACtG,CAAC;IACJ,CAAC;IALe,sCAAY,eAK3B,CAAA;AACH,CAAC,EAVgB,yBAAyB,GAAzB,iCAAyB,KAAzB,iCAAyB,QAUzC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from './gateway';\nimport { CanSetStateAxisResponse } from './can_set_state_axis_response';\n\n/**\n * An object containing any setup issues that will prevent setting a state to a given device.\n */\nexport interface CanSetStateDeviceResponse {\n /**\n * The error blocking applying this state to the given device.\n */\n error: string;\n\n /**\n * Maps axis numbers to errors that block setting state of that axis.\n */\n peripheralErrors: CanSetStateAxisResponse[];\n\n}\n\nexport namespace CanSetStateDeviceResponse {\n export const __type = 'CanSetStateDeviceResponse';\n\n /** @internal */\n export function fromProtobuf(pbData: gateway.CanSetStateDeviceResponse.AsObject): CanSetStateDeviceResponse {\n return {\n error: pbData.error,\n peripheralErrors: pbData.peripheralErrorsList.map(item => CanSetStateAxisResponse.fromProtobuf(item)),\n };\n }\n}\n"]}
|
|
@@ -27,6 +27,8 @@ export { OsFailedException } from './os_failed_exception';
|
|
|
27
27
|
export { OutOfRequestIdsException } from './out_of_request_ids_exception';
|
|
28
28
|
export { RequestTimeoutException } from './request_timeout_exception';
|
|
29
29
|
export { SerialPortBusyException } from './serial_port_busy_exception';
|
|
30
|
+
export { SetDeviceStateFailedException } from './set_device_state_failed_exception';
|
|
31
|
+
export { SetPeripheralStateFailedException } from './set_peripheral_state_failed_exception';
|
|
30
32
|
export { SettingNotFoundException } from './setting_not_found_exception';
|
|
31
33
|
export { StreamExecutionException } from './stream_execution_exception';
|
|
32
34
|
export { StreamModeException } from './stream_mode_exception';
|
|
@@ -43,6 +45,8 @@ export { InvalidPacketExceptionData } from './invalid_packet_exception_data';
|
|
|
43
45
|
export { InvalidResponseExceptionData } from './invalid_response_exception_data';
|
|
44
46
|
export { MovementFailedExceptionData } from './movement_failed_exception_data';
|
|
45
47
|
export { MovementInterruptedExceptionData } from './movement_interrupted_exception_data';
|
|
48
|
+
export { SetDeviceStateExceptionData } from './set_device_state_exception_data';
|
|
49
|
+
export { SetPeripheralStateExceptionData } from './set_peripheral_state_exception_data';
|
|
46
50
|
export { StreamExecutionExceptionData } from './stream_execution_exception_data';
|
|
47
51
|
export { StreamMovementFailedExceptionData } from './stream_movement_failed_exception_data';
|
|
48
52
|
export { StreamMovementInterruptedExceptionData } from './stream_movement_interrupted_exception_data';
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //
|
|
3
3
|
// ============= DO NOT EDIT DIRECTLY ============= //
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.
|
|
5
|
+
exports.StreamExecutionExceptionData = exports.SetPeripheralStateExceptionData = exports.SetDeviceStateExceptionData = exports.MovementInterruptedExceptionData = exports.MovementFailedExceptionData = exports.InvalidResponseExceptionData = exports.InvalidPacketExceptionData = exports.DeviceAddressConflictExceptionData = exports.CommandFailedExceptionData = exports.BinaryCommandFailedExceptionData = exports.MotionLibException = exports.UnknownRequestException = exports.TransportAlreadyUsedException = exports.StreamSetupFailedException = exports.StreamMovementInterruptedException = exports.StreamMovementFailedException = exports.StreamModeException = exports.StreamExecutionException = exports.SettingNotFoundException = exports.SetPeripheralStateFailedException = exports.SetDeviceStateFailedException = exports.SerialPortBusyException = exports.RequestTimeoutException = exports.OutOfRequestIdsException = exports.OsFailedException = exports.NotSupportedException = exports.NoDeviceFoundException = exports.MovementInterruptedException = exports.MovementFailedException = exports.LockstepNotEnabledException = exports.LockstepEnabledException = exports.IoFailedException = exports.IoChannelOutOfRangeException = exports.InvalidResponseException = exports.InvalidParkStateException = exports.InvalidPacketException = exports.InvalidDataException = exports.InvalidArgumentException = exports.InternalErrorException = exports.DeviceNotIdentifiedException = exports.DeviceFailedException = exports.DeviceDbFailedException = exports.DeviceBusyException = exports.DeviceAddressConflictException = exports.ConversionFailedException = exports.ConnectionFailedException = exports.ConnectionClosedException = exports.CommandPreemptedException = exports.CommandFailedException = exports.BinaryCommandFailedException = void 0;
|
|
6
|
+
exports.StreamMovementInterruptedExceptionData = exports.StreamMovementFailedExceptionData = void 0;
|
|
6
7
|
var binary_command_failed_exception_1 = require("./binary_command_failed_exception");
|
|
7
8
|
Object.defineProperty(exports, "BinaryCommandFailedException", { enumerable: true, get: function () { return binary_command_failed_exception_1.BinaryCommandFailedException; } });
|
|
8
9
|
var command_failed_exception_1 = require("./command_failed_exception");
|
|
@@ -61,6 +62,10 @@ var request_timeout_exception_1 = require("./request_timeout_exception");
|
|
|
61
62
|
Object.defineProperty(exports, "RequestTimeoutException", { enumerable: true, get: function () { return request_timeout_exception_1.RequestTimeoutException; } });
|
|
62
63
|
var serial_port_busy_exception_1 = require("./serial_port_busy_exception");
|
|
63
64
|
Object.defineProperty(exports, "SerialPortBusyException", { enumerable: true, get: function () { return serial_port_busy_exception_1.SerialPortBusyException; } });
|
|
65
|
+
var set_device_state_failed_exception_1 = require("./set_device_state_failed_exception");
|
|
66
|
+
Object.defineProperty(exports, "SetDeviceStateFailedException", { enumerable: true, get: function () { return set_device_state_failed_exception_1.SetDeviceStateFailedException; } });
|
|
67
|
+
var set_peripheral_state_failed_exception_1 = require("./set_peripheral_state_failed_exception");
|
|
68
|
+
Object.defineProperty(exports, "SetPeripheralStateFailedException", { enumerable: true, get: function () { return set_peripheral_state_failed_exception_1.SetPeripheralStateFailedException; } });
|
|
64
69
|
var setting_not_found_exception_1 = require("./setting_not_found_exception");
|
|
65
70
|
Object.defineProperty(exports, "SettingNotFoundException", { enumerable: true, get: function () { return setting_not_found_exception_1.SettingNotFoundException; } });
|
|
66
71
|
var stream_execution_exception_1 = require("./stream_execution_exception");
|
|
@@ -93,6 +98,10 @@ var movement_failed_exception_data_1 = require("./movement_failed_exception_data
|
|
|
93
98
|
Object.defineProperty(exports, "MovementFailedExceptionData", { enumerable: true, get: function () { return movement_failed_exception_data_1.MovementFailedExceptionData; } });
|
|
94
99
|
var movement_interrupted_exception_data_1 = require("./movement_interrupted_exception_data");
|
|
95
100
|
Object.defineProperty(exports, "MovementInterruptedExceptionData", { enumerable: true, get: function () { return movement_interrupted_exception_data_1.MovementInterruptedExceptionData; } });
|
|
101
|
+
var set_device_state_exception_data_1 = require("./set_device_state_exception_data");
|
|
102
|
+
Object.defineProperty(exports, "SetDeviceStateExceptionData", { enumerable: true, get: function () { return set_device_state_exception_data_1.SetDeviceStateExceptionData; } });
|
|
103
|
+
var set_peripheral_state_exception_data_1 = require("./set_peripheral_state_exception_data");
|
|
104
|
+
Object.defineProperty(exports, "SetPeripheralStateExceptionData", { enumerable: true, get: function () { return set_peripheral_state_exception_data_1.SetPeripheralStateExceptionData; } });
|
|
96
105
|
var stream_execution_exception_data_1 = require("./stream_execution_exception_data");
|
|
97
106
|
Object.defineProperty(exports, "StreamExecutionExceptionData", { enumerable: true, get: function () { return stream_execution_exception_data_1.StreamExecutionExceptionData; } });
|
|
98
107
|
var stream_movement_failed_exception_data_1 = require("./stream_movement_failed_exception_data");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/exceptions/index.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/exceptions/index.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;AAEtD,qFAAiF;AAAxE,+IAAA,4BAA4B,OAAA;AACrC,uEAAoE;AAA3D,kIAAA,sBAAsB,OAAA;AAC/B,6EAA0E;AAAjE,wIAAA,yBAAyB,OAAA;AAClC,6EAA0E;AAAjE,wIAAA,yBAAyB,OAAA;AAClC,6EAA0E;AAAjE,wIAAA,yBAAyB,OAAA;AAClC,6EAA0E;AAAjE,wIAAA,yBAAyB,OAAA;AAClC,yFAAqF;AAA5E,mJAAA,8BAA8B,OAAA;AACvC,iEAA8D;AAArD,4HAAA,mBAAmB,OAAA;AAC5B,2EAAuE;AAA9D,qIAAA,uBAAuB,OAAA;AAChC,qEAAkE;AAAzD,gIAAA,qBAAqB,OAAA;AAC9B,qFAAiF;AAAxE,+IAAA,4BAA4B,OAAA;AACrC,uEAAoE;AAA3D,kIAAA,sBAAsB,OAAA;AAC/B,2EAAwE;AAA/D,sIAAA,wBAAwB,OAAA;AACjC,mEAAgE;AAAvD,8HAAA,oBAAoB,OAAA;AAC7B,uEAAoE;AAA3D,kI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AAA;AAC3C,iFAA6E;AAApE,2IAAA,0BAA0B,OAAA;AACnC,qFAAiF;AAAxE,+IAAA,4BAA4B,OAAA;AACrC,mFAA+E;AAAtE,6IAAA,2BAA2B,OAAA;AACpC,6FAAyF;AAAhF,uJAAA,gCAAgC,OAAA;AACzC,qFAAgF;AAAvE,8IAAA,2BAA2B,OAAA;AACpC,6FAAwF;AAA/E,sJAAA,+BAA+B,OAAA;AACxC,qFAAiF;AAAxE,+IAAA,4BAA4B,OAAA;AACrC,iGAA4F;AAAnF,0JAAA,iCAAiC,OAAA;AAC1C,2GAAsG;AAA7F,oKAAA,sCAAsC,OAAA","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nexport { BinaryCommandFailedException } from './binary_command_failed_exception';\nexport { CommandFailedException } from './command_failed_exception';\nexport { CommandPreemptedException } from './command_preempted_exception';\nexport { ConnectionClosedException } from './connection_closed_exception';\nexport { ConnectionFailedException } from './connection_failed_exception';\nexport { ConversionFailedException } from './conversion_failed_exception';\nexport { DeviceAddressConflictException } from './device_address_conflict_exception';\nexport { DeviceBusyException } from './device_busy_exception';\nexport { DeviceDbFailedException } from './device_db_failed_exception';\nexport { DeviceFailedException } from './device_failed_exception';\nexport { DeviceNotIdentifiedException } from './device_not_identified_exception';\nexport { InternalErrorException } from './internal_error_exception';\nexport { InvalidArgumentException } from './invalid_argument_exception';\nexport { InvalidDataException } from './invalid_data_exception';\nexport { InvalidPacketException } from './invalid_packet_exception';\nexport { InvalidParkStateException } from './invalid_park_state_exception';\nexport { InvalidResponseException } from './invalid_response_exception';\nexport { IoChannelOutOfRangeException } from './io_channel_out_of_range_exception';\nexport { IoFailedException } from './io_failed_exception';\nexport { LockstepEnabledException } from './lockstep_enabled_exception';\nexport { LockstepNotEnabledException } from './lockstep_not_enabled_exception';\nexport { MovementFailedException } from './movement_failed_exception';\nexport { MovementInterruptedException } from './movement_interrupted_exception';\nexport { NoDeviceFoundException } from './no_device_found_exception';\nexport { NotSupportedException } from './not_supported_exception';\nexport { OsFailedException } from './os_failed_exception';\nexport { OutOfRequestIdsException } from './out_of_request_ids_exception';\nexport { RequestTimeoutException } from './request_timeout_exception';\nexport { SerialPortBusyException } from './serial_port_busy_exception';\nexport { SetDeviceStateFailedException } from './set_device_state_failed_exception';\nexport { SetPeripheralStateFailedException } from './set_peripheral_state_failed_exception';\nexport { SettingNotFoundException } from './setting_not_found_exception';\nexport { StreamExecutionException } from './stream_execution_exception';\nexport { StreamModeException } from './stream_mode_exception';\nexport { StreamMovementFailedException } from './stream_movement_failed_exception';\nexport { StreamMovementInterruptedException } from './stream_movement_interrupted_exception';\nexport { StreamSetupFailedException } from './stream_setup_failed_exception';\nexport { TransportAlreadyUsedException } from './transport_already_used_exception';\nexport { UnknownRequestException } from './unknown_request_exception';\nexport { MotionLibException } from './motion_lib_exception';\n\nexport { BinaryCommandFailedExceptionData } from './binary_command_failed_exception_data';\nexport { CommandFailedExceptionData } from './command_failed_exception_data';\nexport { DeviceAddressConflictExceptionData } from './device_address_conflict_exception_data';\nexport { InvalidPacketExceptionData } from './invalid_packet_exception_data';\nexport { InvalidResponseExceptionData } from './invalid_response_exception_data';\nexport { MovementFailedExceptionData } from './movement_failed_exception_data';\nexport { MovementInterruptedExceptionData } from './movement_interrupted_exception_data';\nexport { SetDeviceStateExceptionData } from './set_device_state_exception_data';\nexport { SetPeripheralStateExceptionData } from './set_peripheral_state_exception_data';\nexport { StreamExecutionExceptionData } from './stream_execution_exception_data';\nexport { StreamMovementFailedExceptionData } from './stream_movement_failed_exception_data';\nexport { StreamMovementInterruptedExceptionData } from './stream_movement_interrupted_exception_data';\n"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SetPeripheralStateExceptionData } from './set_peripheral_state_exception_data';
|
|
2
|
+
/**
|
|
3
|
+
* Contains additional data for a SetDeviceStateFailedException.
|
|
4
|
+
*/
|
|
5
|
+
export interface SetDeviceStateExceptionData {
|
|
6
|
+
/**
|
|
7
|
+
* A list of settings which could not be set.
|
|
8
|
+
*/
|
|
9
|
+
settings: string[];
|
|
10
|
+
/**
|
|
11
|
+
* The reason the stream buffers could not be set.
|
|
12
|
+
*/
|
|
13
|
+
streamBuffers: string[];
|
|
14
|
+
/**
|
|
15
|
+
* The reason the triggers could not be set.
|
|
16
|
+
*/
|
|
17
|
+
triggers: string[];
|
|
18
|
+
/**
|
|
19
|
+
* Errors for any peripherals that could not be set.
|
|
20
|
+
*/
|
|
21
|
+
peripherals: SetPeripheralStateExceptionData[];
|
|
22
|
+
}
|
|
23
|
+
export declare namespace SetDeviceStateExceptionData {
|
|
24
|
+
const __type = "SetDeviceStateExceptionData";
|
|
25
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //
|
|
3
|
+
// ============= DO NOT EDIT DIRECTLY ============= //
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.SetDeviceStateExceptionData = void 0;
|
|
6
|
+
const set_peripheral_state_exception_data_1 = require("./set_peripheral_state_exception_data");
|
|
7
|
+
var SetDeviceStateExceptionData;
|
|
8
|
+
(function (SetDeviceStateExceptionData) {
|
|
9
|
+
SetDeviceStateExceptionData.__type = 'SetDeviceStateExceptionData';
|
|
10
|
+
/** @internal */
|
|
11
|
+
function fromProtobuf(pbData) {
|
|
12
|
+
return {
|
|
13
|
+
settings: pbData.settingsList,
|
|
14
|
+
streamBuffers: pbData.streamBuffersList,
|
|
15
|
+
triggers: pbData.triggersList,
|
|
16
|
+
peripherals: pbData.peripheralsList.map(item => set_peripheral_state_exception_data_1.SetPeripheralStateExceptionData.fromProtobuf(item)),
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
SetDeviceStateExceptionData.fromProtobuf = fromProtobuf;
|
|
20
|
+
})(SetDeviceStateExceptionData = exports.SetDeviceStateExceptionData || (exports.SetDeviceStateExceptionData = {}));
|
|
21
|
+
//# sourceMappingURL=set_device_state_exception_data.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set_device_state_exception_data.js","sourceRoot":"","sources":["../../../src/exceptions/set_device_state_exception_data.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;AAGtD,+FAAwF;AA4BxF,IAAiB,2BAA2B,CAY3C;AAZD,WAAiB,2BAA2B;IAC7B,kCAAM,GAAG,6BAA6B,CAAC;IAEpD,gBAAgB;IAChB,SAAgB,YAAY,CAAC,MAAoD;QAC/E,OAAO;YACL,QAAQ,EAAE,MAAM,CAAC,YAAY;YAC7B,aAAa,EAAE,MAAM,CAAC,iBAAiB;YACvC,QAAQ,EAAE,MAAM,CAAC,YAAY;YAC7B,WAAW,EAAE,MAAM,CAAC,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,qEAA+B,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;SACpG,CAAC;IACJ,CAAC;IAPe,wCAAY,eAO3B,CAAA;AACH,CAAC,EAZgB,2BAA2B,GAA3B,mCAA2B,KAA3B,mCAA2B,QAY3C","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from '../gateway';\nimport { SetPeripheralStateExceptionData } from './set_peripheral_state_exception_data';\n\n/**\n * Contains additional data for a SetDeviceStateFailedException.\n */\nexport interface SetDeviceStateExceptionData {\n /**\n * A list of settings which could not be set.\n */\n settings: string[];\n\n /**\n * The reason the stream buffers could not be set.\n */\n streamBuffers: string[];\n\n /**\n * The reason the triggers could not be set.\n */\n triggers: string[];\n\n /**\n * Errors for any peripherals that could not be set.\n */\n peripherals: SetPeripheralStateExceptionData[];\n\n}\n\nexport namespace SetDeviceStateExceptionData {\n export const __type = 'SetDeviceStateExceptionData';\n\n /** @internal */\n export function fromProtobuf(pbData: gateway.SetDeviceStateExceptionData.AsObject): SetDeviceStateExceptionData {\n return {\n settings: pbData.settingsList,\n streamBuffers: pbData.streamBuffersList,\n triggers: pbData.triggersList,\n peripherals: pbData.peripheralsList.map(item => SetPeripheralStateExceptionData.fromProtobuf(item)),\n };\n }\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { MotionLibException } from './motion_lib_exception';
|
|
3
|
+
import { SetDeviceStateExceptionData } from './set_device_state_exception_data';
|
|
4
|
+
/**
|
|
5
|
+
* Thrown when a device cannot be set to the supplied state.
|
|
6
|
+
*/
|
|
7
|
+
export declare class SetDeviceStateFailedException extends MotionLibException {
|
|
8
|
+
/**
|
|
9
|
+
* Additional data for SetDeviceStateFailedException
|
|
10
|
+
*/
|
|
11
|
+
get details(): SetDeviceStateExceptionData;
|
|
12
|
+
private _details;
|
|
13
|
+
constructor(message: string, customData: Buffer | SetDeviceStateExceptionData);
|
|
14
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //
|
|
3
|
+
// ============= DO NOT EDIT DIRECTLY ============= //
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.SetDeviceStateFailedException = void 0;
|
|
6
|
+
const motion_lib_exception_1 = require("./motion_lib_exception");
|
|
7
|
+
const main_pb_1 = require("../protobufs/main_pb");
|
|
8
|
+
const set_device_state_exception_data_1 = require("./set_device_state_exception_data");
|
|
9
|
+
/**
|
|
10
|
+
* Thrown when a device cannot be set to the supplied state.
|
|
11
|
+
*/
|
|
12
|
+
class SetDeviceStateFailedException extends motion_lib_exception_1.MotionLibException {
|
|
13
|
+
constructor(message, customData) {
|
|
14
|
+
super(message);
|
|
15
|
+
Object.setPrototypeOf(this, SetDeviceStateFailedException.prototype);
|
|
16
|
+
if (Buffer.isBuffer(customData)) {
|
|
17
|
+
const protobufObj = main_pb_1.SetDeviceStateExceptionData.deserializeBinary(customData);
|
|
18
|
+
this._details = set_device_state_exception_data_1.SetDeviceStateExceptionData.fromProtobuf(protobufObj.toObject());
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
this._details = customData;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Additional data for SetDeviceStateFailedException
|
|
26
|
+
*/
|
|
27
|
+
get details() {
|
|
28
|
+
return this._details;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.SetDeviceStateFailedException = SetDeviceStateFailedException;
|
|
32
|
+
//# sourceMappingURL=set_device_state_failed_exception.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set_device_state_failed_exception.js","sourceRoot":"","sources":["../../../src/exceptions/set_device_state_failed_exception.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;AAEtD,iEAA4D;AAC5D,kDAAyF;AACzF,uFAAgF;AAEhF;;GAEG;AACH,MAAa,6BAA8B,SAAQ,yCAAkB;IASnE,YACE,OAAe,EACf,UAAgD;QAEhD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,6BAA6B,CAAC,SAAS,CAAC,CAAC;QAErE,IAAI,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE;YAC/B,MAAM,WAAW,GAAG,qCAAkB,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;YACrE,IAAI,CAAC,QAAQ,GAAG,6DAA2B,CAAC,YAAY,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAC;SAClF;aAAM;YACL,IAAI,CAAC,QAAQ,GAAG,UAAU,CAAC;SAC5B;IACH,CAAC;IArBD;;OAEG;IACH,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;CAiBF;AAvBD,sEAuBC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { MotionLibException } from './motion_lib_exception';\nimport { SetDeviceStateExceptionData as CustomDataProtobuf } from '../protobufs/main_pb';\nimport { SetDeviceStateExceptionData } from './set_device_state_exception_data';\n\n/**\n * Thrown when a device cannot be set to the supplied state.\n */\nexport class SetDeviceStateFailedException extends MotionLibException {\n /**\n * Additional data for SetDeviceStateFailedException\n */\n public get details(): SetDeviceStateExceptionData {\n return this._details;\n }\n private _details: SetDeviceStateExceptionData;\n\n constructor(\n message: string,\n customData: Buffer | SetDeviceStateExceptionData\n ) {\n super(message);\n Object.setPrototypeOf(this, SetDeviceStateFailedException.prototype);\n\n if (Buffer.isBuffer(customData)) {\n const protobufObj = CustomDataProtobuf.deserializeBinary(customData);\n this._details = SetDeviceStateExceptionData.fromProtobuf(protobufObj.toObject());\n } else {\n this._details = customData;\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Contains additional data for a SetPeripheralStateFailedException.
|
|
3
|
+
*/
|
|
4
|
+
export interface SetPeripheralStateExceptionData {
|
|
5
|
+
/**
|
|
6
|
+
* The number of axis where the exception originated.
|
|
7
|
+
*/
|
|
8
|
+
axisNumber: number;
|
|
9
|
+
/**
|
|
10
|
+
* A list of settings which could not be set.
|
|
11
|
+
*/
|
|
12
|
+
settings: string[];
|
|
13
|
+
/**
|
|
14
|
+
* The reason servo tuning could not be set.
|
|
15
|
+
*/
|
|
16
|
+
servoTuning: string;
|
|
17
|
+
}
|
|
18
|
+
export declare namespace SetPeripheralStateExceptionData {
|
|
19
|
+
const __type = "SetPeripheralStateExceptionData";
|
|
20
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //
|
|
3
|
+
// ============= DO NOT EDIT DIRECTLY ============= //
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.SetPeripheralStateExceptionData = void 0;
|
|
6
|
+
var SetPeripheralStateExceptionData;
|
|
7
|
+
(function (SetPeripheralStateExceptionData) {
|
|
8
|
+
SetPeripheralStateExceptionData.__type = 'SetPeripheralStateExceptionData';
|
|
9
|
+
/** @internal */
|
|
10
|
+
function fromProtobuf(pbData) {
|
|
11
|
+
return {
|
|
12
|
+
axisNumber: pbData.axisNumber,
|
|
13
|
+
settings: pbData.settingsList,
|
|
14
|
+
servoTuning: pbData.servoTuning,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
SetPeripheralStateExceptionData.fromProtobuf = fromProtobuf;
|
|
18
|
+
})(SetPeripheralStateExceptionData = exports.SetPeripheralStateExceptionData || (exports.SetPeripheralStateExceptionData = {}));
|
|
19
|
+
//# sourceMappingURL=set_peripheral_state_exception_data.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set_peripheral_state_exception_data.js","sourceRoot":"","sources":["../../../src/exceptions/set_peripheral_state_exception_data.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;AAyBtD,IAAiB,+BAA+B,CAW/C;AAXD,WAAiB,+BAA+B;IACjC,sCAAM,GAAG,iCAAiC,CAAC;IAExD,gBAAgB;IAChB,SAAgB,YAAY,CAAC,MAAwD;QACnF,OAAO;YACL,UAAU,EAAE,MAAM,CAAC,UAAU;YAC7B,QAAQ,EAAE,MAAM,CAAC,YAAY;YAC7B,WAAW,EAAE,MAAM,CAAC,WAAW;SAChC,CAAC;IACJ,CAAC;IANe,4CAAY,eAM3B,CAAA;AACH,CAAC,EAXgB,+BAA+B,GAA/B,uCAA+B,KAA/B,uCAA+B,QAW/C","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from '../gateway';\n\n/**\n * Contains additional data for a SetPeripheralStateFailedException.\n */\nexport interface SetPeripheralStateExceptionData {\n /**\n * The number of axis where the exception originated.\n */\n axisNumber: number;\n\n /**\n * A list of settings which could not be set.\n */\n settings: string[];\n\n /**\n * The reason servo tuning could not be set.\n */\n servoTuning: string;\n\n}\n\nexport namespace SetPeripheralStateExceptionData {\n export const __type = 'SetPeripheralStateExceptionData';\n\n /** @internal */\n export function fromProtobuf(pbData: gateway.SetPeripheralStateExceptionData.AsObject): SetPeripheralStateExceptionData {\n return {\n axisNumber: pbData.axisNumber,\n settings: pbData.settingsList,\n servoTuning: pbData.servoTuning,\n };\n }\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { MotionLibException } from './motion_lib_exception';
|
|
3
|
+
import { SetPeripheralStateExceptionData } from './set_peripheral_state_exception_data';
|
|
4
|
+
/**
|
|
5
|
+
* Thrown when an axis cannot be set to the supplied state.
|
|
6
|
+
*/
|
|
7
|
+
export declare class SetPeripheralStateFailedException extends MotionLibException {
|
|
8
|
+
/**
|
|
9
|
+
* Additional data for SetPeripheralStateFailedException
|
|
10
|
+
*/
|
|
11
|
+
get details(): SetPeripheralStateExceptionData;
|
|
12
|
+
private _details;
|
|
13
|
+
constructor(message: string, customData: Buffer | SetPeripheralStateExceptionData);
|
|
14
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //
|
|
3
|
+
// ============= DO NOT EDIT DIRECTLY ============= //
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.SetPeripheralStateFailedException = void 0;
|
|
6
|
+
const motion_lib_exception_1 = require("./motion_lib_exception");
|
|
7
|
+
const main_pb_1 = require("../protobufs/main_pb");
|
|
8
|
+
const set_peripheral_state_exception_data_1 = require("./set_peripheral_state_exception_data");
|
|
9
|
+
/**
|
|
10
|
+
* Thrown when an axis cannot be set to the supplied state.
|
|
11
|
+
*/
|
|
12
|
+
class SetPeripheralStateFailedException extends motion_lib_exception_1.MotionLibException {
|
|
13
|
+
constructor(message, customData) {
|
|
14
|
+
super(message);
|
|
15
|
+
Object.setPrototypeOf(this, SetPeripheralStateFailedException.prototype);
|
|
16
|
+
if (Buffer.isBuffer(customData)) {
|
|
17
|
+
const protobufObj = main_pb_1.SetPeripheralStateExceptionData.deserializeBinary(customData);
|
|
18
|
+
this._details = set_peripheral_state_exception_data_1.SetPeripheralStateExceptionData.fromProtobuf(protobufObj.toObject());
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
this._details = customData;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Additional data for SetPeripheralStateFailedException
|
|
26
|
+
*/
|
|
27
|
+
get details() {
|
|
28
|
+
return this._details;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.SetPeripheralStateFailedException = SetPeripheralStateFailedException;
|
|
32
|
+
//# sourceMappingURL=set_peripheral_state_failed_exception.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set_peripheral_state_failed_exception.js","sourceRoot":"","sources":["../../../src/exceptions/set_peripheral_state_failed_exception.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;AAEtD,iEAA4D;AAC5D,kDAA6F;AAC7F,+FAAwF;AAExF;;GAEG;AACH,MAAa,iCAAkC,SAAQ,yCAAkB;IASvE,YACE,OAAe,EACf,UAAoD;QAEpD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,iCAAiC,CAAC,SAAS,CAAC,CAAC;QAEzE,IAAI,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE;YAC/B,MAAM,WAAW,GAAG,yCAAkB,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;YACrE,IAAI,CAAC,QAAQ,GAAG,qEAA+B,CAAC,YAAY,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAC;SACtF;aAAM;YACL,IAAI,CAAC,QAAQ,GAAG,UAAU,CAAC;SAC5B;IACH,CAAC;IArBD;;OAEG;IACH,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;CAiBF;AAvBD,8EAuBC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { MotionLibException } from './motion_lib_exception';\nimport { SetPeripheralStateExceptionData as CustomDataProtobuf } from '../protobufs/main_pb';\nimport { SetPeripheralStateExceptionData } from './set_peripheral_state_exception_data';\n\n/**\n * Thrown when an axis cannot be set to the supplied state.\n */\nexport class SetPeripheralStateFailedException extends MotionLibException {\n /**\n * Additional data for SetPeripheralStateFailedException\n */\n public get details(): SetPeripheralStateExceptionData {\n return this._details;\n }\n private _details: SetPeripheralStateExceptionData;\n\n constructor(\n message: string,\n customData: Buffer | SetPeripheralStateExceptionData\n ) {\n super(message);\n Object.setPrototypeOf(this, SetPeripheralStateFailedException.prototype);\n\n if (Buffer.isBuffer(customData)) {\n const protobufObj = CustomDataProtobuf.deserializeBinary(customData);\n this._details = SetPeripheralStateExceptionData.fromProtobuf(protobufObj.toObject());\n } else {\n this._details = customData;\n }\n }\n}\n"]}
|
package/dist/lib/gateway/call.js
CHANGED
|
@@ -8,25 +8,25 @@ const convert_exceptions_1 = require("./convert_exceptions");
|
|
|
8
8
|
async function callAsync(request, requestData, responseProto) {
|
|
9
9
|
const requestProto = new main_pb_1.Request();
|
|
10
10
|
requestProto.setRequest(request);
|
|
11
|
-
const data = serialization_1.serialize(requestProto, requestData);
|
|
12
|
-
const resultBuffer = await new Promise(resolve => bindings_1.getBinding().callAsync(data, resolve));
|
|
13
|
-
const structBuffers = serialization_1.deserialize(resultBuffer);
|
|
11
|
+
const data = (0, serialization_1.serialize)(requestProto, requestData);
|
|
12
|
+
const resultBuffer = await new Promise(resolve => (0, bindings_1.getBinding)().callAsync(data, resolve));
|
|
13
|
+
const structBuffers = (0, serialization_1.deserialize)(resultBuffer);
|
|
14
14
|
return processResponse(structBuffers, responseProto);
|
|
15
15
|
}
|
|
16
16
|
exports.callAsync = callAsync;
|
|
17
17
|
function callSync(request, requestData, responseProto) {
|
|
18
18
|
const requestProto = new main_pb_1.Request();
|
|
19
19
|
requestProto.setRequest(request);
|
|
20
|
-
const data = serialization_1.serialize(requestProto, requestData);
|
|
21
|
-
const resultBuffer = bindings_1.getBinding().callSync(data);
|
|
22
|
-
const structBuffers = serialization_1.deserialize(resultBuffer);
|
|
20
|
+
const data = (0, serialization_1.serialize)(requestProto, requestData);
|
|
21
|
+
const resultBuffer = (0, bindings_1.getBinding)().callSync(data);
|
|
22
|
+
const structBuffers = (0, serialization_1.deserialize)(resultBuffer);
|
|
23
23
|
return processResponse(structBuffers, responseProto);
|
|
24
24
|
}
|
|
25
25
|
exports.callSync = callSync;
|
|
26
26
|
function processResponse(structBuffers, responseProto) {
|
|
27
27
|
const response = main_pb_1.Response.deserializeBinary(structBuffers[0]);
|
|
28
28
|
if (response.getResponse() !== main_pb_1.Response.ResponseType.OK) {
|
|
29
|
-
throw convert_exceptions_1.convertToException(response.getErrorType(), response.getErrorMessage(), structBuffers[1]);
|
|
29
|
+
throw (0, convert_exceptions_1.convertToException)(response.getErrorType(), response.getErrorMessage(), structBuffers[1]);
|
|
30
30
|
}
|
|
31
31
|
/* istanbul ignore if */
|
|
32
32
|
if (responseProto && structBuffers.length <= 1) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"call.js","sourceRoot":"","sources":["../../../src/gateway/call.ts"],"names":[],"mappings":";;;AAEA,kDAAyD;AAEzD,yCAAwC;AACxC,mDAAuE;AACvE,6DAA0D;AAanD,KAAK,UAAU,SAAS,CAC7B,OAAe,EACf,WAAsC,EACtC,aAA2B;IAE3B,MAAM,YAAY,GAAG,IAAI,iBAAO,EAAE,CAAC;IACnC,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,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AAQ,CAAC,iBAAiB,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;IAE9D,IAAI,QAAQ,CAAC,WAAW,EAAE,KAAK,kBAAQ,CAAC,YAAY,CAAC,EAAE,EAAE;QACvD,MAAM,IAAA,uCAAkB,EAAC,QAAQ,CAAC,YAAY,EAAE,EAAE,QAAQ,CAAC,eAAe,EAAE,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;KACjG;IAED,wBAAwB;IACxB,IAAI,aAAa,IAAI,aAAa,CAAC,MAAM,IAAI,CAAC,EAAE;QAC9C,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;KAC7C;IACD,wBAAwB;IACxB,IAAI,CAAC,aAAa,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE;QAC9C,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;KAClD;IACD,IAAI,aAAa,EAAE;QACjB,OAAQ,aAAqB,CAAC,iBAAiB,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;KACnE;SAAM;QACL,OAAO,IAAI,CAAC;KACb;AACH,CAAC","sourcesContent":["import { Message } from 'google-protobuf';\n\nimport { Request, Response } from '../protobufs/main_pb';\n\nimport { getBinding } from './bindings';\nimport { Serializable, serialize, deserialize } from './serialization';\nimport { convertToException } from './convert_exceptions';\n\nexport async function callAsync(\n request: string,\n requestData?: Serializable\n): Promise<null>;\n\nexport async function callAsync<T extends Message>(\n request: string,\n requestData: Serializable | undefined,\n responseProto: new () => T\n): Promise<T>;\n\nexport async function callAsync<T extends Message>(\n request: string,\n requestData?: Serializable | undefined,\n responseProto?: new () => T\n): Promise<T | null> {\n const requestProto = new Request();\n requestProto.setRequest(request);\n\n const data = serialize(requestProto, requestData);\n\n const resultBuffer = await new Promise<Buffer>(resolve =>\n getBinding().callAsync(data, resolve)\n );\n\n const structBuffers = deserialize(resultBuffer);\n\n return processResponse(structBuffers, responseProto);\n}\n\nexport function callSync(\n request: string,\n requestData?: Serializable | undefined,\n): null;\n\nexport function callSync<T extends Message>(\n request: string,\n requestData: Serializable | undefined,\n responseProto: new () => T\n): T;\n\nexport function callSync<T extends Message>(\n request: string,\n requestData?: Serializable,\n responseProto?: new () => T\n): T | null {\n const requestProto = new Request();\n requestProto.setRequest(request);\n\n const data = serialize(requestProto, requestData);\n\n const resultBuffer: Buffer = getBinding().callSync(data);\n\n const structBuffers = deserialize(resultBuffer);\n\n return processResponse(structBuffers, responseProto);\n}\n\nfunction processResponse<T extends Message>(structBuffers: Buffer[], responseProto?: new () => T): T | null {\n const response = Response.deserializeBinary(structBuffers[0]);\n\n if (response.getResponse() !== Response.ResponseType.OK) {\n throw convertToException(response.getErrorType(), response.getErrorMessage(), structBuffers[1]);\n }\n\n /* istanbul ignore if */\n if (responseProto && structBuffers.length <= 1) {\n throw new Error('No response from library');\n }\n /* istanbul ignore if */\n if (!responseProto && structBuffers.length > 1) {\n throw new Error('Response from library ignored');\n }\n if (responseProto) {\n return (responseProto as any).deserializeBinary(structBuffers[1]);\n } else {\n return null;\n }\n}\n"]}
|
|
@@ -54,6 +54,8 @@ errorMapping.set(main_pb_1.Errors.OS_FAILED, exceptions.OsFailedException);
|
|
|
54
54
|
errorMapping.set(main_pb_1.Errors.OUT_OF_REQUEST_IDS, exceptions.OutOfRequestIdsException);
|
|
55
55
|
errorMapping.set(main_pb_1.Errors.REQUEST_TIMEOUT, exceptions.RequestTimeoutException);
|
|
56
56
|
errorMapping.set(main_pb_1.Errors.SERIAL_PORT_BUSY, exceptions.SerialPortBusyException);
|
|
57
|
+
errorMapping.set(main_pb_1.Errors.SET_DEVICE_STATE_FAILED, exceptions.SetDeviceStateFailedException);
|
|
58
|
+
errorMapping.set(main_pb_1.Errors.SET_PERIPHERAL_STATE_FAILED, exceptions.SetPeripheralStateFailedException);
|
|
57
59
|
errorMapping.set(main_pb_1.Errors.SETTING_NOT_FOUND, exceptions.SettingNotFoundException);
|
|
58
60
|
errorMapping.set(main_pb_1.Errors.STREAM_EXECUTION, exceptions.StreamExecutionException);
|
|
59
61
|
errorMapping.set(main_pb_1.Errors.STREAM_MODE, exceptions.StreamModeException);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convert_exceptions.js","sourceRoot":"","sources":["../../../src/gateway/convert_exceptions.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;AAEtD,kDAA0D;AAC1D,0DAA4C;AAE5C,MAAM,YAAY,GAAG,IAAI,GAAG,EAAwF,CAAC;AACrH,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,qBAAqB,EAAE,UAAU,CAAC,4BAA4B,CAAC,CAAC;AAC1F,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,cAAc,EAAE,UAAU,CAAC,sBAAsB,CAAC,CAAC;AAC7E,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,iBAAiB,EAAE,UAAU,CAAC,yBAAyB,CAAC,CAAC;AACnF,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,iBAAiB,EAAE,UAAU,CAAC,yBAAyB,CAAC,CAAC;AACnF,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,iBAAiB,EAAE,UAAU,CAAC,yBAAyB,CAAC,CAAC;AACnF,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,iBAAiB,EAAE,UAAU,CAAC,yBAAyB,CAAC,CAAC;AACnF,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,uBAAuB,EAAE,UAAU,CAAC,8BAA8B,CAAC,CAAC;AAC9F,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,WAAW,EAAE,UAAU,CAAC,mBAAmB,CAAC,CAAC;AACvE,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,gBAAgB,EAAE,UAAU,CAAC,uBAAuB,CAAC,CAAC;AAChF,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,aAAa,EAAE,UAAU,C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AuB,CAAC,CAAC;AAE/E,SAAgB,kBAAkB,CAAC,KAAe,EAAE,OAAe,EAAE,UAAmB;IACtF,MAAM,iBAAiB,GAAG,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAElD,wBAAwB;IACxB,IAAI,CAAC,iBAAiB,EAAE;QACtB,OAAO,IAAI,UAAU,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;KACnD;IAED,OAAO,IAAI,iBAAiB,CAAC,OAAO,EAAE,UAAW,CAAC,CAAC;AACrD,CAAC;AATD,gDASC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { Errors as PbErrors } from '../protobufs/main_pb';\nimport * as exceptions from '../exceptions';\n\nconst errorMapping = new Map<PbErrors, new (message: string, customData: Buffer) => exceptions.MotionLibException>();\nerrorMapping.set(PbErrors.BINARY_COMMAND_FAILED, exceptions.BinaryCommandFailedException);\nerrorMapping.set(PbErrors.COMMAND_FAILED, exceptions.CommandFailedException);\nerrorMapping.set(PbErrors.COMMAND_PREEMPTED, exceptions.CommandPreemptedException);\nerrorMapping.set(PbErrors.CONNECTION_CLOSED, exceptions.ConnectionClosedException);\nerrorMapping.set(PbErrors.CONNECTION_FAILED, exceptions.ConnectionFailedException);\nerrorMapping.set(PbErrors.CONVERSION_FAILED, exceptions.ConversionFailedException);\nerrorMapping.set(PbErrors.DEVICE_ADDRESS_CONFLICT, exceptions.DeviceAddressConflictException);\nerrorMapping.set(PbErrors.DEVICE_BUSY, exceptions.DeviceBusyException);\nerrorMapping.set(PbErrors.DEVICE_DB_FAILED, exceptions.DeviceDbFailedException);\nerrorMapping.set(PbErrors.DEVICE_FAILED, exceptions.DeviceFailedException);\nerrorMapping.set(PbErrors.DEVICE_NOT_IDENTIFIED, exceptions.DeviceNotIdentifiedException);\nerrorMapping.set(PbErrors.INTERNAL_ERROR, exceptions.InternalErrorException);\nerrorMapping.set(PbErrors.INVALID_ARGUMENT, exceptions.InvalidArgumentException);\nerrorMapping.set(PbErrors.INVALID_DATA, exceptions.InvalidDataException);\nerrorMapping.set(PbErrors.INVALID_PACKET, exceptions.InvalidPacketException);\nerrorMapping.set(PbErrors.INVALID_PARK_STATE, exceptions.InvalidParkStateException);\nerrorMapping.set(PbErrors.INVALID_RESPONSE, exceptions.InvalidResponseException);\nerrorMapping.set(PbErrors.IO_CHANNEL_OUT_OF_RANGE, exceptions.IoChannelOutOfRangeException);\nerrorMapping.set(PbErrors.IO_FAILED, exceptions.IoFailedException);\nerrorMapping.set(PbErrors.LOCKSTEP_ENABLED, exceptions.LockstepEnabledException);\nerrorMapping.set(PbErrors.LOCKSTEP_NOT_ENABLED, exceptions.LockstepNotEnabledException);\nerrorMapping.set(PbErrors.MOVEMENT_FAILED, exceptions.MovementFailedException);\nerrorMapping.set(PbErrors.MOVEMENT_INTERRUPTED, exceptions.MovementInterruptedException);\nerrorMapping.set(PbErrors.NO_DEVICE_FOUND, exceptions.NoDeviceFoundException);\nerrorMapping.set(PbErrors.NOT_SUPPORTED, exceptions.NotSupportedException);\nerrorMapping.set(PbErrors.OS_FAILED, exceptions.OsFailedException);\nerrorMapping.set(PbErrors.OUT_OF_REQUEST_IDS, exceptions.OutOfRequestIdsException);\nerrorMapping.set(PbErrors.REQUEST_TIMEOUT, exceptions.RequestTimeoutException);\nerrorMapping.set(PbErrors.SERIAL_PORT_BUSY, exceptions.SerialPortBusyException);\nerrorMapping.set(PbErrors.SETTING_NOT_FOUND, exceptions.SettingNotFoundException);\nerrorMapping.set(PbErrors.STREAM_EXECUTION, exceptions.StreamExecutionException);\nerrorMapping.set(PbErrors.STREAM_MODE, exceptions.StreamModeException);\nerrorMapping.set(PbErrors.STREAM_MOVEMENT_FAILED, exceptions.StreamMovementFailedException);\nerrorMapping.set(PbErrors.STREAM_MOVEMENT_INTERRUPTED, exceptions.StreamMovementInterruptedException);\nerrorMapping.set(PbErrors.STREAM_SETUP_FAILED, exceptions.StreamSetupFailedException);\nerrorMapping.set(PbErrors.TRANSPORT_ALREADY_USED, exceptions.TransportAlreadyUsedException);\nerrorMapping.set(PbErrors.UNKNOWN_REQUEST, exceptions.UnknownRequestException);\n\nexport function convertToException(error: PbErrors, message: string, customData?: Buffer): exceptions.MotionLibException {\n const SpecificException = errorMapping.get(error);\n\n /* istanbul ignore if */\n if (!SpecificException) {\n return new exceptions.MotionLibException(message);\n }\n\n return new SpecificException(message, customData!);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"convert_exceptions.js","sourceRoot":"","sources":["../../../src/gateway/convert_exceptions.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;AAEtD,kDAA0D;AAC1D,0DAA4C;AAE5C,MAAM,YAAY,GAAG,IAAI,GAAG,EAAwF,CAAC;AACrH,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,qBAAqB,EAAE,UAAU,CAAC,4BAA4B,CAAC,CAAC;AAC1F,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,cAAc,EAAE,UAAU,CAAC,sBAAsB,CAAC,CAAC;AAC7E,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,iBAAiB,EAAE,UAAU,CAAC,yBAAyB,CAAC,CAAC;AACnF,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,iBAAiB,EAAE,UAAU,CAAC,yBAAyB,CAAC,CAAC;AACnF,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,iBAAiB,EAAE,UAAU,CAAC,yBAAyB,CAAC,CAAC;AACnF,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,iBAAiB,EAAE,UAAU,CAAC,yBAAyB,CAAC,CAAC;AACnF,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,uBAAuB,EAAE,UAAU,CAAC,8BAA8B,CAAC,CAAC;AAC9F,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,WAAW,EAAE,UAAU,CAAC,mBA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,CAAC;AAC5F,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,2BAA2B,EAAE,UAAU,CAAC,kCAAkC,CAAC,CAAC;AACtG,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,mBAAmB,EAAE,UAAU,CAAC,0BAA0B,CAAC,CAAC;AACtF,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,sBAAsB,EAAE,UAAU,CAAC,6BAA6B,CAAC,CAAC;AAC5F,YAAY,CAAC,GAAG,CAAC,gBAAQ,CAAC,eAAe,EAAE,UAAU,CAAC,uBAAuB,CAAC,CAAC;AAE/E,SAAgB,kBAAkB,CAAC,KAAe,EAAE,OAAe,EAAE,UAAmB;IACtF,MAAM,iBAAiB,GAAG,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAElD,wBAAwB;IACxB,IAAI,CAAC,iBAAiB,EAAE;QACtB,OAAO,IAAI,UAAU,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;KACnD;IAED,OAAO,IAAI,iBAAiB,CAAC,OAAO,EAAE,UAAW,CAAC,CAAC;AACrD,CAAC;AATD,gDASC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { Errors as PbErrors } from '../protobufs/main_pb';\nimport * as exceptions from '../exceptions';\n\nconst errorMapping = new Map<PbErrors, new (message: string, customData: Buffer) => exceptions.MotionLibException>();\nerrorMapping.set(PbErrors.BINARY_COMMAND_FAILED, exceptions.BinaryCommandFailedException);\nerrorMapping.set(PbErrors.COMMAND_FAILED, exceptions.CommandFailedException);\nerrorMapping.set(PbErrors.COMMAND_PREEMPTED, exceptions.CommandPreemptedException);\nerrorMapping.set(PbErrors.CONNECTION_CLOSED, exceptions.ConnectionClosedException);\nerrorMapping.set(PbErrors.CONNECTION_FAILED, exceptions.ConnectionFailedException);\nerrorMapping.set(PbErrors.CONVERSION_FAILED, exceptions.ConversionFailedException);\nerrorMapping.set(PbErrors.DEVICE_ADDRESS_CONFLICT, exceptions.DeviceAddressConflictException);\nerrorMapping.set(PbErrors.DEVICE_BUSY, exceptions.DeviceBusyException);\nerrorMapping.set(PbErrors.DEVICE_DB_FAILED, exceptions.DeviceDbFailedException);\nerrorMapping.set(PbErrors.DEVICE_FAILED, exceptions.DeviceFailedException);\nerrorMapping.set(PbErrors.DEVICE_NOT_IDENTIFIED, exceptions.DeviceNotIdentifiedException);\nerrorMapping.set(PbErrors.INTERNAL_ERROR, exceptions.InternalErrorException);\nerrorMapping.set(PbErrors.INVALID_ARGUMENT, exceptions.InvalidArgumentException);\nerrorMapping.set(PbErrors.INVALID_DATA, exceptions.InvalidDataException);\nerrorMapping.set(PbErrors.INVALID_PACKET, exceptions.InvalidPacketException);\nerrorMapping.set(PbErrors.INVALID_PARK_STATE, exceptions.InvalidParkStateException);\nerrorMapping.set(PbErrors.INVALID_RESPONSE, exceptions.InvalidResponseException);\nerrorMapping.set(PbErrors.IO_CHANNEL_OUT_OF_RANGE, exceptions.IoChannelOutOfRangeException);\nerrorMapping.set(PbErrors.IO_FAILED, exceptions.IoFailedException);\nerrorMapping.set(PbErrors.LOCKSTEP_ENABLED, exceptions.LockstepEnabledException);\nerrorMapping.set(PbErrors.LOCKSTEP_NOT_ENABLED, exceptions.LockstepNotEnabledException);\nerrorMapping.set(PbErrors.MOVEMENT_FAILED, exceptions.MovementFailedException);\nerrorMapping.set(PbErrors.MOVEMENT_INTERRUPTED, exceptions.MovementInterruptedException);\nerrorMapping.set(PbErrors.NO_DEVICE_FOUND, exceptions.NoDeviceFoundException);\nerrorMapping.set(PbErrors.NOT_SUPPORTED, exceptions.NotSupportedException);\nerrorMapping.set(PbErrors.OS_FAILED, exceptions.OsFailedException);\nerrorMapping.set(PbErrors.OUT_OF_REQUEST_IDS, exceptions.OutOfRequestIdsException);\nerrorMapping.set(PbErrors.REQUEST_TIMEOUT, exceptions.RequestTimeoutException);\nerrorMapping.set(PbErrors.SERIAL_PORT_BUSY, exceptions.SerialPortBusyException);\nerrorMapping.set(PbErrors.SET_DEVICE_STATE_FAILED, exceptions.SetDeviceStateFailedException);\nerrorMapping.set(PbErrors.SET_PERIPHERAL_STATE_FAILED, exceptions.SetPeripheralStateFailedException);\nerrorMapping.set(PbErrors.SETTING_NOT_FOUND, exceptions.SettingNotFoundException);\nerrorMapping.set(PbErrors.STREAM_EXECUTION, exceptions.StreamExecutionException);\nerrorMapping.set(PbErrors.STREAM_MODE, exceptions.StreamModeException);\nerrorMapping.set(PbErrors.STREAM_MOVEMENT_FAILED, exceptions.StreamMovementFailedException);\nerrorMapping.set(PbErrors.STREAM_MOVEMENT_INTERRUPTED, exceptions.StreamMovementInterruptedException);\nerrorMapping.set(PbErrors.STREAM_SETUP_FAILED, exceptions.StreamSetupFailedException);\nerrorMapping.set(PbErrors.TRANSPORT_ALREADY_USED, exceptions.TransportAlreadyUsedException);\nerrorMapping.set(PbErrors.UNKNOWN_REQUEST, exceptions.UnknownRequestException);\n\nexport function convertToException(error: PbErrors, message: string, customData?: Buffer): exceptions.MotionLibException {\n const SpecificException = errorMapping.get(error);\n\n /* istanbul ignore if */\n if (!SpecificException) {\n return new exceptions.MotionLibException(message);\n }\n\n return new SpecificException(message, customData!);\n}\n"]}
|