First I receive the data and convert it to string.
data = client.Receive(ref ep);
string received = BitConverter.ToString(data);
The string I get is FF-FF-FF-FF-66-0A. And I try to get INT values from it.
foreach (var item in received)
{
int rec = Convert.ToInt32(item);
int rec = Convert.ToInt32(item,16);
//IF I try second line I get error
//cannot convert from 'int' to 'system.iformatprovider'
}
From using that first line int rec = Convert.ToInt32(item); I get numbers like this 70 70 70 70 45 45 70 70 70 70
As I figured it out I'm converting F > 70 and F > 70, but how to convert FF and make it work by getting FF > 255
BitConverter.ToInt32(data, 0)?intis 32 bits, but that hex number you have is 48 bits. Do you just want to ignore the extra bits at the end?