![](/media/cache/profiles/56f9e53c06985234d40a35145c1a919e.jpg.50x50_q85.jpg)
seeedstudio ARCH GPRS Test for GPRS function
Fork of ARCH_GPRS_Demo by
ARCH GPRS Introduction
- Arch GPRS is a wireless network module based on EG-10, it can achive remote data colletion function to communicate with outside world by GPRS network.
- Arch GPRS has standard Arduino interface and Grove connectors. It’s convenient to connect existing Shields and Grove products to Arch GPRS.
- You can use the solar panel to charge for battery, and own to its low-power design, so Arch GPRS can work normally in outdoor.
- For more information, please visit http://www.seeedstudio.com/depot/arch-gprs-p-1657.html?cPath=6_11
main.cpp
/* main.cpp 2013 Copyright (c) Seeed Technology Inc. All right reserved. Author:lawliet zou(lawliet.zou@gmail.com) 2013-7-21 This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "mbed.h" #include "string.h" #include "gprs.h" #define SEND_SMS_TEST 0 #define CALL_UP_TEST 0 #define ANSWER_TEST 0 #define READ_SMS_TEST 0 #define PHONE_NUMBER "150****9566" #define PINPWR P1_2 // power on EG 10, low enable #define PINONOFF P1_7 // switch of EG10, low enable, low for 2s to turn on EG10 DigitalOut eg10_pwr(PINPWR); DigitalOut eg10_on(PINONOFF); GPRS gprsTest(P0_19, P0_18, 115200, PHONE_NUMBER); void EG10_PowerUp(void) { eg10_pwr = 1; eg10_on = 1; wait(2); eg10_pwr = 0; eg10_on = 0; wait(2); eg10_on = 1; wait(2); } int main(void) { EG10_PowerUp(); while(0 != gprsTest.init()) { wait(2); } #if CALL_UP_TEST gprsTest.callUp(PHONE_NUMBER); #endif #if SEND_SMS_TEST gprsTest.sendSMS(PHONE_NUMBER,"hello,lawliet"); #endif #if ANSWER_TEST || READ_SMS_TEST while(1) { int messageType = gprsTest.loopHandle(); if(MESSAGE_RING == messageType) { gprsTest.answer(); } else if(MESSAGE_SMS == messageType) { char smsMessage[SMS_MAX_LENGTH]; gprsTest.getSMS(smsMessage); } } #endif return 0; }
ARCH_GPRS_HW/ARCH_GPRS_HW_DFS.h@0:6d297fe482af, 2013-08-23 (annotated)
- Committer:
- loovee
- Date:
- Fri Aug 23 02:31:06 2013 +0000
- Revision:
- 0:6d297fe482af
seeedstudio Arch Gprs Demo. ; ; post data to yeelink.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
loovee | 0:6d297fe482af | 1 | /* |
loovee | 0:6d297fe482af | 2 | IOT_hw_dfs.h |
loovee | 0:6d297fe482af | 3 | 2013 Copyright (c) Seeed Technology Inc. All right reserved. |
loovee | 0:6d297fe482af | 4 | |
loovee | 0:6d297fe482af | 5 | Author:Loovee |
loovee | 0:6d297fe482af | 6 | 2013-7-21 |
loovee | 0:6d297fe482af | 7 | |
loovee | 0:6d297fe482af | 8 | This library is free software; you can redistribute it and/or |
loovee | 0:6d297fe482af | 9 | modify it under the terms of the GNU Lesser General Public |
loovee | 0:6d297fe482af | 10 | License as published by the Free Software Foundation; either |
loovee | 0:6d297fe482af | 11 | version 2.1 of the License, or (at your option) any later version. |
loovee | 0:6d297fe482af | 12 | |
loovee | 0:6d297fe482af | 13 | This library is distributed in the hope that it will be useful, |
loovee | 0:6d297fe482af | 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
loovee | 0:6d297fe482af | 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
loovee | 0:6d297fe482af | 16 | Lesser General Public License for more details. |
loovee | 0:6d297fe482af | 17 | |
loovee | 0:6d297fe482af | 18 | You should have received a copy of the GNU Lesser General Public |
loovee | 0:6d297fe482af | 19 | License along with this library; if not, write to the Free Software |
loovee | 0:6d297fe482af | 20 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
loovee | 0:6d297fe482af | 21 | */ |
loovee | 0:6d297fe482af | 22 | |
loovee | 0:6d297fe482af | 23 | #ifndef __ARCH_GPRS_HW_DFS_H__ |
loovee | 0:6d297fe482af | 24 | #define __ARCH_GPRS_HW_DFS_H__ |
loovee | 0:6d297fe482af | 25 | |
loovee | 0:6d297fe482af | 26 | // pin define |
loovee | 0:6d297fe482af | 27 | #define PINPWR P1_2 // power on EG 10, low enable |
loovee | 0:6d297fe482af | 28 | #define PINONOFF P1_7 // switch of EG10, low enable, low for 2s to turn on EG10 |
loovee | 0:6d297fe482af | 29 | #define PINTX P0_18 // EG10 TX |
loovee | 0:6d297fe482af | 30 | #define PINRX P0_19 // EG10 RX |
loovee | 0:6d297fe482af | 31 | #define PINSYSRST P1_6 // EG10 RST,high enable |
loovee | 0:6d297fe482af | 32 | #define PINEGSTATE P1_15 // in and out, read eg10 state, HIGH: on, LOW: off |
loovee | 0:6d297fe482af | 33 | |
loovee | 0:6d297fe482af | 34 | |
loovee | 0:6d297fe482af | 35 | // grove pin |
loovee | 0:6d297fe482af | 36 | #define GROVE_I2C_SCL P0_4 // grove i2c pin |
loovee | 0:6d297fe482af | 37 | #define GROVE_I2C_SDA P0_5 // grove i2c sda |
loovee | 0:6d297fe482af | 38 | |
loovee | 0:6d297fe482af | 39 | #define GROVE_UART_RX P0_14 // grove uart rx |
loovee | 0:6d297fe482af | 40 | #define GROVE_UART_TX P0_13 // grove uart tx |
loovee | 0:6d297fe482af | 41 | |
loovee | 0:6d297fe482af | 42 | #define GROVE_ADC_1 P0_12 // grove ADC, the outside one |
loovee | 0:6d297fe482af | 43 | #define GROVE_ADC_2 P0_11 // grove ADC, the other one |
loovee | 0:6d297fe482af | 44 | |
loovee | 0:6d297fe482af | 45 | #define GROVE_PWR P1_3 // control all grove power, low enable |
loovee | 0:6d297fe482af | 46 | |
loovee | 0:6d297fe482af | 47 | // charge circuit |
loovee | 0:6d297fe482af | 48 | #define PIN_CHRGING P1_1 // charging, low enable |
loovee | 0:6d297fe482af | 49 | #define PIN_CHRGDONE P1_0 // charge done |
loovee | 0:6d297fe482af | 50 | #define PIN_READBAT P0_23 // battery voltage in, the value should x2 |
loovee | 0:6d297fe482af | 51 | |
loovee | 0:6d297fe482af | 52 | // led pin |
loovee | 0:6d297fe482af | 53 | #define PINLED1 P1_8 |
loovee | 0:6d297fe482af | 54 | #define PINLED2 P1_9 |
loovee | 0:6d297fe482af | 55 | #define PINLED3 P1_10 |
loovee | 0:6d297fe482af | 56 | #define PINLED4 P1_11 |
loovee | 0:6d297fe482af | 57 | |
loovee | 0:6d297fe482af | 58 | // charge state |
loovee | 0:6d297fe482af | 59 | #define CHRGING 1 |
loovee | 0:6d297fe482af | 60 | #define CHRGDONE 2 |
loovee | 0:6d297fe482af | 61 | #define NOCHRG 3 |
loovee | 0:6d297fe482af | 62 | |
loovee | 0:6d297fe482af | 63 | #endif |
loovee | 0:6d297fe482af | 64 | |
loovee | 0:6d297fe482af | 65 | /********************************************************************************************************* |
loovee | 0:6d297fe482af | 66 | END FILE |
loovee | 0:6d297fe482af | 67 | *********************************************************************************************************/ |