Extension to serial communication. GetInput() method that takes string input from serial device. Work still in progress.
Bluetooth.h@0:31203426e0fb, 2021-09-21 (annotated)
- Committer:
- nzupcic
- Date:
- Tue Sep 21 16:45:49 2021 +0000
- Revision:
- 0:31203426e0fb
1st commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
nzupcic | 0:31203426e0fb | 1 | #ifndef BLUETOOTH_H |
nzupcic | 0:31203426e0fb | 2 | #define BLUETOOTH_H |
nzupcic | 0:31203426e0fb | 3 | |
nzupcic | 0:31203426e0fb | 4 | #include <string> |
nzupcic | 0:31203426e0fb | 5 | #include <cstdlib> |
nzupcic | 0:31203426e0fb | 6 | #include "mbed.h" |
nzupcic | 0:31203426e0fb | 7 | |
nzupcic | 0:31203426e0fb | 8 | class Bluetooth : public Serial{ |
nzupcic | 0:31203426e0fb | 9 | public: |
nzupcic | 0:31203426e0fb | 10 | Bluetooth(PinName tx, PinName rx); |
nzupcic | 0:31203426e0fb | 11 | float State(); |
nzupcic | 0:31203426e0fb | 12 | void Init(); |
nzupcic | 0:31203426e0fb | 13 | private: |
nzupcic | 0:31203426e0fb | 14 | bool state; |
nzupcic | 0:31203426e0fb | 15 | char GetKey(void); |
nzupcic | 0:31203426e0fb | 16 | void PutKey(char key); |
nzupcic | 0:31203426e0fb | 17 | void AskUser(string msgString); |
nzupcic | 0:31203426e0fb | 18 | float ReturnAnswer(float value); |
nzupcic | 0:31203426e0fb | 19 | string GetStringInput(void); |
nzupcic | 0:31203426e0fb | 20 | }; |
nzupcic | 0:31203426e0fb | 21 | |
nzupcic | 0:31203426e0fb | 22 | #endif |