private void FrameAvailableHandler(ref RdsFrame frame) { RdsFrameAvailableDelegate availableDelegate = this.FrameAvailable; if (availableDelegate == null) return; availableDelegate(ref frame); }
public void Process(ref RdsFrame _rdsFrame) { string text = string.Format("{0:X}", _rdsFrame.GroupA); if (text.Length == 4 && (!XDRPlugin.ExternalRDS)) { XDRPlugin.RDS_Group = _rdsFrame.GroupB.ToString("X4") + _rdsFrame.GroupC.ToString("X4") + _rdsFrame.GroupD.ToString("X4"); } }
private void FrameAvailableHandler(ref RdsFrame frame) { RdsFrameAvailableDelegate frameAvailable = this.FrameAvailable; if (frameAvailable != null) { frameAvailable(ref frame); } }
public void Process(ref RdsFrame _rdsFrame) { string text = string.Format("{0:X}", _rdsFrame.GroupA); if (text.Length == 4) { this._rdsDataLoggerPanel.printData(ref _rdsFrame); } }
public void PushChange(RdsFrame frame) { //Fire events rdsSupported = true; OnRDSFrameReceived?.Invoke(frame); //Get the command RDSCommand c = RDSCommand.ReadRdsFrame(frame); OnRDSCommandReceived?.Invoke(c); //Set info programIdentificationCode = c.programIdentificationCode; //Switch on the type Type commandType = c.GetType(); if (commandType == typeof(BasicDataRDSCommand)) { HandleBasicDataRDSCommand((BasicDataRDSCommand)c); } }
public static RDSCommand ReadRdsFrame(RdsFrame frame) { //Swap frame bits ushort groupA = (ushort)((frame.GroupA >> 8) | (frame.GroupA << 8)); ushort groupB = (ushort)((frame.GroupB >> 8) | (frame.GroupB << 8)); ushort groupC = (ushort)((frame.GroupC >> 8) | (frame.GroupC << 8)); ushort groupD = (ushort)((frame.GroupD >> 8) | (frame.GroupD << 8)); //Decode params in block 2 RdsHeaderFrame header = DecodeGroupBHeader(groupB); //Determine the RDSCommand to use RDSCommand cmd; switch (header.groupType) { case 0: cmd = new BasicDataRDSCommand(); break; case 2: cmd = new RadioTextRDSCommand(); break; default: cmd = new UnsupportedRDSCommand(); break; } //Set basic params on the command cmd.programIdentificationCode = groupA; cmd._header = header; cmd._groupA = groupA; cmd._groupB = groupB; cmd._groupC = groupC; cmd._groupD = groupD; //Read the data cmd.ReadCommand(header.specialData, groupC, groupD); return(cmd); }
public void printData(ref RdsFrame _rdsFrame) { if (m_terminalIsOpen) { if (checkBoxRFtapOn.Checked == true) { byte[] header = { 0x52, 0x46, 0x74, 0x61, 4, 0, 0, 0, 0x10, 0, 3, 0xFF, 0x72, 0x64, 0x73, 0 }; byte[] payload = { 0, 0, 0, 0, 0, 0, 0, 0, 0x41, 0x42, 0x43, 0x44 }; MemoryStream MS = new MemoryStream(); BinaryWriter Writer1 = new BinaryWriter(MS); Writer1.Write(header); payload[0] = (byte)(_rdsFrame.GroupA >> 8); payload[1] = (byte)(_rdsFrame.GroupA & 0x00FF); payload[2] = (byte)(_rdsFrame.GroupB >> 8); payload[3] = (byte)(_rdsFrame.GroupB & 0x00FF); payload[4] = (byte)(_rdsFrame.GroupC >> 8); payload[5] = (byte)(_rdsFrame.GroupC & 0x00FF); payload[6] = (byte)(_rdsFrame.GroupD >> 8); payload[7] = (byte)(_rdsFrame.GroupD & 0x00FF); Writer1.Write(payload); var byts = MS.ToArray(); SendUdp2(56148, "101.64.121.21", 52001, byts); MS.Dispose(); } m_serverTerminal.SendMessage("G:\r\n"); m_serverTerminal.SendMessage(_rdsFrame.GroupA.ToString("X4")); m_serverTerminal.SendMessage(_rdsFrame.GroupB.ToString("X4")); m_serverTerminal.SendMessage(_rdsFrame.GroupC.ToString("X4")); m_serverTerminal.SendMessage(_rdsFrame.GroupD.ToString("X4")); m_serverTerminal.SendMessage("\r\n\r\n"); } }