[Logo] Mango Community
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Exception reading the properties of an AccessDoor Bacnet Object  XML
Forum Index » BACnet4J general discussion
Author Message
jeremie

Initiate

Joined: 30/08/2010 08:35:42
Messages: 11
Offline

Hi all,


I read succesfully bacnet objects from different type, except one type : "Access Door".

Here the code :



The exception is throwed from the Bacnet4J Encodable.java file - the concerned method is :



When the exception appears, the data are following :

queue=[29,e5,4e,7,8,4f,29,1c,4e,75,c,0,4f,54,45,53,20,44,4f,4f,52,20,31,4f,29,e2,4e,91,0,4f,29,e4,4e,c4,1,0,20,0,4f,29,e8,4e,0,4f,29,ea,5e,91,2,91,20,5f,1f] - readEnd(queue)=-1 - contextId=4

Thanks in advance for your help
mlohbihler

Master
[Avatar]

Joined: 01/03/2007 22:48:52
Messages: 1847
Offline

Can you provide either the full stack trace or the complete APDU bytes? There isn't enough context to go on (i.e. what object is currently being deserialized when the exception occurs). The APDU bytes would be preferred.

Best regards,
Matthew Lohbihler
jeremie

Initiate

Joined: 30/08/2010 08:35:42
Messages: 11
Offline

Not sure it helps... :

Below the stack trace of the exception :



And here the serviceRequest object who causes this exception :



If it is not enough, can you say me what function/parameters to survey in the source code? Thank you

This message was edited 1 time. Last update was at 17/09/2010 08:51:26

mlohbihler

Master
[Avatar]

Joined: 01/03/2007 22:48:52
Messages: 1847
Offline

Yeah, i still can't see what it was trying to decode. If you could set a breakpoint at IpMessageControl line 553:



... and then provide the full contents of "queue", that would be very helpful.

Best regards,
Matthew Lohbihler
mlohbihler

Master
[Avatar]

Joined: 01/03/2007 22:48:52
Messages: 1847
Offline

Or if it's easier, put a breakpoint at ComplexACK line 189,



A post the contents of "serviceData".

Best regards,
Matthew Lohbihler
jeremie

Initiate

Joined: 30/08/2010 08:35:42
Messages: 11
Offline

Hi Matthew

During the last call to the parseServiceDate() function (before the exception appears), serviceData has this value :

[c,7,80,30,0,1e,29,4b,4e,c4,7,80,30,0,4f,29,4d,4e,75,c,0,4f,54,45,53,20,44,4f,
4f,52,20,31,4f,29,4f,4e,91,1e,4f,29,55,4e,91,0,4f,29,6f,4e,82,4,0,4f,29,24,4e,
91,0,4f,29,67,4e,91,0,4f,29,51,4e,10,4f,29,57,4e,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,4f,29,68,4e,91,0,4f,29,e7,4e,91,0,4f,29,e9,4e,91,0,4f,29,eb,4e,91,2,4f,29,
e6,4e,1e,4f,29,e3,4e,64,4f,29,e5,4e,7,8,4f,29,1c,4e,75,c,0,4f,54,45,53,20,44,
4f,4f,52,20,31,4f,29,e2,4e,91,0,4f,29,e4,4e,c4,1,0,20,0,4f,29,e8,4e,0,4f,29,ea,
5e,91,2,91,20,5f,1f]
mlohbihler

Master
[Avatar]

Joined: 01/03/2007 22:48:52
Messages: 1847
Offline

Hi jeremie,

The data for the Door Pulse Time is not encoded properly. According to the specification an Unsigned Integer must begin with a tag that provides the length of the value (20.2.4). This is the offending part (in bold):

[c,7,80,30,0,1e,29,4b,4e,c4,7,80,30,0,4f,29,4d,4e,75,c,0,4f,54,45,53,20,44,4f,
4f,52,20,31,4f,29,4f,4e,91,1e,4f,29,55,4e,91,0,4f,29,6f,4e,82,4,0,4f,29,24,4e,
91,0,4f,29,67,4e,91,0,4f,29,51,4e,10,4f,29,57,4e,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,4f,29,68,4e,91,0,4f,29,e7,4e,91,0,4f,29,e9,4e,91,0,4f,29,eb,4e,91,2,4f,29,
e6,4e,1e,4f,29,e3,4e,64,4f,29,e5,4e,7,8,4f,29,1c,4e,75,c,0,4f,54,45,53,20,44,
4f,4f,52,20,31,4f,29,e2,4e,91,0,4f,29,e4,4e,c4,1,0,20,0,4f,29,e8,4e,0,4f,29,ea,
5e,91,2,91,20,5f,1f]

The correct encoding of value of 30 is "4e,21,1e,4f".

In "21", the "2" signifies that the type is an UnsignedInteger, and the "1" provides the length (1 byte in this case). I realize that this information can be implied (the type by the property identifier, and the length by whatever is contained in the tags 4e and 4f) but i can't find anywhere in the spec where this alternative encoding is described.

What kind of equipment are you using?

This message was edited 1 time. Last update was at 20/09/2010 10:35:50


Best regards,
Matthew Lohbihler
jeremie

Initiate

Joined: 30/08/2010 08:35:42
Messages: 11
Offline

Many thanks for your help Matthew!

For your information, I have got an OpenSource BACNET Server for Linux (C/C++), embedded in a proprietary equipment.

This message was edited 1 time. Last update was at 21/09/2010 07:54:59

mlohbihler

Master
[Avatar]

Joined: 01/03/2007 22:48:52
Messages: 1847
Offline

Ok. Maybe you could inform the developer of the server about this issue, and find out whether this alternate encoding is official, common, or just a mistake.

Best regards,
Matthew Lohbihler
jeremie

Initiate

Joined: 30/08/2010 08:35:42
Messages: 11
Offline

I will


In BACNet, reliability property for AccessDoor Object is always required.
Therefore, I think the declaration is uncorrect in the ObjectProperties.java file (com.serotonin.bacnet4j.obj package) :



=>



mlohbihler

Master
[Avatar]

Joined: 01/03/2007 22:48:52
Messages: 1847
Offline

Right you are. The change has been added to the code.

Best regards,
Matthew Lohbihler
 
Forum Index » BACnet4J general discussion
Go to:   
Powered by JForum 2.1.9 © JForum Team