Async/Await & SIMPL+

I had a recent job where I needed to control NewTek Spark IO decoders. These little guys have a REST API that is fairly easy to use, but require HTTP, cookies, JSON parsing, etc. Perfect fit for C# instead of SIMPL! But the HttpClient class uses asynchronous calls, so getting it to play nicely with SIMPL means you have to work around the async methods since SIMPL+ won’t see them.

My first stab at writing code to control these things works, but the module throws an exception if I dispose objects too quickly. And if a device reboots, it’s hard to tell when it comes back until an exception throws. So my code needs some clean up! I’d like to write about that once I’ve had a chance to sit down and refactor it. In the meantime, I thought it would be good to do a small example of getting async/await to work with SIMPL+.

Continue reading “Async/Await & SIMPL+”

SIMPL+ and Delegates

I’ve been working on my Gold Exam and a good chunk of it is written in SIMPL#. It’s been a good reminder that getting code in SIMPL# to play nicely with SIMPL logic can sometimes turn into a chore. We have SIMPL+ to thank for most of the hair-pulling. I thought a post about delegates and getting them to work in SIMPL+ would be a good thing to write down.

Continue reading “SIMPL+ and Delegates”

Crestron Drivers

I just finished watching all the videos for the C# for Crestron – Crestron Drivers online course and feel like I absorbed very little of it. The driver abstraction seems overly complicated, and the overall presentation of their videos is very dull. I like to contrast them with Q-SYS videos which are short and focused enough to hold your attention. Something about Crestron’s videos feels too robotic and I find myself multitasking with them on in the background.

Continue reading “Crestron Drivers”