hi Mikko,
I am using the server dlms example to set some values to obis,
Suppose if i want to set some data and send that to meter, and the data type is something like <structure><long-unsigned></long-unsigned></structure> how do we add this type of value???
in the code we have obis like
e.g
void addFirmwareVersion() {
GXDLMSData d = new GXDLMSData("1.0.0.2.0.255");
d.setValue("Gurux FW 0.0.1");
getItems().add(d);
}
if I want to give the value like mentioned above how can i do that?
Hi Mikko,
i have structure
long
octet-string
visible-string
How can i add these to structure, I see there are only GXUInt8,GXUInt16,GXUInt32,GXUInt64
how can i add the above values?
var data = new GXStructure ();
data.Add ("Simulator IMEI");
data.Add ("Simulator ICCID");
data.Add ("Simulator IMSI");
modemInformation.Value = data;
When I execute a read of said object it is returning me the following apdu:
C401400002030A0E53696D756C61746F7220494D45490A0F53696D756C61746F722049434349440A0E53696D756C61746F7220494D5349
Which translated with Gurux has the following structure.
Hi,
Hi,
You can do it like this:
GXStructure data = new GXStructure();
data.Add(new GXUInt16(1));
data.Add(new GXUInt16(2));
GXDLMSData d = new GXDLMSData("1.0.0.2.0.255");
d.setValue(data);
BR,
Mikko
Hi Mikko,
Hi Mikko,
i have structure
long
octet-string
visible-string
How can i add these to structure, I see there are only GXUInt8,GXUInt16,GXUInt32,GXUInt64
how can i add the above values?
Hi,
Hi,
data.Add(new Short(2));
data.Add(new Long(2));
data.Add(new byte[]{1, 2, 3});
data.Add("Gurux");
BR,
Mikko
Hi Mikko,
Hi Mikko,
I am having a problem like the one described in this post.
I use gurux as a server so that it acts as a simulator of a Dlms device
I am trying to create Modem Information object which is of type IC 1 -> Data with DataType of type structure.
This structure is made up of three elements of type OctetString.
ModemInformation (IC: 1, DataType: Structure)
{
IMEI: OctetString,
ICCID: OctetString,
IMSI: OctetString
}
For I have developed the following code:
var modemInformation = (GXDLMSData) companionObjectCollection.FindByLN (ObjectType.Data, obisCodeList.ModemInformation);
modemInformation.SetDataType (2, DataType.Structure);
modemInformation.SetUIDataType (2, DataType.Structure);
var data = new GXStructure ();
data.Add ("Simulator IMEI");
data.Add ("Simulator ICCID");
data.Add ("Simulator IMSI");
modemInformation.Value = data;
When I execute a read of said object it is returning me the following apdu:
C401400002030A0E53696D756C61746F7220494D45490A0F53696D756C61746F722049434349440A0E53696D756C61746F7220494D5349
Which translated with Gurux has the following structure.
<GetResponse>
<GetResponseNormal>
<!--Priority: NORMAL ServiceClass: CONFIRMED invokeID: 0-->
<InvokeIdAndPriority Value="40" />
<Result>
<Data>
<Structure Qty="03" >
<String Value="Simulator IMEI" />
<String Value="Simulator ICCID" />
<String Value="Simulator IMSI" />
</Structure>
</Data>
</Result>
</GetResponseNormal>
</GetResponse>
These objects are of type string instead of OctetString.
Can you help me with this???? I am very grateful to you in advance.
Sincerely,
Rubent