Fixing stats display issue for virtual fire-alarm in MT mode

merge-requests/1/head
Ace 7 years ago
parent 65ee884bb7
commit 0cfa757c0a

@ -199,8 +199,11 @@ public class VirtualHardwareManager {
try { try {
sequence = MidiSystem.getSequence(audioSrc); sequence = MidiSystem.getSequence(audioSrc);
sequencer = MidiSystem.getSequencer(); sequencer = MidiSystem.getSequencer();
sequencer.open(); if(sequencer != null) {
sequencer.setSequence(sequence); sequencer.open();
sequencer.setSequence(sequence);
sequencer.setLoopCount(Clip.LOOP_CONTINUOUSLY);
}
} catch (InvalidMidiDataException e) { } catch (InvalidMidiDataException e) {
log.error("AudioReader: Error whilst setting MIDI Audio reader sequence"); log.error("AudioReader: Error whilst setting MIDI Audio reader sequence");
} catch (IOException e) { } catch (IOException e) {
@ -208,8 +211,6 @@ public class VirtualHardwareManager {
} catch (MidiUnavailableException e) { } catch (MidiUnavailableException e) {
log.error("AudioReader: Error whilst openning MIDI Audio reader sequencer"); log.error("AudioReader: Error whilst openning MIDI Audio reader sequencer");
} }
sequencer.setLoopCount(Clip.LOOP_CONTINUOUSLY);
} }
} }

@ -21,5 +21,5 @@
<property name="topic">${tenant-domain}/virtual_firealarm/+/temperature</property> <property name="topic">${tenant-domain}/virtual_firealarm/+/temperature</property>
</from> </from>
<mapping customMapping="disable" type="json"/> <mapping customMapping="disable" type="json"/>
<to streamName="org.wso2.iot.virtualfirealarm" version="1.0.0"/> <to streamName="iot.per.device.stream.virtualfirealarm" version="1.0.0"/>
</eventReceiver> </eventReceiver>

@ -1,16 +0,0 @@
{
"name": "org.wso2.iot.virtualfirealarm",
"version": "1.0.0",
"nickName": "virtual_firealarm",
"description": "Temperature data received from the virtual_firealarm",
"metaData": [
{"name":"owner","type":"STRING"},
{"name":"deviceId","type":"STRING"},
{"name":"time","type":"LONG"}
],
"payloadData": [
{
"name": "temperature","type": "FLOAT"
}
]
}

@ -338,13 +338,13 @@
<Description>Unlock the device</Description> <Description>Unlock the device</Description>
</Feature> </Feature>
</Features> </Features>
<TaskConfiguration> //Name needs to be decided <!--DeviceMonitoring--> <TaskConfiguration>
<Enable>true</Enable> <Enable>true</Enable>
<Frequency>60000</Frequency> //Name needs to be decided <!--Period--> <Frequency>60000</Frequency>
<Operations> <Operations>
<Operation> <Operation>
<Name>DEVICE_INFO</Name> <Name>DEVICE_INFO</Name>
<RecurrentTimes>1</RecurrentTimes> //Name needs to be decided <!--PeriodFactor--> <RecurrentTimes>1</RecurrentTimes>
</Operation> </Operation>
<Operation> <Operation>
<Name>APPLICATION_LIST</Name> <Name>APPLICATION_LIST</Name>

Loading…
Cancel
Save