Simple code to upload temperature readings to SensorUp SensorThings Playground (http://pg.sensorup.com)from the LM75B temperature sensor in a mbed application board.It works with mbed LPC1768.

Dependencies:   C12832 EthernetNetIf LM75B mbed

Committer:
robinlk
Date:
Thu Dec 10 01:53:20 2015 +0000
Revision:
0:597aea501d68
Simple code to upload temperature readings to SensorUp SensorThings Playground (http://pg.sensorup.com)from the LM75B temperature sensor in an mbed application board.It works with mbed LPC1768.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
robinlk 0:597aea501d68 1 /*
robinlk 0:597aea501d68 2 * mbed Tiny HTTP Client
robinlk 0:597aea501d68 3 * Copyright (c) 2011 Hiroshi Suga
robinlk 0:597aea501d68 4 * Released under the MIT License: http://mbed.org/license/mit
robinlk 0:597aea501d68 5 */
robinlk 0:597aea501d68 6
robinlk 0:597aea501d68 7 /** @file
robinlk 0:597aea501d68 8 * @brief Tiny HTTP Client
robinlk 0:597aea501d68 9 */
robinlk 0:597aea501d68 10
robinlk 0:597aea501d68 11 #ifndef TinyHTTP_h
robinlk 0:597aea501d68 12 #define TinyHTTP_h
robinlk 0:597aea501d68 13
robinlk 0:597aea501d68 14 #define DEBUG
robinlk 0:597aea501d68 15
robinlk 0:597aea501d68 16 #define HTTP_PORT 80
robinlk 0:597aea501d68 17 #define HTTP_TIMEOUT 15000 // ms
robinlk 0:597aea501d68 18
robinlk 0:597aea501d68 19 #define METHOD_GET 0
robinlk 0:597aea501d68 20 #define METHOD_POST 1
robinlk 0:597aea501d68 21
robinlk 0:597aea501d68 22 /** send http request
robinlk 0:597aea501d68 23 * @param method METHOD_GET or METHOD_POST
robinlk 0:597aea501d68 24 * @param host http server
robinlk 0:597aea501d68 25 * @param uri URI
robinlk 0:597aea501d68 26 * @param head http header (CR+LF) (or NULL)
robinlk 0:597aea501d68 27 * @param body POST body (or NULL)
robinlk 0:597aea501d68 28 * @return http code, -1:failue
robinlk 0:597aea501d68 29 */
robinlk 0:597aea501d68 30 int httpRequest (int method, Host *host, char *uri, char *head, char *body);
robinlk 0:597aea501d68 31
robinlk 0:597aea501d68 32 void createauth (char *user, char *pwd, char *buf, int len);
robinlk 0:597aea501d68 33
robinlk 0:597aea501d68 34 int base64enc(const char *input, unsigned int length, char *output, int len);
robinlk 0:597aea501d68 35
robinlk 0:597aea501d68 36 int urlencode(char *str, char *buf, int len);
robinlk 0:597aea501d68 37
robinlk 0:597aea501d68 38 #endif