Problem with new Xiongmaitech / XM Camera binding

Hi all,

I’ve struggled the last hours to put together a basic binding for use with cheap mass-deployed ip cameras based on XMEye SDK.

The current state is:

  • supported things are automatically discovered and added to the inbox
  • upon successful login, device properties (like mac address, firmware etc.) are available to the thing

My problem / need for help:
I’m not a java guy, so the code quality sucks :wink:
But that’s up to a review - currently, I’m trying to add a sound playback channel to an IP camera but without success.

My approach is to translate janglapuk’s python code to java:

When trying to play back audio, I’m using a known-good pcm file and try to send it. However, chunking it and sending does not work and hangs the java thread. Any clues from the experts on this in which direction I could take a look?

The problematic function is PlaySound:

Next pithole will be to delay the disposal of the 2nd socket connection. How to delay a certain action (and access the needed objects there)?

Thanks for any clues and hints - I’m happy if I can give something back to OH when ready :smiley:

Best,
Sascha