1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-11-10 12:50:16 +02:00

add gcom to trunk too (closes: #333).

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@3792 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
nico 2006-05-17 01:37:51 +00:00
parent 33ac34cace
commit 151ad3e398
10 changed files with 207 additions and 0 deletions

View File

@ -300,6 +300,7 @@ endmenu
menu "Utilities" menu "Utilities"
source "package/bc/Config.in" source "package/bc/Config.in"
source "package/gcom/Config.in"
source "package/gdbserver/Config.in" source "package/gdbserver/Config.in"
source "package/hdparm/Config.in" source "package/hdparm/Config.in"
source "package/pcmcia-cs/Config.in" # pcmcia-utils source "package/pcmcia-cs/Config.in" # pcmcia-utils

View File

@ -59,6 +59,7 @@ package-$(BR2_PACKAGE_FREERADIUS) += freeradius
package-$(BR2_COMPILE_FREETYPE) += freetype package-$(BR2_COMPILE_FREETYPE) += freetype
package-$(BR2_PACKAGE_FRICKIN) += frickin package-$(BR2_PACKAGE_FRICKIN) += frickin
package-$(BR2_COMPILE_FUSE) += fuse package-$(BR2_COMPILE_FUSE) += fuse
package-$(BR2_PACKAGE_GCOM) += gcom
package-$(BR2_PACKAGE_GDBSERVER) += gdbserver package-$(BR2_PACKAGE_GDBSERVER) += gdbserver
package-$(BR2_COMPILE_GLIB) += glib package-$(BR2_COMPILE_GLIB) += glib
package-$(BR2_PACKAGE_GMEDIASERVER) += gmediaserver package-$(BR2_PACKAGE_GMEDIASERVER) += gmediaserver

View File

@ -0,0 +1,11 @@
config BR2_PACKAGE_GCOM
prompt "gcom.............................. Option/Vodafone 3G/GPRS control tool"
tristate
default m
help
Option GlobeTrotter GPRS/EDGE/3G/HSDPA and Vodafone 3G/GPRS datacard control tool
gcom is a scripting language interpreter useful for establishing communications
on serial lines and through PCMCIA modems as well as GPRS and 3G datacards.
http://www.pharscape.org/content/view/46/70/

View File

@ -0,0 +1,49 @@
# $Id$
include $(TOPDIR)/rules.mk
PKG_NAME:=gcom
PKG_VERSION:=0.3
PKG_RELEASE:=1
PKG_MD5SUM:=cd32663025ed94a0ee623a689989f3c3
PKG_SOURCE_URL:=http://www.pharscape.org/3G/gcom
PKG_SOURCE:=$(PKG_NAME)$(PKG_VERSION).tgz
PKG_CAT:=zcat
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
include $(TOPDIR)/package/rules.mk
$(eval $(call PKG_template,GCOM,$(PKG_NAME),$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
$(PKG_BUILD_DIR)/.prepared:
rm -rf $(PKG_BUILD_DIR)
mkdir -p $(PKG_BUILD_DIR)
# the .tgz is different - no subdirectory, so do this manually
zcat $(DL_DIR)/$(PKG_SOURCE) | tar -C $(PKG_BUILD_DIR) $(TAR_OPTIONS) -
if [ -d ./patches ]; then $(PATCH) $(PKG_BUILD_DIR) ./patches ; fi
touch $@
$(PKG_BUILD_DIR)/.configured:
touch $@
$(PKG_BUILD_DIR)/.built:
$(MAKE) -C $(PKG_BUILD_DIR) \
CC="$(TARGET_CC)" \
CFLAGS="$(TARGET_CFLAGS)" \
gcom
touch $@
$(IPKG_GCOM):
install -d -m0755 $(IDIR_GCOM)/usr/bin
install -m0755 $(PKG_BUILD_DIR)/gcom $(IDIR_GCOM)/usr/bin/
install -d -m0755 $(IDIR_GCOM)/etc/gcom
install -m0644 ./files/setpin.gcom $(IDIR_GCOM)/etc/gcom/setpin.gcom
install -m0644 ./files/setmode.gcom $(IDIR_GCOM)/etc/gcom/setmode.gcom
install -m0644 ./files/getcardinfo.gcom $(IDIR_GCOM)/etc/gcom/getcardinfo.gcom
install -m0644 ./files/getstrength.gcom $(IDIR_GCOM)/etc/gcom/getstrength.gcom
$(RSTRIP) $(IDIR_GCOM)
$(IPKG_BUILD) $(IDIR_GCOM) $(PACKAGE_DIR)

View File

@ -0,0 +1,14 @@
opengt
set com 115200n81
set comecho off
set senddelay 0.02
waitquiet 0.2 0.2
flash 0.1
:start
send "ATI^m"
get 1 "" $s
print $s
:continue
exit 0

View File

@ -0,0 +1,14 @@
opengt
set com 115200n81
set comecho off
set senddelay 0.02
waitquiet 0.2 0.2
flash 0.1
:start
send "AT+CSQ^m"
get 1 "" $s
print $s
:continue
exit 0

View File

@ -0,0 +1,26 @@
# set wwan mode from environment
opengt
set com 115200n81
set senddelay 0.02
waitquiet 1 0.2
flash 0.1
:start
print "Trying to set mode\n"
send $env("MODE")
send "^m"
waitfor 15 "OK","ERR","ERROR"
if % = 0 goto continue
if % = 1 goto modeerror
if % = 2 goto modeerror
print "Timeout setting WWAN mode!\n"
exit 1
:modeerror
print "Error setting WWAN mode!\n"
exit 1
:continue
exit 0

View File

@ -0,0 +1,55 @@
# set pin code from evnironment "$PINCODE"
opengt
set com 115200n81
set senddelay 0.05
waitquiet 3 0.5
flash 0.1
let c=0
:start
send "AT+CPIN?^m"
waitfor 15 "SIM PUK","SIM PIN","READY","ERROR","ERR"
if % = -1 goto timeout
if % = 0 goto ready
if % = 1 goto setpin
if % = 2 goto ready
if % = 3 goto checkrepeat
if % = 4 goto checkrepeat
:checkrepeat
inc c
if c>3 goto pinerror
waitquiet 12 0.5
goto start
:timeout
print "timeout checking for PIN."
exit 1
:ready
print "SIM ready\n"
goto continue
exit 0
:setpin
# check if output was "SIM PIN2", that's ok.
waitfor 1 "2"
if % = 0 goto ready
print "Trying to set PIN\n"
send "AT+CPIN=\""
send $env("PINCODE")
send "\"^m"
waitfor 20 "OK","ERR"
if % = -1 goto pinerror
if % = 0 goto continue
if % = 1 goto pinerror
:pinerror
print "Error setting PIN, check card manually\n"
exit 1
:continue
print "PIN set successfully\n"
exit 0

View File

@ -0,0 +1,4 @@
Package: gcom
Priority: optional
Section: console
Description: Option GlobeTrotter GPRS/EDGE/3G/HSDPA and Vodafone 3G/GPRS datacard control tool

View File

@ -0,0 +1,32 @@
--- gcom-0.3.x/Makefile 2006-01-04 17:05:28.000000000 +0200
+++ gcom-0.3/Makefile 2006-02-26 13:02:07.000000000 +0200
@@ -20,8 +20,6 @@
#
# $Id$
#
-LIB = -L/usr/local/lib
-INC = -I/usr/local/include
EXE = /usr/local/bin
MAN = /usr/share/man/man1
CPROG = gcom
@@ -29,9 +27,6 @@
BIN = $(CPROG) $(SCRIPT)
MANP = gcom.1 sigmon.1
-CFLAGS = -c
-LDFLAGS =
-
all: $(BIN)
install:
@@ -53,8 +48,8 @@
gcom: gcom.o
- cc gcom.o $(LDFLAGS) -o gcom
+ $(CC) gcom.o $(LDFLAGS) -o gcom
gcom.o: gcom.c gcom.h
- cc gcom.c $(CFLAGS)
+ $(CC) -c $(CFLAGS) gcom.c