RN41/42 control lib. RN41/42 is bluetooth module with class 1 or 2.
Dependencies: StrLib myTimer RingBuffer
Revision 5:63925964cbd5, committed 2015-11-20
- Comitter:
- AkinoriHashimoto
- Date:
- Fri Nov 20 07:15:40 2015 +0000
- Parent:
- 4:8b74db22e4c6
- Commit message:
- add reboot().
Changed in this revision
diff -r 8b74db22e4c6 -r 63925964cbd5 RN41.cpp --- a/RN41.cpp Mon Nov 16 04:11:50 2015 +0000 +++ b/RN41.cpp Fri Nov 20 07:15:40 2015 +0000 @@ -158,6 +158,17 @@ return NG; } +bool RN41::reboot() +{ + if(!enterCMD()) + return ; // CMD入れず + sendCMD("R,1"); + +// bool2 find= chkReply("Reboot!\r", 100); + + return chkReply("Reboot!\r", 100).b1; +} + void RN41::sendCMD(string str, bool addCR) {
diff -r 8b74db22e4c6 -r 63925964cbd5 RN41.h --- a/RN41.h Mon Nov 16 04:11:50 2015 +0000 +++ b/RN41.h Fri Nov 20 07:15:40 2015 +0000 @@ -102,6 +102,7 @@ bool enterCMD(); int connect(string addr); // 必ず、Checkを呼ぶこと。2-5sかかるよ bool disconnect(); + bool reboot(); private: RawSerial rn41;
diff -r 8b74db22e4c6 -r 63925964cbd5 myTimer.lib --- a/myTimer.lib Mon Nov 16 04:11:50 2015 +0000 +++ b/myTimer.lib Fri Nov 20 07:15:40 2015 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/AkinoriHashimoto/code/myTimer/#de4737751df6 +http://mbed.org/users/AkinoriHashimoto/code/myTimer/#2f7a8e62597a