ARM mbed M2X API Client: The ARM mbed client library is used to send/receive data to/from AT&T's M2X service from mbed LPC1768 microcontrollers.
Dependents: m2x-demo-all M2X_MTS_ACCEL_DEMO M2X_MTS_Accel M2X_K64F_ACCEL ... more
Diff: Print.cpp
- Revision:
- 22:4d895e732765
- Parent:
- 21:6878944d2ce2
diff -r 6878944d2ce2 -r 4d895e732765 Print.cpp --- a/Print.cpp Sat Jan 02 02:29:43 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,62 +0,0 @@ -#include "Print.h" -#include "mbed.h" - -#include <stdio.h> -#include <string.h> - -size_t Print::write(const uint8_t* buf, size_t size) { - size_t ret = 0; - while (size--) { - ret += write(*buf++); - } - return ret; -} - -size_t Print::print(const char* s) { - return write((const uint8_t*)s, strlen(s)); -} - -size_t Print::print(char c) { - return write(c); -} - -size_t Print::print(int n) { - return print((long) n); -} - -size_t Print::print(long n) { - char buf[8 * sizeof(long) + 1]; - snprintf(buf, sizeof(buf), "%ld", n); - return print(buf); -} - -// Digits are ignored for now -size_t Print::print(double n, int digits) { - char buf[65]; - snprintf(buf, sizeof(buf), "%g", n); - return print(buf); -} - -size_t Print::println(const char* s) { - return print(s) + println(); -} - -size_t Print::println(char c) { - return print(c) + println(); -} - -size_t Print::println(int n) { - return print(n) + println(); -} - -size_t Print::println(long n) { - return print(n) + println(); -} - -size_t Print::println(double n, int digits) { - return print(n, digits) + println(); -} - -size_t Print::println() { - return print('\r') + print('\n'); -}