@synapticon/motion-master-client 6.0.0-alpha.97 → 6.0.0-alpha.99

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.
@@ -1,4 +1,4 @@
1
- import { AlStatusCode, AutoTuningError, AutoTuningRunRequest, AutoTuningRunResponse, AutoTuningStatus, BrakeState, Cia402Status, DcSyncStatus, DeviceDiagnostics, DeviceFile, DeviceParameter, Encoders, EscRegister, EsiParseResult, FirmwareCompatibility, FirmwarePackageName, FoeErrorCode, GameLoopHealth, HardwareDescription, HrdRecording, IntegroVariant, IntegroVariantOption, MailboxErrorCode, Monitoring, ObjectDataTypeInfo, OperationModes, OutputStageResult, ParameterCacheEntry, ParameterValue, PdoMapping, PdoMappingRequest, ProcedureListing, ProcedureRequest, ProcedureSnapshot, ProcessDataWatchdog, ProcessImageObject, SdoAbortCode, SlaveConfig, SlaveInformationInterface, UserCacheListing } from "./data-contracts.js";
1
+ import { AlStatusCode, AutoTuningError, AutoTuningRunRequest, AutoTuningRunResponse, AutoTuningStatus, BrakeState, CaptureSummary, Cia402Status, DcSyncStatus, DeviceDiagnostics, DeviceFile, DeviceParameter, Encoders, EscRegister, EsiParseResult, FirmwareCompatibility, FirmwarePackageName, FoeErrorCode, GameLoopHealth, HardwareDescription, HrdRecording, IntegroVariant, IntegroVariantOption, MailboxErrorCode, Monitoring, ObjectDataTypeInfo, OperationModes, OutputStageResult, ParameterCacheEntry, ParameterValue, PdoMapping, PdoMappingRequest, ProcedureListing, ProcedureRequest, ProcedureSnapshot, ProcessDataWatchdog, ProcessImageObject, SdoAbortCode, SlaveConfig, SlaveInformationInterface, UserCacheListing } from "./data-contracts.js";
2
2
  import { HttpClient, RequestParams } from "./http-client.js";
3
3
  export declare class Api<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
4
4
  /**
@@ -307,6 +307,17 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
307
307
  * @example false
308
308
  */
309
309
  parametersUnavailable: boolean;
310
+ /**
311
+ * The low byte of ESC register 0x0000, which names the slave controller family: 0x85 is a netX (Integro), 0xC0 the controller of a Circulo, 0x90 a TI PRU-ICSS (Jasper). Null when the register could not be read at the scan, and over SPoE.
312
+ * @format int32
313
+ * @example 192
314
+ */
315
+ escType?: number | null;
316
+ /**
317
+ * Whether Motion Master writes each mailbox request to this device once and never sends it again. True for a Synapticon or Sensodrive device whose ESC type is not 0x85, because its EtherCAT stack locks its receive mailbox when it gets one request twice. False for a netX, which discards a repeat, and for every other vendor, where a write with no frame back is sent again.
318
+ * @example true
319
+ */
320
+ mailboxWriteOnce?: boolean;
310
321
  /**
311
322
  * Whether the device has an EtherCAT Slave Controller: SII, ESC registers, distributed clocks and the ESC diagnostics. False over SPoE, where those endpoints answer 409.
312
323
  * @example true
@@ -1320,6 +1331,54 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
1320
1331
  */
1321
1332
  error: string;
1322
1333
  }>>;
1334
+ /**
1335
+ * @description Runs the capture program `motion-master-capture`, which ships beside the server binary, on the adapter the bus is on, waits for it to exit, and answers the summary. The program records every EtherCAT frame that leaves or enters the adapter with a kernel timestamp and writes them as a pcap file under `captures/` in the user cache, so the file is listed, downloaded and deleted through the `/api/user-cache` routes and opens in Wireshark. The summary matches each frame the master sent to the frame that came back for it, by the index and the header of its first datagram, and reports per kind of frame how late the returns were. The cyclic process-data frame is one kind; mailbox and register datagrams, the control plane, are the other. The bands are the three waits the driver uses, 2 ms, 20 ms and 100 ms, and they are cumulative: a frame later than 100 ms counts in all three. A frame sent again with the same index and header while its first copy had no answer counts once, as `resent`, and its return is timed from the first copy. The time is the kernel's, taken at the boundary to the NIC driver on both sides: when the frame is handed to the driver, and when the driver hands its return back. So the number covers the NIC, the wire and the device, and not the host's own queues and scheduling between that boundary and Motion Master. A capture that shows late frames puts the delay on the wire or in the device. A clean capture beside the server's own warnings, "mailbox write(s) got no frame back", puts it inside the host. Read the two together. One capture at a time. The capture adds no frame to the bus and runs on a thread of its own, so the bus is not touched. The program needs `CAP_NET_RAW`, which the packages grant it at install.
1336
+ *
1337
+ * @name RunCapture
1338
+ * @summary Record the EtherCAT frames of the bus adapter for a number of seconds
1339
+ * @request POST:/api/captures
1340
+ */
1341
+ runCapture: (data?: {
1342
+ /**
1343
+ * How long to record. A capture is a measurement a person starts.
1344
+ * @min 1
1345
+ * @max 120
1346
+ * @default 30
1347
+ */
1348
+ seconds?: number;
1349
+ /**
1350
+ * The adapter to record, when no bus is up. Defaults to the adapter of the bus.
1351
+ * @example "enp0s13f0u1u2"
1352
+ */
1353
+ adapter?: string;
1354
+ }, params?: RequestParams) => Promise<import("./http-client.js").HttpResponse<{
1355
+ /**
1356
+ * The pcap file, relative to the user-cache root
1357
+ * @example "captures/capture-20261022-143005-enp0s13f0u1u2.pcap"
1358
+ */
1359
+ path: string;
1360
+ /** @example "enp0s13f0u1u2" */
1361
+ adapter: string;
1362
+ /** @example 30 */
1363
+ seconds: number;
1364
+ /** How late the frames of a capture came back. See `POST /api/captures`. */
1365
+ summary: CaptureSummary;
1366
+ }, void | {
1367
+ error: string;
1368
+ }>>;
1369
+ /**
1370
+ * @description Reads `captures/{name}` from the user cache and answers the summary that `POST /api/captures` answers, over any Ethernet pcap: a file the server recorded, or one from `tcpdump` on another host that a user put into `captures/` with `PUT /api/user-cache/captures/{name}`. Microsecond and nanosecond timestamps and both byte orders are read.
1371
+ *
1372
+ * @name GetCaptureSummary
1373
+ * @summary Summarise a pcap file in the user cache
1374
+ * @request GET:/api/captures/{name}
1375
+ */
1376
+ getCaptureSummary: (name: string, params?: RequestParams) => Promise<import("./http-client.js").HttpResponse<{
1377
+ /** @example "captures/capture-20261022-143005-enp0s13f0u1u2.pcap" */
1378
+ path: string;
1379
+ /** How late the frames of a capture came back. See `POST /api/captures`. */
1380
+ summary: CaptureSummary;
1381
+ }, void>>;
1323
1382
  /**
1324
1383
  * @description Reads the current EtherCAT Application Layer state for one or more devices. Omit the `positions` query parameter to query all discovered devices.
1325
1384
  *
@@ -1511,6 +1570,17 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
1511
1570
  * @example false
1512
1571
  */
1513
1572
  parametersUnavailable: boolean;
1573
+ /**
1574
+ * The low byte of ESC register 0x0000, which names the slave controller family: 0x85 is a netX (Integro), 0xC0 the controller of a Circulo, 0x90 a TI PRU-ICSS (Jasper). Null when the register could not be read at the scan, and over SPoE.
1575
+ * @format int32
1576
+ * @example 192
1577
+ */
1578
+ escType?: number | null;
1579
+ /**
1580
+ * Whether Motion Master writes each mailbox request to this device once and never sends it again. True for a Synapticon or Sensodrive device whose ESC type is not 0x85, because its EtherCAT stack locks its receive mailbox when it gets one request twice. False for a netX, which discards a repeat, and for every other vendor, where a write with no frame back is sent again.
1581
+ * @example true
1582
+ */
1583
+ mailboxWriteOnce?: boolean;
1514
1584
  /**
1515
1585
  * Whether the device has an EtherCAT Slave Controller: SII, ESC registers, distributed clocks and the ESC diagnostics. False over SPoE, where those endpoints answer 409.
1516
1586
  * @example true
@@ -972,6 +972,34 @@ export class Api extends HttpClient {
972
972
  format: "json",
973
973
  ...params,
974
974
  });
975
+ /**
976
+ * @description Runs the capture program `motion-master-capture`, which ships beside the server binary, on the adapter the bus is on, waits for it to exit, and answers the summary. The program records every EtherCAT frame that leaves or enters the adapter with a kernel timestamp and writes them as a pcap file under `captures/` in the user cache, so the file is listed, downloaded and deleted through the `/api/user-cache` routes and opens in Wireshark. The summary matches each frame the master sent to the frame that came back for it, by the index and the header of its first datagram, and reports per kind of frame how late the returns were. The cyclic process-data frame is one kind; mailbox and register datagrams, the control plane, are the other. The bands are the three waits the driver uses, 2 ms, 20 ms and 100 ms, and they are cumulative: a frame later than 100 ms counts in all three. A frame sent again with the same index and header while its first copy had no answer counts once, as `resent`, and its return is timed from the first copy. The time is the kernel's, taken at the boundary to the NIC driver on both sides: when the frame is handed to the driver, and when the driver hands its return back. So the number covers the NIC, the wire and the device, and not the host's own queues and scheduling between that boundary and Motion Master. A capture that shows late frames puts the delay on the wire or in the device. A clean capture beside the server's own warnings, "mailbox write(s) got no frame back", puts it inside the host. Read the two together. One capture at a time. The capture adds no frame to the bus and runs on a thread of its own, so the bus is not touched. The program needs `CAP_NET_RAW`, which the packages grant it at install.
977
+ *
978
+ * @name RunCapture
979
+ * @summary Record the EtherCAT frames of the bus adapter for a number of seconds
980
+ * @request POST:/api/captures
981
+ */
982
+ runCapture = (data, params = {}) => this.request({
983
+ path: `/api/captures`,
984
+ method: "POST",
985
+ body: data,
986
+ type: ContentType.Json,
987
+ format: "json",
988
+ ...params,
989
+ });
990
+ /**
991
+ * @description Reads `captures/{name}` from the user cache and answers the summary that `POST /api/captures` answers, over any Ethernet pcap: a file the server recorded, or one from `tcpdump` on another host that a user put into `captures/` with `PUT /api/user-cache/captures/{name}`. Microsecond and nanosecond timestamps and both byte orders are read.
992
+ *
993
+ * @name GetCaptureSummary
994
+ * @summary Summarise a pcap file in the user cache
995
+ * @request GET:/api/captures/{name}
996
+ */
997
+ getCaptureSummary = (name, params = {}) => this.request({
998
+ path: `/api/captures/${name}`,
999
+ method: "GET",
1000
+ format: "json",
1001
+ ...params,
1002
+ });
975
1003
  /**
976
1004
  * @description Reads the current EtherCAT Application Layer state for one or more devices. Omit the `positions` query parameter to query all discovered devices.
977
1005
  *
@@ -1420,6 +1420,84 @@ export interface DcSyncStatus {
1420
1420
  */
1421
1421
  systemTimeDifference: number;
1422
1422
  }
1423
+ /** The counts for one kind of frame. The bands are cumulative. */
1424
+ export interface CaptureKindSummary {
1425
+ /**
1426
+ * Frames the master sent. A frame sent again counts once.
1427
+ * @example 60021
1428
+ */
1429
+ sent: number;
1430
+ /**
1431
+ * Frames sent again with the same index and header while the first copy had no answer yet. A register datagram goes out again every 2 ms, so a late one shows here too.
1432
+ * @example 12
1433
+ */
1434
+ resent: number;
1435
+ /**
1436
+ * Sent frames that came back
1437
+ * @example 60018
1438
+ */
1439
+ returned: number;
1440
+ /**
1441
+ * Sent frames with no return before the capture ended
1442
+ * @example 3
1443
+ */
1444
+ lost: number;
1445
+ /**
1446
+ * Returns later than 2 ms after the first send
1447
+ * @example 1210
1448
+ */
1449
+ over2Ms: number;
1450
+ /**
1451
+ * Returns later than 20 ms. Counted in over2Ms as well.
1452
+ * @example 1198
1453
+ */
1454
+ over20Ms: number;
1455
+ /**
1456
+ * Returns later than 100 ms. Counted in the two above as well.
1457
+ * @example 1195
1458
+ */
1459
+ over100Ms: number;
1460
+ /**
1461
+ * The latest return, in microseconds after its first send
1462
+ * @format int64
1463
+ * @example 221748
1464
+ */
1465
+ latestUs: number;
1466
+ }
1467
+ /** How late the frames of a capture came back. See `POST /api/captures`. */
1468
+ export interface CaptureSummary {
1469
+ /**
1470
+ * Every record in the capture
1471
+ * @example 120050
1472
+ */
1473
+ frames: number;
1474
+ /**
1475
+ * Records that are not an EtherCAT command frame
1476
+ * @example 0
1477
+ */
1478
+ notEtherCat: number;
1479
+ /**
1480
+ * Frames from the slaves with no send to match, such as the second answer to a frame sent twice
1481
+ * @example 8
1482
+ */
1483
+ unmatchedReturns: number;
1484
+ /**
1485
+ * Timestamp of the first record, epoch microseconds
1486
+ * @format int64
1487
+ * @example 1761143405000123
1488
+ */
1489
+ firstUs: number;
1490
+ /**
1491
+ * Timestamp of the last record, epoch microseconds
1492
+ * @format int64
1493
+ * @example 1761143435000456
1494
+ */
1495
+ lastUs: number;
1496
+ /** The counts for one kind of frame. The bands are cumulative. */
1497
+ control: CaptureKindSummary;
1498
+ /** The counts for one kind of frame. The bands are cumulative. */
1499
+ cyclic: CaptureKindSummary;
1500
+ }
1423
1501
  export interface AlStatusCode {
1424
1502
  /**
1425
1503
  * AL Status Code value (ETG.1000.6 §6.4.1)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synapticon/motion-master-client",
3
- "version": "6.0.0-alpha.97",
3
+ "version": "6.0.0-alpha.99",
4
4
  "description": "Isomorphic TypeScript client for Motion Master: the generated HTTP API client, the WebSocket connection, and helpers.",
5
5
  "license": "MIT",
6
6
  "repository": {