@science-corporation/synapse 2.0.0 → 2.2.2

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.
Files changed (127) hide show
  1. package/README.md +7 -0
  2. package/package.json +3 -2
  3. package/src/config.ts +1 -5
  4. package/src/device.ts +1 -5
  5. package/src/nodes/index.ts +0 -2
  6. package/synapse-api/README.md +1 -1
  7. package/synapse-api/api/app.proto +55 -0
  8. package/synapse-api/api/channel.proto +15 -1
  9. package/synapse-api/api/datatype.proto +97 -1
  10. package/synapse-api/api/device.proto +65 -0
  11. package/synapse-api/api/node.proto +19 -18
  12. package/synapse-api/api/nodes/application.proto +24 -0
  13. package/synapse-api/api/nodes/broadband_source.proto +1 -0
  14. package/synapse-api/api/nodes/disk_writer.proto +17 -0
  15. package/synapse-api/api/nodes/optical_stimulation.proto +29 -0
  16. package/synapse-api/api/nodes/signal_config.proto +2 -0
  17. package/synapse-api/api/performance.proto +29 -0
  18. package/synapse-api/api/query.proto +8 -0
  19. package/synapse-api/api/status.proto +6 -1
  20. package/synapse-api/api/synapse.proto +8 -31
  21. package/synapse-api/api/tap.proto +35 -0
  22. package/synapse-api/api/time.proto +53 -0
  23. package/dist/api/api.d.ts +0 -6755
  24. package/dist/api/api.d.ts.map +0 -1
  25. package/dist/api/api.js +0 -15729
  26. package/dist/api/api.js.map +0 -1
  27. package/dist/api/proto.json +0 -1144
  28. package/dist/browser.d.ts +0 -4
  29. package/dist/browser.d.ts.map +0 -1
  30. package/dist/browser.js +0 -22
  31. package/dist/browser.js.map +0 -1
  32. package/dist/config.d.ts +0 -17
  33. package/dist/config.d.ts.map +0 -1
  34. package/dist/config.js +0 -115
  35. package/dist/config.js.map +0 -1
  36. package/dist/demo.d.ts +0 -2
  37. package/dist/demo.d.ts.map +0 -1
  38. package/dist/demo.js +0 -285
  39. package/dist/demo.js.map +0 -1
  40. package/dist/device.d.ts +0 -38
  41. package/dist/device.d.ts.map +0 -1
  42. package/dist/device.js +0 -185
  43. package/dist/device.js.map +0 -1
  44. package/dist/index.d.ts +0 -7
  45. package/dist/index.d.ts.map +0 -1
  46. package/dist/index.js +0 -30
  47. package/dist/index.js.map +0 -1
  48. package/dist/node.d.ts +0 -10
  49. package/dist/node.d.ts.map +0 -1
  50. package/dist/node.js +0 -14
  51. package/dist/node.js.map +0 -1
  52. package/dist/nodes/broadband_source.d.ts +0 -11
  53. package/dist/nodes/broadband_source.d.ts.map +0 -1
  54. package/dist/nodes/broadband_source.js +0 -28
  55. package/dist/nodes/broadband_source.js.map +0 -1
  56. package/dist/nodes/disk_writer.d.ts +0 -11
  57. package/dist/nodes/disk_writer.d.ts.map +0 -1
  58. package/dist/nodes/disk_writer.js +0 -28
  59. package/dist/nodes/disk_writer.js.map +0 -1
  60. package/dist/nodes/electrical_stimulation.d.ts +0 -11
  61. package/dist/nodes/electrical_stimulation.d.ts.map +0 -1
  62. package/dist/nodes/electrical_stimulation.js +0 -28
  63. package/dist/nodes/electrical_stimulation.js.map +0 -1
  64. package/dist/nodes/index.d.ts +0 -12
  65. package/dist/nodes/index.d.ts.map +0 -1
  66. package/dist/nodes/index.js +0 -27
  67. package/dist/nodes/index.js.map +0 -1
  68. package/dist/nodes/optical_stimulation.d.ts +0 -11
  69. package/dist/nodes/optical_stimulation.d.ts.map +0 -1
  70. package/dist/nodes/optical_stimulation.js +0 -28
  71. package/dist/nodes/optical_stimulation.js.map +0 -1
  72. package/dist/nodes/spectral_filter.d.ts +0 -11
  73. package/dist/nodes/spectral_filter.d.ts.map +0 -1
  74. package/dist/nodes/spectral_filter.js +0 -28
  75. package/dist/nodes/spectral_filter.js.map +0 -1
  76. package/dist/nodes/spike_binner.d.ts +0 -11
  77. package/dist/nodes/spike_binner.d.ts.map +0 -1
  78. package/dist/nodes/spike_binner.js +0 -28
  79. package/dist/nodes/spike_binner.js.map +0 -1
  80. package/dist/nodes/spike_detector.d.ts +0 -11
  81. package/dist/nodes/spike_detector.d.ts.map +0 -1
  82. package/dist/nodes/spike_detector.js +0 -28
  83. package/dist/nodes/spike_detector.js.map +0 -1
  84. package/dist/nodes/spike_source.d.ts +0 -11
  85. package/dist/nodes/spike_source.d.ts.map +0 -1
  86. package/dist/nodes/spike_source.js +0 -28
  87. package/dist/nodes/spike_source.js.map +0 -1
  88. package/dist/nodes/stream_in.d.ts +0 -15
  89. package/dist/nodes/stream_in.d.ts.map +0 -1
  90. package/dist/nodes/stream_in.js +0 -66
  91. package/dist/nodes/stream_in.js.map +0 -1
  92. package/dist/nodes/stream_out.d.ts +0 -23
  93. package/dist/nodes/stream_out.d.ts.map +0 -1
  94. package/dist/nodes/stream_out.js +0 -105
  95. package/dist/nodes/stream_out.js.map +0 -1
  96. package/dist/utils/client.d.ts +0 -10
  97. package/dist/utils/client.d.ts.map +0 -1
  98. package/dist/utils/client.js +0 -39
  99. package/dist/utils/client.js.map +0 -1
  100. package/dist/utils/discover.d.ts +0 -10
  101. package/dist/utils/discover.d.ts.map +0 -1
  102. package/dist/utils/discover.js +0 -49
  103. package/dist/utils/discover.js.map +0 -1
  104. package/dist/utils/enum.d.ts +0 -2
  105. package/dist/utils/enum.d.ts.map +0 -1
  106. package/dist/utils/enum.js +0 -13
  107. package/dist/utils/enum.js.map +0 -1
  108. package/dist/utils/index.d.ts +0 -2
  109. package/dist/utils/index.d.ts.map +0 -1
  110. package/dist/utils/index.js +0 -6
  111. package/dist/utils/index.js.map +0 -1
  112. package/dist/utils/ip.d.ts +0 -2
  113. package/dist/utils/ip.d.ts.map +0 -1
  114. package/dist/utils/ip.js +0 -52
  115. package/dist/utils/ip.js.map +0 -1
  116. package/dist/utils/status.d.ts +0 -28
  117. package/dist/utils/status.d.ts.map +0 -1
  118. package/dist/utils/status.js +0 -54
  119. package/dist/utils/status.js.map +0 -1
  120. package/src/api/api.d.ts +0 -6755
  121. package/src/api/api.js +0 -16783
  122. package/src/api/proto.json +0 -1144
  123. package/src/demo.ts +0 -325
  124. package/src/nodes/stream_in.ts +0 -78
  125. package/src/nodes/stream_out.ts +0 -109
  126. package/synapse-api/api/nodes/stream_in.proto +0 -14
  127. package/synapse-api/api/nodes/stream_out.proto +0 -42
@@ -0,0 +1,35 @@
1
+ syntax = "proto3";
2
+
3
+ package synapse;
4
+
5
+ enum TapType {
6
+ TAP_TYPE_UNSPECIFIED = 0;
7
+
8
+ // The tap will be producing data
9
+ TAP_TYPE_PRODUCER = 1;
10
+
11
+ // The tap type will be consuming data
12
+ TAP_TYPE_CONSUMER = 2;
13
+ }
14
+
15
+ message TapConnection {
16
+ // Unique name id for this tap
17
+ string name = 1;
18
+
19
+ // What is the zmq endpoint to connect to
20
+ string endpoint = 2;
21
+
22
+ // What is the protobuf message to expect over this
23
+ string message_type = 3;
24
+
25
+ // Is this tap meant to be producing or consuming
26
+ TapType tap_type = 4;
27
+ }
28
+
29
+ message ListTapsQuery {
30
+
31
+ }
32
+
33
+ message ListTapsResponse {
34
+ repeated TapConnection taps = 1;
35
+ }
@@ -0,0 +1,53 @@
1
+ syntax = "proto3";
2
+
3
+ package synapse;
4
+
5
+ /**
6
+ * Used for precise time synchronization over UDP between clients and a server
7
+ * In most cases, the server is the Synapse device.enum
8
+ *
9
+ * How it works:
10
+ * 1. Client generates a random client_id on first connection
11
+ * 2. Client increments the sequence number on each packet (to detect drops)
12
+ * 3. Client records the send time and sends the packet to the server over udp.
13
+ * - The server port will be available through the Status message
14
+ * - Try to timestamp the packet as close as possible to the send to minimize
15
+ * the calculated offset error. Future improvements could support hardware timestamps
16
+ * 4. Server records the receive time
17
+ * 5. Server immediately echos it back to the client, recording the send time
18
+ * 6. Client records the receive time when the packet returns
19
+ *
20
+ * With these times, the client can calculate
21
+ * - Round Trip Time: (client_receive_time_ns - client_send_time_ns)
22
+ * - Network Latency (assumes symmetric paths): rtt / 2
23
+ * - Clock offset: https://en.wikipedia.org/wiki/Network_Time_Protocol#Clock_synchronization_algorithm
24
+ *
25
+ * Implementation notes:
26
+ * - All timestamps are monotonic nanoseconds since Unix epoch
27
+ * - The server acts as a passive reflector
28
+ * - Multiple sync packets (8 or so) should be sent with a short period (200 ms) between
29
+ */
30
+ message TimeSyncPacket {
31
+ fixed32 client_id = 1;
32
+ fixed32 sequence = 2;
33
+
34
+ fixed64 client_send_time_ns = 3;
35
+ fixed64 server_receive_time_ns = 4;
36
+ fixed64 server_send_time_ns = 5;
37
+ fixed64 client_receive_time_ns = 6;
38
+ }
39
+
40
+ // Defines the time synchronization method for device timestamps
41
+ enum TimeSource {
42
+ TIME_SOURCE_UNKNOWN = 0;
43
+
44
+ // Use std::chrono::steady_clock (monotonic, immune to system time changes)
45
+ // Note: The epoch is implementation-defined (often system boot time)
46
+ TIME_SOURCE_STEADY_CLOCK = 1;
47
+
48
+ // Calculate timestamps based on sample counter and sampling rate
49
+ // counter_diff = (counter - first_counter)
50
+ // timestamp_ns = (counter_diff * 1e9 / sample_rate) + initial_steady_clock_value
51
+ // Where initial_steady_clock_value = get_steady_clock_now() at start
52
+ TIME_SOURCE_SAMPLE_COUNTER = 2;
53
+ }