質問編集履歴
7
削除
test
CHANGED
File without changes
|
test
CHANGED
@@ -3,57 +3,3 @@
|
|
3
3
|
|
4
4
|
|
5
5
|
UnityにてDLLをImportし、C# Scriptにて動作させる事
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
### 発生している問題・エラーメッセージ
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
DLL import動作時playerlogファイル(output_log.txt)で
|
14
|
-
|
15
|
-
PlatformNotSupportedException: Operation is not supported on this platform.
|
16
|
-
|
17
|
-
が発生した場合の対処方法について
|
18
|
-
|
19
|
-
PlatformNotSupportedException: Operation is not supported on this platform.
|
20
|
-
|
21
|
-
at System.IO.Ports.SerialPort..ctor () [0x00000] in <0813754e7cfa415ebfedff172c2dd6e0>:0
|
22
|
-
|
23
|
-
と記載あるので、SerialPortでErrorが発生している模様
|
24
|
-
|
25
|
-
→なにか対処方法ご存知の方いらっしゃればアドバイスください。
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
### 該当のソースコード
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
```C#
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
```
|
38
|
-
|
39
|
-
### 試したこと
|
40
|
-
|
41
|
-
BuildSettingにてX86_64 X86どちらも実施して結果変化なし
|
42
|
-
|
43
|
-
Build Setting→Player Setting→Ohter Setting →Configurationにて
|
44
|
-
|
45
|
-
- Runtime versionを3.5に修正→再起動してビルドするもNGのまま
|
46
|
-
|
47
|
-
- Scripting BackendをIL2CPP→NGのまま
|
48
|
-
|
49
|
-
- ApiConpatibilityを.Net 4.x → NGのまま
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
### 補足情報(FW/ツールのバージョンなど)
|
54
|
-
|
55
|
-
■OS:Windows10 version1903
|
56
|
-
|
57
|
-
■Version :Unity 2018.4.16f1 personal
|
58
|
-
|
59
|
-
■Version :Microsoft Visual Studio Community 2019 Version 16.5.1
|
6
文言修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -7,8 +7,6 @@
|
|
7
7
|
|
8
8
|
|
9
9
|
### 発生している問題・エラーメッセージ
|
10
|
-
|
11
|
-
下記構成・症状を参照ください。
|
12
10
|
|
13
11
|
|
14
12
|
|
@@ -28,10 +26,6 @@
|
|
28
26
|
|
29
27
|
|
30
28
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
29
|
### 該当のソースコード
|
36
30
|
|
37
31
|
|
@@ -43,8 +37,6 @@
|
|
43
37
|
```
|
44
38
|
|
45
39
|
### 試したこと
|
46
|
-
|
47
|
-
|
48
40
|
|
49
41
|
BuildSettingにてX86_64 X86どちらも実施して結果変化なし
|
50
42
|
|
5
文言修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -12,73 +12,23 @@
|
|
12
12
|
|
13
13
|
|
14
14
|
|
15
|
-
|
15
|
+
DLL import動作時playerlogファイル(output_log.txt)で
|
16
16
|
|
17
|
-
|
17
|
+
PlatformNotSupportedException: Operation is not supported on this platform.
|
18
18
|
|
19
|
+
が発生した場合の対処方法について
|
20
|
+
|
21
|
+
PlatformNotSupportedException: Operation is not supported on this platform.
|
22
|
+
|
23
|
+
at System.IO.Ports.SerialPort..ctor () [0x00000] in <0813754e7cfa415ebfedff172c2dd6e0>:0
|
24
|
+
|
25
|
+
と記載あるので、SerialPortでErrorが発生している模様
|
26
|
+
|
19
|
-
|
27
|
+
→なにか対処方法ご存知の方いらっしゃればアドバイスください。
|
20
28
|
|
21
29
|
|
22
30
|
|
23
|
-
過去にUnityでDLLを使用した方で、
|
24
31
|
|
25
|
-
Build Setting→Player Setting→Ohter Setting →Configurationで設定を変更しても解決しない為
|
26
|
-
|
27
|
-
アドバイスをお願いします。
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
■Version :Unity 2018.4.16f1 personal
|
32
|
-
|
33
|
-
■Version :Microsoft Visual Studio Community 2019 Version 16.5.1
|
34
|
-
|
35
|
-
■構成:空のProjectにCanvasとButtonを配置
|
36
|
-
|
37
|
-
→ButtonのOnClickイベントに下記StartBLE関数を追加
|
38
|
-
|
39
|
-
DLL: Assetフォルダ内に下記3ファイルを配置
|
40
|
-
|
41
|
-
- cybleautobase.dll
|
42
|
-
|
43
|
-
- cyblecommonbase.dll
|
44
|
-
|
45
|
-
- cybledonglecommunicator.dll
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
■症状: ビルドは問題なし
|
50
|
-
|
51
|
-
下記Source Code上if (err.IsOk)にてBreakした際に、
|
52
|
-
|
53
|
-
DongleManager.TryGetCySmartDongleCommunicator(DongleInfo, out Comm);のCommがNullで
|
54
|
-
|
55
|
-
動作していない症状
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
C#上でBreakを貼っているため、StartBLE関数が確実に到達している事は確認済
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
■VS2019単独のWPFとしてProjectを作成すると問題なく動作
|
64
|
-
|
65
|
-
BreakするとDongleManager.TryGetCySmartDongleCommunicator(DongleInfo, out Comm);のCommがNullではなく
|
66
|
-
|
67
|
-
DeviceIDやBleManagerなどが格納されているのが一番大きな異なる点
|
68
|
-
|
69
|
-
→err.IsOk==true
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
■DLLについて
|
74
|
-
|
75
|
-
VS2019にてDLLのPropertyを見ると
|
76
|
-
|
77
|
-
- Version : 1.3.0.8
|
78
|
-
|
79
|
-
- Runtime Version: v2.0.50727
|
80
|
-
|
81
|
-
となっていて、このDLLはCypress社が作成したのものなので、自分では特に変更はできない
|
82
32
|
|
83
33
|
|
84
34
|
|
@@ -88,63 +38,7 @@
|
|
88
38
|
|
89
39
|
```C#
|
90
40
|
|
91
|
-
using System.Collections;
|
92
41
|
|
93
|
-
using System.Collections.Generic;
|
94
|
-
|
95
|
-
using UnityEngine;
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
using CySmart.Common.Base.Compatibility.Net20;
|
100
|
-
|
101
|
-
using CySmart.DongleCommunicator.API;
|
102
|
-
|
103
|
-
using System.Runtime.InteropServices.ComTypes;
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
public class BLErx : MonoBehaviour
|
108
|
-
|
109
|
-
{
|
110
|
-
|
111
|
-
CyDongleInfo DongleInfo;
|
112
|
-
|
113
|
-
CySmartDongleMgr DongleManager;
|
114
|
-
|
115
|
-
ICySmartDongleCommunicator Comm;
|
116
|
-
|
117
|
-
// Start is called before the first frame update
|
118
|
-
|
119
|
-
public void StartBLE()
|
120
|
-
|
121
|
-
{
|
122
|
-
|
123
|
-
DongleInfo = new CyDongleInfo("COM3", CyDongleInfo.CySmartDongleType.CY5677);
|
124
|
-
|
125
|
-
DongleManager = CySmartDongleMgr.GetInstance();
|
126
|
-
|
127
|
-
CyApiErr err = DongleManager.TryGetCySmartDongleCommunicator(DongleInfo, out Comm);
|
128
|
-
|
129
|
-
if (err.IsOk)
|
130
|
-
|
131
|
-
{
|
132
|
-
|
133
|
-
Debug.Log("OK");
|
134
|
-
|
135
|
-
}
|
136
|
-
|
137
|
-
else
|
138
|
-
|
139
|
-
{
|
140
|
-
|
141
|
-
Debug.Log("NG");
|
142
|
-
|
143
|
-
}
|
144
|
-
|
145
|
-
}
|
146
|
-
|
147
|
-
}
|
148
42
|
|
149
43
|
```
|
150
44
|
|
@@ -153,8 +47,6 @@
|
|
153
47
|
|
154
48
|
|
155
49
|
BuildSettingにてX86_64 X86どちらも実施して結果変化なし
|
156
|
-
|
157
|
-
|
158
50
|
|
159
51
|
Build Setting→Player Setting→Ohter Setting →Configurationにて
|
160
52
|
|
@@ -166,10 +58,6 @@
|
|
166
58
|
|
167
59
|
|
168
60
|
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
61
|
### 補足情報(FW/ツールのバージョンなど)
|
174
62
|
|
175
63
|
■OS:Windows10 version1903
|
@@ -177,7 +65,3 @@
|
|
177
65
|
■Version :Unity 2018.4.16f1 personal
|
178
66
|
|
179
67
|
■Version :Microsoft Visual Studio Community 2019 Version 16.5.1
|
180
|
-
|
181
|
-
■DLL情報:CypressのToolで下記よりDL可能
|
182
|
-
|
183
|
-
https://japan.cypress.com/documentation/software-and-drivers/cysmart-bluetooth-le-test-and-debug-tool
|
4
Configurationの変更検討結果追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -22,11 +22,9 @@
|
|
22
22
|
|
23
23
|
過去にUnityでDLLを使用した方で、
|
24
24
|
|
25
|
-
Build Setting→Player Setting→Ohter Setting →Configuration
|
25
|
+
Build Setting→Player Setting→Ohter Setting →Configurationで設定を変更しても解決しない為
|
26
26
|
|
27
27
|
アドバイスをお願いします。
|
28
|
-
|
29
|
-
ApiConpatibilityを.Net 4.xにしてもダメでした。
|
30
28
|
|
31
29
|
|
32
30
|
|
@@ -160,6 +158,8 @@
|
|
160
158
|
|
161
159
|
Build Setting→Player Setting→Ohter Setting →Configurationにて
|
162
160
|
|
161
|
+
- Runtime versionを3.5に修正→再起動してビルドするもNGのまま
|
162
|
+
|
163
163
|
- Scripting BackendをIL2CPP→NGのまま
|
164
164
|
|
165
165
|
- ApiConpatibilityを.Net 4.x → NGのまま
|
3
Code表示変更
test
CHANGED
File without changes
|
test
CHANGED
@@ -25,6 +25,8 @@
|
|
25
25
|
Build Setting→Player Setting→Ohter Setting →Configurationにてどこを変えればよいか?など経験した方いらっしゃれば
|
26
26
|
|
27
27
|
アドバイスをお願いします。
|
28
|
+
|
29
|
+
ApiConpatibilityを.Net 4.xにしてもダメでした。
|
28
30
|
|
29
31
|
|
30
32
|
|
@@ -86,6 +88,8 @@
|
|
86
88
|
|
87
89
|
|
88
90
|
|
91
|
+
```C#
|
92
|
+
|
89
93
|
using System.Collections;
|
90
94
|
|
91
95
|
using System.Collections.Generic;
|
@@ -144,7 +148,7 @@
|
|
144
148
|
|
145
149
|
}
|
146
150
|
|
147
|
-
|
151
|
+
```
|
148
152
|
|
149
153
|
### 試したこと
|
150
154
|
|
@@ -154,9 +158,15 @@
|
|
154
158
|
|
155
159
|
|
156
160
|
|
157
|
-
Build Setting→Player Setting→Ohter Setting →Configurationにて
|
161
|
+
Build Setting→Player Setting→Ohter Setting →Configurationにて
|
158
162
|
|
159
|
-
|
163
|
+
- Scripting BackendをIL2CPP→NGのまま
|
164
|
+
|
165
|
+
- ApiConpatibilityを.Net 4.x → NGのまま
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
160
170
|
|
161
171
|
|
162
172
|
|
2
Configurationについて説明追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -17,6 +17,14 @@
|
|
17
17
|
ただし、UnityではなくVS2019のみを使用して全く同一のFunctionを実行した際は、
|
18
18
|
|
19
19
|
特に問題なく動作していることを確認しています。
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
過去にUnityでDLLを使用した方で、
|
24
|
+
|
25
|
+
Build Setting→Player Setting→Ohter Setting →Configurationにてどこを変えればよいか?など経験した方いらっしゃれば
|
26
|
+
|
27
|
+
アドバイスをお願いします。
|
20
28
|
|
21
29
|
|
22
30
|
|
@@ -146,6 +154,12 @@
|
|
146
154
|
|
147
155
|
|
148
156
|
|
157
|
+
Build Setting→Player Setting→Ohter Setting →Configurationにてどこを変えればよいか?など経験した方いらっしゃれば
|
158
|
+
|
159
|
+
アドバイスをお願いします。
|
160
|
+
|
161
|
+
|
162
|
+
|
149
163
|
### 補足情報(FW/ツールのバージョンなど)
|
150
164
|
|
151
165
|
■OS:Windows10 version1903
|
1
題名を修正
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
Unity DLL import時Errorはでないが、動作しない問題()
|
1
|
+
Unity DLL import時Errorはでないが、動作しない問題(VS WPF単独のProjectでは動作確認済)
|
test
CHANGED
@@ -47,6 +47,10 @@
|
|
47
47
|
動作していない症状
|
48
48
|
|
49
49
|
|
50
|
+
|
51
|
+
C#上でBreakを貼っているため、StartBLE関数が確実に到達している事は確認済
|
52
|
+
|
53
|
+
|
50
54
|
|
51
55
|
■VS2019単独のWPFとしてProjectを作成すると問題なく動作
|
52
56
|
|