rfaricy
Member
I decompiled the Raw Audio sample app Uniden included with their downloads. I added a second drop-down box for an Output port, and installed com0com which allows this app to write to a port, and allow another application to connect to com0com's output port to read it (in short, it creates a virtual serial port/device).
So far, the connection is working, and I can see the data from my app going into COM11 (com0com's input) and coming out on COM15 (com0com's output). All I'm doing right now is passing the AdValue (I assume, based on the code, that AdValue is the high and low byte pushed together?) straight through:
Am I correct to pass the AdValue straight through as soon as the High Byte and Low Byte are both defined? I'm new to this kind of stuff, but really want to start harnessing this power and perhaps provide a universal tool that translates Uniden's output into straight RS-232 discrim data.
I also noticed it outputs random stuff even when there is no carrier - is it supposed to be like this? Again, I'm new to all this, so forgive me.
So far, the connection is working, and I can see the data from my app going into COM11 (com0com's input) and coming out on COM15 (com0com's output). All I'm doing right now is passing the AdValue (I assume, based on the code, that AdValue is the high and low byte pushed together?) straight through:
Code:
private void timer1_Tick(object sender, EventArgs e)
{
if (this.serialPort1.BytesToRead > 0)
{
int bytesToRead = this.serialPort1.BytesToRead;
byte[] numArray = new byte[bytesToRead];
this.serialPort1.Read(numArray, 0, bytesToRead);
for (int i = 0; i < (int) numArray.Length; i++)
{
if ((numArray[i] & 128) != 0)
{
this.HighByte = numArray[i];
continue;
}
if ((this.HighByte & 128) != 0)
{
if (this.serialPort2.IsOpen)
{
var adElement = new AdElement(DateTime.Now, this.HighByte, numArray[i]);
var u = BitConverter.GetBytes(adElement.AdValue);
this.serialPort2.Write(u, 0, u.Length);
}
this.AdDatabs.Append(this.HighByte, numArray[i]);
}
}
this.pictureBox1.Refresh();
if (this.buttonLog.Text == "Logging" && !this.AdDatabs.IsLogging())
{
this.buttonLog.Text = "Log";
MessageBox.Show("Log reached 65,535 lines.\nLoggin finish");
}
}
}
Am I correct to pass the AdValue straight through as soon as the High Byte and Low Byte are both defined? I'm new to this kind of stuff, but really want to start harnessing this power and perhaps provide a universal tool that translates Uniden's output into straight RS-232 discrim data.
I also noticed it outputs random stuff even when there is no carrier - is it supposed to be like this? Again, I'm new to all this, so forgive me.
Last edited: