Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error writing multistate property 'stateText' #60

Open
envas opened this issue Apr 16, 2021 · 0 comments
Open

Error writing multistate property 'stateText' #60

envas opened this issue Apr 16, 2021 · 0 comments

Comments

@envas
Copy link

envas commented Apr 16, 2021

Describe the bug
Cannot write multistate property stateText

To Reproduce
Steps to reproduce the behavior:

  1. Create a MultistateValue object in a device
  2. Connect a BACnet client and try to update stateText from the client
  3. Error is generated in the device (server)
java.lang.ClassCastException: com.serotonin.bacnet4j.type.constructed.SequenceOf cannot be cast to com.serotonin.bacnet4j.type.constructed.BACnetArray
	at com.serotonin.bacnet4j.obj.mixin.MultistateMixin.validateProperty(MultistateMixin.java:63)
	at com.serotonin.bacnet4j.obj.BACnetObject.writeProperty(BACnetObject.java:481)
	at com.serotonin.bacnet4j.service.confirmed.WritePropertyRequest.handle(WritePropertyRequest.java:102)
	at com.serotonin.bacnet4j.transport.DefaultTransport.handleConfirmedRequest(DefaultTransport.java:870)
	at com.serotonin.bacnet4j.transport.DefaultTransport.incomingConfirmedRequest(DefaultTransport.java:827)
	at com.serotonin.bacnet4j.transport.DefaultTransport.receiveAPDU(DefaultTransport.java:640)
	at com.serotonin.bacnet4j.transport.DefaultTransport.receiveImpl(DefaultTransport.java:578)
	at com.serotonin.bacnet4j.transport.DefaultTransport.run(DefaultTransport.java:498)
	at java.lang.Thread.run(Thread.java:748)

Expected behavior
I can update stateText from a BACnet client

I logged the request in 'DeviceEventAdapter.allowPropertyWrite()' listener callback and the Property Value is really of the type SequenceOf. The log from my device (server):

2021-04-16 15:09:03,140 - BACnet write property write request received from=192.168.0.130:0xBAC0
2021-04-16 15:09:03,140 -          object-name  : 71L2Az00_plant_mod
2021-04-16 15:09:03,141 -          object-type  : multi-state-value
2021-04-16 15:09:03,141 -          property     : state-text
2021-04-16 15:09:03,141 -          value        : [Anlage Aus, ON-Optimum Start, Ein-Stützbetrieb, Ein-Nachtkühlung, Ein-Zeitprogramm, Ein-Übersteuerung, Ein-Nachlauf]
2021-04-16 15:09:03,141 -          value-type   : SequenceOf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant