Здравствуйте, у меня есть новый проект о помещении. После обнаружения пользователей и получения IP-адреса и ма c с устройства, которое подключается к маршрутизатору, я не понимаю, как получить значение rssi для этих пользователей. Возможно ли правильно? Кто-нибудь, пожалуйста, помогите мне :) это мой тезис, спасибо
Я использовал android studio Кстати .. Это мой код для отображения IP-адрес, ма c и SSID устройства, которые подключаются к wifi
private class HostsAdapter extends ArrayAdapter<Void> {
public HostsAdapter(Context ctxt) {
super(ctxt, R.layout.list_host, R.id.list);
}
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
ViewHolder holder;
View view = convertView;
if (convertView == null) {
convertView = mInflater.inflate(R.layout.list_host, null);
holder = new ViewHolder();
holder.host = (TextView) convertView.findViewById(R.id.list);
holder.mac = (TextView) convertView.findViewById(R.id.mac);
holder.vendor = (TextView) convertView.findViewById(R.id.vendor);
holder.logo = (ImageView) convertView.findViewById(R.id.logo);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
final HostBean host = hosts.get(position);
if (host.deviceType == HostBean.TYPE_GATEWAY) {
holder.logo.setImageResource(R.drawable.router);
} else if (host.isAlive == 1 || !host.hardwareAddress.equals(NetInfo.NOMAC)) {
holder.logo.setImageResource(R.drawable.computer);
} else {
holder.logo.setImageResource(R.drawable.computer);
}
if (host.hostname != null && !host.hostname.equals(host.ipAddress) && !host.hostname.equals(host.rssi)) {
holder.host.setText(host.hostname + " (" + host.ipAddress + ")");
} else {
holder.host.setText(host.ipAddress);
}
if (!host.hardwareAddress.equals(NetInfo.NOMAC)) {
holder.mac.setText(host.hardwareAddress);
if(host.nicVendor != null){
holder.vendor.setText(host.nicVendor);
} else {
holder.vendor.setText(R.string.info_unknown);
}
holder.mac.setVisibility(View.VISIBLE);
holder.vendor.setVisibility(View.VISIBLE);
} else {
holder.mac.setVisibility(View.GONE);
holder.vendor.setVisibility(View.GONE);
}
return convertView;
}
}