void Write (void)
{
FT_STATUS ftStatus = 2;
DWORD BytesWritten;
char TxBuffer[1] = {0}; // Contains data to write to device
int to_send = 16; // Data to send
TxBuffer[0] = (char) to_send;
DWORD EventDWord;
DWORD TxBytes;
DWORD RxBytes;
DWORD BytesReceived;
char RxBuffer[1] = {0};
// Sending data frame
ftStatus = FT_Write(ftHandle, TxBuffer, sizeof(TxBuffer), &BytesWritten);
if (ftStatus == FT_OK)
{
cout << "Data transmitted" << endl;
}
else
{
}
FT_GetStatus(ftHandle,&RxBytes,&TxBytes,&EventDWord);
if (ftStatus == FT_OK)
{
cout << "Status device readed" << endl;
}
//if (RxBytes > 0)
//{
ftStatus = FT_Read(ftHandle,RxBuffer,RxBytes,&BytesReceived);
if (ftStatus == FT_OK)
{
cout << "Data readed" << endl;
for (unsigned int i = 0; i<300; i++)
{
cout << "containing of buffor ==> " << i << " "<< (int) RxBuffer[i] << endl;
}
}
else
{
}
//}
getchar();
getchar();
}