Minimal project to send AT-commands from the USB serialport to the BG96.
Fork of Nucleo_NbIotBG96_A2_cloud_IBM by
main.cpp@3:74c56cab5786, 2018-09-21 (annotated)
- Committer:
- albertskog
- Date:
- Fri Sep 21 07:15:44 2018 +0000
- Revision:
- 3:74c56cab5786
- Parent:
- 2:b72797c38464
Removed everything and made small loop to send AT-commands directly from the serialport to the BG96.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
abci5961 | 0:ae6c6727b545 | 1 | #include "mbed.h" |
abci5961 | 0:ae6c6727b545 | 2 | |
albertskog | 3:74c56cab5786 | 3 | Serial pc(SERIAL_TX, SERIAL_RX); |
albertskog | 3:74c56cab5786 | 4 | Serial bg96(D8, D2); |
abci5961 | 0:ae6c6727b545 | 5 | |
albertskog | 3:74c56cab5786 | 6 | DigitalOut resetPin(D7, 0); |
albertskog | 3:74c56cab5786 | 7 | DigitalOut vbatEnPin(D11, 1); |
albertskog | 3:74c56cab5786 | 8 | DigitalOut powerKeyPin(D10, 1); |
abci5961 | 0:ae6c6727b545 | 9 | |
abci5961 | 0:ae6c6727b545 | 10 | int main() |
abci5961 | 0:ae6c6727b545 | 11 | { |
albertskog | 3:74c56cab5786 | 12 | pc.baud(115200); |
albertskog | 3:74c56cab5786 | 13 | bg96.baud(115200); |
abci5961 | 0:ae6c6727b545 | 14 | |
albertskog | 3:74c56cab5786 | 15 | while(1){ |
albertskog | 3:74c56cab5786 | 16 | while(pc.readable()){ |
albertskog | 3:74c56cab5786 | 17 | bg96.putc(pc.getc()); |
albertskog | 3:74c56cab5786 | 18 | } |
albertskog | 3:74c56cab5786 | 19 | while(bg96.readable()){ |
albertskog | 3:74c56cab5786 | 20 | pc.putc(bg96.getc()); |
albertskog | 3:74c56cab5786 | 21 | } |
albertskog | 3:74c56cab5786 | 22 | } |
abci5961 | 0:ae6c6727b545 | 23 | } |