本文整理汇总了Java中com.gizwits.gizwifisdk.api.GizWifiDevice类的典型用法代码示例。如果您正苦于以下问题:Java GizWifiDevice类的具体用法?Java GizWifiDevice怎么用?Java GizWifiDevice使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GizWifiDevice类属于com.gizwits.gizwifisdk.api包,在下文中一共展示了GizWifiDevice类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: discoveredrCb
import com.gizwits.gizwifisdk.api.GizWifiDevice; //导入依赖的package包/类
@Override
public void discoveredrCb(GizWifiErrorCode result,
java.util.List<GizWifiDevice> deviceList) {
Logger.d(TAG,
"discoveredrCb -> deviceList size:" + deviceList.size()
+ " result:" + result);
switch (result) {
case GIZ_SDK_SUCCESS:
Logger.e(TAG, "load device sucess");
update(deviceList);
break;
default:
break;
}
}
示例2: update
import com.gizwits.gizwifisdk.api.GizWifiDevice; //导入依赖的package包/类
void update(List<GizWifiDevice> gizWifiDevices) {
if (gizWifiDevices == null) {
deviceNames.clear();
} else if (gizWifiDevices != null && gizWifiDevices.size() >= 1) {
wifiDevices.clear();
wifiDevices.addAll(gizWifiDevices);
deviceNames.clear();
for (int i = 0; i < wifiDevices.size(); i++) {
deviceNames.add(wifiDevices.get(i).getProductName() + "("
+ wifiDevices.get(i).getMacAddress() + ") "
+ getBindInfo(wifiDevices.get(i).isBind()) + "\n"
+ getLANInfo(wifiDevices.get(i).isLAN())+" "+getOnlineInfo(wifiDevices.get(i).getNetStatus()));
}
}
adapter.notifyDataSetChanged();
}
示例3: discoveredrCb
import com.gizwits.gizwifisdk.api.GizWifiDevice; //导入依赖的package包/类
@Override
public void discoveredrCb(GizWifiErrorCode result,
List<GizWifiDevice> deviceList) {
Logger.d(TAG,
"discoveredrCb -> deviceList size:" + deviceList.size()
+ " result:" + result);
switch (result) {
case GIZ_SDK_SUCCESS:
Logger.e(TAG, "load device sucess");
update(deviceList);
break;
default:
break;
}
}
示例4: update
import com.gizwits.gizwifisdk.api.GizWifiDevice; //导入依赖的package包/类
void update(List<GizWifiDevice> gizWifiDevices) {
if (gizWifiDevices != null) {
Log.e("DeviceListActivity", gizWifiDevices.size() + "");
}
if (gizWifiDevices == null) {
deviceNames.clear();
} else if (gizWifiDevices != null && gizWifiDevices.size() >= 1) {
wifiDevices.clear();
wifiDevices.addAll(gizWifiDevices);
deviceNames.clear();
for (int i = 0; i < wifiDevices.size(); i++) {
deviceNames.add(wifiDevices.get(i).getProductName() + "("
+ wifiDevices.get(i).getMacAddress() + ") "
+ getBindInfo(wifiDevices.get(i).isBind()) + "\n"
+ getLANInfo(wifiDevices.get(i).isLAN()) + " " + getOnlineInfo(wifiDevices.get(i).getNetStatus()));
}
}
adapter.notifyDataSetChanged();
}
示例5: onCreate
import com.gizwits.gizwifisdk.api.GizWifiDevice; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.act_codeapi);
// 遥控云数据接口分装对象对象
ykanInterface = new YkanIRInterfaceImpl(getApplicationContext());
// 遥控云数据接口分装对象对象
ykanInterface = new YkanIRInterfaceImpl(getApplicationContext());
initView();
initDevice();
List<GizWifiDevice> gizWifiDevices = DeviceManager
.instanceDeviceManager(getApplicationContext()).getCanUseGizWifiDevice();
if (gizWifiDevices != null) {
Log.e("YKCodeAPIActivity", gizWifiDevices.size() + "");
}
}
示例6: didSetSubscribe
import com.gizwits.gizwifisdk.api.GizWifiDevice; //导入依赖的package包/类
@Override
protected void didSetSubscribe(GizWifiErrorCode result, GizWifiDevice device, boolean isSubscribed) {
// TODO 控制页面跳转
progressDialog.cancel();
Message msg = new Message();
if (GizWifiErrorCode.GIZ_SDK_SUCCESS == result) {
msg.what = TOCONTROL;
msg.obj = device;
} else {
if (device.isBind()) {
msg.what = TOAST;
// String setSubscribeFail = (String)
// getText(R.string.setsubscribe_failed);
msg.obj = toastError(result);// setSubscribeFail + "\n" + arg0;
}
}
handler.sendMessage(msg);
}
示例7: initDevice
import com.gizwits.gizwifisdk.api.GizWifiDevice; //导入依赖的package包/类
private void initDevice() {
Intent intent = getIntent();
device = (GizWifiDevice) intent.getParcelableExtra("GizWifiDevice");
driverControl = new DeviceController(getApplicationContext(),device,this);
//获取设备硬件相关信息
driverControl.getDevice().getHardwareInfo();
//修改设备显示名称
driverControl.getDevice().setCustomInfo("alias", "遥控中心产品");
RemoteControl remoteControl = jsonParser.parseObjecta(intent.getStringExtra("remoteControl"), RemoteControl.class);
if (!Utility.isEmpty(remoteControl)) {
airVerSion =remoteControl.getVersion();
codeDatas=remoteControl.getRcCommand();
airEvent=getAirEvent(codeDatas);
}
}
示例8: didGetHardwareInfo
import com.gizwits.gizwifisdk.api.GizWifiDevice; //导入依赖的package包/类
@Override
public void didGetHardwareInfo(GizWifiErrorCode result,GizWifiDevice device, ConcurrentHashMap<String, String> hardwareInfo) {
Logger.d(TAG, "获取设备信息 :");
if (GizWifiErrorCode.GIZ_SDK_SUCCESS == result) {
Logger.d(TAG, "获取设备信息 : hardwareInfo :" + hardwareInfo);
} else {
}
}
示例9: didSetCustomInfo
import com.gizwits.gizwifisdk.api.GizWifiDevice; //导入依赖的package包/类
@Override
public void didSetCustomInfo(GizWifiErrorCode result, GizWifiDevice device) {
Logger.d(TAG, "自定义设备信息回调");
if (GizWifiErrorCode.GIZ_SDK_SUCCESS == result) {
Logger.d(TAG, "自定义设备信息成功");
}
}
示例10: didUpdateNetStatus
import com.gizwits.gizwifisdk.api.GizWifiDevice; //导入依赖的package包/类
@Override
public void didUpdateNetStatus(GizWifiDevice device,GizWifiDeviceNetStatus netStatus) {
switch (device.getNetStatus()) {
case GizDeviceOffline:
Logger.d(TAG, "设备下线");
break;
case GizDeviceOnline:
Logger.d(TAG, "设备上线");
break;
default:
break;
}
}
示例11: getView
import com.gizwits.gizwifisdk.api.GizWifiDevice; //导入依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder;
if (convertView == null) {
convertView = LayoutInflater.from(getApplicationContext())
.inflate(R.layout.lv_item, parent, false);
holder = new ViewHolder();
holder.name = (TextView) convertView.findViewById(R.id.tv_item);
holder.btn = (Button) convertView.findViewById(R.id.btn_item);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
holder.name.setText(deviceNames.get(position));
final int pos = position;
holder.btn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
GizWifiDevice mGizWifiDevice = wifiDevices.get(pos);
// 已经绑定的设备才去解绑
if (mGizWifiDevice.isBind()) {
// 解绑该设备
mDeviceManager.unbindDevice(mGizWifiDevice.getDid());
update(mDeviceManager.getCanUseGizWifiDevice());
} else {
toast("该设备未绑定");
}
}
});
return convertView;
}
示例12: initDevice
import com.gizwits.gizwifisdk.api.GizWifiDevice; //导入依赖的package包/类
private void initDevice() {
Intent intent = getIntent();
device = (GizWifiDevice) intent.getParcelableExtra("GizWifiDevice");
rcCommand = intent.getStringExtra("rcCommand");
}
示例13: initDevice
import com.gizwits.gizwifisdk.api.GizWifiDevice; //导入依赖的package包/类
private void initDevice() {
currGizWifiDevice = (GizWifiDevice) getIntent().getParcelableExtra(
"GizWifiDevice");
if (currGizWifiDevice != null) {
deviceId = currGizWifiDevice.getDid();
tvDevice.setText(currGizWifiDevice.getProductName() + "("
+ currGizWifiDevice.getMacAddress() + ") ");
// 在下载数据之前需要设置设备ID,用哪个设备去下载
YkanSDKManager.getInstance().setDeviceId(deviceId);
if (currGizWifiDevice.isSubscribed() == false) {
currGizWifiDevice.setSubscribe(true);
}
}
}
示例14: onCreate
import com.gizwits.gizwifisdk.api.GizWifiDevice; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_scheduler_list);
listView = (ListView) findViewById(R.id.list_view);
schedulerAdapter = new SchedulerAdapter();
listView.setAdapter(schedulerAdapter);
currGizWifiDevice = (GizWifiDevice) getIntent().getParcelableExtra(
"GizWifiDevice");
// 设置定时任务监听
GizDeviceSchedulerCenter.setListener(mListener);
// 同步更新设备的定时任务列表,mDevice为在设备列表中得到的设备对象
GizDeviceSchedulerCenter.updateSchedulers(Constant.UID, Constant.TOKEN, currGizWifiDevice);
}
示例15: didUpdateSchedulers
import com.gizwits.gizwifisdk.api.GizWifiDevice; //导入依赖的package包/类
@Override
public void didUpdateSchedulers(GizWifiErrorCode result, GizWifiDevice schedulerOwner, List<GizDeviceScheduler> schedulerList) {
if (result == GizWifiErrorCode.GIZ_SDK_SUCCESS) {
if (schedulerList != null) {
list.clear();
list.addAll(schedulerList);
schedulerAdapter.notifyDataSetChanged();
Log.e(TAG, schedulerList.toString());
}
} else {
}
}