/// <summary> /// 配置RX的工作模式 /// </summary> /// <param name="mode">工作模式</param> /// <param name="is_fod">是否配置为FOD状态</param> /// <param name="targetId"></param> /// <returns></returns> public byte[] RxConfigMode(RxMode mode, byte is_fod, int targetId = 0) { byte[] ar = null; UInt16 crc; RxInitConfigCmd cmd = new RxInitConfigCmd(); InitHeader(typeof(RxInitConfigCmd), (CmdHeader)cmd, 0xA1, TYPE_RX, (UInt16)targetId); cmd.mode = (byte)mode; cmd.testfunc = is_fod; cmd.action = 0x01; ar = Struct2Array <RxInitConfigCmd>(cmd); crc = CalcCRC16(0, ar, ar.Length - 2); ar[ar.Length - 2] = (byte)(crc >> 8); ar[ar.Length - 1] = (byte)(crc & 0xff); return(ar); }
public async Task <bool> SetRXModeAsync(RxMode mode) { return(await WriteRegsAsync(RX_MODE, new byte[] { (byte)mode })); }