1 package diku
.distlab
.motecontrolclientlib
.protocols
.clientserver
;
3 import java
.io
.DataInput
;
4 import java
.io
.DataOutput
;
5 import java
.util
.ArrayList
;
7 import diku
.distlab
.motecontrolclientlib
.protocols
.MsgIO
;
8 import diku
.distlab
.motecontrolclientlib
.protocols
.MsgUint16
;
9 import diku
.distlab
.motecontrolclientlib
.protocols
.MsgUint32
;
11 public class MsgMoteIdList
extends MsgIO
{
17 public MsgMoteIdList() {
19 moteIds
= new ArrayList();
22 public void read(DataInput is
) throws Exception
24 MsgUint16 count
= new MsgUint16();
28 for (int i
=0; i
<count
.getValue(); i
++)
30 moteId
= new MsgUint32();
32 this.addMoteId(moteId
);
36 public void write(DataOutput os
) throws Exception
38 MsgUint16 count
= new MsgUint16(moteIds
.size());
41 for (int i
=0; i
<count
.getValue(); i
++)
43 moteId
= (MsgUint32
)moteIds
.get(i
);
53 public int getLength()
55 return moteIds
.size();
58 public void addMoteId(MsgUint32 moteId
)
63 public MsgUint32
getMoteId(int index
)
65 return (MsgUint32
) moteIds
.get(index
);