com.shinolab.autd3-sdk 0.2.0 → 0.3.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/Client.cs CHANGED
@@ -16,6 +16,9 @@ namespace AUTD3
16
16
  }
17
17
 
18
18
  public bool IsThermalAsserted => (Raw & (1 << 0)) != 0;
19
+ public bool IsPatternStopped => (Raw & (1 << 4)) != 0;
20
+ public bool IsModStopped => (Raw & (1 << 5)) != 0;
21
+ public bool IsTransitionPending => (Raw & (1 << 6)) != 0;
19
22
  public bool ReadsEnabled => (Raw & (1 << 7)) != 0;
20
23
  }
21
24
 
@@ -311,6 +314,12 @@ namespace AUTD3
311
314
  public Task<byte[]> ReadErrorDetailAsync() =>
312
315
  ReadByteArrayAsync((cb, ud) => NativeClient.autd3_client_read_error_detail(Handle, cb, ud));
313
316
 
317
+ public Task<byte[]> ReadTelemetryAsync(Telemetry counter) =>
318
+ ReadByteArrayAsync((cb, ud) => NativeClient.autd3_client_read_telemetry(Handle, (byte)counter, cb, ud));
319
+
320
+ public Task<byte[]> ReadFpgaFunctionsAsync() =>
321
+ ReadByteArrayAsync((cb, ud) => NativeClient.autd3_client_read_fpga_functions(Handle, cb, ud));
322
+
314
323
  internal static async Task<byte[]> ReadByteArrayAsync(Action<CompletionCallback, IntPtr> invoke)
315
324
  {
316
325
  var array = await AsyncOps.InvokeAsync(invoke).ConfigureAwait(false);
package/Native.cs CHANGED
@@ -93,6 +93,12 @@ namespace AUTD3
93
93
  [DllImport(Lib)]
94
94
  internal static extern void autd3_client_read_error_detail(IntPtr client, CompletionCallback cb, IntPtr userData);
95
95
 
96
+ [DllImport(Lib)]
97
+ internal static extern void autd3_client_read_telemetry(IntPtr client, byte counter, CompletionCallback cb, IntPtr userData);
98
+
99
+ [DllImport(Lib)]
100
+ internal static extern void autd3_client_read_fpga_functions(IntPtr client, CompletionCallback cb, IntPtr userData);
101
+
96
102
  [DllImport(Lib)]
97
103
  internal static extern UIntPtr autd3_byte_array_len(IntPtr array);
98
104
 
Binary file
Binary file
package/Stm.cs CHANGED
@@ -40,17 +40,20 @@ namespace AUTD3
40
40
  [DllImport(Lib)]
41
41
  internal static extern IntPtr autd3_stm_config_sampling(ushort divide);
42
42
 
43
+ [DllImport(Lib)]
44
+ internal static extern int autd3_stm_config_into_sampling_config(IntPtr config, UIntPtr size, out ushort @out);
45
+
43
46
  [DllImport(Lib)]
44
47
  internal static extern void autd3_stm_config_free(IntPtr config);
45
48
 
46
49
  [DllImport(Lib)]
47
- internal static extern IntPtr autd3_op_foci_stm(IntPtr config, Autd3StmControlPointNative[] points, UIntPtr numSamples, byte numFoci, byte[] intensities, byte bank, float soundSpeedMS, ushort loopRep, byte transitionMode, ulong transitionValue);
50
+ internal static extern IntPtr autd3_op_foci_stm(IntPtr config, Autd3StmControlPointNative[] points, UIntPtr numSamples, byte numFoci, byte[] intensities, byte bank, float soundSpeedMS, ushort loopRep, byte transitionMode, ulong transitionValue, uint transitionMarginNs);
48
51
 
49
52
  [DllImport(Lib)]
50
53
  internal static extern IntPtr autd3_op_write_foci_buffer(byte bank, uint indexOffset, Autd3StmControlPointNative[] points, UIntPtr numSamples, byte numFoci, byte[] intensities);
51
54
 
52
55
  [DllImport(Lib)]
53
- internal static extern IntPtr autd3_op_pattern_stm(IntPtr config, IntPtr[] patterns, UIntPtr numPatterns, byte bank, byte mode, ushort loopRep, byte transitionMode, ulong transitionValue);
56
+ internal static extern IntPtr autd3_op_pattern_stm(IntPtr config, IntPtr[] patterns, UIntPtr numPatterns, byte bank, byte mode, ushort loopRep, byte transitionMode, ulong transitionValue, uint transitionMarginNs);
54
57
 
55
58
  [DllImport(Lib)]
56
59
  internal static extern int autd3_stm_circle(float[] center, float radiusMm, UIntPtr numPoints, float[] normal, byte intensity, Autd3StmControlPointNative[] outPoints, byte[] outIntensities);
@@ -101,6 +104,33 @@ namespace AUTD3
101
104
  {
102
105
  }
103
106
 
107
+ public static implicit operator StmConfig(Freq freq) => new StmConfig(freq);
108
+
109
+ public static implicit operator StmConfig(Nearest<Freq> freq) => new StmConfig(freq);
110
+
111
+ public static implicit operator StmConfig(TimeSpan period) => new StmConfig(period);
112
+
113
+ public static implicit operator StmConfig(Nearest<TimeSpan> period) => new StmConfig(period);
114
+
115
+ public static implicit operator StmConfig(SamplingConfig sampling) => new StmConfig(sampling);
116
+
117
+ public SamplingConfig IntoSamplingConfig(int size)
118
+ {
119
+ var handle = CreateHandle();
120
+ try
121
+ {
122
+ if (NativeStm.autd3_stm_config_into_sampling_config(handle, (UIntPtr)Math.Max(size, 1), out var divide) != 0)
123
+ {
124
+ throw new Autd3Exception("stm config cannot be resolved to a sampling config");
125
+ }
126
+ return new SamplingConfig(divide);
127
+ }
128
+ finally
129
+ {
130
+ NativeStm.autd3_stm_config_free(handle);
131
+ }
132
+ }
133
+
104
134
  internal IntPtr CreateHandle()
105
135
  {
106
136
  var handle = _kind switch
@@ -229,7 +259,7 @@ namespace AUTD3
229
259
  try
230
260
  {
231
261
  return NativeStm.autd3_op_foci_stm(configHandle, points, (UIntPtr)_points.Length, numFoci, intensities,
232
- (byte)_option.Bank, _option.SoundSpeed.MPerS, _option.LoopBehavior.Rep, _option.TransitionMode.Mode, _option.TransitionMode.Value);
262
+ (byte)_option.Bank, _option.SoundSpeed.MPerS, _option.LoopBehavior.Rep, _option.TransitionMode.Mode, _option.TransitionMode.Value, _option.TransitionMode.MarginNs);
233
263
  }
234
264
  finally
235
265
  {
@@ -262,7 +292,7 @@ namespace AUTD3
262
292
  try
263
293
  {
264
294
  return NativeStm.autd3_op_pattern_stm(configHandle, handles, (UIntPtr)handles.Length,
265
- (byte)_option.Bank, (byte)_option.Mode, _option.LoopBehavior.Rep, _option.TransitionMode.Mode, _option.TransitionMode.Value);
295
+ (byte)_option.Bank, (byte)_option.Mode, _option.LoopBehavior.Rep, _option.TransitionMode.Mode, _option.TransitionMode.Value, _option.TransitionMode.MarginNs);
266
296
  }
267
297
  finally
268
298
  {
@@ -886,10 +886,10 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
886
886
 
887
887
  Used by:
888
888
 
889
- - autd3-ffi 0.2.0 — https://github.com/shinolab/autd3-sdk
890
- - autd3-ffi-abi 0.2.0 — https://github.com/shinolab/autd3-sdk
891
- - autd3-rs 0.2.0 — https://github.com/shinolab/autd3-sdk
892
- - autd3-rs-core 0.2.0 — https://github.com/shinolab/autd3-sdk
889
+ - autd3-ffi 0.3.0 — https://github.com/shinolab/autd3-sdk
890
+ - autd3-ffi-abi 0.3.0 — https://github.com/shinolab/autd3-sdk
891
+ - autd3-rs 0.3.0 — https://github.com/shinolab/autd3-sdk
892
+ - autd3-rs-core 0.3.0 — https://github.com/shinolab/autd3-sdk
893
893
  - chrono 0.4.45 — https://github.com/chronotope/chrono
894
894
  - wide 1.5.0 — https://github.com/Lokathor/wide
895
895
  - winapi-i686-pc-windows-gnu 0.4.0 — https://github.com/retep998/winapi-rs
package/package.json CHANGED
@@ -1,6 +1,11 @@
1
1
  {
2
2
  "name": "com.shinolab.autd3-sdk",
3
- "version": "0.2.0",
3
+ "repository": {
4
+ "type": "git",
5
+ "url": "git+https://github.com/shinolab/autd3-sdk.git",
6
+ "directory": "bindings/unity/com.shinolab.autd3-sdk"
7
+ },
8
+ "version": "0.3.0",
4
9
  "displayName": "AUTD3",
5
10
  "description": "AUTD3 client, datagrams and STM (Unity binding).",
6
11
  "unity": "6000.0",
@@ -10,9 +15,9 @@
10
15
  "url": "https://github.com/shinolab"
11
16
  },
12
17
  "dependencies": {
13
- "com.shinolab.autd3-sdk.core": "0.2.0",
14
- "com.shinolab.autd3-sdk.pattern": "0.2.0",
15
- "com.shinolab.autd3-sdk.modulation": "0.2.0"
18
+ "com.shinolab.autd3-sdk.core": "0.3.0",
19
+ "com.shinolab.autd3-sdk.pattern": "0.3.0",
20
+ "com.shinolab.autd3-sdk.modulation": "0.3.0"
16
21
  },
17
22
  "samples": [
18
23
  {