Reading Device Information

The methods to read information from a device and to write them to a device are realized asynchronous. To read configurations of a device call the method method getDeviceConfiguration() of the sdk. The first parameter of this method represents the device from what the configuration should be read. The second defines the configuration to be read. Possible values are: SDK.DATETIME, SDK.SERIAL_NUMBER, SDK.FIRMWARE, SDK.IEEE_MAC_ADDRESS, SDK.USER_SETTING, SDK.DEVICE_STATUS. To read multiple configurations this constants can be combined with the bitwise or operator | .

// get the serial number and the firmware from the device...
sdk.getDeviceConfiguration(medicalDevice, SDK.SERIAL_NUMBER | SDK.FIRMWARE);

For each configuration that is received and that has changed the event onDeviceConfigurationUpdate() of the SDKDevicesListener is fired. The first parameter of this method (medicalDevice) contains all the currently known information of the device. The Parameter configuration represents the actually updated configuration.

public class MySDKDevicesListener implements SDKDevicesListener {
    public void onSearchResult(MedicalDeviceTO medicalDevice) {}
    public void onDeviceOnlineStateChanges(MedicalDeviceTO
        medicalDevice) { }
    public void onDeviceBindStateChanges(MedicalDeviceTO
    medicalDevice) {}
    public void onDeviceConfigurationUpdate(MedicalDeviceTO
            medicalDevice, int configuration) {
        switch(configuration) {
        case SDK.DATETIME:
            System.out.println("device time received: "+
                medicalDevice.getDateTime());
            break;
        case SDK.SERIAL_NUMBER:
            // ...
            break;
        // ...
        }
    }
    public void onDeviceStatusChanges(MedicalDeviceTO
        medicalDevice) {}
}

In the case of communication problems the event onCommunicationError() of the SDKErrorListener is fired.

 
SourceForge.net Logo