"netcfg wlan0 up" Not working from application

7

I have custom hardware and custom android operating system. Devices are unable to stay connected to the Wireless network after going through day to day workflow. I have used WifiManager.WifiLock in application to make sure hardware running up. But After I have found that my custom OS not able to make it up.

So I have try from my application.

"netcfg" command give me list off network hardware

lo      UP    127.0.0.1       255.0.0.0       0x00000049  
wlan0   DOWN  0.0.0.0         0.0.0.0         0x00001002

"netcfg wlan0 up" And "ifconfig wlan0 up" both are not working from application.

Can any one have any suggestion that I can make hardware up from my application.

Or any other way around like native application class or anything that I can make hardware up.

android
networking
native
ifconfig
asked on Stack Overflow Nov 30, 2016 by Mr. Borad • edited Dec 2, 2016 by Eugene S

1 Answer

0

So what I've done is add a service in init.rc file in android os, That checks every 10 seconds if wl1271 firmware state is 'stopped' with 'getprop init.svc.dhcpcd_wlan0' command. If it is anything other than 'stopped', the service does nothing and checks again in 10 seconds. If getprop returns 'stopped', the the command 'ifconfig wlan0 up' is run and the service waits for 30 seconds before checking again.

answered on Stack Overflow Dec 12, 2016 by Mr. Borad

User contributions licensed under CC BY-SA 3.0