1 package net.sf.mbus4j.dataframes;
2
3 /*
4 * #%L
5 * mbus4j-core
6 * %%
7 * Copyright (C) 2009 - 2014 MBus4J
8 * %%
9 * mbus4j - Drivers for the M-Bus protocol - http://mbus4j.sourceforge.net/
10 * Copyright (C) 2009-2014, mbus4j.sf.net, and individual contributors as indicated
11 * by the @authors tag. See the copyright.txt in the distribution for a
12 * full listing of individual contributors.
13 *
14 * This is free software; you can redistribute it and/or modify it
15 * under the terms of the GNU General Public License as
16 * published by the Free Software Foundation; either version 3 of
17 * the License, or (at your option) any later version.
18 *
19 * This software is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * Lesser General Public License for more details.
23 *
24 * You should have received a copy of the GNU Lesser General Public
25 * License along with this software; if not, write to the Free
26 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
27 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
28 * #L%
29 */
30 import net.sf.json.JSONObject;
31
32 import net.sf.mbus4j.json.JsonSerializeType;
33
34 /**
35 *
36 * @author arnep@users.sourceforge.net
37 * @version $Id: SendUserDataManSpec.java 104 2014-02-21 09:31:17Z arnep $
38 */
39 public class SendUserDataManSpec
40 implements ControlFrame {
41
42 private byte address;
43 private boolean fcb;
44 private int ciField;
45
46 public SendUserDataManSpec(SendUserData sendUserData, int ciField) {
47 this.ciField = ciField;
48 this.address = sendUserData.getAddress();
49 this.fcb = sendUserData.isFcb();
50 }
51
52 /**
53 * @return the address
54 */
55 @Override
56 public byte getAddress() {
57 return address;
58 }
59
60 /**
61 * @return the ciField
62 */
63 public int getCiField() {
64 return ciField;
65 }
66
67 @Override
68 public ControlCode getControlCode() {
69 return ControlCode.SND_UD;
70 }
71
72 /**
73 * @return the fcb
74 */
75 public boolean isFcb() {
76 return fcb;
77 }
78
79 /**
80 * @param address the address to set
81 */
82 @Override
83 public void setAddress(byte address) {
84 this.address = address;
85 }
86
87 /**
88 * @param ciField the ciField to set
89 */
90 public void setCiField(int ciField) {
91 this.ciField = ciField;
92 }
93
94 /**
95 * @param fcb the fcb to set
96 */
97 public void setFcb(boolean fcb) {
98 this.fcb = fcb;
99 }
100
101 @Override
102 public JSONObject toJSON(JsonSerializeType jsonSerializeType) {
103 throw new UnsupportedOperationException("Not supported yet.");
104 }
105
106 @Override
107 public void fromJSON(JSONObject json) {
108 throw new UnsupportedOperationException("Not supported yet.");
109 }
110 }