Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of dgps by
adapt/xbee.cpp
- Committer:
- krobertson
- Date:
- 2014-04-20
- Revision:
- 18:e72ee7aed088
- Parent:
- 14:6be57da62283
File content as of revision 18:e72ee7aed088:
#include "xbee.h"
Serial* XBEE::xbee=NULL;
DigitalOut* XBEE::setTCPConStatus = NULL;
DigitalIn* XBEE::getTCPConStatus = NULL;
InterruptIn* XBEE::TCPconnLost = NULL;
Serial& XBEE::getSerial(){
if(xbee==NULL){
// Init Serial USB
xbee=new Serial(XBEEPINTX,XBEEPINRX);
xbee->baud(XBEEBAUD);
//xbee->set_flow_control(SerialBase::CTS,NC,p20);
}
return *xbee;
}
DigitalOut& XBEE::getTCPConOut(){
if(setTCPConStatus==NULL){
setTCPConStatus=new DigitalOut(p11);
}
return *setTCPConStatus;
}
DigitalIn& XBEE::getTCPConIn(){
if(getTCPConStatus==NULL){
getTCPConStatus=new DigitalIn(p12);
}
return *getTCPConStatus;
}
InterruptIn& XBEE::getTCPInterrupt(){
if(TCPconnLost==NULL){
TCPconnLost=new InterruptIn(p12);
}
return *TCPconnLost;
}
