BLE Temperature Service Mobile and Ubiquitous Computing Module Birkbeck College

Dependencies:   DS1820

Committer:
gkroussos
Date:
Sun Mar 08 19:42:20 2015 +0000
Revision:
0:dd0fea342ad2
BLE Temperature Service ; Mobile and Ubiquitous Computing Module; Birkbeck College

Who changed what in which revision?

UserRevisionLine numberNew contents of line
gkroussos 0:dd0fea342ad2 1 /* mbed Microcontroller Library
gkroussos 0:dd0fea342ad2 2 * Copyright (c) 2006-2013 ARM Limited
gkroussos 0:dd0fea342ad2 3 *
gkroussos 0:dd0fea342ad2 4 * Licensed under the Apache License, Version 2.0 (the "License");
gkroussos 0:dd0fea342ad2 5 * you may not use this file except in compliance with the License.
gkroussos 0:dd0fea342ad2 6 * You may obtain a copy of the License at
gkroussos 0:dd0fea342ad2 7 *
gkroussos 0:dd0fea342ad2 8 * http://www.apache.org/licenses/LICENSE-2.0
gkroussos 0:dd0fea342ad2 9 *
gkroussos 0:dd0fea342ad2 10 * Unless required by applicable law or agreed to in writing, software
gkroussos 0:dd0fea342ad2 11 * distributed under the License is distributed on an "AS IS" BASIS,
gkroussos 0:dd0fea342ad2 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
gkroussos 0:dd0fea342ad2 13 * See the License for the specific language governing permissions and
gkroussos 0:dd0fea342ad2 14 * limitations under the License.
gkroussos 0:dd0fea342ad2 15 */
gkroussos 0:dd0fea342ad2 16 #ifndef MBED_STREAM_H
gkroussos 0:dd0fea342ad2 17 #define MBED_STREAM_H
gkroussos 0:dd0fea342ad2 18
gkroussos 0:dd0fea342ad2 19 #include "platform.h"
gkroussos 0:dd0fea342ad2 20 #include "FileLike.h"
gkroussos 0:dd0fea342ad2 21
gkroussos 0:dd0fea342ad2 22 namespace mbed {
gkroussos 0:dd0fea342ad2 23
gkroussos 0:dd0fea342ad2 24 class Stream : public FileLike {
gkroussos 0:dd0fea342ad2 25
gkroussos 0:dd0fea342ad2 26 public:
gkroussos 0:dd0fea342ad2 27 Stream(const char *name=NULL);
gkroussos 0:dd0fea342ad2 28 virtual ~Stream();
gkroussos 0:dd0fea342ad2 29
gkroussos 0:dd0fea342ad2 30 int putc(int c);
gkroussos 0:dd0fea342ad2 31 int puts(const char *s);
gkroussos 0:dd0fea342ad2 32 int getc();
gkroussos 0:dd0fea342ad2 33 char *gets(char *s, int size);
gkroussos 0:dd0fea342ad2 34 int printf(const char* format, ...);
gkroussos 0:dd0fea342ad2 35 int scanf(const char* format, ...);
gkroussos 0:dd0fea342ad2 36
gkroussos 0:dd0fea342ad2 37 operator std::FILE*() {return _file;}
gkroussos 0:dd0fea342ad2 38
gkroussos 0:dd0fea342ad2 39 protected:
gkroussos 0:dd0fea342ad2 40 virtual int close();
gkroussos 0:dd0fea342ad2 41 virtual ssize_t write(const void* buffer, size_t length);
gkroussos 0:dd0fea342ad2 42 virtual ssize_t read(void* buffer, size_t length);
gkroussos 0:dd0fea342ad2 43 virtual off_t lseek(off_t offset, int whence);
gkroussos 0:dd0fea342ad2 44 virtual int isatty();
gkroussos 0:dd0fea342ad2 45 virtual int fsync();
gkroussos 0:dd0fea342ad2 46 virtual off_t flen();
gkroussos 0:dd0fea342ad2 47
gkroussos 0:dd0fea342ad2 48 virtual int _putc(int c) = 0;
gkroussos 0:dd0fea342ad2 49 virtual int _getc() = 0;
gkroussos 0:dd0fea342ad2 50
gkroussos 0:dd0fea342ad2 51 std::FILE *_file;
gkroussos 0:dd0fea342ad2 52 };
gkroussos 0:dd0fea342ad2 53
gkroussos 0:dd0fea342ad2 54 } // namespace mbed
gkroussos 0:dd0fea342ad2 55
gkroussos 0:dd0fea342ad2 56 #endif