//------------------------------------------------------------------------------
void MobiCoreDriverDaemon::processGetMobiCoreVersion(
    Connection  *connection
)
{
    // there is no payload to read

    // Device required
    MobiCoreDevice *device = (MobiCoreDevice *) (connection->connectionData);
    CHECK_DEVICE(device, connection);

    // Get <t-base version info from secure world.
    mcDrvRspGetMobiCoreVersion_t rspGetMobiCoreVersion;

    mcResult_t mcResult = device->getMobiCoreVersion(&rspGetMobiCoreVersion.payload);

    if (mcResult != MC_DRV_OK) {
        LOG_V("MC GET_MOBICORE_VERSION returned code %d", mcResult);
        writeResult(connection, mcResult);
        return;
    }

    rspGetMobiCoreVersion.header.responseId = MC_DRV_OK;
    connection->writeData(
        &rspGetMobiCoreVersion,
        sizeof(rspGetMobiCoreVersion));
}
//------------------------------------------------------------------------------
void MobiCoreDriverDaemon::processGetMobiCoreVersion(
    Connection  *connection
) {
	// Device required
	MobiCoreDevice *device = (MobiCoreDevice *) (connection->connectionData);
	if (NULL == device) {
		writeResult(connection, MC_DRV_RSP_DEVICE_NOT_OPENED);
		return;
	}

	// Get MobiCore version info from secure world.
	mcDrvRspGetMobiCoreVersion_t rspGetMobiCoreVersion;

	device->getMobiCoreVersion(
		&rspGetMobiCoreVersion.payload);

	uint32_t mcResult = rspGetMobiCoreVersion.payload.mcResult;
	if (MC_MCP_RET_OK != mcResult) {
		LOG_E("processGetMobiCoreVersion(): rspGetMobiCoreVersion mcResult %d", mcResult);
		writeResult(connection, MC_DRV_RSP_FAILED);
		return;
	}

	rspGetMobiCoreVersion.header.responseId = MC_DRV_RSP_OK;
	connection->writeData(
		&rspGetMobiCoreVersion,
		sizeof(rspGetMobiCoreVersion));
}