FHT binding: set time of FHT80b

Hi @ugh_bough,

i tried using the set time configuration with my nanoCUL and openhab2.

It leads to a situation where my CUL isn’t working anymore. I have to reboot in order to make it work again.
Normally sending commands to my my FHT80’s and FS20 devices is working well.

Stacktrace:

2017-02-03 19:35:01.531 [ERROR] [port.cul.internal.AbstractCULHandler] - Can't write to CUL /dev/ttyACM0
java.io.IOException: Input/output error in writeArray
        at gnu.io.RXTXPort.writeArray(Native Method)
        at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1211)[223:com.neuronrobotics.nrjavaserial:3.12.0.OH]
        at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:221)[:1.8.0]
        at sun.nio.cs.StreamEncoder.implFlushBuffer(StreamEncoder.java:291)[:1.8.0]
        at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:295)[:1.8.0]
        at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:141)[:1.8.0]
        at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:229)[:1.8.0]
        at java.io.BufferedWriter.flush(BufferedWriter.java:254)[:1.8.0]
        at org.openhab.io.transport.cul.internal.AbstractCULHandler.writeMessage(AbstractCULHandler.java:306)[220:org.openhab.io.transport.cul:1.9.0.201701020211]
        at org.openhab.io.transport.cul.internal.AbstractCULHandler.access$0(AbstractCULHandler.java:297)[220:org.openhab.io.transport.cul:1.9.0.201701020211]
        at org.openhab.io.transport.cul.internal.AbstractCULHandler$SendThread.run(AbstractCULHandler.java:59)[220:org.openhab.io.transport.cul:1.9.0.201701020211]
2017-02-03 19:35:01.684 [ERROR] [port.cul.internal.AbstractCULHandler] - Can't write report command to CUL
java.io.IOException: Input/output error in writeArray
        at gnu.io.RXTXPort.writeArray(Native Method)
        at gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1211)[223:com.neuronrobotics.nrjavaserial:3.12.0.OH]
        at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:221)[:1.8.0]
        at sun.nio.cs.StreamEncoder.implFlushBuffer(StreamEncoder.java:291)[:1.8.0]
        at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:295)[:1.8.0]
        at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:141)[:1.8.0]
        at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:229)[:1.8.0]
        at java.io.BufferedWriter.flush(BufferedWriter.java:254)[:1.8.0]
        at org.openhab.io.transport.cul.internal.AbstractCULHandler.requestCreditReport(AbstractCULHandler.java:285)[220:org.openhab.io.transport.cul:1.9.0.201701020211]
        at org.openhab.io.transport.cul.internal.AbstractCULHandler.writeMessage(AbstractCULHandler.java:311)[220:org.openhab.io.transport.cul:1.9.0.201701020211]
        at org.openhab.io.transport.cul.internal.AbstractCULHandler.access$0(AbstractCULHandler.java:297)[220:org.openhab.io.transport.cul:1.9.0.201701020211]
        at org.openhab.io.transport.cul.internal.AbstractCULHandler$SendThread.run(AbstractCULHandler.java:59)[220:org.openhab.io.transport.cul:1.9.0.201701020211]  

Anyone got a hint on this?

Edit:
When i shutdown my openhab i get this exception in my log too:

2017-02-04 20:55:00.154 [ERROR] [org.quartz.core.JobRunShell         ] - Job cul.FHT UpdateFHTTimeJob threw an unhandled Exception:
java.lang.NullPointerException
        at org.openhab.binding.fht.internal.FHTBinding.writeRegisters(FHTBinding.java:597)[216:org.openhab.binding.fht:1.9.0.201701020211]
        at org.openhab.binding.fht.internal.FHTBinding.updateTime(FHTBinding.java:553)[216:org.openhab.binding.fht:1.9.0.201701020211]
        at org.openhab.binding.fht.internal.FHTBinding.access$1(FHTBinding.java:549)[216:org.openhab.binding.fht:1.9.0.201701020211]
        at org.openhab.binding.fht.internal.FHTBinding$UpdateFHTTimeJob.execute(FHTBinding.java:620)[216:org.openhab.binding.fht:1.9.0.201701020211]
        at org.quartz.core.JobRunShell.run(JobRunShell.java:202)[104:org.eclipse.smarthome.core.scheduler:0.9.0.b3]
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)[104:org.eclipse.smarthome.core.scheduler:0.9.0.b3]
2017-02-04 20:55:00.189 [ERROR] [org.quartz.core.ErrorLogger         ] - Job (cul.FHT UpdateFHTTimeJob threw an exception.
org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: java.lang.NullPointerException]
        at org.quartz.core.JobRunShell.run(JobRunShell.java:213)[104:org.eclipse.smarthome.core.scheduler:0.9.0.b3]
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)[104:org.eclipse.smarthome.core.scheduler:0.9.0.b3]
Caused by: java.lang.NullPointerException
        at org.openhab.binding.fht.internal.FHTBinding.writeRegisters(FHTBinding.java:597)[216:org.openhab.binding.fht:1.9.0.201701020211]
        at org.openhab.binding.fht.internal.FHTBinding.updateTime(FHTBinding.java:553)[216:org.openhab.binding.fht:1.9.0.201701020211]
        at org.openhab.binding.fht.internal.FHTBinding.access$1(FHTBinding.java:549)[216:org.openhab.binding.fht:1.9.0.201701020211]
        at org.openhab.binding.fht.internal.FHTBinding$UpdateFHTTimeJob.execute(FHTBinding.java:620)[216:org.openhab.binding.fht:1.9.0.201701020211]
        at org.quartz.core.JobRunShell.run(JobRunShell.java:202)[104:org.eclipse.smarthome.core.scheduler:0.9.0.b3]
        ... 1 more