0

I am working on a wpf application which performs few operations. I was working on C++ application few days before and now their is a requirement to implement the same in my wpf app.

In my c++ code I had written the following:

m_texti2cRead->clear();

unsigned char buffer[512];
int address = m_texteditAddress->getText().getHexValue32();
m_msp430->SetAddress(address);
if(m_msp430->ReadBytes(m_dataSize, buffer) == 1 )
{
   //Display
   String output = String::toHexString(buffer, m_dataSize);
   m_texti2cRead->setText(output);
}

I implemented the same in my Wpf App as follows:

ReadMessage = string.Empty;
Byte[] buffer = new Byte[512];
int address;
int m_DataSize = 1;

string strValue = AddressMessage;
if (strValue.StartsWith("0x"))
{
     strValue = strValue.Remove(0, 2);
     address = Convert.ToInt32(strValue);
     mComm.setAddress(address);
}           
if (mComm.ReadBytes(m_datasize, ref buffer) == 1)
{
    // Here I don know how to perform ToHexString Operation of (buffer and m_DataSize)
}

How can I do the same in my wpf app??? Please help!!!

Dennis
  • 37,026
  • 10
  • 82
  • 150
Owais Wani
  • 119
  • 1
  • 6
  • 14

0 Answers0