YITechnology / YIOpenAPI

YI Open API provides mobile SDKs and reference designs for software developers and hardware makers to build cool apps and products with YI 4K Action Cameras
Other
346 stars 77 forks source link

sta.conf - device name query #28

Open philwindsor opened 7 years ago

philwindsor commented 7 years ago

Hi,

I have a quick question regarding the config file used to connect to a WiFi hotspot.

There is a setting for DEVICE_NAME. What is this used for? I would like to be able to read this setting via the SDK, is this possible? I've gone through the SDK a few times and haven't seen anything.

##### Wifi configuration file ##########################################
# SSID
SSID=PM2.5-5G
# Password
PASSWORD=1234567890
# Device Name
DEVICE_NAME=xiaoyi-1
# Country Code
COUNTRY_CODE=US
philwindsor commented 7 years ago

Hi,

I manage to get the info I needed from the InetAddress class.

InetAddress.getByName(ip).getHostName();

It would still be nice to know if the SDK exposes this value?

philwindsor commented 7 years ago

me again, turns out InetAddress.getByName(ip).getHostName(); no longer works on android 6.0+. If you want this to work you need to target API 21.

Is there a way to pull this from the SDK directly?