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