当前位置: 首页>>代码示例>>Java>>正文


Java Transmitter类代码示例

本文整理汇总了Java中com.eveningoutpost.dexdrip.G5Model.Transmitter的典型用法代码示例。如果您正苦于以下问题:Java Transmitter类的具体用法?Java Transmitter怎么用?Java Transmitter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Transmitter类属于com.eveningoutpost.dexdrip.G5Model包,在下文中一共展示了Transmitter类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getTransmitterDetails

import com.eveningoutpost.dexdrip.G5Model.Transmitter; //导入依赖的package包/类
private void getTransmitterDetails() {
    prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
    Log.d(TAG, "Transmitter: " + prefs.getString("dex_txid", "ABCDEF"));
    defaultTransmitter = new Transmitter(prefs.getString("dex_txid", "ABCDEF"));
    isBondedOrBonding = false;
    Set<BluetoothDevice> pairedDevices = mBluetoothAdapter.getBondedDevices();
    if (pairedDevices.size() > 0) {
        for (BluetoothDevice device : pairedDevices) {
            if (device.getName() != null) {

                String transmitterIdLastTwo = Extensions.lastTwoCharactersOfString(defaultTransmitter.transmitterId);
                String deviceNameLastTwo = Extensions.lastTwoCharactersOfString(device.getName());

                if (transmitterIdLastTwo.equals(deviceNameLastTwo)) {
                    isBondedOrBonding = true;
                } else {
                    isIntialScan = true;
                }

            }
        }
    }
    Log.d(TAG, "Bonded? " + isBondedOrBonding.toString());
}
 
开发者ID:StephenBlackWasAlreadyTaken,项目名称:xDrip-Experimental,代码行数:25,代码来源:G5CollectionService.java

示例2: getTransmitterDetails

import com.eveningoutpost.dexdrip.G5Model.Transmitter; //导入依赖的package包/类
private synchronized void getTransmitterDetails() {
    prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
    Log.d(TAG, "Transmitter: " + prefs.getString("dex_txid", "ABCDEF"));
    defaultTransmitter = new Transmitter(prefs.getString("dex_txid", "ABCDEF"));
    final boolean previousBondedState = isBonded;
    isBondedOrBonding = false;
    isBonded = false;
    if (mBluetoothAdapter == null) {
        Log.wtf(TAG, "No bluetooth adapter");
        return;
    }
    final Set<BluetoothDevice> pairedDevices = mBluetoothAdapter.getBondedDevices();
    if ((pairedDevices != null) && (pairedDevices.size() > 0)) {
        for (BluetoothDevice device : pairedDevices) {
            if (device.getName() != null) {

                final String transmitterIdLastTwo = Extensions.lastTwoCharactersOfString(defaultTransmitter.transmitterId);
                final String deviceNameLastTwo = Extensions.lastTwoCharactersOfString(device.getName());

                if (transmitterIdLastTwo.equals(deviceNameLastTwo)) {
                    isBondedOrBonding = true;
                    isBonded=true;
                    if (!previousBondedState) Log.e(TAG,"Device is now detected as bonded!");
                // TODO should we break here for performance?
                } else {
                    isIntialScan = true;
                }
            }
        }
    }
    if (previousBondedState && !isBonded) Log.e(TAG,"Device is no longer detected as bonded!");
    Log.d(TAG, "getTransmitterDetails() result: Bonded? " + isBondedOrBonding.toString()+(isBonded ? " localed bonded" : " not locally bonded"));
}
 
开发者ID:NightscoutFoundation,项目名称:xDrip,代码行数:34,代码来源:G5CollectionService.java

示例3: getTransmitterDetails

import com.eveningoutpost.dexdrip.G5Model.Transmitter; //导入依赖的package包/类
private synchronized void getTransmitterDetails() {
    prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
    Log.d(TAG, "Transmitter: " + prefs.getString("dex_txid", "ABCDEF"));
    defaultTransmitter = new Transmitter(prefs.getString("dex_txid", "ABCDEF"));
    final boolean previousBondedState = isBonded;
    isBondedOrBonding = false;
    isBonded = false;
    static_is_bonded = false;
    if (mBluetoothAdapter == null) {
        Log.wtf(TAG, "No bluetooth adapter");
        return;
    }
    final Set<BluetoothDevice> pairedDevices = mBluetoothAdapter.getBondedDevices();
    if ((pairedDevices != null) && (pairedDevices.size() > 0)) {
        for (BluetoothDevice device : pairedDevices) {
            if (device.getName() != null) {

                final String transmitterIdLastTwo = Extensions.lastTwoCharactersOfString(defaultTransmitter.transmitterId);
                final String deviceNameLastTwo = Extensions.lastTwoCharactersOfString(device.getName());

                if (transmitterIdLastTwo.equals(deviceNameLastTwo)) {
                    isBondedOrBonding = true;
                    isBonded=true;
                    static_is_bonded = true;
                    if (!previousBondedState) Log.e(TAG,"Device is now detected as bonded!");
                // TODO should we break here for performance?
                } else {
                    isIntialScan = true;
                }
            }
        }
    }
    if (previousBondedState && !isBonded) Log.e(TAG,"Device is no longer detected as bonded!");
    Log.d(TAG, "getTransmitterDetails() result: Bonded? " + isBondedOrBonding.toString()+(isBonded ? " localed bonded" : " not locally bonded"));
}
 
开发者ID:NightscoutFoundation,项目名称:xDrip,代码行数:36,代码来源:G5CollectionService.java

示例4: setCurrentDevice

import com.eveningoutpost.dexdrip.G5Model.Transmitter; //导入依赖的package包/类
public void setCurrentDevice() {
    if(activeBluetoothDevice != null) {
        current_device.setText(activeBluetoothDevice.name);
    } else {
        current_device.setText("None Set");
    }

    String collection_method = prefs.getString("dex_collection_method", "BluetoothWixel");
    if (collection_method.compareTo("DexcomG5") == 0) {
        Transmitter defaultTransmitter = new Transmitter(prefs.getString("dex_txid", "ABCDEF"));
        mBluetoothAdapter = mBluetoothManager.getAdapter();
        if (mBluetoothAdapter != null) {
            Set<BluetoothDevice> pairedDevices = mBluetoothAdapter.getBondedDevices();
            if ((pairedDevices != null) && (pairedDevices.size() > 0)) {
                for (BluetoothDevice device : pairedDevices) {
                    if (device.getName() != null) {

                        String transmitterIdLastTwo = Extensions.lastTwoCharactersOfString(defaultTransmitter.transmitterId);
                        String deviceNameLastTwo = Extensions.lastTwoCharactersOfString(device.getName());

                        if (transmitterIdLastTwo.equals(deviceNameLastTwo)) {
                            current_device.setText(defaultTransmitter.transmitterId);
                        }

                    }
                }
            }
        } else {
            current_device.setText("No Bluetooth");
        }
    }
}
 
开发者ID:NightscoutFoundation,项目名称:xDrip,代码行数:33,代码来源:SystemStatus.java

示例5: setCurrentDevice

import com.eveningoutpost.dexdrip.G5Model.Transmitter; //导入依赖的package包/类
public void setCurrentDevice() {
    if (activeBluetoothDevice != null) {
        current_device.setText(activeBluetoothDevice.name);
    } else {
        current_device.setText("None Set");
    }

    String collection_method = prefs.getString("dex_collection_method", "BluetoothWixel");
    if (collection_method.compareTo("DexcomG5") == 0) {
        Transmitter defaultTransmitter = new Transmitter(prefs.getString("dex_txid", "ABCDEF"));
        if (Build.VERSION.SDK_INT >= 18) {
            mBluetoothAdapter = mBluetoothManager.getAdapter();
        }
        if (mBluetoothAdapter != null) {
            Set<BluetoothDevice> pairedDevices = mBluetoothAdapter.getBondedDevices();
            if ((pairedDevices != null) && (pairedDevices.size() > 0)) {
                for (BluetoothDevice device : pairedDevices) {
                    if (device.getName() != null) {

                        String transmitterIdLastTwo = Extensions.lastTwoCharactersOfString(defaultTransmitter.transmitterId);
                        String deviceNameLastTwo = Extensions.lastTwoCharactersOfString(device.getName());

                        if (transmitterIdLastTwo.equals(deviceNameLastTwo)) {
                            current_device.setText(defaultTransmitter.transmitterId);
                        }

                    }
                }
            }
        } else {
            current_device.setText("No Bluetooth");
        }
    }
}
 
开发者ID:NightscoutFoundation,项目名称:xDrip,代码行数:35,代码来源:SystemStatusFragment.java

示例6: setCurrentDevice

import com.eveningoutpost.dexdrip.G5Model.Transmitter; //导入依赖的package包/类
public void setCurrentDevice() {
    if(activeBluetoothDevice != null) {
        current_device.setText(activeBluetoothDevice.name);
    } else {
        current_device.setText("None Set");
    }

    String collection_method = prefs.getString("dex_collection_method", "BluetoothWixel");
    if(collection_method.compareTo("DexcomG5") == 0) {
        Transmitter defaultTransmitter = new Transmitter(prefs.getString("dex_txid", "ABCDEF"));
        mBluetoothAdapter = mBluetoothManager.getAdapter();

        Set<BluetoothDevice> pairedDevices = mBluetoothAdapter.getBondedDevices();
        if (pairedDevices.size() > 0) {
            for (BluetoothDevice device : pairedDevices) {
                if (device.getName() != null) {

                    String transmitterIdLastTwo = Extensions.lastTwoCharactersOfString(defaultTransmitter.transmitterId);
                    String deviceNameLastTwo = Extensions.lastTwoCharactersOfString(device.getName());

                    if (transmitterIdLastTwo.equals(deviceNameLastTwo)) {
                        current_device.setText(defaultTransmitter.transmitterId);
                    }

                }
            }
        }
    }
}
 
开发者ID:StephenBlackWasAlreadyTaken,项目名称:xDrip-Experimental,代码行数:30,代码来源:SystemStatus.java

示例7: setConnectionStatus

import com.eveningoutpost.dexdrip.G5Model.Transmitter; //导入依赖的package包/类
private void setConnectionStatus() {
    boolean connected = false;
    if (mBluetoothManager != null && activeBluetoothDevice != null) {
        for (BluetoothDevice bluetoothDevice : mBluetoothManager.getConnectedDevices(BluetoothProfile.GATT)) {
            if (bluetoothDevice.getAddress().compareTo(activeBluetoothDevice.address) == 0) {
                connected = true;
            }
        }
    }
    if(connected) {
        connection_status.setText("Connected");
    } else {
        connection_status.setText("Not Connected");
    }

    String collection_method = prefs.getString("dex_collection_method", "BluetoothWixel");
    if(collection_method.compareTo("DexcomG5") == 0) {
        Transmitter defaultTransmitter = new Transmitter(prefs.getString("dex_txid", "ABCDEF"));
        mBluetoothAdapter = mBluetoothManager.getAdapter();

        Set<BluetoothDevice> pairedDevices = mBluetoothAdapter.getBondedDevices();
        if (pairedDevices.size() > 0) {
            for (BluetoothDevice device : pairedDevices) {
                if (device.getName() != null) {

                    String transmitterIdLastTwo = Extensions.lastTwoCharactersOfString(defaultTransmitter.transmitterId);
                    String deviceNameLastTwo = Extensions.lastTwoCharactersOfString(device.getName());

                    if (transmitterIdLastTwo.equals(deviceNameLastTwo)) {
                        connection_status.setText(device.getName() + "\nAuthenticated");
                    }

                }
            }
        }
    }
}
 
开发者ID:StephenBlackWasAlreadyTaken,项目名称:xDrip-Experimental,代码行数:38,代码来源:SystemStatus.java

示例8: setConnectionStatus

import com.eveningoutpost.dexdrip.G5Model.Transmitter; //导入依赖的package包/类
private void setConnectionStatus() {
    boolean connected = false;
    if (mBluetoothManager != null && activeBluetoothDevice != null) {
        for (BluetoothDevice bluetoothDevice : mBluetoothManager.getConnectedDevices(BluetoothProfile.GATT)) {
            if (bluetoothDevice.getAddress().compareTo(activeBluetoothDevice.address) == 0) {
                connected = true;
            }
        }
    }
    if(connected) {
        connection_status.setText("Connected");
    } else {
        connection_status.setText("Not Connected");
    }

    String collection_method = prefs.getString("dex_collection_method", "BluetoothWixel");
    if(collection_method.compareTo("DexcomG5") == 0) {
        Transmitter defaultTransmitter = new Transmitter(prefs.getString("dex_txid", "ABCDEF"));
        mBluetoothAdapter = mBluetoothManager.getAdapter();
        if (mBluetoothAdapter != null) {
            Set<BluetoothDevice> pairedDevices = mBluetoothAdapter.getBondedDevices();
            if (pairedDevices.size() > 0) {
                for (BluetoothDevice device : pairedDevices) {
                    if (device.getName() != null) {

                        String transmitterIdLastTwo = Extensions.lastTwoCharactersOfString(defaultTransmitter.transmitterId);
                        String deviceNameLastTwo = Extensions.lastTwoCharactersOfString(device.getName());

                        if (transmitterIdLastTwo.equals(deviceNameLastTwo)) {
                            final String fw = G5CollectionService.getFirmwareVersionString(defaultTransmitter.transmitterId);
                            connection_status.setText(device.getName() + " Authed" + ((fw != null) ? ("\n" + fw) : ""));
                            break;
                        }

                    }
                }
            }
        } else {
            connection_status.setText("No bluetooth");
        }
    }
}
 
开发者ID:NightscoutFoundation,项目名称:xDrip,代码行数:43,代码来源:SystemStatus.java

示例9: setConnectionStatus

import com.eveningoutpost.dexdrip.G5Model.Transmitter; //导入依赖的package包/类
private void setConnectionStatus() {
    boolean connected = false;
    if (mBluetoothManager != null && activeBluetoothDevice != null && (Build.VERSION.SDK_INT >= 18)) {
        for (BluetoothDevice bluetoothDevice : mBluetoothManager.getConnectedDevices(BluetoothProfile.GATT)) {
            if (bluetoothDevice.getAddress().compareTo(activeBluetoothDevice.address) == 0) {
                connected = true;
            }
        }
    }
    if (connected) {
        connection_status.setText("Connected");
    } else {
        connection_status.setText("Not Connected");
    }

    String collection_method = prefs.getString("dex_collection_method", "BluetoothWixel");
    if (collection_method.compareTo("DexcomG5") == 0) {
        Transmitter defaultTransmitter = new Transmitter(prefs.getString("dex_txid", "ABCDEF"));
        if (Build.VERSION.SDK_INT >= 18) mBluetoothAdapter = mBluetoothManager.getAdapter();
        if (mBluetoothAdapter != null) {
            Set<BluetoothDevice> pairedDevices = mBluetoothAdapter.getBondedDevices();
            if (pairedDevices.size() > 0) {
                for (BluetoothDevice device : pairedDevices) {
                    if (device.getName() != null) {

                        String transmitterIdLastTwo = Extensions.lastTwoCharactersOfString(defaultTransmitter.transmitterId);
                        String deviceNameLastTwo = Extensions.lastTwoCharactersOfString(device.getName());

                        if (transmitterIdLastTwo.equals(deviceNameLastTwo)) {
                            final String fw = G5CollectionService.getFirmwareVersionString(defaultTransmitter.transmitterId);
                            connection_status.setText(device.getName() + " Authed" + ((fw != null) ? ("\n" + fw) : ""));
                            break;
                        }

                    }
                }
            }
        } else {
            connection_status.setText("No bluetooth");
        }
    }
}
 
开发者ID:NightscoutFoundation,项目名称:xDrip,代码行数:43,代码来源:SystemStatusFragment.java


注:本文中的com.eveningoutpost.dexdrip.G5Model.Transmitter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。