質問編集履歴

9

試験内容の補足説明

2021/10/22 01:09

投稿

suban
suban

スコア28

test CHANGED
File without changes
test CHANGED
@@ -117,3 +117,13 @@
117
117
  <BLE_SCANのテスト結果>
118
118
 
119
119
  ![イメージ説明](c3af340c9fc0e4213c058848709db9df.png)
120
+
121
+
122
+
123
+ ***************************************************
124
+
125
+ やりたい事は、型名「FSCBP103」でコンペアして
126
+
127
+ 一致すれば、そのMACアドレスをシリアル送信しようとして
128
+
129
+ その為には、型名を読めるかのテストをしておりました。

8

試験内容の補足説明

2021/10/22 01:09

投稿

suban
suban

スコア28

test CHANGED
File without changes
test CHANGED
@@ -112,4 +112,8 @@
112
112
 
113
113
  delay(40); // 0.1秒wait
114
114
 
115
+ }
116
+
117
+ <BLE_SCANのテスト結果>
118
+
115
- }![イメージ説明](c3af340c9fc0e4213c058848709db9df.png)
119
+ ![イメージ説明](c3af340c9fc0e4213c058848709db9df.png)

7

試験内容の補足説明

2021/08/24 00:17

投稿

suban
suban

スコア28

test CHANGED
File without changes
test CHANGED
@@ -15,6 +15,8 @@
15
15
  ちなみに、ESP32のスッケチ例の中のBLE_scanを
16
16
 
17
17
  実行させると正常に「FSCBP103」と表示しているのですが
18
+
19
+ その表示している画面を下記に追加しました。
18
20
 
19
21
 
20
22
 

6

試験内容の補足説明

2021/08/23 01:44

投稿

suban
suban

スコア28

test CHANGED
File without changes
test CHANGED
@@ -110,4 +110,4 @@
110
110
 
111
111
  delay(40); // 0.1秒wait
112
112
 
113
- }
113
+ }![イメージ説明](c3af340c9fc0e4213c058848709db9df.png)

5

試験内容の補足説明

2021/08/23 01:42

投稿

suban
suban

スコア28

test CHANGED
File without changes
test CHANGED
@@ -19,3 +19,95 @@
19
19
 
20
20
 
21
21
  ![イメージ説明](6d1a574dcc0dce1cbe9865d7a75fa8d5.png)
22
+
23
+ <使用したプログラム>
24
+
25
+ #include <BLEDevice.h>
26
+
27
+
28
+
29
+ //FSC-BP103
30
+
31
+ #define DEF_BLE_ADDR "dc:0d:30:**:**:dd"
32
+
33
+ BLEScan* g_pBLEScan;
34
+
35
+
36
+
37
+ void setup() {
38
+
39
+ Serial1.begin(115200, SERIAL_8N1, 26, 27); //RX--26,TX--27
40
+
41
+ Serial.begin(115200); // ログ出力準備
42
+
43
+ pinMode(5, OUTPUT);//5番ピンを出力に設定
44
+
45
+
46
+
47
+ BLEDevice::init(""); // BLEデバイス初期化
48
+
49
+ g_pBLEScan = BLEDevice::getScan(); // Scanオブジェクト取得
50
+
51
+ g_pBLEScan->setActiveScan(false); // パッシブスキャンに設定
52
+
53
+ }
54
+
55
+
56
+
57
+ void loop() {
58
+
59
+ char buf[1024];
60
+
61
+ sprintf(buf, "");
62
+
63
+ BLEScanResults res = g_pBLEScan->start(1); // スキャン時間1秒
64
+
65
+ int nCnt = res.getCount();
66
+
67
+ if (nCnt > 30) { // 上限30件まで検出
68
+
69
+ nCnt = 30;
70
+
71
+ }
72
+
73
+ // 検出したBLE件数分ループ
74
+
75
+ for (int i = 0; i < nCnt; i++) {
76
+
77
+ BLEAdvertisedDevice bledev = res.getDevice(i);
78
+
79
+ BLEAddress ble_addr = bledev.getAddress(); // BLEのMACアドレス取得
80
+
81
+ std::string ble_name = bledev.getName(); // BLEの名称取得
82
+
83
+ // MACアドレスが一致している場合
84
+
85
+ if( DEF_BLE_ADDR == ble_addr.toString() ){
86
+
87
+ // ログ出力
88
+
89
+ digitalWrite(5, HIGH);//5番ピンの出力をHIGH(5V)に設定
90
+
91
+ delay(10);//10msec待機(1秒待機)
92
+
93
+ sprintf(buf, "name=[%s]; addr=[%s]", ble_name.c_str(), ble_addr.toString().c_str());
94
+
95
+ Serial.println(buf);
96
+
97
+ Serial1.print(ble_addr.toString().c_str());
98
+
99
+ break;
100
+
101
+ }
102
+
103
+ }
104
+
105
+
106
+
107
+ digitalWrite(5, LOW);//5番ピンの出力をLOW(0V)に設定
108
+
109
+
110
+
111
+ delay(40); // 0.1秒wait
112
+
113
+ }

4

試験内容の誤記修正

2021/08/19 00:50

投稿

suban
suban

スコア28

test CHANGED
File without changes
test CHANGED
@@ -12,7 +12,7 @@
12
12
 
13
13
 
14
14
 
15
- ちなみに、ESP32のスッケチ例の中のbcon scanを
15
+ ちなみに、ESP32のスッケチ例の中のBLE_scanを
16
16
 
17
17
  実行させると正常に「FSCBP103」と表示しているのですが
18
18
 

3

試験内容の補足説明

2021/08/16 02:55

投稿

suban
suban

スコア28

test CHANGED
File without changes
test CHANGED
@@ -12,4 +12,10 @@
12
12
 
13
13
 
14
14
 
15
+ ちなみに、ESP32のスッケチ例の中のbcon scanを
16
+
17
+ 実行させると正常に「FSCBP103」と表示しているのですが
18
+
19
+
20
+
15
21
  ![イメージ説明](6d1a574dcc0dce1cbe9865d7a75fa8d5.png)

2

タイトル修正

2021/08/16 01:20

投稿

suban
suban

スコア28

test CHANGED
@@ -1 +1 @@
1
- ESP32によるBLE通信について教えてください
1
+ ESP32によるBLE通信で、BLE名称を表示せた
test CHANGED
File without changes

1

タイトル修正

2021/08/16 00:40

投稿

suban
suban

スコア28

test CHANGED
@@ -1 +1 @@
1
- ESP32によるBLE通信について
1
+ ESP32によるBLE通信について教えてください
test CHANGED
File without changes