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.
Dependencies: mbed CANBuffer Watchdog MODSERIAL mbed-rtos xbeeRelay IAP
Fork of SystemManagement by
Diff: XBee/XBee_Lib.h
- Revision:
- 30:91af74a299e1
- Parent:
- 24:f58a3c0071c3
- Child:
- 31:7eaa5e881b56
--- a/XBee/XBee_Lib.h Fri Nov 07 21:26:46 2014 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,112 +0,0 @@
-/*
-Test Code
-//#include "XBee_Lib.h"
-#include "mbed.h"
-#include<sstream>
-#include <cstring>
-#include <string>
-Serial xbee(p28,p27);
-Serial pc(USBTX,USBRX);
-DigitalOut led1(LED1);
-DigitalOut led2(LED2);
-DigitalOut reset(p5);
-DigitalIn CTS(p6, PullNone);
-DigitalIn in(p21, PullDown);
-
-int main()
-{
- //char a[]="Hello.....";
- //int i=0;
- //while(a[i]!='\0')
- xbee.baud(250000);
- char a[63];
- char b[100];
-
- a[0]='\x31';
- for(int j=1; j<=60; j++)
- {
- if(a[j-1]=='\x39')
- {
- a[j]='\x41';
- }
- else if(a[j-1]=='\x5A')
- {
- a[j]='\x61';
- }
- else
- a[j]=a[j-1]+1;
- }
- a[61]='\n';
- a[62]='\r';
- char data[8]="";
- data[0]='a';
- data[1]='b';
- data[2]='c';
- string stri;
-
- //pc.printf("%s",a);
- reset=0;
- wait_ms(1);
- reset=1;
- wait_ms(1);
-
-
- std::ostringstream ostr;
- ostr<<data;
- stri=ostr.str();
- std::strcpy (b, (ostr.str()).c_str());
- pc.printf("%s",b);
- while(1)
- {
- while(in.read())
- {
- pc.printf("Sending Data...\n\r");
- xbee.printf("%s",b);
-
- if(CTS.read()==1)
- {
- pc.printf("DI buffer full\n\r");
- led2=1;
- //break;
- while(CTS.read()){}
- pc.printf("DI buffer has place\n\r");
- led2=0;
- //i=0;
- }
-
- //wait_ms(1000);
- led1=!led1;
- //++i;
- }
- }
-}
-*/
-#ifndef XBEE_LIB_H
-#define XBEE_LIB_H
-
-#include"LPCDigitalOut.h"
-#include"mbed.h"
-#include<sstream>
-
-Serial Xbee_e1(p9,p10);
-Serial Xbee_e2(p13,p14);
-
-// Used for wireless communications with Xbee
-
-//Include the send function only in the main code.
-class XBee250x
-{
- public:
- XBee250x()
- {
- Xbee_e1.baud(250000);
- Xbee_e2.baud(250000);
- }
-
- void send(CANMessage Rxmsg)
- {
- Xbee_e1.printf("%c \t %d \t %s \n\r",Rxmsg.id, Rxmsg.len, Rxmsg.data);
- Xbee_e2.printf("%c \t %d \t %s \n\r",Rxmsg.id, Rxmsg.len, Rxmsg.data);
- }
-};
-#endif /*XBEE_LIB_H*/
\ No newline at end of file
