Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1690 | - | 1 | package dongfang.mkt.frames; |
2 | |||
3 | public class ReadRCChannelsResponseFrame extends ResponseFrame { |
||
4 | private int numberOfChannels; |
||
5 | private int[] channels; |
||
6 | |||
7 | public ReadRCChannelsResponseFrame(int address) { |
||
8 | super(address); |
||
9 | // TODO Auto-generated constructor stub |
||
10 | } |
||
11 | |||
12 | public int getNumberOfChannels() { |
||
13 | return numberOfChannels; |
||
14 | } |
||
15 | |||
16 | public void setNumberOfChannels(int numberOfChannels) { |
||
17 | this.numberOfChannels = numberOfChannels; |
||
18 | } |
||
19 | |||
20 | public int[] getChannels() { |
||
21 | return channels; |
||
22 | } |
||
23 | |||
24 | public void setChannels(int[] channels) { |
||
25 | this.channels = channels; |
||
26 | } |
||
27 | |||
28 | @Override |
||
29 | public boolean isResponseTo(RequestFrame r) { |
||
30 | return r instanceof ReadRCChannelsRequestFrame; |
||
31 | } |
||
32 | |||
33 | public String toString() { |
||
34 | StringBuilder sb = new StringBuilder(); |
||
35 | for (int i=0; i<getNumberOfChannels(); i++) { |
||
36 | if (i!=0) sb.append(", "); |
||
37 | sb.append(i + ":" + channels[i]); |
||
38 | } |
||
39 | return sb.toString(); |
||
40 | } |
||
41 | } |