uint32_t PN_API_DEV_plugSubmodule | ( | uint16_t | slotNumber_p, |
uint16_t | subslotNumber_p, | ||
PN_API_DEV_SSubmoduleDescriptor_t * | pSubmoduleDescriptor_p | ||
) |
Plug a submodule.
With this function the application can attach a submodule to particular module and plug a submodule to a subslot. By doing this, the submodule will be registered on stack and can be visible from outside.
Function takes a pointer to an instance of the submodule description structure and checks, that it is filled with valid parameters. If the parameters are correct, it checks further:
If the conditions fulfilled the function will copy the instance of the submodule to the stack. Application can modify the module instance and the pointer to it after invoking the function.
/////////////////// I&M Functionality ///////////////////
Additionally, the function checks the I&M representation scope of the submodule. If I&M representation scope of the submodule is other than no representation (PN_API_DEV_APP_IM_R_NO), submodule will be assigned as an I&M Carrier. In thi case function checks the correctness of the I&M Data Set, specified by the I&M Data Set pointer in the submodule description structure.
Every I&M Data Set must contain at least I&M0 Data. An I&M Device Representative must support additionally I&M1, I&M2 and I&M3 Data.
[in] | slotNumber_p | Number of the slot. |
[in] | subslotNumber_p | Number of the sub slot. |
[in] | pSubmoduleDescriptor_p | Sub module, to be plugged. |
PN_API_DEV_eOK | Submodule was plugged successfuly. |
PN_API_DEV_eERROR_PLUG_SUBMODULE_INVALID_SLOT | Either slot is empty or invalid slot number. |
PN_API_DEV_eERROR_PLUG_SUBMODULE_NO_FREE_SUBSLOT | No free subslot. |
PN_API_DEV_eERROR_PLUG_SUBMODULE_SUBSSLOT_ALREADY_PLUGGED | Subslot with this number is already plugged. |
PN_API_DEV_eERROR_PLUG_SUBMODULE_INVALID_SUBMODULE_TYPE | Invalid submodule type. |
\ Relevant for I&M Carrier
PN_API_DEV_eERROR_IM_DATA_SET_INVALID_POINTER | Invalid pointer to I&M Data. |
PN_API_DEV_eERROR_IM_INVALID_REPRESENTATIVE_SCOPE | Invalid representative scope of I&M Carrier. |
#PN_API_DEV_eERROR_IM_DEVICE_REPRESENTATIVE_ALREADY_PLUGGED | I&M device representative is already assigned. |
#PN_API_DEV_eERROR_IM_MODULE_REPRESENTATIVE_ALREADY_PLUGGED | I&M module representative is already assigned for this module. |
PN_API_DEV_eERROR_IM_CARRIER_NO_IM0_DATA | I&M data set doesn't contain valid I&M0 data. |
PN_API_DEV_eERROR_IM_DEVICE_REPRESENTATIVE_NO_IM1_DATA | I&M data set for I&M device representatives doesn't support I&M1 data. |
PN_API_DEV_eERROR_IM_DEVICE_REPRESENTATIVE_NO_IM2_DATA | I&M data set for I&M device representatives doesn't support I&M2 data. |
PN_API_DEV_eERROR_IM_DEVICE_REPRESENTATIVE_NO_IM3_DATA | I&M data set for I&M device representatives doesn't support I&M3 data. |