PIR grove sensor that sends the sensed data to Thingspeak.com through the wifi module ESP 8266

Dependencies:   mbed

Committer:
skrawool
Date:
Mon Dec 05 16:39:27 2016 +0000
Revision:
0:3954a906acc2
PIR grove sensor that sends the sensed data to thingspeak through the wifi module ESP 8266

Who changed what in which revision?

UserRevisionLine numberNew contents of line
skrawool 0:3954a906acc2 1 /* mbed Microcontroller Library
skrawool 0:3954a906acc2 2 * Copyright (c) 2006-2013 ARM Limited
skrawool 0:3954a906acc2 3 *
skrawool 0:3954a906acc2 4 * Licensed under the Apache License, Version 2.0 (the "License");
skrawool 0:3954a906acc2 5 * you may not use this file except in compliance with the License.
skrawool 0:3954a906acc2 6 * You may obtain a copy of the License at
skrawool 0:3954a906acc2 7 *
skrawool 0:3954a906acc2 8 * http://www.apache.org/licenses/LICENSE-2.0
skrawool 0:3954a906acc2 9 *
skrawool 0:3954a906acc2 10 * Unless required by applicable law or agreed to in writing, software
skrawool 0:3954a906acc2 11 * distributed under the License is distributed on an "AS IS" BASIS,
skrawool 0:3954a906acc2 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
skrawool 0:3954a906acc2 13 * See the License for the specific language governing permissions and
skrawool 0:3954a906acc2 14 * limitations under the License.
skrawool 0:3954a906acc2 15 */
skrawool 0:3954a906acc2 16 #ifndef MBED_STREAM_H
skrawool 0:3954a906acc2 17 #define MBED_STREAM_H
skrawool 0:3954a906acc2 18
skrawool 0:3954a906acc2 19 #include "platform/platform.h"
skrawool 0:3954a906acc2 20 #include "drivers/FileLike.h"
skrawool 0:3954a906acc2 21 #include <cstdarg>
skrawool 0:3954a906acc2 22
skrawool 0:3954a906acc2 23 namespace mbed {
skrawool 0:3954a906acc2 24 /** \addtogroup drivers */
skrawool 0:3954a906acc2 25 /** @{*/
skrawool 0:3954a906acc2 26
skrawool 0:3954a906acc2 27 extern void mbed_set_unbuffered_stream(FILE *_file);
skrawool 0:3954a906acc2 28 extern int mbed_getc(FILE *_file);
skrawool 0:3954a906acc2 29 extern char* mbed_gets(char *s, int size, FILE *_file);
skrawool 0:3954a906acc2 30
skrawool 0:3954a906acc2 31 /** File stream
skrawool 0:3954a906acc2 32 *
skrawool 0:3954a906acc2 33 * @Note Synchronization level: Set by subclass
skrawool 0:3954a906acc2 34 */
skrawool 0:3954a906acc2 35 class Stream : public FileLike {
skrawool 0:3954a906acc2 36
skrawool 0:3954a906acc2 37 public:
skrawool 0:3954a906acc2 38 Stream(const char *name=NULL);
skrawool 0:3954a906acc2 39 virtual ~Stream();
skrawool 0:3954a906acc2 40
skrawool 0:3954a906acc2 41 int putc(int c);
skrawool 0:3954a906acc2 42 int puts(const char *s);
skrawool 0:3954a906acc2 43 int getc();
skrawool 0:3954a906acc2 44 char *gets(char *s, int size);
skrawool 0:3954a906acc2 45 int printf(const char* format, ...);
skrawool 0:3954a906acc2 46 int scanf(const char* format, ...);
skrawool 0:3954a906acc2 47 int vprintf(const char* format, std::va_list args);
skrawool 0:3954a906acc2 48 int vscanf(const char* format, std::va_list args);
skrawool 0:3954a906acc2 49
skrawool 0:3954a906acc2 50 operator std::FILE*() {return _file;}
skrawool 0:3954a906acc2 51
skrawool 0:3954a906acc2 52 protected:
skrawool 0:3954a906acc2 53 virtual int close();
skrawool 0:3954a906acc2 54 virtual ssize_t write(const void* buffer, size_t length);
skrawool 0:3954a906acc2 55 virtual ssize_t read(void* buffer, size_t length);
skrawool 0:3954a906acc2 56 virtual off_t lseek(off_t offset, int whence);
skrawool 0:3954a906acc2 57 virtual int isatty();
skrawool 0:3954a906acc2 58 virtual int fsync();
skrawool 0:3954a906acc2 59 virtual off_t flen();
skrawool 0:3954a906acc2 60
skrawool 0:3954a906acc2 61 virtual int _putc(int c) = 0;
skrawool 0:3954a906acc2 62 virtual int _getc() = 0;
skrawool 0:3954a906acc2 63
skrawool 0:3954a906acc2 64 std::FILE *_file;
skrawool 0:3954a906acc2 65
skrawool 0:3954a906acc2 66 /* disallow copy constructor and assignment operators */
skrawool 0:3954a906acc2 67 private:
skrawool 0:3954a906acc2 68 Stream(const Stream&);
skrawool 0:3954a906acc2 69 Stream & operator = (const Stream&);
skrawool 0:3954a906acc2 70 };
skrawool 0:3954a906acc2 71
skrawool 0:3954a906acc2 72 } // namespace mbed
skrawool 0:3954a906acc2 73
skrawool 0:3954a906acc2 74 #endif
skrawool 0:3954a906acc2 75
skrawool 0:3954a906acc2 76 /** @}*/