3/19/2019
Wio Tracker - GPS, BT3.0, GSM, Arduino Compatible - Seeed Wiki
http://wiki.seeedstudio.com/wio_gps_board/
18/20
Bluetooth Connection
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
GPSTracker gpsTracker = GPSTracker();
void
setup
() {
// MC20_init();
pinMode(RGBPIN, OUTPUT);
digitalWrite(RGBPIN, LOW);
SerialUSB.begin(
115200
);
// while(!SerialUSB);
gpsTracker.Power_On();
SerialUSB.println(
"Power On!"
);
// gpsTracker.deleteSMS(1);
}
void
loop
() {
if
(MC20_check_readable()){
inComing =
1
;
}
else
{
delay(
1000
);
}
if
(
1
== inComing){
MC20_read_buffer(buffer,
64
);
SerialUSB.println(buffer);
if
(
NULL
!= (s = strstr(buffer,
"+CMTI:
\"
SM
\"
"
))) {
//SMS: $$+CM
char
message[
128
];
int
messageIndex = atoi(s+
12
);
gpsTracker.readSMS(messageIndex, message,
128
);
SerialUSB.print(
"Recv SMS: "
);
SerialUSB.println(message);
}
MC20_clean_buffer(buffer,
64
);
inComing =
0
;
}
}