Skip to content

Commit

Permalink
add "wificonf", a command line tool to read/write mtk wifi profile.
Browse files Browse the repository at this point in the history
Usage:
    wificonf [option] use <profile>
    wificonf [option] get <key>
    wificonf [option] get <key> [idx]
    wificonf [option] set <key> <value>
    wificonf [option] set <key> <idx> <value>
  • Loading branch information
Nossiac committed Feb 10, 2018
1 parent 4d4c138 commit 91dfb94
Show file tree
Hide file tree
Showing 3 changed files with 723 additions and 0 deletions.
57 changes: 57 additions & 0 deletions applications/wificonf/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#
# Hua Shao <[email protected]>
#
#

include $(TOPDIR)/rules.mk

PKG_NAME:=wificonf
PKG_RELEASE:=1

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
PKG_CONFIG_DEPENDS:=

PKG_MAINTAINER:=Hua Shao <[email protected]>

include $(INCLUDE_DIR)/package.mk

define Package/wificonf
SECTION:=MTK Properties
CATEGORY:=MTK Properties
TITLE:=Read/Write MTK WiFi profiles
DEPENDS:=
SUBMENU:=Applications
MENU:=1
endef

define Package/wificonf/description
Read/Write MTK WiFi profiles
endef

define Package/wificonf/config
if PACKAGE_wificonf
config SUPPORT_LSDK_NVRAM_CMD
bool "Provide compatible usage for LSDK nvram command"
default n
endif
endef

define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
make -C src clean
$(CP) ./src/* $(PKG_BUILD_DIR)/
endef

TARGET_CFLAGS += -Wall
TARGET_CFLAGS += -Wno-error=format-security

define Package/wificonf/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/wificonf $(1)/usr/bin
if [ "$$(CONFIG_SUPPORT_LSDK_NVRAM_CMD)" != "" ]; then \
ln -s /usr/bin/wificonf $(1)/nvram_get; \
ln -s /usr/bin/wificonf $(1)/nvram_set; \
fi
endef

$(eval $(call BuildPackage,wificonf))
7 changes: 7 additions & 0 deletions applications/wificonf/src/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

wificonf: wificonf.c
$(CC) -Wall -Werror $(CFLAGS) $(LDFLAGS) -o $@ wificonf.c

clean:
-rm -f *.o *.elf *.gbd wificonf

Loading

0 comments on commit 91dfb94

Please sign in to comment.