Sets Dragonfly into an AT command path via a USB to Serial path. The debug path is selected by default. This also has the commands to send a simple text and set the APN.
Fork of YYY_Dragonfly_USBTerminal by
main.cpp@1:af87be58749e, 2015-10-20 (annotated)
- Committer:
- BlueShadow
- Date:
- Tue Oct 20 00:27:25 2015 +0000
- Revision:
- 1:af87be58749e
- Parent:
- 0:46dc3fdbc97e
- Child:
- 2:69fe2640298a
USB Terminal Program for Dragonfly Training 2015-11
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mfiore | 0:46dc3fdbc97e | 1 | #include "mbed.h" |
mfiore | 0:46dc3fdbc97e | 2 | |
BlueShadow | 1:af87be58749e | 3 | int main() |
BlueShadow | 1:af87be58749e | 4 | { |
mfiore | 0:46dc3fdbc97e | 5 | // external serial port |
BlueShadow | 1:af87be58749e | 6 | Serial ext(USBTX,USBRX ); // Serial ext(dbgTX/*PB_6*/,dbgRX/* PB_7*/ ); // Serial ext(PA_2, PA_3); |
BlueShadow | 1:af87be58749e | 7 | |
mfiore | 0:46dc3fdbc97e | 8 | // internal serial port to radio |
mfiore | 0:46dc3fdbc97e | 9 | Serial radio(RADIO_TX, RADIO_RX); |
BlueShadow | 1:af87be58749e | 10 | |
BlueShadow | 1:af87be58749e | 11 | ext.baud(115200); |
mfiore | 0:46dc3fdbc97e | 12 | radio.baud(115200); |
BlueShadow | 1:af87be58749e | 13 | |
mfiore | 0:46dc3fdbc97e | 14 | while (true) { |
mfiore | 0:46dc3fdbc97e | 15 | if (ext.readable()) |
mfiore | 0:46dc3fdbc97e | 16 | radio.putc(ext.getc()); |
mfiore | 0:46dc3fdbc97e | 17 | if (radio.readable()) |
mfiore | 0:46dc3fdbc97e | 18 | ext.putc(radio.getc()); |
mfiore | 0:46dc3fdbc97e | 19 | } |
mfiore | 0:46dc3fdbc97e | 20 | } |