Dev1an / Swift-Atem

Blackmagic Design Atem network protocol implementation in swift 5.1 using NIO 2
MIT License
58 stars 27 forks source link

Connected to Switcher #4

Closed reykroona closed 4 years ago

reykroona commented 4 years ago

Hi, I've been looking through your library and I can't seem to figure it out, but is there a way to tell if the controller is connected to a switch? Or if it disconnects from a switch?

Thanks-

Dev1an commented 4 years ago

Hi @reykroona You can add a handler to handle InitiationComplete messages. They will be emitted when a software controller is successfully connected to a switcher. For the moment there is no way to know when a switcher disconnects though. I will add a way to get this information in a future version.

reykroona commented 4 years ago

Thanks, I'll look into that. I've also made some changes in a forked repo in my account that adds CCU controls for shutter, iris, wb, gain & autofocus. I'm not really a programmer by trade, so I'm not 100% sure how to submit a pull request since it's based on an older version, but if you are interested in adding it, it's there.

iosdeveloper commented 4 years ago

Any chance to be notified on disconnected and

sendto(descriptor:pointer:size:destinationPtr:destinationSize:) failed: Can't assign requested address (errno: 49)
ioOnClosedChannel
ioOnClosedChannel
...

in order to reset the controller object (or ideally this would be handled internally). Thanks!