Ejemplo n.º 1
0
RfProfileData DomainRfProfileStatus_001::getRfProfileData(UIntN participantIndex, UIntN domainIndex)
{
    // FIXME:  can this be cached?  If so how do we know when the data changes?

    // if center frequency isn't available the error will get thrown back to the policy

    Frequency centerFrequency = getParticipantServices()->primitiveExecuteGetAsFrequency(
        esif_primitive_type::GET_RFPROFILE_CENTER_FREQUENCY, domainIndex);

    RfProfileSupplementalData rfProfileSupplementalData(0, 0, 0, 0, RadioConnectionStatus::NotConnected, 0);
    RfProfileData rfProfileData(centerFrequency, Frequency(0), Frequency(0), rfProfileSupplementalData);

    return rfProfileData;
}
Ejemplo n.º 2
0
RfProfileData DomainRfProfileStatus_002::getRfProfileData(UIntN participantIndex, UIntN domainIndex)
{
    // FIXME:  can any of this be cached?  If so how do we know when the data changes?

    //
    // If any of these primitive calls fail we allow the exception to throw back to the requesting policy.
    //

    Frequency centerFrequency = getParticipantServices()->primitiveExecuteGetAsFrequency(
        esif_primitive_type::GET_RFPROFILE_CENTER_FREQUENCY, domainIndex);

    Frequency leftFrequencySpread = getParticipantServices()->primitiveExecuteGetAsFrequency(
        esif_primitive_type::GET_RFPROFILE_FREQUENCY_SPREAD_LEFT, domainIndex);

    Frequency rightFrequencySpread = getParticipantServices()->primitiveExecuteGetAsFrequency(
        esif_primitive_type::GET_RFPROFILE_FREQUENCY_SPREAD_RIGHT, domainIndex);

    UInt32 channelNumber = getParticipantServices()->primitiveExecuteGetAsUInt32(
        esif_primitive_type::GET_RFPROFILE_CHANNEL_NUMBER, domainIndex);

    UInt32 noisePower = getParticipantServices()->primitiveExecuteGetAsUInt32(
        esif_primitive_type::GET_RFPROFILE_NOISE_POWER, domainIndex);

    UInt32 signalToNoiseRatio = getParticipantServices()->primitiveExecuteGetAsUInt32(
        esif_primitive_type::GET_RFPROFILE_SIGNAL_TO_NOISE_RATIO, domainIndex);

    UInt32 rssi = getParticipantServices()->primitiveExecuteGetAsUInt32(
        esif_primitive_type::GET_RFPROFILE_RSSI, domainIndex);

    UInt32 uint32Value = getParticipantServices()->primitiveExecuteGetAsUInt32(
        esif_primitive_type::GET_RFPROFILE_CONNECTION_STATUS, domainIndex);
    RadioConnectionStatus::Type radioConnectionStatus = static_cast<RadioConnectionStatus::Type>(uint32Value);

    UInt32 bitError = getParticipantServices()->primitiveExecuteGetAsUInt32(
        esif_primitive_type::GET_RFPROFILE_BIT_ERROR, domainIndex);

    RfProfileSupplementalData rfProfileSupplementalData(channelNumber, noisePower, signalToNoiseRatio, rssi,
        radioConnectionStatus, bitError);

    RfProfileData rfProfileData(centerFrequency, leftFrequencySpread, rightFrequencySpread, rfProfileSupplementalData);

    return rfProfileData;
}