-1

In my sdr client Application in C# I am unable to properly convert frequency(10087000) in hexa decimal and pass it to socket.

I am using cloudIQ device and need help to set the frequency and other parameters using socket.

petezurich
  • 9,280
  • 9
  • 43
  • 57
M Imran
  • 109
  • 7

1 Answers1

1

Assuming that the frequency is in Int32

public String FrequencyToHexadecimal(Int32 frequency)
{
    Int32 networkOrder = IPAddress.HostToNetworkOrder(frequency);
    Byte[] bytes = BitConverter.GetBytes(networkOrder);
    return BitConverter.ToString(bytes).Replace("-","");
}

The result will be a hexadecimal string in network byte order.

amsga
  • 98
  • 12