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.
Xbee.cpp@0:633baa9653b0, 2015-11-22 (annotated)
- Committer:
- Xiaofei
- Date:
- Sun Nov 22 01:04:30 2015 +0000
- Revision:
- 0:633baa9653b0
- Child:
- 1:e44c66cd2de6
Commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Xiaofei | 0:633baa9653b0 | 1 | #pragma once |
Xiaofei | 0:633baa9653b0 | 2 | #include "Xbee.h" |
Xiaofei | 0:633baa9653b0 | 3 | |
Xiaofei | 0:633baa9653b0 | 4 | void Xbee::Send(const char* buffer) |
Xiaofei | 0:633baa9653b0 | 5 | { |
Xiaofei | 0:633baa9653b0 | 6 | while(!_xbee.readable()); |
Xiaofei | 0:633baa9653b0 | 7 | _xbee.puts(buffer); |
Xiaofei | 0:633baa9653b0 | 8 | } |
Xiaofei | 0:633baa9653b0 | 9 | |
Xiaofei | 0:633baa9653b0 | 10 | void Xbee::Recv(char* buffer, const size_t& sz) |
Xiaofei | 0:633baa9653b0 | 11 | { |
Xiaofei | 0:633baa9653b0 | 12 | while(1) |
Xiaofei | 0:633baa9653b0 | 13 | { |
Xiaofei | 0:633baa9653b0 | 14 | if(_xbee.readable()) |
Xiaofei | 0:633baa9653b0 | 15 | { |
Xiaofei | 0:633baa9653b0 | 16 | _xbee.gets(buffer,sz); |
Xiaofei | 0:633baa9653b0 | 17 | break; |
Xiaofei | 0:633baa9653b0 | 18 | } |
Xiaofei | 0:633baa9653b0 | 19 | } |
Xiaofei | 0:633baa9653b0 | 20 | _xbee.putc(' '); |
Xiaofei | 0:633baa9653b0 | 21 | } |