libs/iwinfo: add dummy module for the sdk, use dummy on Darwin
authorJo-Philipp Wich <jow@openwrt.org>
Mon, 10 Aug 2009 13:33:00 +0000 (13:33 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Mon, 10 Aug 2009 13:33:00 +0000 (13:33 +0000)
libs/iwinfo/Makefile
libs/iwinfo/src/dummy.lua [new file with mode: 0644]

index 7f4585e5b8242e6876f2f5ff35a3fa0399d450fb..77299471d0017d2f59f2f5991329b37543676917 100644 (file)
@@ -9,15 +9,22 @@ endif
 IWINFO_LDFLAGS    =
 IWINFO_CFLAGS     = -fstrict-aliasing
 IWINFO_SO         = iwinfo.so
+IWINFO_LUA        = iwinfo.lua
 IWINFO_OBJ        = src/iwinfo_wl.o src/iwinfo_madwifi.o src/iwinfo_wext.o src/iwinfo_lualib.o
 
 %.o: %.c
        $(COMPILE) $(IWINFO_CFLAGS) $(LUA_CFLAGS) $(FPIC) -c -o $@ $< 
 
+ifeq ($(OS),Linux)
 compile: clean $(IWINFO_OBJ)
        $(LINK) $(SHLIB_FLAGS) $(IWINFO_LDFLAGS) -o src/$(IWINFO_SO) $(IWINFO_OBJ)
        mkdir -p dist$(LUA_LIBRARYDIR)
        cp src/$(IWINFO_SO) dist$(LUA_LIBRARYDIR)/$(IWINFO_SO)
+else
+compile: clean
+       mkdir -p dist$(LUA_LIBRARYDIR)
+       cp src/dummy.lua dist$(LUA_LIBRARYDIR)/$(IWINFO_LUA)
+endif
 
 install: build
        cp -pR dist$(LUA_LIBRARYDIR)/* $(LUA_LIBRARYDIR)
diff --git a/libs/iwinfo/src/dummy.lua b/libs/iwinfo/src/dummy.lua
new file mode 100644 (file)
index 0000000..5199893
--- /dev/null
@@ -0,0 +1,55 @@
+module "iwinfo"
+
+function type()
+       return "dummy"
+end
+
+dummy = {}
+
+function dummy.channel()
+       return 1
+end
+
+function dummy.frequency()
+       return 2412
+end
+
+function dummy.bitrate()
+       return 36
+end
+
+function dummy.signal()
+       return -53
+end
+
+function dummy.noise()
+       return -96
+end
+
+function dummy.quality()
+       return 11
+end
+
+function dummy.quality_max()
+       return 70
+end
+
+function dummy.mode()
+       return "Master"
+end
+
+function dummy.ssid()
+       return "OpenWrt"
+end
+
+function dummy.bssid()
+       return "00:11:22:33:44:55"
+end
+
+function dummy.enctype()
+       return "WPA2 PSK (CCMP)"
+end
+
+function dummy.assoclist()
+       return {}
+end