#include <DFRobot_Bluno2.h>
#include <ArduinoJson.h>
DFRobot_Bluno2 blunoNet;
int blunoID=0;
void setup()
{
Serial.begin(9600);
blunoNet.begin(Serial);//
获取
id
}
void loop()
{
uint8_t event=blunoNet.getEvent();//queue
switch(event)
{
case EVENT_NETINFO:
{
eventNode e = blunoNet.popEvent();
StaticJsonBuffer<200> jsonBuffer;
JsonObject& root = jsonBuffer.parseObject((const char *)e.payload);
if (!root.success()) {
return;
}
int s = root["r"].size();
for(int i = 0; i < s; i++){
if(root["r"][i]["s"].as<int>()){
blunoID = root["r"][i]["i"].as<int>();
break;
}
break;
}
Содержание BLE4.1
Страница 10: ...Fig2 Connected Send data frome the Data sending Area...
Страница 11: ...Fig3 Send Data Click Send Data to send data...