I'm working on the AppearTv x20 Platform driver and my task was to implement a table with the services from the transcoder that you can see in the picture. However, I encountered an issue. When I looked into the response of GetMultiServices() it was missing that yellow part. I looked into other calls and found out that this data was on GetServiceStatus(). I asked AppearTv x20 how I could link the two the responses.
They told me to look into the GetMultiServices, but also to look into the result from multiServiceProfile/GetMultiServiceProfiles.
In each multiservice there is a profile ID, to be matched to the uuid/key of a MultiServiceProfile.
Inside the profile there is a list of subservices, and the "index" variable is the one that is combined with the multiservice uuid/key.
This combination between the multiservice uuid/key and index is done in c++:
boost::uuids::name_generator gen(multiservice-uuid);
coderservice-uuid = gen(to_string(index));
It will give me a key that I can find in GetCardAllocations and match it with GetServiceStatus and get the data that I want.
My issue is how to use that c++ code in my driver and how to translate it to c#.
I believe there are 2 ways to tackle this:
- Find or implement something that executes the same logic in C#
- Import the C++ dlls and use the [DllImport] attribute to call the methods from the c++ library. This does require you to know which dll contains the required method(s)
Concerning the 2nd way, I can add an example taken from an older driver the iDirect iSite.
<QAction id="52" name="Manual Login" encoding="csharp" triggers="52" dllImport="MyCPPDll_1-0-0-4.dll"
then in the code:
public class Proxy
{
public static void Login(string username, string password, string ip, int port, int timeout, bool secureConnection, out string result, out string errorResult)
{ … my code…
Login(username, password, ip, port, timeout, secureConnection, out Result, out ErrorResult);
}
[DllImport("MyCPPDll_1-0-0-4.dll")]
extern static void Login(string username, string password, string ip, int port, int timeout, bool secureConnection, out IntPtr result, out IntPtr errorResult);
}