I have an encoder function which has an IP and SDI input interface.
Dependent of the input interface, I need to send a specific command to my device. How can I know in my profile load script which input interface is in use?
Although there are calls to navigate in the booking from within profile-load scripts, we should avoid using them.
As general rule, a profile-load should only apply settings to the function DVE and nothing more. This allows to have independent profile-load scripts that can be applied on a function DVE , without any dependency on a booking. This has, amongst other, following advantages:
- during implementation phase, profile-load scripts can be tested at a very early stage
- profile-load can more easily be re-used across projects
- profile-load scripts can be unit-tested
- configuration can be validated by the end user at a very early stage
Looking at your use case, the connectivity is defined in your service definition. Considering that your LSO script is specific to your service definition, you can just hard code the interface in use in your LSO. I'd then suggest to call your profile-load with a specific 'Profile Action' indicating which interface needs to be configured ( ie : 'APPLY_WITH_SDI_INPUT' instead of just 'APPLY' ). Then, inside your Profile-load script, apply different settings based on the incoming Profile Action.
Another option would be to check in the profile-load script which interface has a profile instance assigned (need to further investigate here to see what is possible).
Hi Jens,
From your reservation, you can get the service definition used.
From that service definition, you can get the node for which your profile load script is running.
From that node object, you can use the GetConnectedResources method, to find out which resources are connected to your interface.
Based on this, you should be able to detect which interface type is used.
Optionally you can pass an interface type and interface name to the GetConnectedResources method, to find out which one has any connected resources.