<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Creating a Schedule Object in BACnet4j]]></title><description><![CDATA[<p dir="auto">I am trying to create a schedule object in BACnet4j using the following (simplified for clarity):</p>
<pre><code>
import com.serotonin.bacnet4j.LocalDevice;
import com.serotonin.bacnet4j.exception.BACnetServiceException;
import com.serotonin.bacnet4j.npdu.ip.IpNetwork;
import com.serotonin.bacnet4j.obj.BACnetObject;
import com.serotonin.bacnet4j.transport.Transport;
import com.serotonin.bacnet4j.type.enumerated.ObjectType;
import com.serotonin.bacnet4j.type.enumerated.PropertyIdentifier;
import com.serotonin.bacnet4j.type.primitive.Enumerated;
import com.serotonin.bacnet4j.type.primitive.ObjectIdentifier;


public class ScheduleTest
{
	public static void main(String[] args)
	{
		try
		{
			LocalDevice localDevice = new LocalDevice(21, new Transport(new IpNetwork("255.255.255.0")));
			BACnetObject schedule = new BACnetObject(localDevice, new ObjectIdentifier(ObjectType.schedule, 0));

			schedule.setProperty(PropertyIdentifier.scheduleDefault, new Enumerated(0));
		}
		catch (BACnetServiceException e)
		{
			e.printStackTrace();
		}
	}
}
```However, when I run it, I get this:
</code></pre>
<p dir="auto">com.serotonin.bacnet4j.exception.BACnetServiceException: class=Property, code=Invalid data type, message=expected class com.serotonin.bacnet4j.type.AmbiguousValue, received=class com.serotonin.bacnet4j.type.primitive.Enumerated<br />
at com.serotonin.bacnet4j.obj.ObjectProperties.validateValue(ObjectProperties.java:154)<br />
at com.serotonin.bacnet4j.obj.BACnetObject.setProperty(BACnetObject.java:192)<br />
at ScheduleTest.main(ScheduleTest.java:21)</p>
<pre><code class="language-From"></code></pre>
]]></description><link>https://forum.mango-os.com/topic/1825/creating-a-schedule-object-in-bacnet4j</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 23:26:02 GMT</lastBuildDate><atom:link href="https://forum.mango-os.com/topic/1825.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 06 Mar 2015 10:54:35 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Creating a Schedule Object in BACnet4j on Tue, 02 Jun 2015 12:39:52 GMT]]></title><description><![CDATA[<p dir="auto">Sorry to answer so lately, I finally found back my login and password for this site.</p>
<p dir="auto">Tank you Joolz, your comment helped me buld a schedule object. I'll try to paste a very basic example when I'll figure out how to put my code into code tag.</p>
]]></description><link>https://forum.mango-os.com/post/10060</link><guid isPermaLink="true">https://forum.mango-os.com/post/10060</guid><dc:creator><![CDATA[wang]]></dc:creator><pubDate>Tue, 02 Jun 2015 12:39:52 GMT</pubDate></item><item><title><![CDATA[Reply to Creating a Schedule Object in BACnet4j on Thu, 16 Apr 2015 03:11:30 GMT]]></title><description><![CDATA[<p dir="auto">I have, but BACnet4j doesn't make it straight forward.</p>
<p dir="auto">First you need to subclass BACnetObject and make a Schedule object class.<br />
In that schedule object class, have a local variable for schedule default property.<br />
In the constructor, set the present value and schedule default properties with this value:<br />
new AmbiguousValue(new ByteQueue(new byte[]{0}))</p>
<p dir="auto">Then override the get() and set() methods, so that if the schedule default property is being set/retrieved, you get it from your local variable instead of the property map.</p>
]]></description><link>https://forum.mango-os.com/post/9870</link><guid isPermaLink="true">https://forum.mango-os.com/post/9870</guid><dc:creator><![CDATA[joolz]]></dc:creator><pubDate>Thu, 16 Apr 2015 03:11:30 GMT</pubDate></item><item><title><![CDATA[Reply to Creating a Schedule Object in BACnet4j on Wed, 15 Apr 2015 16:06:35 GMT]]></title><description><![CDATA[<p dir="auto">Up.</p>
<p dir="auto">Has no one succeeded to implement this object ?</p>
]]></description><link>https://forum.mango-os.com/post/9862</link><guid isPermaLink="true">https://forum.mango-os.com/post/9862</guid><dc:creator><![CDATA[wang]]></dc:creator><pubDate>Wed, 15 Apr 2015 16:06:35 GMT</pubDate></item><item><title><![CDATA[Reply to Creating a Schedule Object in BACnet4j on Tue, 24 Mar 2015 13:37:20 GMT]]></title><description><![CDATA[<p dir="auto">Hello community,</p>
<p dir="auto">I am also having some troubles with the Bacnet schedule, or there might be something I do not understand.<br />
Can someone provide a brief example of a working Bacnet schedule object, because I did not find any?</p>
<p dir="auto">Thanks in advance.<br />
Best regards,</p>
]]></description><link>https://forum.mango-os.com/post/9803</link><guid isPermaLink="true">https://forum.mango-os.com/post/9803</guid><dc:creator><![CDATA[wang]]></dc:creator><pubDate>Tue, 24 Mar 2015 13:37:20 GMT</pubDate></item></channel></rss>