├── Dev_Light.cpp ├── Dev_Light.h ├── Dev_Switch.cpp ├── Dev_Switch.h ├── Dev_THSensor.cpp ├── Dev_THSensor.h ├── Dev_THSensorInterface.h ├── Doxyfile.doxy ├── Eth_ESP8266.cpp ├── Eth_ESP8266.h ├── Eth_GSM.cpp ├── Eth_GSM.h ├── Eth_W5X00.cpp ├── Eth_W5X00.h ├── ITEAD-logo.JPG ├── IoTgo.cpp ├── IoTgo.h ├── IoTgo_config.h ├── IoTgo_device.h ├── IoTgo_doxygen.h ├── IoTgo_error.h ├── Net_NetInterface.h ├── README.md ├── doc ├── IoTgo-Arduino-Library-API-html │ ├── ITEAD-logo.JPG │ ├── _dev___light_8cpp.html │ ├── _dev___light_8cpp_source.html │ ├── _dev___light_8h.html │ ├── _dev___light_8h_source.html │ ├── _dev___switch_8cpp.html │ ├── _dev___switch_8cpp_source.html │ ├── _dev___switch_8h.html │ ├── _dev___switch_8h_source.html │ ├── _dev___t_h_sensor_8cpp.html │ ├── _dev___t_h_sensor_8cpp_source.html │ ├── _dev___t_h_sensor_8h.html │ ├── _dev___t_h_sensor_8h_source.html │ ├── _dev___t_h_sensor_interface_8h.html │ ├── _dev___t_h_sensor_interface_8h_source.html │ ├── _eth___e_s_p8266_8cpp.html │ ├── _eth___e_s_p8266_8cpp_source.html │ ├── _eth___e_s_p8266_8h.html │ ├── _eth___e_s_p8266_8h_source.html │ ├── _eth___g_s_m_8cpp_source.html │ ├── _eth___g_s_m_8h_source.html │ ├── _eth___w5_x00_8cpp_source.html │ ├── _eth___w5_x00_8h_source.html │ ├── _h_w___eth___dhcp_8cpp_source.html │ ├── _h_w___eth___dhcp_8h_source.html │ ├── _h_w___eth___dns_8cpp_source.html │ ├── _h_w___eth___dns_8h_source.html │ ├── _h_w___eth___ethernet_8cpp_source.html │ ├── _h_w___eth___ethernet_8h_source.html │ ├── _h_w___eth___ethernet_client_8cpp_source.html │ ├── _h_w___eth___ethernet_client_8h_source.html │ ├── _h_w___eth___ethernet_server_8cpp_source.html │ ├── _h_w___eth___ethernet_server_8h_source.html │ ├── _h_w___eth___ethernet_udp_8cpp_source.html │ ├── _h_w___eth___ethernet_udp_8h_source.html │ ├── _h_w___eth___twitter_8cpp_source.html │ ├── _h_w___eth___twitter_8h_source.html │ ├── _h_w___eth__config_8h_source.html │ ├── _h_w___eth__socket_8cpp_source.html │ ├── _h_w___eth__socket_8h_source.html │ ├── _h_w___eth__util_8h_source.html │ ├── _h_w___eth__w5100_8cpp_source.html │ ├── _h_w___eth__w5100_8h_source.html │ ├── _h_w___eth__w5200_8cpp_source.html │ ├── _h_w___eth__w5200_8h_source.html │ ├── _h_w___eth__w5500_8cpp_source.html │ ├── _h_w___eth__w5500_8h_source.html │ ├── _h_w___g_s_m___g_s_m_8cpp_source.html │ ├── _h_w___g_s_m___g_s_m_8h_source.html │ ├── _h_w___g_s_m___h_w_serial_8cpp_source.html │ ├── _h_w___g_s_m___h_w_serial_8h_source.html │ ├── _h_w___g_s_m___l_o_g_8cpp_source.html │ ├── _h_w___g_s_m___l_o_g_8h_source.html │ ├── _h_w___g_s_m___r_e_a_d_m_e_8md_source.html │ ├── _h_w___g_s_m___s_i_m900_8cpp_source.html │ ├── _h_w___g_s_m___s_i_m900_8h_source.html │ ├── _h_w___g_s_m___streaming_8h_source.html │ ├── _h_w___g_s_m___wide_text_finder_8cpp_source.html │ ├── _h_w___g_s_m___wide_text_finder_8h_source.html │ ├── _h_w___g_s_m__call_8cpp_source.html │ ├── _h_w___g_s_m__call_8h_source.html │ ├── _h_w___g_s_m__gps_8cpp_source.html │ ├── _h_w___g_s_m__gps_8h_source.html │ ├── _h_w___g_s_m__inet_g_s_m_8cpp_source.html │ ├── _h_w___g_s_m__inet_g_s_m_8h_source.html │ ├── _h_w___g_s_m__sms_8cpp_source.html │ ├── _h_w___g_s_m__sms_8h_source.html │ ├── _h_w___s_h_t1x_8cpp.html │ ├── _h_w___s_h_t1x_8cpp_source.html │ ├── _h_w___s_h_t1x_8h.html │ ├── _h_w___s_h_t1x_8h_source.html │ ├── _io_tgo_8cpp.html │ ├── _io_tgo_8cpp_source.html │ ├── _io_tgo_8h.html │ ├── _io_tgo_8h_source.html │ ├── _io_tgo__config_8h.html │ ├── _io_tgo__config_8h_source.html │ ├── _io_tgo__debug_8h.html │ ├── _io_tgo__debug_8h_source.html │ ├── _io_tgo__device_8h.html │ ├── _io_tgo__device_8h_source.html │ ├── _io_tgo__doxygen_8h.html │ ├── _io_tgo__doxygen_8h_source.html │ ├── _io_tgo__error_8h.html │ ├── _io_tgo__error_8h_source.html │ ├── _net___net_interface_8h.html │ ├── _net___net_interface_8h_source.html │ ├── _r_e_a_d_m_e_8md_source.html │ ├── annotated.html │ ├── bc_s.png │ ├── bdwn.png │ ├── class_e_s_p8266-members.html │ ├── class_e_s_p8266.html │ ├── class_e_s_p8266.png │ ├── class_eth_w5_x00-members.html │ ├── class_eth_w5_x00.html │ ├── class_eth_w5_x00.png │ ├── class_gsm-members.html │ ├── class_gsm.html │ ├── class_gsm.png │ ├── class_io_tgo-members.html │ ├── class_io_tgo.html │ ├── class_io_tgo.png │ ├── class_light-members.html │ ├── class_light.html │ ├── class_light.png │ ├── class_net_interface-members.html │ ├── class_net_interface.html │ ├── class_net_interface.png │ ├── class_s_h_t1x-members.html │ ├── class_s_h_t1x.html │ ├── class_s_h_t1x.png │ ├── class_switch-members.html │ ├── class_switch.html │ ├── class_switch.png │ ├── class_t_h_sensor-members.html │ ├── class_t_h_sensor.html │ ├── class_t_h_sensor.png │ ├── class_t_h_sensor_interface-members.html │ ├── class_t_h_sensor_interface.html │ ├── class_t_h_sensor_interface.png │ ├── classes.html │ ├── closed.png │ ├── dir_0c19209abb061b77327d2bacba6c2f9e.html │ ├── dir_1ee8911f57154bf799046cca56f1470e.html │ ├── dir_1f9af4683cc546486fb539acf110e0c0.html │ ├── dir_2450f83f0383aec37b6e796592d7a290.html │ ├── dir_46743b0942d3df0e21257feeaeec7797.html │ ├── dir_64e73385a8b7738563c26ce10415b58d.html │ ├── dir_9024a3bf10609f0ef45c6e129877cf3d.html │ ├── dir_b90a8a55cbbfb9aef848d22d503b6350.html │ ├── dir_b996b1e613343db23061b3d6c613cdf8.html │ ├── dir_d28a4824dc47e487b107a5db32ef43c4.html │ ├── doxygen.css │ ├── doxygen.png │ ├── dynsections.js │ ├── examples.html │ ├── files.html │ ├── ftv2blank.png │ ├── ftv2doc.png │ ├── ftv2folderclosed.png │ ├── ftv2folderopen.png │ ├── ftv2lastnode.png │ ├── ftv2link.png │ ├── ftv2mlastnode.png │ ├── ftv2mnode.png │ ├── ftv2node.png │ ├── ftv2plastnode.png │ ├── ftv2pnode.png │ ├── ftv2splitbar.png │ ├── ftv2vertline.png │ ├── functions.html │ ├── functions_func.html │ ├── globals.html │ ├── globals_enum.html │ ├── globals_eval.html │ ├── group___error.html │ ├── group___io_tgo.html │ ├── group___light.html │ ├── group___net_interface.html │ ├── group___network.html │ ├── group___switch.html │ ├── group___t_h_sensor.html │ ├── group___t_h_sensor_interface.html │ ├── hierarchy.html │ ├── index.hhc │ ├── index.hhk │ ├── index.hhp │ ├── index.html │ ├── iotgo_8ino-example.html │ ├── iotgo_8ino_source.html │ ├── jquery.js │ ├── light_8ino-example.html │ ├── light_8ino_source.html │ ├── light__local_8ino_source.html │ ├── light__remote_8ino_source.html │ ├── light_local_8ino-example.html │ ├── light_remote_8ino-example.html │ ├── md__r_e_a_d_m_e.html │ ├── md_utility__h_w__g_s_m__r_e_a_d_m_e.html │ ├── modules.html │ ├── nav_f.png │ ├── nav_g.png │ ├── nav_h.png │ ├── open.png │ ├── pages.html │ ├── switch_8ino-example.html │ ├── switch_8ino_source.html │ ├── switch__local_8ino_source.html │ ├── switch__remote_8ino_source.html │ ├── switch_local_8ino-example.html │ ├── switch_remote_8ino-example.html │ ├── sync_off.png │ ├── sync_on.png │ ├── tab_a.png │ ├── tab_b.png │ ├── tab_h.png │ ├── tab_s.png │ ├── tabs.css │ ├── temp__hum__sensor_8ino_source.html │ └── temp_hum_sensor_8ino-example.html └── IoTgo-Arduino-Library-API.chm ├── examples ├── iotgo │ └── iotgo.ino ├── light │ └── light.ino ├── switch │ └── switch.ino └── temp_hum_sensor │ └── temp_hum_sensor.ino └── utility ├── HW_Eth_Dhcp.cpp ├── HW_Eth_Dhcp.h ├── HW_Eth_Dns.cpp ├── HW_Eth_Dns.h ├── HW_Eth_Ethernet.cpp ├── HW_Eth_Ethernet.h ├── HW_Eth_EthernetClient.cpp ├── HW_Eth_EthernetClient.h ├── HW_Eth_EthernetServer.cpp ├── HW_Eth_EthernetServer.h ├── HW_Eth_EthernetUdp.cpp ├── HW_Eth_EthernetUdp.h ├── HW_Eth_Twitter.cpp ├── HW_Eth_Twitter.h ├── HW_Eth_socket.cpp ├── HW_Eth_socket.h ├── HW_Eth_util.h ├── HW_Eth_w5100.cpp ├── HW_Eth_w5100.h ├── HW_Eth_w5200.cpp ├── HW_Eth_w5200.h ├── HW_Eth_w5500.cpp ├── HW_Eth_w5500.h ├── HW_GSM_GSM.cpp ├── HW_GSM_GSM.h ├── HW_GSM_HWSerial.cpp ├── HW_GSM_HWSerial.h ├── HW_GSM_Instructions.txt ├── HW_GSM_LICENSE ├── HW_GSM_LOG.cpp ├── HW_GSM_LOG.h ├── HW_GSM_List.txt ├── HW_GSM_README ├── HW_GSM_SIM900.cpp ├── HW_GSM_SIM900.h ├── HW_GSM_Streaming.h ├── HW_GSM_WideTextFinder.cpp ├── HW_GSM_WideTextFinder.h ├── HW_GSM_call.cpp ├── HW_GSM_call.h ├── HW_GSM_gps.cpp ├── HW_GSM_gps.h ├── HW_GSM_inetGSM.cpp ├── HW_GSM_inetGSM.h ├── HW_GSM_sms.cpp ├── HW_GSM_sms.h ├── HW_SHT1x.cpp └── HW_SHT1x.h /Dev_Light.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file Dev_Light.h 3 | * 4 | * Light API of IoTgo (iotgo.iteadstudio.com) 5 | * 6 | * @author Wu Pengfei (email:) 7 | * @date 2014/11/11 8 | * @copyright 9 | * Copyright (C) 2013-2014 ITEAD Intelligent Systems Co., Ltd. \n 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License as 12 | * published by the Free Software Foundation; either version 2 of 13 | * the License, or (at your option) any later version. 14 | */ 15 | 16 | #ifndef __DEV_LIGHT_H__ 17 | #define __DEV_LIGHT_H__ 18 | 19 | #include "IoTgo.h" 20 | 21 | /** 22 | * @addtogroup Light 23 | * @{ 24 | */ 25 | 26 | /** 27 | * Indicate the state of light device. 28 | */ 29 | enum LightState 30 | { 31 | LIGHT_STATE_OFF = 0, /**< light off */ 32 | LIGHT_STATE_ON = 1, /**< light on */ 33 | }; 34 | 35 | /** 36 | * Light, subclass of IoTgo, provides simple methods to control light device. 37 | * 38 | */ 39 | class Light: public IoTgo 40 | { 41 | public: /* public methods */ 42 | Light(NetInterface *net, uint16_t light_pin); 43 | int32_t sync(void); 44 | int32_t getState(int32_t *state); 45 | int32_t on(void); 46 | int32_t off(void); 47 | 48 | private: /* private methods */ 49 | int32_t setState(int32_t state); 50 | 51 | private: /* private static data members */ 52 | static const char *STATE[]; 53 | static const char *VALUE_ON[]; 54 | static const char *VALUE_OFF[]; 55 | 56 | private: 57 | uint16_t light_pin; 58 | }; 59 | 60 | /** @} */ 61 | 62 | #endif /* #ifndef __DEV_LIGHT_H__ */ 63 | -------------------------------------------------------------------------------- /Dev_Switch.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file Dev_Switch.h 3 | * 4 | * Switch API of IoTgo (iotgo.iteadstudio.com) 5 | * 6 | * @author Wu Pengfei (email:) 7 | * @date 2014/11/11 8 | * @copyright 9 | * Copyright (C) 2013-2014 ITEAD Intelligent Systems Co., Ltd. \n 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License as 12 | * published by the Free Software Foundation; either version 2 of 13 | * the License, or (at your option) any later version. 14 | */ 15 | 16 | #ifndef __DEV_SWITCH_H__ 17 | #define __DEV_SWITCH_H__ 18 | 19 | #include "IoTgo.h" 20 | 21 | /** 22 | * @addtogroup Switch 23 | * @{ 24 | */ 25 | 26 | /** 27 | * Indicates the state of switch device. 28 | */ 29 | enum SwitchState 30 | { 31 | SWITCH_STATE_OFF = 0, /**< switch off */ 32 | SWITCH_STATE_ON = 1, /**< switch on */ 33 | }; 34 | 35 | 36 | /** 37 | * Switch, subclass of IoTgo, provides simple methods to control switch device. 38 | * 39 | */ 40 | class Switch: public IoTgo 41 | { 42 | public: /* public methods */ 43 | Switch(NetInterface *net, uint16_t sw_pin); 44 | 45 | int32_t sync(void); 46 | int32_t getState(int32_t *state); 47 | int32_t on(void); 48 | int32_t off(void); 49 | 50 | private: /* private methods */ 51 | int32_t setState(int32_t state); 52 | 53 | private: /* private static data members */ 54 | static const char *STATE[]; 55 | static const char *VALUE_ON[]; 56 | static const char *VALUE_OFF[]; 57 | 58 | private: 59 | uint16_t sw_pin; 60 | }; 61 | 62 | /** @} */ 63 | 64 | #endif /* #ifndef __DEV_SWITCH_H__ */ 65 | -------------------------------------------------------------------------------- /Dev_THSensor.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file Dev_THSensor.h 3 | * 4 | * THSensor API of IoTgo (iotgo.iteadstudio.com) 5 | * 6 | * @author Wu Pengfei (email:) 7 | * @date 2014/11/17 8 | * @copyright 9 | * Copyright (C) 2013-2014 ITEAD Intelligent Systems Co., Ltd. \n 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License as 12 | * published by the Free Software Foundation; either version 2 of 13 | * the License, or (at your option) any later version. 14 | */ 15 | 16 | #ifndef __DEV_THSENSOR_H__ 17 | #define __DEV_THSENSOR_H__ 18 | 19 | #include "IoTgo.h" 20 | #include "Dev_THSensorInterface.h" 21 | 22 | /** 23 | * @addtogroup THSensor 24 | * @{ 25 | */ 26 | 27 | /** 28 | * THSensor, subclass of IoTgo, provides simple methods to read temperature and 29 | * humidity from devices. 30 | */ 31 | class THSensor: public IoTgo 32 | { 33 | public: /* public methods */ 34 | THSensor(NetInterface *net, THSensorInterface *sensor); 35 | int32_t begin(void); 36 | int32_t end(void); 37 | int32_t sync(void); 38 | int32_t getTemperatureC(float *temp_c); 39 | int32_t getTemperatureF(float *temp_f); 40 | int32_t getHumidity(float *hum); 41 | int32_t getAll(float *temp_c, float *temp_f, float *hum); 42 | 43 | private: /* private data */ 44 | THSensorInterface *sensor; 45 | }; 46 | 47 | /** @} */ 48 | 49 | #endif /* #ifndef __DEV_THSENSOR_H__ */ 50 | -------------------------------------------------------------------------------- /Dev_THSensorInterface.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file Dev_THSensorInterface.h 3 | * 4 | * The interface needed by THSensor for getting data. 5 | * 6 | * @author Wu Pengfei (email:) 7 | * @date 2014/11/19 8 | * @copyright 9 | * Copyright (C) 2013-2014 ITEAD Intelligent Systems Co., Ltd. \n 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License as 12 | * published by the Free Software Foundation; either version 2 of 13 | * the License, or (at your option) any later version. 14 | */ 15 | 16 | #ifndef __THSENSORINTERFACE_H__ 17 | #define __THSENSORINTERFACE_H__ 18 | 19 | #include 20 | 21 | #include "IoTgo_error.h" 22 | 23 | /** 24 | * Abstract class, declares the unified interface to 25 | * read temperature and humidity from Temperature & Humidity Sensor. 26 | * 27 | * @ingroup THSensorInterface 28 | */ 29 | class THSensorInterface 30 | { 31 | public: /* public methods */ 32 | 33 | /** 34 | * Initialize Temperature & Humidity Sensor. 35 | * 36 | * @retval 0 - success. 37 | * @retval ERR_INIT_DEVICE_FAILED - if initialization failed! 38 | */ 39 | virtual int32_t begin(void) = 0; 40 | 41 | /** 42 | * Read temperature and humidity from device. 43 | * 44 | * @param temp_c - the pointer storing temperature by Celsius. 45 | * @param temp_f - the pointer storing temperature by Fahrenheit. 46 | * @param hum - the pointer stroing humidigy in percentage. 47 | * 48 | * @retval 0 - success and the data stored in pointers. 49 | * @retval ERR_READ_DEVICE_FAILED - if device cannot be read. 50 | * 51 | * @note temp_c, temp_f and hum can be NULL, if you need no anyone of them. 52 | */ 53 | virtual int32_t getData(float *temp_c, float *temp_f, float *hum) = 0; 54 | 55 | /** 56 | * Close Temperature & Humidity Sensor. 57 | * 58 | * @retval 0 - success. 59 | * @retval ERR_CLOSE_DEVICE_FAILED - if device cannot be closed. 60 | */ 61 | virtual int32_t end(void) = 0; 62 | }; 63 | 64 | #endif /* #ifndef __THSENSORINTERFACE_H__ */ 65 | -------------------------------------------------------------------------------- /Eth_ESP8266.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file Eth_ESP8266.h 3 | * 4 | * ESP8266 library 5 | * 6 | * @author Wu Pengfei (email:) 7 | * @date 2014/11/17 8 | * @copyright 9 | * Copyright (C) 2013-2014 ITEAD Intelligent Systems Co., Ltd. \n 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License as 12 | * published by the Free Software Foundation; either version 2 of 13 | * the License, or (at your option) any later version. 14 | */ 15 | #ifndef __ETH_ESP8266_H__ 16 | #define __ETH_ESP8266_H__ 17 | 18 | #include 19 | #include 20 | 21 | #include "IoTgo_config.h" 22 | #include "Net_NetInterface.h" 23 | 24 | #ifdef NET_USE_ESP8266 25 | 26 | /* The way of encrypstion */ 27 | #define ESP8266_ENC_OPEN 0 28 | #define ESP8266_ENC_WEP 1 29 | #define ESP8266_ENC_WAP_PSK 2 30 | #define ESP8266_ENC_WAP2_PSK 3 31 | #define ESP8266_ENC_WAP_WAP2_PSK 4 32 | 33 | /* Communication mode */ 34 | #define TCP_MODE 1 35 | #define UDP_MODE 0 36 | 37 | /* The type of initialized ESP8266 */ 38 | #define STA 1 39 | #define AP 2 40 | #define AP_STA 3 41 | 42 | #define ESP8266SERIAL_TIMEOUT_DEFAULT (3000) 43 | 44 | 45 | /** 46 | * Provides TCP service for Application Layer of Network Protocol Stack. 47 | * 48 | * The implemetation is based on ESP8266 by sigle connection mode. 49 | * 50 | * @ingroup NetInterface 51 | */ 52 | class ESP8266: public NetInterface 53 | { 54 | public: /* Implementation of NetInterface */ 55 | virtual int32_t createTCPConnection(String host, uint32_t port); 56 | virtual int32_t send(String data); 57 | virtual int32_t recv(char *buffer, uint32_t length); 58 | virtual int32_t releaseTCPConnection(void); 59 | 60 | public: /* public methods */ 61 | bool connectWiFi(String ssid, String password); 62 | bool disconnectWiFi(void); 63 | 64 | private: 65 | void begin(void); 66 | bool Initialize(byte mode, String ssid, String pwd, byte chl = 1, byte ecn = 2); 67 | boolean ipConfig(byte type, String addr, int32_t port, boolean a = 0, byte id = 0); 68 | boolean Send(String str); 69 | boolean Send(byte id, String str); 70 | int32_t ReceiveMessage(char *buf); 71 | 72 | bool confMode(byte a); 73 | boolean confJAP(String ssid , String pwd); 74 | boolean confSAP(String ssid , String pwd , byte chl , byte ecn); 75 | String showMode(void); 76 | String showAP(void); 77 | String showJAP(void); 78 | boolean quitAP(void); 79 | String showSAP(void); 80 | 81 | String showStatus(void); 82 | String showMux(void); 83 | boolean confMux(boolean a); 84 | boolean newMux(byte type, String addr, int32_t port); 85 | boolean newMux(byte id, byte type, String addr, int32_t port); 86 | void closeMux(void); 87 | void closeMux(byte id); 88 | String showIP(void); 89 | boolean confServer(byte mode, int32_t port); 90 | }; 91 | #endif 92 | 93 | #endif /* #ifndef __ETH_ESP8266_H__ */ 94 | -------------------------------------------------------------------------------- /Eth_GSM.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "IoTgo.h" 6 | #include "Eth_GSM.h" 7 | 8 | #ifdef NET_USE_GSM 9 | 10 | /* Create a object of InetGSM class */ 11 | static InetGSM inet; 12 | static InetGSM *gsm_inet = &inet; 13 | 14 | 15 | /** 16 | * Initialize the GSM module 17 | * 18 | * @retval true - success. 19 | * @retval false - failed. 20 | */ 21 | bool Gsm::intialGSM() 22 | { 23 | if(gsm.begin(9600)) 24 | { 25 | DebugSerial.println("Gsm ready OK!"); 26 | 27 | //GPRS attach, put in order APN, username and password. 28 | if(gsm_inet->attachGPRS("internet.wind", "", "")) 29 | { 30 | DebugSerial.println("attachGPRS status=ATTACHED"); 31 | } 32 | else 33 | { 34 | DebugSerial.println("attachGPRS status=ERROR"); 35 | return false; 36 | } 37 | delay(1000); 38 | 39 | //Read IP address. 40 | gsm.SimpleWriteln("AT+CIFSR"); 41 | delay(5000); 42 | gsm.WhileSimpleRead(); 43 | 44 | return true; 45 | } 46 | else 47 | { 48 | DebugSerial.println("gsm.begin err!"); 49 | return false; 50 | } 51 | } 52 | 53 | 54 | int32_t Gsm::createTCPConnection(String host, uint32_t port) 55 | { 56 | char msg[64] = {0}; 57 | const char *server_name = host.c_str(); 58 | bool connected = false; 59 | int i; 60 | 61 | for (i = 0; i < 10; i++) 62 | { 63 | //DebugSerial.print("Try "); 64 | //DebugSerial.println(i); 65 | if(gsm_inet->connectTCP(server_name, (int)port)) 66 | { 67 | //DebugSerial.println("TCP connect ok!"); 68 | return 0; 69 | } 70 | delay(1000); 71 | } 72 | 73 | DebugSerial.println("TCP connect err!"); 74 | return ERR_TCP_CONN_FAILED; 75 | 76 | } 77 | 78 | 79 | int32_t Gsm::send(String data) 80 | { 81 | int32_t ret = 0; 82 | char end_c[2]; 83 | end_c[0]=0x1a; 84 | end_c[1]='\0'; 85 | 86 | gsm.SimpleWrite(data.c_str()); 87 | gsm.SimpleWrite(end_c); 88 | 89 | switch(gsm.WaitResp(10000, 10, "SEND OK")) 90 | { 91 | case RX_TMOUT_ERR: 92 | ret = ERR_TCP_SEND_FAILED; 93 | DebugSerial.println("send timeout!"); 94 | break; 95 | case RX_FINISHED_STR_NOT_RECV: 96 | ret = ERR_TCP_SEND_FAILED; 97 | //DebugSerial.println("send no response!"); 98 | break; 99 | //default: 100 | //DebugSerial.println("send ok!"); 101 | } 102 | 103 | return ret; 104 | } 105 | 106 | 107 | int32_t Gsm::recv(char * buffer, uint32_t length) 108 | { 109 | return gsm.read(buffer, length); 110 | } 111 | 112 | 113 | int32_t Gsm::releaseTCPConnection() 114 | { 115 | return gsm_inet->disconnectTCP() == 1 ? 0 : ERR_TCP_DISCONN_FAILED; 116 | } 117 | 118 | 119 | #endif /*NET_USE_GSM*/ 120 | -------------------------------------------------------------------------------- /Eth_GSM.h: -------------------------------------------------------------------------------- 1 | #ifndef __ETH_GSM_H__ 2 | #define __ETH_GSM_H__ 3 | 4 | #include 5 | #include 6 | 7 | #include "utility/HW_GSM_SIM900.h" 8 | #include "utility/HW_GSM_inetGSM.h" 9 | #include "utility/HW_GSM_GSM.h" 10 | 11 | #include "IoTgo_config.h" 12 | #include "Net_NetInterface.h" 13 | 14 | #ifdef NET_USE_GSM 15 | 16 | /** 17 | * Provides TCP service for Application Layer of Network Protocol Stack. 18 | * 19 | * The implemetation is based on GSM/GPRS (SIM900/908/800/808). 20 | * 21 | * @ingroup NetInterface 22 | */ 23 | class Gsm: public NetInterface, public InetGSM, public SIMCOM900 24 | { 25 | public: /* Implementation of NetInterface */ 26 | virtual int32_t createTCPConnection(String host, uint32_t port); 27 | virtual int32_t send(String data); 28 | virtual int32_t recv(char *buffer, uint32_t length); 29 | virtual int32_t releaseTCPConnection(void); 30 | 31 | public: /* Initial the EthW5X00 class*/ 32 | bool intialGSM(); 33 | }; 34 | 35 | #endif 36 | 37 | #endif 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Eth_W5X00.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | #include "IoTgo.h" 8 | #include "Eth_W5X00.h" 9 | 10 | #ifdef NET_USE_W5X00 11 | 12 | static EthernetClient client_w5x00; 13 | EthernetClient *c = &client_w5x00; 14 | 15 | bool EthW5X00::Initial(uint8_t *mac) 16 | { 17 | int ret = 0; 18 | int r = 0; 19 | 20 | ret = Ethernet.begin(mac); 21 | 22 | if(ret != 1) 23 | { 24 | DebugSerial.println("Net initial config failed!"); 25 | while(1); 26 | } 27 | else 28 | { 29 | DebugSerial.print("My module's IP address: "); 30 | for(byte i = 0; i<4; i++) 31 | { 32 | DebugSerial.print(Ethernet.localIP()[i], DEC); 33 | DebugSerial.print("."); 34 | } 35 | DebugSerial.println(); 36 | } 37 | 38 | return true; 39 | 40 | } 41 | 42 | 43 | /** 44 | * Initialize the W5X00 module 45 | * 46 | * @retval true - success. 47 | * @retval false - failed. 48 | */ 49 | bool EthW5X00::configW5X00(uint8_t *mac) 50 | { 51 | return Initial(mac); 52 | } 53 | 54 | 55 | 56 | int32_t EthW5X00::createTCPConnection(String host, uint32_t port) 57 | { 58 | int cnt; 59 | const char *domain_name = host.c_str(); 60 | 61 | 62 | for (cnt = 0; cnt < 10; cnt++) 63 | { 64 | if (1 == c->connect(domain_name, (uint16_t)port)) 65 | { 66 | //DebugSerial.println("Ready OK!"); 67 | return 0; 68 | } 69 | delay(100); 70 | } 71 | 72 | DebugSerial.println("TCP connection failed!"); 73 | return ERR_TCP_CONN_FAILED; 74 | 75 | } 76 | 77 | 78 | int32_t EthW5X00::send(String data) 79 | { 80 | size_t ret = 0; 81 | size_t len = 0; 82 | 83 | const char *ndata = data.c_str(); 84 | len = strlen(ndata); 85 | ret = c->write((const uint8_t*)ndata, len); 86 | if(ret == len) 87 | { 88 | //DebugSerial.println("Send data successed!"); 89 | return 0; 90 | } 91 | else 92 | { 93 | DebugSerial.println("Send data failed!"); 94 | return ERR_TCP_SEND_FAILED; 95 | } 96 | 97 | } 98 | 99 | 100 | int32_t EthW5X00::recv(char * buffer, uint32_t length) 101 | { 102 | int ret = 0; 103 | int cnt; 104 | 105 | for (cnt = 0; cnt < 100; cnt++) 106 | { 107 | ret = c->read((uint8_t *)buffer, (size_t)length); 108 | if (ret != -1) 109 | { 110 | return ret; 111 | } 112 | delay(100); 113 | } 114 | 115 | //DebugSerial.println("Recv data failed!"); 116 | return ERR_TCP_RECV_FAILED; 117 | } 118 | 119 | 120 | int32_t EthW5X00::releaseTCPConnection() 121 | { 122 | c->stop(); 123 | } 124 | 125 | #endif /* #ifdef NET_USE_W5X00 */ 126 | 127 | 128 | -------------------------------------------------------------------------------- /Eth_W5X00.h: -------------------------------------------------------------------------------- 1 | #ifndef __ETH_W5X00_H__ 2 | #define __ETH_W5X00_H__ 3 | 4 | 5 | #include 6 | #include 7 | #include "utility/HW_Eth_Ethernet.h" 8 | #include "utility/HW_Eth_EthernetClient.h" 9 | 10 | #include "IoTgo_config.h" 11 | #include "Net_NetInterface.h" 12 | 13 | #ifdef NET_USE_W5X00 14 | 15 | /** 16 | * Provides TCP service for Application Layer of Network Protocol Stack. 17 | * 18 | * The implemetation is based on W5100/W5200/W5500. 19 | * 20 | * @ingroup NetInterface 21 | */ 22 | class EthW5X00:public NetInterface, public EthernetClient, public EthernetClass 23 | { 24 | public: /* Implementation of NetInterface */ 25 | virtual int32_t createTCPConnection(String host, uint32_t port); 26 | virtual int32_t send(String data); 27 | virtual int32_t recv(char *buffer, uint32_t length); 28 | virtual int32_t releaseTCPConnection(void); 29 | 30 | public: /* Initial the EthW5X00 class*/ 31 | bool configW5X00(uint8_t *mac); 32 | 33 | private: /* The private funtion of EthW5X00 class*/ 34 | //void reset(); 35 | //IPAddress StringToIp(String str_ip); 36 | bool Initial(uint8_t *mac); 37 | }; 38 | 39 | #endif 40 | 41 | #endif 42 | 43 | -------------------------------------------------------------------------------- /ITEAD-logo.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itead/ITEADLIB_Arduino_IoTgo/6baedcedc3864c12605508ed1cb0e8a7c8a0421d/ITEAD-logo.JPG -------------------------------------------------------------------------------- /IoTgo.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file IoTgo.h 3 | * 4 | * API of IoTgo (iotgo.iteadstudio.com) 5 | * 6 | * @author Wu Pengfei (email:) 7 | * @date 2014/11/11 8 | * @copyright 9 | * Copyright (C) 2013-2014 ITEAD Intelligent Systems Co., Ltd. \n 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License as 12 | * published by the Free Software Foundation; either version 2 of 13 | * the License, or (at your option) any later version. 14 | */ 15 | 16 | #ifndef __ITEADIOT_H__ 17 | #define __ITEADIOT_H__ 18 | 19 | #include 20 | #include 21 | 22 | #include "IoTgo_config.h" 23 | #include "IoTgo_error.h" 24 | #include "Net_NetInterface.h" 25 | 26 | /** 27 | * @addtogroup IoTgo 28 | * @{ 29 | */ 30 | 31 | /** 32 | * Constants of IoTgo platform. 33 | * 34 | * Maybe these are useless for users. 35 | */ 36 | enum IoTgoConstant 37 | { 38 | IOT_BUFFER_SIZE = 512, /**< the length of http request */ 39 | APIKEY_LEN = 36, /**< the length of apikey */ 40 | DEVICE_ID_LEN = 10, /**< the length of device id */ 41 | }; 42 | 43 | /** 44 | * Indicates the type of device. 45 | * 46 | * Used in method: @ref IoTgo::init. If the deviceid is created by developers on website 47 | * of IoTgo platform, the type is DEVICE_DIY. Else DEVICE_PRODUCT. 48 | */ 49 | enum IoTgoDeviceType 50 | { 51 | DEVICE_DIY = 0, /**< DIY deviceid */ 52 | DEVICE_PRODUCT = 1, /**< Product deviceid */ 53 | }; 54 | 55 | 56 | /** 57 | * IoTgo provides some simple API for device of IoT. 58 | */ 59 | class IoTgo 60 | { 61 | public: /* public methods */ 62 | IoTgo(NetInterface *net); 63 | void setHost(const char *ip, const char *domain_name); 64 | const char *init(const char *device_id, const char *apikey, 65 | IoTgoDeviceType device_type = DEVICE_DIY); 66 | const char *query(const char *params[]); 67 | const char *update(const char *params[], const char *values[]); 68 | 69 | private: /* private methods */ 70 | const char * request(const char *http_body, char *const buffer, int32_t len); 71 | 72 | 73 | private: /* private datas */ 74 | NetInterface *net; 75 | char buffer[IOT_BUFFER_SIZE]; 76 | char apikey[APIKEY_LEN + 1]; 77 | char device_id[DEVICE_ID_LEN + 1]; 78 | char ip[30]; 79 | char domain_name[30]; 80 | }; 81 | 82 | /** @} */ 83 | 84 | #endif /* #ifndef __ITEADIOT_H__ */ 85 | -------------------------------------------------------------------------------- /IoTgo_config.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file IoTgo_config.h 3 | * 4 | * Configure some options for your board. 5 | * 6 | * @author Wu Pengfei (email:) 7 | * @date 2014/11/27 8 | * @copyright 9 | * Copyright (C) 2013-2014 ITEAD Intelligent Systems Co., Ltd. \n 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License as 12 | * published by the Free Software Foundation; either version 2 of 13 | * the License, or (at your option) any later version. 14 | */ 15 | 16 | #ifndef __IOTGO_CONFIG_H__ 17 | #define __IOTGO_CONFIG_H__ 18 | 19 | 20 | //#define DEBUG /* comment or uncomment this line to toggle debug message output */ 21 | 22 | #define DebugSerial Serial /* Serial port for debug informations */ 23 | 24 | /* 25 | * Select your way for access to internet according to your hardwares. 26 | * ONLY one of three macros following must be defined. 27 | * Define NET_USE_ESP8266 if you choose ESP8266 for accessing to internet. 28 | * Define NET_USE_W5X00 for W5100/W5200/W5500. 29 | * Define NET_USE_GSM for GSM/GPRS SIM900/SIM908/SIM800/SIM808. 30 | */ 31 | #define NET_USE_ESP8266 32 | //#define NET_USE_W5X00 33 | //#define NET_USE_GSM 34 | 35 | 36 | /* 37 | * Configurations for NET_USE_ESP8266 38 | */ 39 | 40 | #define ESP8266_BAUD_RATE (9600) /* Guess what? */ 41 | #define ESP8266Serial Serial1 /* UART used between ESP8266 and MCU */ 42 | 43 | 44 | /* 45 | * Configurations for NET_USE_W5X00 46 | */ 47 | 48 | /* 49 | * Select your ethernet card if NET_USE_W5X00 defined. 50 | * ONLY one of three macros following must be defined. 51 | */ 52 | #define W5100_ETHERNET_SHIELD /* Arduino Ethenret Shield and Compatibles */ 53 | //#define W5200_ETHERNET_SHIELD /* WIZ820io, W5200 Ethernet Shield */ 54 | //#define W5500_ETHERNET_SHIELD /* WIZ550io, ioShield series of WIZnet */ 55 | 56 | #define W5X00SPI SPI /* SPI used between W5X00 and MCU */ 57 | 58 | 59 | /* 60 | * Configurations for NET_USE_GSM 61 | */ 62 | 63 | #define GSMSerial Serial1 /* UART used between GSM and MCU */ 64 | 65 | 66 | #endif /* #ifndef __IOTGO_CONFIG_H__ */ 67 | -------------------------------------------------------------------------------- /IoTgo_device.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file IoTgo_device.h 3 | * 4 | * Include all classes of devices supported by IoTgo Library, such as Switch, 5 | * Light and Temperature & Humidity Sensor etc. User can include this 6 | * header file in *.ino or *.cpp source for using IoTgo Library. 7 | * 8 | * @author Wu Pengfei (email:) 9 | * @date 2014/11/20 10 | * @copyright 11 | * Copyright (C) 2013-2014 ITEAD Intelligent Systems Co., Ltd. \n 12 | * This program is free software; you can redistribute it and/or 13 | * modify it under the terms of the GNU General Public License as 14 | * published by the Free Software Foundation; either version 2 of 15 | * the License, or (at your option) any later version. 16 | */ 17 | 18 | #ifndef __IOTGO_DEVICE_H__ 19 | #define __IOTGO_DEVICE_H__ 20 | 21 | #include "IoTgo_config.h" 22 | 23 | #include "Dev_Switch.h" 24 | #include "Dev_Light.h" 25 | 26 | #include "Dev_THSensor.h" 27 | #include "utility/HW_SHT1x.h" 28 | 29 | #if defined(NET_USE_ESP8266) 30 | 31 | #include "Eth_ESP8266.h" 32 | 33 | #elif defined(NET_USE_W5X00) 34 | 35 | #include "Eth_W5X00.h" 36 | 37 | #elif defined(NET_USE_GSM) 38 | 39 | #include "Eth_GSM.h" 40 | 41 | #endif /* #if defined(NET_USE_ESP8266) */ 42 | 43 | #endif /* #ifndef __IOTGO_DEVICE_H__ */ 44 | 45 | -------------------------------------------------------------------------------- /IoTgo_doxygen.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file IoTgo_doxygen.h 3 | * 4 | * Define modules in API doc. 5 | * 6 | * @author Wu Pengfei (email:) 7 | * @date 2014/11/20 8 | * @copyright 9 | * Copyright (C) 2013-2014 ITEAD Intelligent Systems Co., Ltd. \n 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License as 12 | * published by the Free Software Foundation; either version 2 of 13 | * the License, or (at your option) any later version. 14 | */ 15 | 16 | #ifndef __IOTGO_DOXYGEN_H__ 17 | #define __IOTGO_DOXYGEN_H__ 18 | 19 | /** 20 | * @defgroup IoTgo IoTgo 21 | * @brief Just like a http proxy in charge of communication 22 | * between local device and IoTgo platform(server). 23 | */ 24 | 25 | /** 26 | * @defgroup Switch Switch 27 | * @brief Switch device of IoTgo platform. 28 | */ 29 | 30 | /** 31 | * @defgroup Light Light 32 | * @brief Light device of IoTgo platform. 33 | */ 34 | 35 | /** 36 | * @defgroup THSensor THSensor 37 | * @brief THSensor device of IoTgo platform. 38 | */ 39 | 40 | /** 41 | * @defgroup THSensorInterface THSensorInterface 42 | * @brief Provides unified interface to read data from Temp & Humidity Sensors. 43 | */ 44 | 45 | /** 46 | * @defgroup Error Error 47 | * @brief Constants of error types. 48 | */ 49 | 50 | /** 51 | * @defgroup NetInterface NetInterface 52 | * @brief Provides unified interface accessing internet. 53 | */ 54 | 55 | #endif /* #ifndef __IOTGO_DOXYGEN_H__ */ 56 | -------------------------------------------------------------------------------- /IoTgo_error.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file IoTgo_error.h 3 | * 4 | * Define macros indicate error type. 5 | * 6 | * @author Wu Pengfei (email:) 7 | * @date 2014/11/19 8 | * @copyright 9 | * Copyright (C) 2013-2014 ITEAD Intelligent Systems Co., Ltd. \n 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License as 12 | * published by the Free Software Foundation; either version 2 of 13 | * the License, or (at your option) any later version. 14 | */ 15 | 16 | #ifndef __IOTGOERROR_H__ 17 | #define __IOTGOERROR_H__ 18 | 19 | /** 20 | * @addtogroup Error 21 | * @{ 22 | */ 23 | 24 | /** 25 | * IoTgo errors. 26 | */ 27 | enum IoTgoError 28 | { 29 | /* General */ 30 | ERR_INVALID_PARAMETER = -1, /**< Invalid parameters */ 31 | 32 | /* Net */ 33 | ERR_NO_RESPONSE = -100, /**< No response from server */ 34 | ERR_NO_EXPECT = -101, /**< No contents expected in response */ 35 | 36 | /* Device */ 37 | ERR_NO_DEVICES_AVAILABLE = -200, /**< No devices available */ 38 | ERR_INIT_DEVICE_FAILED = -201, /**< Initialize device failed */ 39 | ERR_READ_DEVICE_FAILED = -202, /**< Read device failed */ 40 | ERR_WRITE_DEVICE_FAILED = -203, /**< Write device failed */ 41 | ERR_CLOSE_DEVICE_FAILED = -204, /**< Close device failed */ 42 | 43 | /* Network */ 44 | ERR_INIT_NET_FAILED = -300, /**< Initialize network failed */ 45 | ERR_CLOSE_NET_FAILED = -301, /**< Close network failed */ 46 | ERR_TCP_CONN_FAILED = -302, /**< Create TCP connection failed */ 47 | ERR_TCP_DISCONN_FAILED = -303, /**< Release TCP connection failed */ 48 | ERR_TCP_SEND_FAILED = -304, /**< Sending data failed */ 49 | ERR_TCP_RECV_FAILED = -305, /**< Receiving data failed */ 50 | }; 51 | 52 | /** @} */ 53 | 54 | #endif /* #ifndef __IOTGOERROR_H__ */ 55 | -------------------------------------------------------------------------------- /Net_NetInterface.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file Net_NetInterface.h 3 | * 4 | * The interface of internet. 5 | * 6 | * @author Wu Pengfei (email:) 7 | * @date 2014/11/27 8 | * @copyright 9 | * Copyright (C) 2013-2014 ITEAD Intelligent Systems Co., Ltd. \n 10 | * This program is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU General Public License as 12 | * published by the Free Software Foundation; either version 2 of 13 | * the License, or (at your option) any later version. 14 | */ 15 | 16 | #ifndef __NET_NETINTERFACE_H__ 17 | #define __NET_NETINTERFACE_H__ 18 | 19 | #include 20 | 21 | #include "IoTgo_error.h" 22 | 23 | /** 24 | * Abstract class, declares the unified interface to access the internet. 25 | * 26 | * @ingroup NetInterface 27 | */ 28 | class NetInterface 29 | { 30 | public: /* public methods */ 31 | 32 | /** 33 | * Create TCP connection. 34 | * 35 | * @param host - IP address of remote host. 36 | * @param port - the port number for connection. 37 | * 38 | * @retval 0 - success. 39 | * @retval ERR_TCP_CONN_FAILED - failed. 40 | */ 41 | virtual int32_t createTCPConnection(String host, uint32_t port) = 0; 42 | 43 | /** 44 | * Send data based on TCP connection created before. 45 | * 46 | * @param data - the data to be sent. 47 | * 48 | * @retval 0 - success. 49 | * @retval ERR_TCP_SEND_FAILED - failed. 50 | */ 51 | virtual int32_t send(String data) = 0; 52 | 53 | /** 54 | * Receive data based on TCP connection created before. 55 | * 56 | * @param buffer - the buffer storing received data. 57 | * @param length - the length of buffer. 58 | * 59 | * @retval positive - the length of data received. 60 | * @retval ERR_TCP_RECV_FAILED - failed. 61 | */ 62 | virtual int32_t recv(char *buffer, uint32_t length) = 0; 63 | 64 | /** 65 | * Release TCP connection created by createTCPConnection before. 66 | * 67 | * @retval 0 - success. 68 | * @retval ERR_TCP_DISCONN_FAILED - failed. 69 | */ 70 | virtual int32_t releaseTCPConnection(void) = 0; 71 | }; 72 | 73 | 74 | #endif /* #ifndef __NET_NETINTERFACE_H__ */ 75 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | @mainpage 2 | 3 | # IoTgo Arduino Library 4 | 5 | # About IoTgo 6 | 7 | IoTgo is an open source IoT platform, like WordPress, ZenCart and all other open 8 | source software, you can deploy your own IoTgo cloud platform. 9 | 10 | We at ITEAD Studio are committed to provide a complete set of hardware for IoTgo 11 | Platform with open source hardware designs and open source firmware. 12 | 13 | Learn more about IoTgo here 14 | 15 | # Source 16 | 17 | Source can be download at . 18 | 19 | You can clone it by: 20 | 21 | git clone https://github.com/itead/ITEADLIB_Arduino_IoTgo.git 22 | 23 | 24 | # Documentation 25 | 26 | Online API documentation can be reached at . 27 | 28 | Offline API documentation can be found under directory 29 | [doc](https://github.com/itead/ITEADLIB_Arduino_IoTgo/tree/master/doc). 30 | 31 | For Raspberry Pi users, Segnix is recommended at . 32 | Segnix ships with an IoTgo library beased on Linux/Raspberry Pi. 33 | 34 | # How to get started 35 | 36 | On the home page of API documentation, the tabs of Modules, Classes and Examples 37 | will be useful for Arduino developers. 38 | 39 | # Project Layers 40 | 41 | IoTgo Arduino Library has layers following: 42 | 43 | - IoTgo Device Layer: Switch, Light, THSensor [source: Dev_*] 44 | - Http Proxy Layer: IoTgo [source: IoTgo*] 45 | - Network Layer: NetInterface [source: Net_*] 46 | - Ethernet Layer: ESP8266(WIFI), W5100/W5200/W5500, GSM/GPRS(SIM908/900/808/800)[source: Eth_*] 47 | - Hardware Layer: MEGA/WBoard/WBoard Pro 48 | 49 | # Mainboard Requires 50 | 51 | - RAM: not less than 8KBytes 52 | - UART: one hardware serial at least 53 | 54 | # Suppported Mainboards 55 | 56 | - WBoard Pro 57 | - MEGA and its derivatives 58 | 59 | # Configuration 60 | 61 | All work of configuration is to comment or uncomment macros related. File: `IoTgo_config.h` 62 | lists all macros which users can modify. Comments around macros will be helpful 63 | to users. 64 | 65 | # Connection 66 | 67 | Depending on your way to access to internet, your hardware connection may be different. 68 | Besides, another connection will be needed if you use examples shipped with this library. 69 | Just be careful and patient when connecting all hardwares together. 70 | 71 | ------------------------------------------------------------------------------- 72 | 73 | # The End! 74 | 75 | ------------------------------------------------------------------------------- 76 | -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/ITEAD-logo.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itead/ITEADLIB_Arduino_IoTgo/6baedcedc3864c12605508ed1cb0e8a7c8a0421d/doc/IoTgo-Arduino-Library-API-html/ITEAD-logo.JPG -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/_dev___light_8cpp.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | IoTgo Arduino Library API: Dev_Light.cpp File Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 25 | 26 | 27 |
21 |
IoTgo Arduino Library API 22 |
23 |
For Arduino developers
24 |
28 |
29 | 30 | 31 | 41 | 47 |
48 |
49 |
50 |
Dev_Light.cpp File Reference
51 |
52 |
53 | 54 |

Light API of IoTgo (iotgo.iteadstudio.com) 55 | More...

56 |
#include "Dev_Light.h"
57 |
58 |

Go to the source code of this file.

59 |

Detailed Description

60 |

Light API of IoTgo (iotgo.iteadstudio.com)

61 |
Author
Wu Pengfei (email:pengf.nosp@m.ei.w.nosp@m.u@ite.nosp@m.ad.c.nosp@m.c)
62 |
Date
2014/11/11
63 | 65 | 66 |

Definition in file Dev_Light.cpp.

67 |
68 | 69 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/_dev___switch_8cpp.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | IoTgo Arduino Library API: Dev_Switch.cpp File Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 25 | 26 | 27 |
21 |
IoTgo Arduino Library API 22 |
23 |
For Arduino developers
24 |
28 |
29 | 30 | 31 | 41 | 47 |
48 |
49 |
50 |
Dev_Switch.cpp File Reference
51 |
52 |
53 | 54 |

Switch API of IoTgo (iotgo.iteadstudio.com) 55 | More...

56 |
#include "Dev_Switch.h"
57 |
58 |

Go to the source code of this file.

59 |

Detailed Description

60 |

Switch API of IoTgo (iotgo.iteadstudio.com)

61 |
Author
Wu Pengfei (email:pengf.nosp@m.ei.w.nosp@m.u@ite.nosp@m.ad.c.nosp@m.c)
62 |
Date
2014/11/11
63 | 65 | 66 |

Definition in file Dev_Switch.cpp.

67 |
68 | 69 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/_dev___t_h_sensor_8cpp.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | IoTgo Arduino Library API: Dev_THSensor.cpp File Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 25 | 26 | 27 |
21 |
IoTgo Arduino Library API 22 |
23 |
For Arduino developers
24 |
28 |
29 | 30 | 31 | 41 | 47 |
48 |
49 |
50 |
Dev_THSensor.cpp File Reference
51 |
52 |
53 | 54 |

THSensor API of IoTgo (iotgo.iteadstudio.com) 55 | More...

56 |
#include "Dev_THSensor.h"
57 |
58 |

Go to the source code of this file.

59 |

Detailed Description

60 |

THSensor API of IoTgo (iotgo.iteadstudio.com)

61 |
Author
Wu Pengfei (email:pengf.nosp@m.ei.w.nosp@m.u@ite.nosp@m.ad.c.nosp@m.c)
62 |
Date
2014/11/17
63 | 65 | 66 |

Definition in file Dev_THSensor.cpp.

67 |
68 | 69 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/_eth___e_s_p8266_8cpp.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | IoTgo Arduino Library API: Eth_ESP8266.cpp File Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 25 | 26 | 27 |
21 |
IoTgo Arduino Library API 22 |
23 |
For Arduino developers
24 |
28 |
29 | 30 | 31 | 41 | 47 |
48 |
49 |
50 |
Eth_ESP8266.cpp File Reference
51 |
52 |
53 | 54 |

ESP8266 library. 55 | More...

56 |
#include "Eth_ESP8266.h"
57 |
58 |

Go to the source code of this file.

59 |

Detailed Description

60 |

ESP8266 library.

61 |
Author
Wu Pengfei (email:pengf.nosp@m.ei.w.nosp@m.u@ite.nosp@m.ad.c.nosp@m.c)
62 |
Date
2014/11/17
63 | 65 | 66 |

Definition in file Eth_ESP8266.cpp.

67 |
68 | 69 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/_h_w___eth__config_8h_source.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | IoTgo Arduino Library API: utility/HW_Eth_config.h Source File 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 25 | 26 | 27 |
21 |
IoTgo Arduino Library API 22 |
23 |
For Arduino developers
24 |
28 |
29 | 30 | 31 | 41 | 47 | 51 |
52 |
53 |
54 |
HW_Eth_config.h
55 |
56 |
57 |
1 #ifndef __HW_ETH_CONFIG_H__
58 |
2 #define __HW_ETH_CONFIG_H__
59 |
3 
60 |
4 /* Select your ethernet card */
61 |
5 #define W5100_ETHERNET_SHIELD // Arduino Ethenret Shield and Compatibles ...
62 |
6 //#define W5200_ETHERNET_SHIELD // WIZ820io, W5200 Ethernet Shield
63 |
7 //#define W5500_ETHERNET_SHIELD // WIZ550io, ioShield series of WIZnet
64 |
8 
65 |
9 #endif /* #ifndef __HW_ETH_CONFIG_H__ */
66 |
67 | 68 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/_h_w___eth__util_8h_source.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | IoTgo Arduino Library API: utility/HW_Eth_util.h Source File 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 25 | 26 | 27 |
21 |
IoTgo Arduino Library API 22 |
23 |
For Arduino developers
24 |
28 |
29 | 30 | 31 | 41 | 47 | 51 |
52 |
53 |
54 |
HW_Eth_util.h
55 |
56 |
57 |
1 #ifndef UTIL_H
58 |
2 #define UTIL_H
59 |
3 
60 |
4 #define htons(x) ( ((x)<<8) | (((x)>>8)&0xFF) )
61 |
5 #define ntohs(x) htons(x)
62 |
6 
63 |
7 #define htonl(x) ( ((x)<<24 & 0xFF000000UL) | \
64 |
8  ((x)<< 8 & 0x00FF0000UL) | \
65 |
9  ((x)>> 8 & 0x0000FF00UL) | \
66 |
10  ((x)>>24 & 0x000000FFUL) )
67 |
11 #define ntohl(x) htonl(x)
68 |
12 
69 |
13 #endif
70 |
71 | 72 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/_h_w___s_h_t1x_8cpp.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | IoTgo Arduino Library API: utility/HW_SHT1x.cpp File Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 25 | 26 | 27 |
21 |
IoTgo Arduino Library API 22 |
23 |
For Arduino developers
24 |
28 |
29 | 30 | 31 | 41 | 47 | 51 |
52 |
53 |
54 |
HW_SHT1x.cpp File Reference
55 |
56 |
57 | 58 |

SHT1x Library. 59 | More...

60 |
#include <WProgram.h>
61 | #include "HW_SHT1x.h"
62 |
63 |

Go to the source code of this file.

64 |

Detailed Description

65 |

SHT1x Library.

66 |

Copyright 2009 Jonathan Oxer jon@o.nosp@m.xer..nosp@m.com.a.nosp@m.u / <www.practicalarduino.com> Based on previous work by: Maurice Ribble: <www.glacialwanderer.com/hobbyrobotics/?p=5> Wayne ?: <ragingreality.blogspot.com/2008/01/ardunio-and-sht15.html>

67 |

Manages communication with SHT1x series (SHT10, SHT11, SHT15) temperature / humidity sensors from Sensirion (www.sensirion.com).

68 | 69 |

Definition in file HW_SHT1x.cpp.

70 |
71 | 72 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/_io_tgo_8cpp.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | IoTgo Arduino Library API: IoTgo.cpp File Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 25 | 26 | 27 |
21 |
IoTgo Arduino Library API 22 |
23 |
For Arduino developers
24 |
28 |
29 | 30 | 31 | 41 | 47 |
48 |
49 |
50 |
IoTgo.cpp File Reference
51 |
52 |
53 | 54 |

API of IoTgo (iotgo.iteadstudio.com) 55 | More...

56 |
#include "IoTgo.h"
57 |
58 |

Go to the source code of this file.

59 |

Detailed Description

60 |

API of IoTgo (iotgo.iteadstudio.com)

61 |
Author
Wu Pengfei (email:pengf.nosp@m.ei.w.nosp@m.u@ite.nosp@m.ad.c.nosp@m.c)
62 |
Date
2014/11/11
63 | 65 | 66 |

Definition in file IoTgo.cpp.

67 |
68 | 69 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/_io_tgo__config_8h.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | IoTgo Arduino Library API: IoTgo_config.h File Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 25 | 26 | 27 |
21 |
IoTgo Arduino Library API 22 |
23 |
For Arduino developers
24 |
28 |
29 | 30 | 31 | 41 | 47 |
48 |
49 |
50 |
IoTgo_config.h File Reference
51 |
52 |
53 | 54 |

Configure some options for your board. 55 | More...

56 | 57 |

Go to the source code of this file.

58 |

Detailed Description

59 |

Configure some options for your board.

60 |
Author
Wu Pengfei (email:pengf.nosp@m.ei.w.nosp@m.u@ite.nosp@m.ad.c.nosp@m.c)
61 |
Date
2014/11/27
62 | 64 | 65 |

Definition in file IoTgo_config.h.

66 |
67 | 68 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/_io_tgo__debug_8h.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | IoTgo Arduino Library API: IoTgo_debug.h File Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 25 | 26 | 27 |
21 |
IoTgo Arduino Library API 22 |
23 |
For Arduino developers
24 |
28 |
29 | 30 | 31 | 41 | 47 |
48 |
49 |
50 |
IoTgo_debug.h File Reference
51 |
52 |
53 | 54 |

Define/Undefine macro DEBUG for debuging project. 55 | More...

56 | 57 |

Go to the source code of this file.

58 |

Detailed Description

59 |

Define/Undefine macro DEBUG for debuging project.

60 |
Author
Wu Pengfei (email:pengf.nosp@m.ei.w.nosp@m.u@ite.nosp@m.ad.c.nosp@m.c)
61 |
Date
2014/11/17
62 | 64 | 65 |

Definition in file IoTgo_debug.h.

66 |
67 | 68 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/_io_tgo__debug_8h_source.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | IoTgo Arduino Library API: IoTgo_debug.h Source File 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 25 | 26 | 27 |
21 |
IoTgo Arduino Library API 22 |
23 |
For Arduino developers
24 |
28 |
29 | 30 | 31 | 41 | 47 |
48 |
49 |
50 |
IoTgo_debug.h
51 |
52 |
53 | Go to the documentation of this file.
1 
54 |
16 #ifndef __IOTGO_DEBUG_H__
55 |
17 #define __IOTGO_DEBUG_H__
56 |
18 
57 |
19 //#define DEBUG
58 |
20 
59 |
21 #endif /* #ifndef __IOTGO_DEBUG_H__ */
60 |
61 | 62 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/_io_tgo__doxygen_8h.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | IoTgo Arduino Library API: IoTgo_doxygen.h File Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 25 | 26 | 27 |
21 |
IoTgo Arduino Library API 22 |
23 |
For Arduino developers
24 |
28 |
29 | 30 | 31 | 41 | 47 |
48 |
49 |
50 |
IoTgo_doxygen.h File Reference
51 |
52 |
53 | 54 |

Define modules in API doc. 55 | More...

56 | 57 |

Go to the source code of this file.

58 |

Detailed Description

59 |

Define modules in API doc.

60 |
Author
Wu Pengfei (email:pengf.nosp@m.ei.w.nosp@m.u@ite.nosp@m.ad.c.nosp@m.c)
61 |
Date
2014/11/20
62 | 64 | 65 |

Definition in file IoTgo_doxygen.h.

66 |
67 | 68 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/_io_tgo__doxygen_8h_source.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | IoTgo Arduino Library API: IoTgo_doxygen.h Source File 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 25 | 26 | 27 |
21 |
IoTgo Arduino Library API 22 |
23 |
For Arduino developers
24 |
28 |
29 | 30 | 31 | 41 | 47 |
48 |
49 |
50 |
IoTgo_doxygen.h
51 |
52 |
53 | Go to the documentation of this file.
1 
54 |
16 #ifndef __IOTGO_DOXYGEN_H__
55 |
17 #define __IOTGO_DOXYGEN_H__
56 |
18 
57 |
55 #endif /* #ifndef __IOTGO_DOXYGEN_H__ */
58 |
59 | 60 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/bc_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itead/ITEADLIB_Arduino_IoTgo/6baedcedc3864c12605508ed1cb0e8a7c8a0421d/doc/IoTgo-Arduino-Library-API-html/bc_s.png -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/bdwn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itead/ITEADLIB_Arduino_IoTgo/6baedcedc3864c12605508ed1cb0e8a7c8a0421d/doc/IoTgo-Arduino-Library-API-html/bdwn.png -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/class_e_s_p8266-members.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | IoTgo Arduino Library API: Member List 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 25 | 26 | 27 |
21 |
IoTgo Arduino Library API 22 |
23 |
For Arduino developers
24 |
28 |
29 | 30 | 31 | 41 | 49 |
50 |
51 |
52 |
ESP8266 Member List
53 |
54 |
55 | 56 |

This is the complete list of members for ESP8266, including all inherited members.

57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 |
connectWiFi(String ssid, String password)ESP8266
createTCPConnection(String host, uint32_t port)ESP8266virtual
disconnectWiFi(void)ESP8266
recv(char *buffer, uint32_t length)ESP8266virtual
releaseTCPConnection(void)ESP8266virtual
send(String data)ESP8266virtual
65 | 66 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/class_e_s_p8266.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itead/ITEADLIB_Arduino_IoTgo/6baedcedc3864c12605508ed1cb0e8a7c8a0421d/doc/IoTgo-Arduino-Library-API-html/class_e_s_p8266.png -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/class_eth_w5_x00-members.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | IoTgo Arduino Library API: Member List 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 25 | 26 | 27 |
21 |
IoTgo Arduino Library API 22 |
23 |
For Arduino developers
24 |
28 |
29 | 30 | 31 | 41 | 49 |
50 |
51 |
52 |
EthW5X00 Member List
53 |
54 |
55 | 56 |

This is the complete list of members for EthW5X00, including all inherited members.

57 | 58 | 59 | 60 | 61 | 62 | 63 |
configW5X00(uint8_t *mac)EthW5X00
createTCPConnection(String host, uint32_t port)EthW5X00virtual
recv(char *buffer, uint32_t length)EthW5X00virtual
releaseTCPConnection(void)EthW5X00virtual
send(String data)EthW5X00virtual
64 | 65 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/class_eth_w5_x00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itead/ITEADLIB_Arduino_IoTgo/6baedcedc3864c12605508ed1cb0e8a7c8a0421d/doc/IoTgo-Arduino-Library-API-html/class_eth_w5_x00.png -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/class_gsm-members.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | IoTgo Arduino Library API: Member List 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 25 | 26 | 27 |
21 |
IoTgo Arduino Library API 22 |
23 |
For Arduino developers
24 |
28 |
29 | 30 | 31 | 41 | 49 |
50 |
51 |
52 |
Gsm Member List
53 |
54 |
55 | 56 |

This is the complete list of members for Gsm, including all inherited members.

57 | 58 | 59 | 60 | 61 | 62 | 63 |
createTCPConnection(String host, uint32_t port)Gsmvirtual
intialGSM()Gsm
recv(char *buffer, uint32_t length)Gsmvirtual
releaseTCPConnection(void)Gsmvirtual
send(String data)Gsmvirtual
64 | 65 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/class_gsm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itead/ITEADLIB_Arduino_IoTgo/6baedcedc3864c12605508ed1cb0e8a7c8a0421d/doc/IoTgo-Arduino-Library-API-html/class_gsm.png -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/class_io_tgo-members.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | IoTgo Arduino Library API: Member List 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 25 | 26 | 27 |
21 |
IoTgo Arduino Library API 22 |
23 |
For Arduino developers
24 |
28 |
29 | 30 | 31 | 41 | 49 |
50 |
51 |
52 |
IoTgo Member List
53 |
54 |
55 | 56 |

This is the complete list of members for IoTgo, including all inherited members.

57 | 58 | 59 | 60 | 61 | 62 | 63 |
init(const char *device_id, const char *apikey, IoTgoDeviceType device_type=DEVICE_DIY)IoTgo
IoTgo(NetInterface *net)IoTgo
query(const char *params[])IoTgo
setHost(const char *ip, const char *domain_name)IoTgo
update(const char *params[], const char *values[])IoTgo
64 | 65 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/class_io_tgo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itead/ITEADLIB_Arduino_IoTgo/6baedcedc3864c12605508ed1cb0e8a7c8a0421d/doc/IoTgo-Arduino-Library-API-html/class_io_tgo.png -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/class_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itead/ITEADLIB_Arduino_IoTgo/6baedcedc3864c12605508ed1cb0e8a7c8a0421d/doc/IoTgo-Arduino-Library-API-html/class_light.png -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/class_net_interface-members.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | IoTgo Arduino Library API: Member List 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 25 | 26 | 27 |
21 |
IoTgo Arduino Library API 22 |
23 |
For Arduino developers
24 |
28 |
29 | 30 | 31 | 41 | 49 |
50 |
51 |
52 |
NetInterface Member List
53 |
54 |
55 | 56 |

This is the complete list of members for NetInterface, including all inherited members.

57 | 58 | 59 | 60 | 61 | 62 |
createTCPConnection(String host, uint32_t port)=0NetInterfacepure virtual
recv(char *buffer, uint32_t length)=0NetInterfacepure virtual
releaseTCPConnection(void)=0NetInterfacepure virtual
send(String data)=0NetInterfacepure virtual
63 | 64 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/class_net_interface.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itead/ITEADLIB_Arduino_IoTgo/6baedcedc3864c12605508ed1cb0e8a7c8a0421d/doc/IoTgo-Arduino-Library-API-html/class_net_interface.png -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/class_s_h_t1x-members.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | IoTgo Arduino Library API: Member List 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 25 | 26 | 27 |
21 |
IoTgo Arduino Library API 22 |
23 |
For Arduino developers
24 |
28 |
29 | 30 | 31 | 41 | 49 |
50 |
51 |
52 |
SHT1x Member List
53 |
54 |
55 | 56 |

This is the complete list of members for SHT1x, including all inherited members.

57 | 58 | 59 | 60 | 61 | 62 |
begin(void)SHT1xinlinevirtual
end(void)SHT1xinlinevirtual
getData(float *temp_c, float *temp_f, float *hum)SHT1xinlinevirtual
SHT1x(int dataPin, int clockPin)SHT1x
63 | 64 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/class_s_h_t1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itead/ITEADLIB_Arduino_IoTgo/6baedcedc3864c12605508ed1cb0e8a7c8a0421d/doc/IoTgo-Arduino-Library-API-html/class_s_h_t1x.png -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/class_switch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itead/ITEADLIB_Arduino_IoTgo/6baedcedc3864c12605508ed1cb0e8a7c8a0421d/doc/IoTgo-Arduino-Library-API-html/class_switch.png -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/class_t_h_sensor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itead/ITEADLIB_Arduino_IoTgo/6baedcedc3864c12605508ed1cb0e8a7c8a0421d/doc/IoTgo-Arduino-Library-API-html/class_t_h_sensor.png -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/class_t_h_sensor_interface-members.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | IoTgo Arduino Library API: Member List 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 25 | 26 | 27 |
21 |
IoTgo Arduino Library API 22 |
23 |
For Arduino developers
24 |
28 |
29 | 30 | 31 | 41 | 49 |
50 |
51 |
52 |
THSensorInterface Member List
53 |
54 |
55 | 56 |

This is the complete list of members for THSensorInterface, including all inherited members.

57 | 58 | 59 | 60 | 61 |
begin(void)=0THSensorInterfacepure virtual
end(void)=0THSensorInterfacepure virtual
getData(float *temp_c, float *temp_f, float *hum)=0THSensorInterfacepure virtual
62 | 63 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/class_t_h_sensor_interface.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itead/ITEADLIB_Arduino_IoTgo/6baedcedc3864c12605508ed1cb0e8a7c8a0421d/doc/IoTgo-Arduino-Library-API-html/class_t_h_sensor_interface.png -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itead/ITEADLIB_Arduino_IoTgo/6baedcedc3864c12605508ed1cb0e8a7c8a0421d/doc/IoTgo-Arduino-Library-API-html/closed.png -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/dir_0c19209abb061b77327d2bacba6c2f9e.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | IoTgo Arduino Library API: examples/switch_local Directory Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 25 | 26 | 27 |
21 |
IoTgo Arduino Library API 22 |
23 |
For Arduino developers
24 |
28 |
29 | 30 | 31 | 41 | 45 |
46 |
47 |
48 |
switch_local Directory Reference
49 |
50 |
51 | 52 | 54 | 55 | 56 |

53 | Files

file  switch_local.ino [code]
 
57 |
58 | 59 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/dir_1ee8911f57154bf799046cca56f1470e.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | IoTgo Arduino Library API: examples/light_remote Directory Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 25 | 26 | 27 |
21 |
IoTgo Arduino Library API 22 |
23 |
For Arduino developers
24 |
28 |
29 | 30 | 31 | 41 | 45 |
46 |
47 |
48 |
light_remote Directory Reference
49 |
50 |
51 | 52 | 54 | 55 | 56 |

53 | Files

file  light_remote.ino [code]
 
57 |
58 | 59 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/dir_1f9af4683cc546486fb539acf110e0c0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | IoTgo Arduino Library API: examples/switch Directory Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 25 | 26 | 27 |
21 |
IoTgo Arduino Library API 22 |
23 |
For Arduino developers
24 |
28 |
29 | 30 | 31 | 41 | 45 |
46 |
47 |
48 |
switch Directory Reference
49 |
50 |
51 | 52 | 54 | 55 | 56 |

53 | Files

file  switch.ino [code]
 
57 |
58 | 59 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/dir_2450f83f0383aec37b6e796592d7a290.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | IoTgo Arduino Library API: examples/temp_hum_sensor Directory Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 25 | 26 | 27 |
21 |
IoTgo Arduino Library API 22 |
23 |
For Arduino developers
24 |
28 |
29 | 30 | 31 | 41 | 45 |
46 |
47 |
48 |
temp_hum_sensor Directory Reference
49 |
50 |
51 | 52 | 54 | 55 | 56 |

53 | Files

file  temp_hum_sensor.ino [code]
 
57 |
58 | 59 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/dir_46743b0942d3df0e21257feeaeec7797.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | IoTgo Arduino Library API: examples/iotgo Directory Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 25 | 26 | 27 |
21 |
IoTgo Arduino Library API 22 |
23 |
For Arduino developers
24 |
28 |
29 | 30 | 31 | 41 | 45 |
46 |
47 |
48 |
iotgo Directory Reference
49 |
50 |
51 | 52 | 54 | 55 | 56 |

53 | Files

file  iotgo.ino [code]
 
57 |
58 | 59 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/dir_9024a3bf10609f0ef45c6e129877cf3d.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | IoTgo Arduino Library API: examples/light Directory Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 25 | 26 | 27 |
21 |
IoTgo Arduino Library API 22 |
23 |
For Arduino developers
24 |
28 |
29 | 30 | 31 | 41 | 45 |
46 |
47 |
48 |
light Directory Reference
49 |
50 |
51 | 52 | 54 | 55 | 56 |

53 | Files

file  light.ino [code]
 
57 |
58 | 59 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/dir_b90a8a55cbbfb9aef848d22d503b6350.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | IoTgo Arduino Library API: examples/switch_remote Directory Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 25 | 26 | 27 |
21 |
IoTgo Arduino Library API 22 |
23 |
For Arduino developers
24 |
28 |
29 | 30 | 31 | 41 | 45 |
46 |
47 |
48 |
switch_remote Directory Reference
49 |
50 |
51 | 52 | 54 | 55 | 56 |

53 | Files

file  switch_remote.ino [code]
 
57 |
58 | 59 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/dir_b996b1e613343db23061b3d6c613cdf8.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | IoTgo Arduino Library API: examples/light_local Directory Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 25 | 26 | 27 |
21 |
IoTgo Arduino Library API 22 |
23 |
For Arduino developers
24 |
28 |
29 | 30 | 31 | 41 | 45 |
46 |
47 |
48 |
light_local Directory Reference
49 |
50 |
51 | 52 | 54 | 55 | 56 |

53 | Files

file  light_local.ino [code]
 
57 |
58 | 59 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/dir_d28a4824dc47e487b107a5db32ef43c4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | IoTgo Arduino Library API: examples Directory Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 25 | 26 | 27 |
21 |
IoTgo Arduino Library API 22 |
23 |
For Arduino developers
24 |
28 |
29 | 30 | 31 | 41 | 45 |
46 |
47 |
48 |
examples Directory Reference
49 |
50 |
51 | 52 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 |

53 | Directories

directory  iotgo
 
directory  light
 
directory  switch
 
directory  temp_hum_sensor
 
63 |
64 | 65 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/doxygen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itead/ITEADLIB_Arduino_IoTgo/6baedcedc3864c12605508ed1cb0e8a7c8a0421d/doc/IoTgo-Arduino-Library-API-html/doxygen.png -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/dynsections.js: -------------------------------------------------------------------------------- 1 | function toggleVisibility(linkObj) 2 | { 3 | var base = $(linkObj).attr('id'); 4 | var summary = $('#'+base+'-summary'); 5 | var content = $('#'+base+'-content'); 6 | var trigger = $('#'+base+'-trigger'); 7 | var src=$(trigger).attr('src'); 8 | if (content.is(':visible')===true) { 9 | content.hide(); 10 | summary.show(); 11 | $(linkObj).addClass('closed').removeClass('opened'); 12 | $(trigger).attr('src',src.substring(0,src.length-8)+'closed.png'); 13 | } else { 14 | content.show(); 15 | summary.hide(); 16 | $(linkObj).removeClass('closed').addClass('opened'); 17 | $(trigger).attr('src',src.substring(0,src.length-10)+'open.png'); 18 | } 19 | return false; 20 | } 21 | 22 | function updateStripes() 23 | { 24 | $('table.directory tr'). 25 | removeClass('even').filter(':visible:even').addClass('even'); 26 | } 27 | 28 | function toggleLevel(level) 29 | { 30 | $('table.directory tr').each(function() { 31 | var l = this.id.split('_').length-1; 32 | var i = $('#img'+this.id.substring(3)); 33 | var a = $('#arr'+this.id.substring(3)); 34 | if (l 2 | 3 | 4 | 5 | 6 | 7 | IoTgo Arduino Library API: Examples 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 25 | 26 | 27 |
21 |
IoTgo Arduino Library API 22 |
23 |
For Arduino developers
24 |
28 |
29 | 30 | 31 | 41 |
42 |
43 |
44 |
Examples
45 |
46 |
47 |
Here is a list of all examples:
57 |
58 | 59 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/ftv2blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itead/ITEADLIB_Arduino_IoTgo/6baedcedc3864c12605508ed1cb0e8a7c8a0421d/doc/IoTgo-Arduino-Library-API-html/ftv2blank.png -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/ftv2doc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itead/ITEADLIB_Arduino_IoTgo/6baedcedc3864c12605508ed1cb0e8a7c8a0421d/doc/IoTgo-Arduino-Library-API-html/ftv2doc.png -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/ftv2folderclosed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itead/ITEADLIB_Arduino_IoTgo/6baedcedc3864c12605508ed1cb0e8a7c8a0421d/doc/IoTgo-Arduino-Library-API-html/ftv2folderclosed.png -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/ftv2folderopen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itead/ITEADLIB_Arduino_IoTgo/6baedcedc3864c12605508ed1cb0e8a7c8a0421d/doc/IoTgo-Arduino-Library-API-html/ftv2folderopen.png -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/ftv2lastnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itead/ITEADLIB_Arduino_IoTgo/6baedcedc3864c12605508ed1cb0e8a7c8a0421d/doc/IoTgo-Arduino-Library-API-html/ftv2lastnode.png -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/ftv2link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itead/ITEADLIB_Arduino_IoTgo/6baedcedc3864c12605508ed1cb0e8a7c8a0421d/doc/IoTgo-Arduino-Library-API-html/ftv2link.png -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/ftv2mlastnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itead/ITEADLIB_Arduino_IoTgo/6baedcedc3864c12605508ed1cb0e8a7c8a0421d/doc/IoTgo-Arduino-Library-API-html/ftv2mlastnode.png -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/ftv2mnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itead/ITEADLIB_Arduino_IoTgo/6baedcedc3864c12605508ed1cb0e8a7c8a0421d/doc/IoTgo-Arduino-Library-API-html/ftv2mnode.png -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/ftv2node.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itead/ITEADLIB_Arduino_IoTgo/6baedcedc3864c12605508ed1cb0e8a7c8a0421d/doc/IoTgo-Arduino-Library-API-html/ftv2node.png -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/ftv2plastnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itead/ITEADLIB_Arduino_IoTgo/6baedcedc3864c12605508ed1cb0e8a7c8a0421d/doc/IoTgo-Arduino-Library-API-html/ftv2plastnode.png -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/ftv2pnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itead/ITEADLIB_Arduino_IoTgo/6baedcedc3864c12605508ed1cb0e8a7c8a0421d/doc/IoTgo-Arduino-Library-API-html/ftv2pnode.png -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/ftv2splitbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itead/ITEADLIB_Arduino_IoTgo/6baedcedc3864c12605508ed1cb0e8a7c8a0421d/doc/IoTgo-Arduino-Library-API-html/ftv2splitbar.png -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/ftv2vertline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itead/ITEADLIB_Arduino_IoTgo/6baedcedc3864c12605508ed1cb0e8a7c8a0421d/doc/IoTgo-Arduino-Library-API-html/ftv2vertline.png -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/globals_enum.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | IoTgo Arduino Library API: File Members 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 25 | 26 | 27 |
21 |
IoTgo Arduino Library API 22 |
23 |
For Arduino developers
24 |
28 |
29 | 30 | 31 | 41 | 47 | 54 |
55 |
56 |   73 |
74 | 75 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/group___network.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | IoTgo Arduino Library API: Network Interface 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 25 | 26 | 27 |
21 |
IoTgo Arduino Library API 22 |
23 |
For Arduino developers
24 |
28 |
29 | 30 | 31 | 41 |
42 |
43 |
44 |
Network Interface
45 |
46 |
47 | 48 |

Provides unified interface accessing internet. 49 | More...

50 |

Provides unified interface accessing internet.

51 |
52 | 53 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/group___t_h_sensor.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | IoTgo Arduino Library API: THSensor 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 25 | 26 | 27 |
21 |
IoTgo Arduino Library API 22 |
23 |
For Arduino developers
24 |
28 |
29 | 30 | 31 | 41 |
42 |
43 |
44 | Classes
45 |
46 |
THSensor
47 |
48 |
49 | 50 |

THSensor device of IoTgo platform. 51 | More...

52 | 53 | 55 | 56 | 57 | 58 |

54 | Classes

class  THSensor
 THSensor, subclass of IoTgo, provides simple methods to read temperature and humidity from devices. More...
 
59 |

Detailed Description

60 |

THSensor device of IoTgo platform.

61 |
62 | 63 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/group___t_h_sensor_interface.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | IoTgo Arduino Library API: THSensorInterface 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 25 | 26 | 27 |
21 |
IoTgo Arduino Library API 22 |
23 |
For Arduino developers
24 |
28 |
29 | 30 | 31 | 41 |
42 |
43 |
44 | Classes
45 |
46 |
THSensorInterface
47 |
48 |
49 | 50 |

Provides unified interface to read data from Temp & Humidity Sensors. 51 | More...

52 | 53 | 55 | 56 | 57 | 58 | 59 | 60 | 61 |

54 | Classes

class  THSensorInterface
 Abstract class, declares the unified interface to read temperature and humidity from Temperature & Humidity Sensor. More...
 
class  SHT1x
 SHT1x implements THSensorInterface. More...
 
62 |

Detailed Description

63 |

Provides unified interface to read data from Temp & Humidity Sensors.

64 |
65 | 66 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/md__r_e_a_d_m_e.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | IoTgo Arduino Library API: README 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 25 | 26 | 27 |
21 |
IoTgo Arduino Library API 22 |
23 |
For Arduino developers
24 |
28 |
29 | 30 | 31 | 41 |
42 |
43 |
44 |
README
45 |
46 |
47 |
48 | 49 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/nav_f.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itead/ITEADLIB_Arduino_IoTgo/6baedcedc3864c12605508ed1cb0e8a7c8a0421d/doc/IoTgo-Arduino-Library-API-html/nav_f.png -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/nav_g.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itead/ITEADLIB_Arduino_IoTgo/6baedcedc3864c12605508ed1cb0e8a7c8a0421d/doc/IoTgo-Arduino-Library-API-html/nav_g.png -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/nav_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itead/ITEADLIB_Arduino_IoTgo/6baedcedc3864c12605508ed1cb0e8a7c8a0421d/doc/IoTgo-Arduino-Library-API-html/nav_h.png -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itead/ITEADLIB_Arduino_IoTgo/6baedcedc3864c12605508ed1cb0e8a7c8a0421d/doc/IoTgo-Arduino-Library-API-html/open.png -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/pages.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | IoTgo Arduino Library API: Related Pages 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 25 | 26 | 27 |
21 |
IoTgo Arduino Library API 22 |
23 |
For Arduino developers
24 |
28 |
29 | 30 | 31 | 41 |
42 |
43 |
44 |
Related Pages
45 |
46 |
47 |
Here is a list of all related documentation pages:
48 | 49 | 50 |
 README
51 |
52 |
53 | 54 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/sync_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itead/ITEADLIB_Arduino_IoTgo/6baedcedc3864c12605508ed1cb0e8a7c8a0421d/doc/IoTgo-Arduino-Library-API-html/sync_off.png -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/sync_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itead/ITEADLIB_Arduino_IoTgo/6baedcedc3864c12605508ed1cb0e8a7c8a0421d/doc/IoTgo-Arduino-Library-API-html/sync_on.png -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/tab_a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itead/ITEADLIB_Arduino_IoTgo/6baedcedc3864c12605508ed1cb0e8a7c8a0421d/doc/IoTgo-Arduino-Library-API-html/tab_a.png -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/tab_b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itead/ITEADLIB_Arduino_IoTgo/6baedcedc3864c12605508ed1cb0e8a7c8a0421d/doc/IoTgo-Arduino-Library-API-html/tab_b.png -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/tab_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itead/ITEADLIB_Arduino_IoTgo/6baedcedc3864c12605508ed1cb0e8a7c8a0421d/doc/IoTgo-Arduino-Library-API-html/tab_h.png -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/tab_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itead/ITEADLIB_Arduino_IoTgo/6baedcedc3864c12605508ed1cb0e8a7c8a0421d/doc/IoTgo-Arduino-Library-API-html/tab_s.png -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API-html/tabs.css: -------------------------------------------------------------------------------- 1 | .tabs, .tabs2, .tabs3 { 2 | background-image: url('tab_b.png'); 3 | width: 100%; 4 | z-index: 101; 5 | font-size: 13px; 6 | font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; 7 | } 8 | 9 | .tabs2 { 10 | font-size: 10px; 11 | } 12 | .tabs3 { 13 | font-size: 9px; 14 | } 15 | 16 | .tablist { 17 | margin: 0; 18 | padding: 0; 19 | display: table; 20 | } 21 | 22 | .tablist li { 23 | float: left; 24 | display: table-cell; 25 | background-image: url('tab_b.png'); 26 | line-height: 36px; 27 | list-style: none; 28 | } 29 | 30 | .tablist a { 31 | display: block; 32 | padding: 0 20px; 33 | font-weight: bold; 34 | background-image:url('tab_s.png'); 35 | background-repeat:no-repeat; 36 | background-position:right; 37 | color: #184C80; 38 | text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); 39 | text-decoration: none; 40 | outline: none; 41 | } 42 | 43 | .tabs3 .tablist a { 44 | padding: 0 10px; 45 | } 46 | 47 | .tablist a:hover { 48 | background-image: url('tab_h.png'); 49 | background-repeat:repeat-x; 50 | color: #fff; 51 | text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); 52 | text-decoration: none; 53 | } 54 | 55 | .tablist li.current a { 56 | background-image: url('tab_a.png'); 57 | background-repeat:repeat-x; 58 | color: #fff; 59 | text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); 60 | } 61 | -------------------------------------------------------------------------------- /doc/IoTgo-Arduino-Library-API.chm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itead/ITEADLIB_Arduino_IoTgo/6baedcedc3864c12605508ed1cb0e8a7c8a0421d/doc/IoTgo-Arduino-Library-API.chm -------------------------------------------------------------------------------- /utility/HW_Eth_Dns.h: -------------------------------------------------------------------------------- 1 | // Arduino DNS client for WizNet5100-based Ethernet shield 2 | // (c) Copyright 2009-2010 MCQN Ltd. 3 | // Released under Apache License, version 2.0 4 | 5 | #ifndef DNSClient_h 6 | #define DNSClient_h 7 | 8 | #include 9 | 10 | class DNSClient 11 | { 12 | public: 13 | // ctor 14 | void begin(const IPAddress& aDNSServer); 15 | 16 | /** Convert a numeric IP address string into a four-byte IP address. 17 | @param aIPAddrString IP address to convert 18 | @param aResult IPAddress structure to store the returned IP address 19 | @result 1 if aIPAddrString was successfully converted to an IP address, 20 | else error code 21 | */ 22 | int inet_aton(const char *aIPAddrString, IPAddress& aResult); 23 | 24 | /** Resolve the given hostname to an IP address. 25 | @param aHostname Name to be resolved 26 | @param aResult IPAddress structure to store the returned IP address 27 | @result 1 if aIPAddrString was successfully converted to an IP address, 28 | else error code 29 | */ 30 | int getHostByName(const char* aHostname, IPAddress& aResult); 31 | 32 | protected: 33 | uint16_t BuildRequest(const char* aName); 34 | uint16_t ProcessResponse(uint16_t aTimeout, IPAddress& aAddress); 35 | 36 | IPAddress iDNSServer; 37 | uint16_t iRequestId; 38 | EthernetUDP iUdp; 39 | }; 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /utility/HW_Eth_Ethernet.h: -------------------------------------------------------------------------------- 1 | /* 2 | modified 12 Aug 2013 3 | by Soohwan Kim (suhwan@wiznet.co.kr) 4 | */ 5 | #ifndef ethernet_h 6 | #define ethernet_h 7 | 8 | #include 9 | #include "HW_Eth_w5100.h" 10 | #include "IPAddress.h" 11 | #include "HW_Eth_EthernetClient.h" 12 | #include "HW_Eth_EthernetServer.h" 13 | #include "HW_Eth_Dhcp.h" 14 | 15 | 16 | 17 | class EthernetClass { 18 | private: 19 | IPAddress _dnsServerAddress; 20 | DhcpClass* _dhcp; 21 | public: 22 | static uint8_t _state[MAX_SOCK_NUM]; 23 | static uint16_t _server_port[MAX_SOCK_NUM]; 24 | // Initialise the Ethernet shield to use the provided MAC address and gain the rest of the 25 | // configuration through DHCP. 26 | // Returns 0 if the DHCP configuration failed, and 1 if it succeeded 27 | int begin(uint8_t *mac_address); 28 | void begin(uint8_t *mac_address, IPAddress local_ip); 29 | void begin(uint8_t *mac_address, IPAddress local_ip, IPAddress dns_server); 30 | void begin(uint8_t *mac_address, IPAddress local_ip, IPAddress dns_server, IPAddress gateway); 31 | void begin(uint8_t *mac_address, IPAddress local_ip, IPAddress dns_server, IPAddress gateway, IPAddress subnet); 32 | 33 | #if defined(WIZ550io_WITH_MACADDRESS) 34 | // Initialize function when use the ioShield serise (included WIZ550io) 35 | // WIZ550io has a MAC address which is written after reset. 36 | // Default IP, Gateway and subnet address are also writen. 37 | // so, It needs some initial time. please refer WIZ550io Datasheet in details. 38 | int begin(void); 39 | void begin(IPAddress local_ip); 40 | void begin(IPAddress local_ip, IPAddress dns_server); 41 | void begin(IPAddress local_ip, IPAddress dns_server, IPAddress gateway); 42 | void begin(IPAddress local_ip, IPAddress dns_server, IPAddress gateway, IPAddress subnet); 43 | #endif 44 | 45 | int maintain(); 46 | 47 | IPAddress localIP(); 48 | IPAddress subnetMask(); 49 | IPAddress gatewayIP(); 50 | IPAddress dnsServerIP(); 51 | 52 | friend class EthernetClient; 53 | friend class EthernetServer; 54 | }; 55 | 56 | extern EthernetClass Ethernet; 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /utility/HW_Eth_EthernetClient.cpp: -------------------------------------------------------------------------------- 1 | #include "HW_Eth_w5100.h" 2 | #include "HW_Eth_socket.h" 3 | 4 | extern "C" { 5 | #include "string.h" 6 | } 7 | 8 | #include "Arduino.h" 9 | 10 | #include "HW_Eth_Ethernet.h" 11 | #include "HW_Eth_EthernetClient.h" 12 | #include "HW_Eth_EthernetServer.h" 13 | #include "HW_Eth_Dns.h" 14 | 15 | uint16_t EthernetClient::_srcport = 1024; 16 | 17 | EthernetClient::EthernetClient() : _sock(MAX_SOCK_NUM) { 18 | } 19 | 20 | EthernetClient::EthernetClient(uint8_t sock) : _sock(sock) { 21 | } 22 | 23 | int EthernetClient::connect(const char* host, uint16_t port) { 24 | // Look up the host first 25 | int ret = 0; 26 | DNSClient dns; 27 | IPAddress remote_addr; 28 | 29 | dns.begin(Ethernet.dnsServerIP()); 30 | ret = dns.getHostByName(host, remote_addr); 31 | if (ret == 1) { 32 | return connect(remote_addr, port); 33 | } else { 34 | return ret; 35 | } 36 | } 37 | 38 | int EthernetClient::connect(IPAddress ip, uint16_t port) { 39 | if (_sock != MAX_SOCK_NUM) 40 | return 0; 41 | 42 | for (int i = 0; i < MAX_SOCK_NUM; i++) { 43 | uint8_t s = W5100.readSnSR(i); 44 | if (s == SnSR::CLOSED || s == SnSR::FIN_WAIT || s == SnSR::CLOSE_WAIT) { 45 | _sock = i; 46 | break; 47 | } 48 | } 49 | 50 | if (_sock == MAX_SOCK_NUM) 51 | return 0; 52 | 53 | _srcport++; 54 | if (_srcport == 0) _srcport = 1024; 55 | socket(_sock, SnMR::TCP, _srcport, 0); 56 | 57 | if (!::connect(_sock, rawIPAddress(ip), port)) { 58 | _sock = MAX_SOCK_NUM; 59 | return 0; 60 | } 61 | 62 | while (status() != SnSR::ESTABLISHED) { 63 | delay(1); 64 | if (status() == SnSR::CLOSED) { 65 | _sock = MAX_SOCK_NUM; 66 | return 0; 67 | } 68 | } 69 | 70 | return 1; 71 | } 72 | 73 | size_t EthernetClient::write(uint8_t b) { 74 | return write(&b, 1); 75 | } 76 | 77 | size_t EthernetClient::write(const uint8_t *buf, size_t size) { 78 | if (_sock == MAX_SOCK_NUM) { 79 | setWriteError(); 80 | return 0; 81 | } 82 | if (!send(_sock, buf, size)) { 83 | setWriteError(); 84 | return 0; 85 | } 86 | return size; 87 | } 88 | 89 | int EthernetClient::available() { 90 | if (_sock != MAX_SOCK_NUM) 91 | return W5100.getRXReceivedSize(_sock); 92 | return 0; 93 | } 94 | 95 | int EthernetClient::read() { 96 | uint8_t b; 97 | if ( recv(_sock, &b, 1) > 0 ) 98 | { 99 | // recv worked 100 | return b; 101 | } 102 | else 103 | { 104 | // No data available 105 | return -1; 106 | } 107 | } 108 | 109 | int EthernetClient::read(uint8_t *buf, size_t size) { 110 | return recv(_sock, buf, size); 111 | } 112 | 113 | int EthernetClient::peek() { 114 | uint8_t b; 115 | // Unlike recv, peek doesn't check to see if there's any data available, so we must 116 | if (!available()) 117 | return -1; 118 | ::peek(_sock, &b); 119 | return b; 120 | } 121 | 122 | void EthernetClient::flush() { 123 | while (available()) 124 | read(); 125 | } 126 | 127 | void EthernetClient::stop() { 128 | if (_sock == MAX_SOCK_NUM) 129 | return; 130 | 131 | // attempt to close the connection gracefully (send a FIN to other side) 132 | disconnect(_sock); 133 | unsigned long start = millis(); 134 | 135 | // wait a second for the connection to close 136 | while (status() != SnSR::CLOSED && millis() - start < 1000) 137 | delay(1); 138 | 139 | // if it hasn't closed, close it forcefully 140 | if (status() != SnSR::CLOSED) 141 | close(_sock); 142 | 143 | EthernetClass::_server_port[_sock] = 0; 144 | _sock = MAX_SOCK_NUM; 145 | } 146 | 147 | uint8_t EthernetClient::connected() { 148 | if (_sock == MAX_SOCK_NUM) return 0; 149 | 150 | uint8_t s = status(); 151 | return !(s == SnSR::LISTEN || s == SnSR::CLOSED || s == SnSR::FIN_WAIT || 152 | (s == SnSR::CLOSE_WAIT && !available())); 153 | } 154 | 155 | uint8_t EthernetClient::status() { 156 | if (_sock == MAX_SOCK_NUM) return SnSR::CLOSED; 157 | return W5100.readSnSR(_sock); 158 | } 159 | 160 | // the next function allows us to use the client returned by 161 | // EthernetServer::available() as the condition in an if-statement. 162 | 163 | EthernetClient::operator bool() { 164 | return _sock != MAX_SOCK_NUM; 165 | } 166 | -------------------------------------------------------------------------------- /utility/HW_Eth_EthernetClient.h: -------------------------------------------------------------------------------- 1 | #ifndef ethernetclient_h 2 | #define ethernetclient_h 3 | #include "Arduino.h" 4 | #include "Print.h" 5 | #include "Client.h" 6 | #include "IPAddress.h" 7 | 8 | class EthernetClient : public Client { 9 | 10 | public: 11 | EthernetClient(); 12 | EthernetClient(uint8_t sock); 13 | 14 | uint8_t status(); 15 | virtual int connect(IPAddress ip, uint16_t port); 16 | virtual int connect(const char *host, uint16_t port); 17 | virtual size_t write(uint8_t); 18 | virtual size_t write(const uint8_t *buf, size_t size); 19 | virtual int available(); 20 | virtual int read(); 21 | virtual int read(uint8_t *buf, size_t size); 22 | virtual int peek(); 23 | virtual void flush(); 24 | virtual void stop(); 25 | virtual uint8_t connected(); 26 | virtual operator bool(); 27 | 28 | friend class EthernetServer; 29 | 30 | using Print::write; 31 | 32 | private: 33 | static uint16_t _srcport; 34 | uint8_t _sock; 35 | }; 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /utility/HW_Eth_EthernetServer.cpp: -------------------------------------------------------------------------------- 1 | #include "HW_Eth_w5100.h" 2 | #include "HW_Eth_socket.h" 3 | extern "C" { 4 | #include "string.h" 5 | } 6 | 7 | #include "HW_Eth_Ethernet.h" 8 | #include "HW_Eth_EthernetClient.h" 9 | #include "HW_Eth_EthernetServer.h" 10 | 11 | EthernetServer::EthernetServer(uint16_t port) 12 | { 13 | _port = port; 14 | } 15 | 16 | void EthernetServer::begin() 17 | { 18 | for (int sock = 0; sock < MAX_SOCK_NUM; sock++) { 19 | EthernetClient client(sock); 20 | if (client.status() == SnSR::CLOSED) { 21 | socket(sock, SnMR::TCP, _port, 0); 22 | listen(sock); 23 | EthernetClass::_server_port[sock] = _port; 24 | break; 25 | } 26 | } 27 | } 28 | 29 | void EthernetServer::accept() 30 | { 31 | int listening = 0; 32 | 33 | for (int sock = 0; sock < MAX_SOCK_NUM; sock++) { 34 | EthernetClient client(sock); 35 | 36 | if (EthernetClass::_server_port[sock] == _port) { 37 | if (client.status() == SnSR::LISTEN) { 38 | listening = 1; 39 | } 40 | else if (client.status() == SnSR::CLOSE_WAIT && !client.available()) { 41 | client.stop(); 42 | } 43 | } 44 | } 45 | 46 | if (!listening) { 47 | begin(); 48 | } 49 | } 50 | 51 | EthernetClient EthernetServer::available() 52 | { 53 | accept(); 54 | 55 | for (int sock = 0; sock < MAX_SOCK_NUM; sock++) { 56 | EthernetClient client(sock); 57 | if (EthernetClass::_server_port[sock] == _port && 58 | (client.status() == SnSR::ESTABLISHED || 59 | client.status() == SnSR::CLOSE_WAIT)) { 60 | if (client.available()) { 61 | // XXX: don't always pick the lowest numbered socket. 62 | return client; 63 | } 64 | } 65 | } 66 | 67 | return EthernetClient(MAX_SOCK_NUM); 68 | } 69 | 70 | size_t EthernetServer::write(uint8_t b) 71 | { 72 | return write(&b, 1); 73 | } 74 | 75 | size_t EthernetServer::write(const uint8_t *buffer, size_t size) 76 | { 77 | size_t n = 0; 78 | 79 | accept(); 80 | 81 | for (int sock = 0; sock < MAX_SOCK_NUM; sock++) { 82 | EthernetClient client(sock); 83 | 84 | if (EthernetClass::_server_port[sock] == _port && 85 | client.status() == SnSR::ESTABLISHED) { 86 | n += client.write(buffer, size); 87 | } 88 | } 89 | 90 | return n; 91 | } 92 | -------------------------------------------------------------------------------- /utility/HW_Eth_EthernetServer.h: -------------------------------------------------------------------------------- 1 | #ifndef ethernetserver_h 2 | #define ethernetserver_h 3 | 4 | #include "Server.h" 5 | 6 | class EthernetClient; 7 | 8 | class EthernetServer : 9 | public Server { 10 | private: 11 | uint16_t _port; 12 | void accept(); 13 | public: 14 | EthernetServer(uint16_t); 15 | EthernetClient available(); 16 | virtual void begin(); 17 | virtual size_t write(uint8_t); 18 | virtual size_t write(const uint8_t *buf, size_t size); 19 | using Print::write; 20 | }; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /utility/HW_Eth_Twitter.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Twitter.cpp - Arduino library to Post messages to Twitter using OAuth. 3 | Copyright (c) NeoCat 2010-2011. All right reserved. 4 | 5 | This library is distributed in the hope that it will be useful, 6 | but WITHOUT ANY WARRANTY; without even the implied warranty of 7 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8 | */ 9 | 10 | // ver1.2 - Use 11 | // ver1.3 - Support IDE 1.0 12 | 13 | #include 14 | #include "HW_Eth_Twitter.h" 15 | 16 | #define LIB_DOMAIN "arduino-tweet.appspot.com" 17 | 18 | #if defined(ARDUINO) && ARDUINO < 100 19 | static uint8_t server[] = {0,0,0,0}; // IP address of LIB_DOMAIN 20 | Twitter::Twitter(const char *token) : client(server, 80), token(token) 21 | { 22 | } 23 | #else 24 | Twitter::Twitter(const char *token) : token(token) 25 | { 26 | } 27 | #endif 28 | 29 | bool Twitter::post(const char *msg) 30 | { 31 | #if defined(ARDUINO) && ARDUINO < 100 32 | DNSError err = EthernetDNS.resolveHostName(LIB_DOMAIN, server); 33 | if (err != DNSSuccess) { 34 | return false; 35 | } 36 | #endif 37 | parseStatus = 0; 38 | statusCode = 0; 39 | #if defined(ARDUINO) && ARDUINO < 100 40 | if (client.connect()) { 41 | #else 42 | if (client.connect(LIB_DOMAIN, 80)) { 43 | #endif 44 | client.println("POST http://" LIB_DOMAIN "/update HTTP/1.0"); 45 | client.print("Content-Length: "); 46 | client.println(strlen(msg)+strlen(token)+14); 47 | client.println(); 48 | client.print("token="); 49 | client.print(token); 50 | client.print("&status="); 51 | client.println(msg); 52 | } else { 53 | return false; 54 | } 55 | return true; 56 | } 57 | 58 | bool Twitter::checkStatus(Print *debug) 59 | { 60 | if (!client.connected()) { 61 | if (debug) 62 | while(client.available()) 63 | debug->print((char)client.read()); 64 | client.flush(); 65 | client.stop(); 66 | return false; 67 | } 68 | if (!client.available()) 69 | return true; 70 | char c = client.read(); 71 | if (debug) 72 | debug->print(c); 73 | switch(parseStatus) { 74 | case 0: 75 | if (c == ' ') parseStatus++; break; // skip "HTTP/1.1 " 76 | case 1: 77 | if (c >= '0' && c <= '9') { 78 | statusCode *= 10; 79 | statusCode += c - '0'; 80 | } else { 81 | parseStatus++; 82 | } 83 | } 84 | return true; 85 | } 86 | 87 | int Twitter::wait(Print *debug) 88 | { 89 | while (checkStatus(debug)); 90 | return statusCode; 91 | } 92 | -------------------------------------------------------------------------------- /utility/HW_Eth_Twitter.h: -------------------------------------------------------------------------------- 1 | /* 2 | Twitter.cpp - Arduino library to Post messages to Twitter using OAuth. 3 | Copyright (c) NeoCat 2010-2011. All right reserved. 4 | 5 | This library is distributed in the hope that it will be useful, 6 | but WITHOUT ANY WARRANTY; without even the implied warranty of 7 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8 | */ 9 | 10 | // ver1.2 - Use to support IDE 0019 or later 11 | // ver1.3 - Support IDE 1.0 12 | 13 | #ifndef TWITTER_H 14 | #define TWITTER_H 15 | 16 | #include 17 | #include 18 | #if defined(ARDUINO) && ARDUINO > 18 // Arduino 0019 or later 19 | #include 20 | #endif 21 | #include 22 | #if defined(ARDUINO) && ARDUINO < 100 // earlier than Arduino 1.0 23 | #include 24 | #endif 25 | 26 | class Twitter 27 | { 28 | private: 29 | uint8_t parseStatus; 30 | int statusCode; 31 | const char *token; 32 | #if defined(ARDUINO) && ARDUINO < 100 33 | Client client; 34 | #else 35 | EthernetClient client; 36 | #endif 37 | public: 38 | Twitter(const char *user_and_passwd); 39 | 40 | bool post(const char *msg); 41 | bool checkStatus(Print *debug = NULL); 42 | int wait(Print *debug = NULL); 43 | int status(void) { return statusCode; } 44 | }; 45 | 46 | #endif //TWITTER_H 47 | -------------------------------------------------------------------------------- /utility/HW_Eth_socket.h: -------------------------------------------------------------------------------- 1 | #ifndef _SOCKET_H_ 2 | #define _SOCKET_H_ 3 | 4 | #include "HW_Eth_w5100.h" 5 | 6 | extern uint8_t socket(SOCKET s, uint8_t protocol, uint16_t port, uint8_t flag); // Opens a socket(TCP or UDP or IP_RAW mode) 7 | extern void close(SOCKET s); // Close socket 8 | extern uint8_t connect(SOCKET s, uint8_t * addr, uint16_t port); // Establish TCP connection (Active connection) 9 | extern void disconnect(SOCKET s); // disconnect the connection 10 | extern uint8_t listen(SOCKET s); // Establish TCP connection (Passive connection) 11 | extern uint16_t send(SOCKET s, const uint8_t * buf, uint16_t len); // Send data (TCP) 12 | extern int16_t recv(SOCKET s, uint8_t * buf, int16_t len); // Receive data (TCP) 13 | extern uint16_t peek(SOCKET s, uint8_t *buf); 14 | extern uint16_t sendto(SOCKET s, const uint8_t * buf, uint16_t len, uint8_t * addr, uint16_t port); // Send data (UDP/IP RAW) 15 | extern uint16_t recvfrom(SOCKET s, uint8_t * buf, uint16_t len, uint8_t * addr, uint16_t *port); // Receive data (UDP/IP RAW) 16 | 17 | extern uint16_t igmpsend(SOCKET s, const uint8_t * buf, uint16_t len); 18 | 19 | // Functions to allow buffered UDP send (i.e. where the UDP datagram is built up over a 20 | // number of calls before being sent 21 | /* 22 | @brief This function sets up a UDP datagram, the data for which will be provided by one 23 | or more calls to bufferData and then finally sent with sendUDP. 24 | @return 1 if the datagram was successfully set up, or 0 if there was an error 25 | */ 26 | extern int startUDP(SOCKET s, uint8_t* addr, uint16_t port); 27 | /* 28 | @brief This function copies up to len bytes of data from buf into a UDP datagram to be 29 | sent later by sendUDP. Allows datagrams to be built up from a series of bufferData calls. 30 | @return Number of bytes successfully buffered 31 | */ 32 | uint16_t bufferData(SOCKET s, uint16_t offset, const uint8_t* buf, uint16_t len); 33 | /* 34 | @brief Send a UDP datagram built up from a sequence of startUDP followed by one or more 35 | calls to bufferData. 36 | @return 1 if the datagram was successfully sent, or 0 if there was an error 37 | */ 38 | int sendUDP(SOCKET s); 39 | 40 | #endif 41 | /* _SOCKET_H_ */ 42 | -------------------------------------------------------------------------------- /utility/HW_Eth_util.h: -------------------------------------------------------------------------------- 1 | #ifndef UTIL_H 2 | #define UTIL_H 3 | 4 | #define htons(x) ( ((x)<<8) | (((x)>>8)&0xFF) ) 5 | #define ntohs(x) htons(x) 6 | 7 | #define htonl(x) ( ((x)<<24 & 0xFF000000UL) | \ 8 | ((x)<< 8 & 0x00FF0000UL) | \ 9 | ((x)>> 8 & 0x0000FF00UL) | \ 10 | ((x)>>24 & 0x000000FFUL) ) 11 | #define ntohl(x) htonl(x) 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /utility/HW_Eth_w5500.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 by WIZnet 3 | * 4 | * This file is free software; you can redistribute it and/or modify 5 | * it under the terms of either the GNU General Public License version 2 6 | * or the GNU Lesser General Public License version 2.1, both as 7 | * published by the Free Software Foundation. 8 | */ 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | #include "HW_Eth_w5100.h" 15 | #if defined(W5500_ETHERNET_SHIELD) 16 | 17 | // W5500 controller instance 18 | W5500Class W5100; 19 | 20 | 21 | void W5500Class::init(void) 22 | { 23 | 24 | initSS(); 25 | delay(300); 26 | W5X00SPI.begin(); 27 | 28 | for (int i=0; i> 8); 101 | W5X00SPI.transfer(_addr & 0xFF); 102 | W5X00SPI.transfer(_cb); 103 | W5X00SPI.transfer(_data); 104 | resetSS(); 105 | return 1; 106 | } 107 | 108 | uint16_t W5500Class::write(uint16_t _addr, uint8_t _cb, const uint8_t *_buf, uint16_t _len) 109 | { 110 | setSS(); 111 | W5X00SPI.transfer(_addr >> 8); 112 | W5X00SPI.transfer(_addr & 0xFF); 113 | W5X00SPI.transfer(_cb); 114 | for (uint16_t i=0; i<_len; i++){ 115 | W5X00SPI.transfer(_buf[i]); 116 | } 117 | resetSS(); 118 | return _len; 119 | } 120 | 121 | uint8_t W5500Class::read(uint16_t _addr, uint8_t _cb) 122 | { 123 | setSS(); 124 | W5X00SPI.transfer(_addr >> 8); 125 | W5X00SPI.transfer(_addr & 0xFF); 126 | W5X00SPI.transfer(_cb); 127 | uint8_t _data = W5X00SPI.transfer(0); 128 | resetSS(); 129 | return _data; 130 | } 131 | 132 | uint16_t W5500Class::read(uint16_t _addr, uint8_t _cb, uint8_t *_buf, uint16_t _len) 133 | { 134 | setSS(); 135 | W5X00SPI.transfer(_addr >> 8); 136 | W5X00SPI.transfer(_addr & 0xFF); 137 | W5X00SPI.transfer(_cb); 138 | for (uint16_t i=0; i<_len; i++){ 139 | _buf[i] = W5X00SPI.transfer(0); 140 | } 141 | resetSS(); 142 | 143 | return _len; 144 | } 145 | 146 | void W5500Class::execCmdSn(SOCKET s, SockCMD _cmd) { 147 | // Send command to socket 148 | writeSnCR(s, _cmd); 149 | // Wait for command to complete 150 | while (readSnCR(s)) 151 | ; 152 | } 153 | #endif -------------------------------------------------------------------------------- /utility/HW_GSM_HWSerial.h: -------------------------------------------------------------------------------- 1 | #define MEGA 2 | 3 | #ifndef _HWSERIAL_H_ 4 | #define _HWSERIAL_H_ 5 | 6 | #include "Arduino.h" 7 | #include "HW_GSM_Streaming.h" 8 | #include 9 | #include "../IoTgo_config.h" 10 | 11 | class HWSerial { 12 | #ifdef MEGA 13 | private: 14 | int write_error; 15 | size_t printNumber(unsigned long, uint8_t); 16 | size_t printFloat(double, uint8_t); 17 | 18 | public: 19 | HWSerial(); 20 | 21 | //bool listen(); 22 | void end(); 23 | /* 24 | bool isListening(); 25 | bool overflow(); 26 | */ 27 | int peek(); 28 | virtual void begin(long baud_rate); 29 | 30 | virtual size_t write(uint8_t byte); 31 | size_t write(const char *str) { 32 | return write((const uint8_t *)str, strlen(str)); 33 | } 34 | virtual size_t write(const uint8_t *buffer, size_t size); 35 | 36 | virtual int read(); 37 | virtual int available(); 38 | virtual void flush(); 39 | 40 | size_t print(const __FlashStringHelper *); 41 | size_t print(const String &); 42 | size_t print(const char[]); 43 | size_t print(char); 44 | size_t print(unsigned char, int = DEC); 45 | size_t print(int, int = DEC); 46 | size_t print(unsigned int, int = DEC); 47 | size_t print(long, int = DEC); 48 | size_t print(unsigned long, int = DEC); 49 | size_t print(double, int = 2); 50 | 51 | 52 | size_t println(const __FlashStringHelper *); 53 | size_t println(const String &s); 54 | size_t println(const char[]); 55 | size_t println(char); 56 | size_t println(unsigned char, int = DEC); 57 | size_t println(int, int = DEC); 58 | size_t println(unsigned int, int = DEC); 59 | size_t println(long, int = DEC); 60 | size_t println(unsigned long, int = DEC); 61 | size_t println(double, int = 2); 62 | 63 | size_t println(void); 64 | 65 | int getString( char *pre_string, char *post_string, char *buffer, int length); 66 | boolean find(char *target); 67 | boolean findUntil(char *target, char *terminate); 68 | 69 | #endif 70 | 71 | }; 72 | #endif -------------------------------------------------------------------------------- /utility/HW_GSM_Instructions.txt: -------------------------------------------------------------------------------- 1 | *************************************************** 2 | GSM/GPRS/GPS Shield of Futura/Open-electronics 3 | 4 | http://www.open-electronics.org/ 5 | 6 | http://store.open-electronics.org/index.php?route=common/home 7 | 8 | *************************************************** 9 | 10 | 11 | 12 | 13 | 14 | *************************************************** 15 | For support use the issues' page on google code: 16 | 17 | http://code.google.com/p/gsm-shield-arduino/issues/ 18 | 19 | or Arduino Forum 20 | 21 | *************************************************** 22 | 23 | 24 | 25 | 26 | 27 | *************************************************** 28 | Library created by: 29 | 30 | Marco Martines 31 | 32 | martines[ dot ]marco[ at ]gmail[ dot ]com 33 | *************************************************** 34 | 35 | 36 | 37 | 38 | [1] How to switch between Arduino Mega and Arduino Uno? 39 | 40 | 1) 41 | Open HW_GSM_GSM.h and comment-decomment the appropriate lines like below 42 | e.g. for Arduino Mega 43 | //#define UNO 44 | #define MEGA 45 | 46 | 2) 47 | If you use Arduino Uno comment the line in HW_GSM_HWSerial.h or decomment if 48 | you are using Arduino Mega 49 | e.g. for Arduino Mega 50 | #define MEGA 51 | 52 | 3) 53 | Save and compile 54 | 55 | [2] How to switch between the old shield (that uses 4 and 5 pins for 56 | SoftwareSerial and the new (that used 2 and 3 pins)? 57 | 58 | 1) 59 | Open GSM.cpp and comment-decomment the appropriate lines like below 60 | e.g. for the new one 61 | 62 | //#define _GSM_TXPIN_ 4 63 | //#define _GSM_RXPIN_ 5 64 | #define _GSM_TXPIN_ 2 65 | #define _GSM_RXPIN_ 3 66 | 67 | 2) 68 | Save and compile 69 | 70 | [3] My shield doesn't work. Why? 71 | 72 | Check this steps and then ask for support on the issues' page on google 73 | code. 74 | 75 | 1) SIM900 and SIM908 require about 1 A during the hardest tasks. 76 | You should have an external power source that can provide about 77 | 1 A at 8-12 V 78 | 79 | 2) If the SIM90X blinks (1 Hz) for some seconds and then turn off, 80 | probably it's a communication's problem. Check the switch/jumpers 81 | for Serial communication. 82 | 83 | 3) Arduino Uno has 2 KB of RAM. Library takes about 80% (we are working 84 | to reduce it), if you use more than 20% left, Arduino can restart 85 | or print on serial strange strings. 86 | 87 | 4) Check the jumper of communication, power source (battery or externel) and charge. -------------------------------------------------------------------------------- /utility/HW_GSM_LOG.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | LOG.cpp - Library for standard logging convention. 3 | Created by Meir Michanie, June 9, 2010. 4 | Released into the public domain. 5 | Version 0.1 6 | */ 7 | 8 | #include "HW_GSM_LOG.h" 9 | 10 | LOG::LOG(int level) 11 | { 12 | setLevel(level); 13 | } 14 | 15 | void LOG::DATA(const char* string) 16 | { 17 | if (_level > 4) { 18 | DebugSerial.print(string); 19 | } 20 | } 21 | 22 | void LOG::DATA(int number) 23 | { 24 | if (_level > 4) { 25 | DebugSerial.print(number); 26 | } 27 | } 28 | 29 | void LOG::DEBUG(const char* string) 30 | { 31 | if (_level > 3) { 32 | DebugSerial.print("\n[DEBUG]: "); 33 | DebugSerial.println(string); 34 | } 35 | } 36 | 37 | void LOG::INFO(const char* string) 38 | { 39 | if (_level > 2) { 40 | DebugSerial.print("\n[INFO]: "); 41 | DebugSerial.println(string); 42 | } 43 | } 44 | 45 | void LOG::WARNING(const char* string) 46 | { 47 | if (_level > 1) { 48 | DebugSerial.print("\n[WARNING]: "); 49 | DebugSerial.println(string); 50 | } 51 | } 52 | 53 | void LOG::CRITICAL(const char* string) 54 | { 55 | if (_level > 0) { 56 | DebugSerial.print("\n[CRITICAL]: "); 57 | DebugSerial.println(string); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /utility/HW_GSM_LOG.h: -------------------------------------------------------------------------------- 1 | /* 2 | LOG.h - Library for standard logging convention. 3 | Created by Meir Michanie, June 9, 2010. 4 | Released into the public domain. 5 | Version 0.1 6 | */ 7 | 8 | #ifndef LOG_h 9 | #define LOG_h 10 | #include "Arduino.h" 11 | #include "../IoTgo_config.h" 12 | 13 | class LOG { 14 | public: 15 | LOG(int level); 16 | void DEBUG(const char* string); 17 | void INFO(const char* string); 18 | void WARNING(const char* string); 19 | void CRITICAL(const char* string); 20 | void DATA(const char* string); 21 | void DATA(int number); 22 | 23 | inline int getLevel(void) { 24 | return _level; 25 | } 26 | inline void setLevel(int level) { 27 | _level = level; 28 | } 29 | 30 | private: 31 | int _level; 32 | }; 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /utility/HW_GSM_SIM900.h: -------------------------------------------------------------------------------- 1 | #ifndef SIMCOM900_H 2 | #define SIMCOM900_H 3 | #include 4 | #include "HW_GSM_HWSerial.h" 5 | #include "HW_GSM_GSM.h" 6 | class SIMCOM900 : public virtual GSM { 7 | 8 | private: 9 | int configandwait(char* pin); 10 | int setPIN(char *pin); 11 | int changeNSIPmode(char); 12 | 13 | public: 14 | SIMCOM900(); 15 | ~SIMCOM900(); 16 | int getCCI(char* cci); 17 | int getIMEI(char* imei); 18 | int sendSMS(const char* to, const char* msg); 19 | boolean readSMS(char* msg, int msglength, char* number, int nlength); 20 | boolean readCall(char* number, int nlength); 21 | boolean call(char* number, unsigned int milliseconds); 22 | char forceON(); 23 | virtual int read(char* result, int resultlength); 24 | virtual uint8_t read(); 25 | virtual int available(); 26 | int readCellData(int &mcc, int &mnc, long &lac, long &cellid); 27 | void SimpleRead(); 28 | void WhileSimpleRead(); 29 | void SimpleWrite(char *comm); 30 | void SimpleWrite(char const *comm); 31 | void SimpleWrite(int comm); 32 | void SimpleWrite(const __FlashStringHelper *pgmstr); 33 | void SimpleWriteln(char *comm); 34 | void SimpleWriteln(char const *comm); 35 | void SimpleWriteln(const __FlashStringHelper *pgmstr); 36 | void SimpleWriteln(int comm); 37 | }; 38 | 39 | extern SIMCOM900 gsm; 40 | 41 | #endif 42 | 43 | -------------------------------------------------------------------------------- /utility/HW_GSM_Streaming.h: -------------------------------------------------------------------------------- 1 | /* 2 | Streaming.h - Arduino library for supporting the << streaming operator 3 | Copyright (c) 2010 Mikal Hart. All rights reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef ARDUINO_STREAMING 21 | #define ARDUINO_STREAMING 22 | 23 | #include 24 | #include "HW_GSM_LOG.h" 25 | 26 | #define __ST_LOG_LEVEL 3 27 | static LOG _st_logme(__ST_LOG_LEVEL); 28 | 29 | // Generic template 30 | template 31 | inline Print &operator <<(Print &stream, T arg) 32 | { 33 | stream.print(arg); 34 | _st_logme.DATA(arg); 35 | return stream; 36 | } 37 | 38 | struct _BASED { 39 | long val; 40 | int base; 41 | _BASED(long v, int b): val(v), base(b) 42 | {} 43 | }; 44 | 45 | #define _HEX(a) _BASED(a, HEX) 46 | #define _DEC(a) _BASED(a, DEC) 47 | #define _OCT(a) _BASED(a, OCT) 48 | #define _BIN(a) _BASED(a, BIN) 49 | 50 | // Specialization for class _BASED 51 | // Thanks to Arduino forum user Ben Combee who suggested this 52 | // clever technique to allow for expressions like 53 | // DebugSerial << _HEX(a); 54 | 55 | inline Print &operator <<(Print &obj, const _BASED &arg) 56 | { 57 | obj.print(arg.val); 58 | return obj; 59 | } 60 | 61 | #if ARDUINO >= 18 62 | // Specialization for class _FLOAT 63 | // Thanks to Michael Margolis for suggesting a way 64 | // to accommodate Arduino 0018's floating point precision 65 | // feature like this: 66 | // DebugSerial << _FLOAT(gps_latitude, 6); // 6 digits of precision 67 | 68 | struct _FLOAT { 69 | float val; 70 | int digits; 71 | _FLOAT(double v, int d): val(v), digits(d) 72 | {} 73 | }; 74 | 75 | inline Print &operator <<(Print &obj, const _FLOAT &arg) 76 | { 77 | obj.print(arg.val, arg.digits); 78 | return obj; 79 | } 80 | #endif 81 | 82 | // Specialization for enum _EndLineCode 83 | // Thanks to Arduino forum user Paul V. who suggested this 84 | // clever technique to allow for expressions like 85 | // DebugSerial << "Hello!" << endl; 86 | 87 | enum _EndLineCode { endl }; 88 | 89 | inline Print &operator <<(Print &obj, _EndLineCode arg) 90 | { 91 | obj.println(); 92 | return obj; 93 | } 94 | 95 | #endif 96 | -------------------------------------------------------------------------------- /utility/HW_GSM_WideTextFinder.h: -------------------------------------------------------------------------------- 1 | #ifndef WideTextFinder_h 2 | #define WideTextFinder_h 3 | 4 | //#include 5 | #include 6 | #include 7 | 8 | 9 | class WideTextFinder { 10 | private: 11 | SoftwareSerial* nSerialStream; 12 | 13 | unsigned long timeout; // number of seconds to wait for the next char before aborting read 14 | unsigned long startMillis; // used for timeout measurement 15 | boolean debug; 16 | 17 | char read(); // private function to read from the stream 18 | 19 | public: 20 | // constructor: 21 | // default timeout is 5 seconds 22 | WideTextFinder(SoftwareSerial &stream, int timeout = 5); // Ethernet constructor 23 | 24 | // Manage debug 25 | void setDebug(boolean d); 26 | 27 | // find methods - these seek through the data but do not return anything 28 | // they are useful to skip past unwanted data 29 | // 30 | boolean find(char *target); // reads data from the stream until the target string is found 31 | // returns true if target string is found 32 | 33 | boolean findUntil(char *target, char *terminate); // as above but search ends if the terminate string is found 34 | 35 | 36 | // get methods - these get a numeric value or string from the data stream 37 | // 38 | long getValue(); // returns the first valid (long) integer value from the current position. 39 | // initial characters that are not digits (or the minus sign) are skipped 40 | // integer is terminated by the first character that is not a digit. 41 | 42 | long getValue(char skipChar); // as above but the given skipChar is ignored 43 | // this allows format characters (typically commas) in values to be ignored 44 | 45 | float getFloat(); // float version of getValue 46 | float getFloat(char skipChar); // as above but the given skipChar is ignored 47 | 48 | int getString( char *pre_string, char *post_string, char *buffer, int length); //puts string found between given delimiters in buffer 49 | // string will be truncated to fit the buffer length 50 | // end of string determined by a match of a character to the first char of close delimiter 51 | // returns the number of characters placed in the buffer (0 means no valid data found) 52 | 53 | unsigned long getTimeout(); // returns the number of seconds to wait for the next char before aborting read 54 | 55 | // set methods 56 | // 57 | void setTimeout(unsigned long timeout); // set a new value for the wait timeout 58 | 59 | }; 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /utility/HW_GSM_call.h: -------------------------------------------------------------------------------- 1 | #ifndef _CALL_H_ 2 | #define _CALL_H_ 3 | 4 | #include "HW_GSM_SIM900.h" 5 | 6 | class CallGSM { 7 | public: 8 | // finds out the status of call 9 | byte CallStatus(void); 10 | byte CallStatusWithAuth(char *phone_number, 11 | byte first_authorized_pos, byte last_authorized_pos); 12 | // picks up an incoming call 13 | void PickUp(void); 14 | // hangs up an incomming call 15 | void HangUp(void); 16 | // calls the specific number 17 | void Call(char *number_string); 18 | // makes a call to the number stored at the specified SIM position 19 | void Call(int sim_position); 20 | void SendDTMF(char *number_string, int time); 21 | 22 | void SetDTMF(int DTMF_status); 23 | char DetDTMF(); 24 | 25 | }; 26 | 27 | #endif 28 | 29 | -------------------------------------------------------------------------------- /utility/HW_GSM_gps.h: -------------------------------------------------------------------------------- 1 | #ifndef _GPS_H_ 2 | #define _GPS_H_ 3 | 4 | #include "HW_GSM_SIM900.h" 5 | 6 | class GPSGSM { 7 | public: 8 | char getBattInf(char *str_perc, char *str_vol); 9 | char getBattTVol(char *str_vol); 10 | char attachGPS(); 11 | char deattachGPS(); 12 | char getStat(); 13 | char getPar(char *str_long, char *str_lat, char *str_alt, char *str_time, char *speed); 14 | void parseTime(char *field, int *time); 15 | double convertLat(void); 16 | double convertLong(void); 17 | }; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /utility/HW_GSM_inetGSM.h: -------------------------------------------------------------------------------- 1 | #ifndef _INETGSM_H_ 2 | #define _INETGSM_H_ 3 | 4 | #define BUFFERSIZE 1 5 | 6 | #include "HW_GSM_SIM900.h" 7 | 8 | class InetGSM { 9 | private: 10 | char _buffer[BUFFERSIZE]; 11 | 12 | public: 13 | int httpGET(const char* server, int port, const char* path, char* result, int resultlength); 14 | int httpPOST(const char* server, int port, const char* path, const char* parameters, char* result, int resultlength); 15 | 16 | // Fast and dirty solution. Should make a "mail" object. And by the moment it does not run. 17 | int openmail(char* server, char* loginbase64, char* passbase64, char* from, char* to, char* subj); 18 | int closemail(); 19 | int attachGPRS(char* domain, char* dom1, char* dom2); 20 | int dettachGPRS(); 21 | int connectTCP(const char* server, int port); 22 | int disconnectTCP(); 23 | int connectTCPServer(int port); 24 | boolean connectedClient(); 25 | 26 | // This runs, yes 27 | //int tweet(const char* token, const char* msg); 28 | 29 | }; 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /utility/HW_GSM_sms.h: -------------------------------------------------------------------------------- 1 | #ifndef _SMS_H_ 2 | #define _SMS_H_ 3 | 4 | #include "HW_GSM_SIM900.h" 5 | 6 | class SMSGSM { 7 | public: 8 | // SMS's methods 9 | char SendSMS(char *number_str, char *message_str); 10 | char SendSMS(byte sim_phonebook_position, char *message_str); 11 | char IsSMSPresent(byte required_status); 12 | char GetSMS(byte position, char *phone_number, char *SMS_text, byte max_SMS_len); 13 | 14 | char GetAuthorizedSMS(byte position, char *phone_number, char *SMS_text, byte max_SMS_len, 15 | byte first_authorized_pos, byte last_authorized_pos); 16 | char DeleteSMS(byte position); 17 | 18 | }; 19 | 20 | #endif 21 | 22 | -------------------------------------------------------------------------------- /utility/HW_SHT1x.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file HW_SHT1x.h 3 | * 4 | * SHT1x Library 5 | * 6 | * Copyright 2009 Jonathan Oxer / 7 | * Based on previous work by: 8 | * Maurice Ribble: 9 | * Wayne ?: 10 | * 11 | * Manages communication with SHT1x series (SHT10, SHT11, SHT15) 12 | * temperature / humidity sensors from Sensirion (www.sensirion.com). 13 | */ 14 | #ifndef __SHT1X_H__ 15 | #define __SHT1X_H__ 16 | 17 | #if (ARDUINO >= 100) 18 | #include 19 | #else 20 | #include 21 | #endif 22 | 23 | #include "Dev_THSensorInterface.h" 24 | 25 | 26 | /** 27 | * SHT1x implements THSensorInterface. 28 | * 29 | * @ingroup THSensorInterface 30 | */ 31 | class SHT1x : public THSensorInterface 32 | { 33 | public: /* Constructors */ 34 | SHT1x(int dataPin, int clockPin); 35 | 36 | public: /* Implementation of methods in THSensorInterface */ 37 | virtual int32_t begin(void) 38 | { 39 | /* Nothing to do */ 40 | return 0; 41 | } 42 | virtual int32_t getData(float *temp_c, float *temp_f, float *hum) 43 | { 44 | if (temp_c) 45 | *temp_c = readTemperatureC(); 46 | if (temp_f) 47 | *temp_f = readTemperatureF(); 48 | if (hum) 49 | *hum = readHumidity(); 50 | return 0; 51 | } 52 | virtual int32_t end(void) 53 | { 54 | /* Nothing to do */ 55 | return 0; 56 | } 57 | 58 | 59 | private: 60 | float readHumidity(); 61 | float readTemperatureC(); 62 | float readTemperatureF(); 63 | 64 | private: 65 | int _dataPin; 66 | int _clockPin; 67 | int _numBits; 68 | float readTemperatureRaw(); 69 | int shiftIn(int _dataPin, int _clockPin, int _numBits); 70 | void sendCommandSHT(int _command, int _dataPin, int _clockPin); 71 | void waitForResultSHT(int _dataPin); 72 | int getData16SHT(int _dataPin, int _clockPin); 73 | void skipCrcSHT(int _dataPin, int _clockPin); 74 | }; 75 | 76 | #endif /* #ifndef __SHT1X_H__ */ 77 | --------------------------------------------------------------------------------