#include "CommandsDefine.h"
#include "ProjectConfig.h"
#include "Probe_MSO7000X_2d5g.h"
#include "AnalogChannelCtrl_2d5g_base.h"

//////////////////////////////////////////////////////////////////////////////
// 			2203/7/X GHz_ljw 合并版
//////////////////////////////////////////////////////////////////////////////
void CMD0x29_Request_SetGainTempCorrection_process(u8 *pData,u16 dataLen,u8 bIsContentBitInverted_Recv,u8 bIsContentBitInverted_SendBack)
{
#ifdef RUNNING_WHERE_AT_BOOT	
	Command_SendbackErrorMessage(Error0x02_CannotRunAtBoot);
#else
	//u8 dataBytes= MAX_CHANNEL_NUM * 4;
	 
	u8 channelId = pData[0];
    u8 setData = 0;
	for(int i=0; i<MAX_CHANNEL_NUM; i++)
	{
			if(((channelId>>i) & 0x01) == 1){
				setData = ((pData[i*4+1] & 1) << 5) + (pData[i*4+2] & 0x1F);
				DSA_PE43711(LMH6401_ADDR_TEMPCORRECT_GAIN,setData,channelId);	
				setData = pData[i*4+4];
				DSA_PE43711(LMH6401_ADDR_TEMPCORRECT_FREQ,setData,channelId);	
			}
	}		
 
	Command_SendbackOKMessage();
#endif	
}
