Listing 2-1. Caesar_Cipher_Threadtype::run() Implementation - Analog Devices ADSP-BF537 EZ-KIT Lite Getting Started

Hide thumbs Also See for ADSP-BF537 EZ-KIT Lite:
Table of Contents

Advertisement

Listing 2-1. Caesar_Cipher_ThreadType::Run() Implementation

Listing 2-1.
Caesar_Cipher_ThreadType::Run()
Implementation
void
Caesar_Cipher_ThreadType::Run()
{
static char *pszWelcome = "Welcome to Blackfin.
\"A\" though \"Z\" and I will encrypt them.\xa\xd";
if ( 0 >= send ( m_iSocket, pszWelcome, strlen ( pszWelcome ),
0 ) )
return;
while (1)
{
int iCount;
if ( ( iCount = recv ( m_iSocket, m_vInBuf, sizeof (
m_vInBuf ) / sizeof ( char ), 0 ) ) >= 1 )
{
int iCharNum;
char c;
for ( iCharNum = 0; iCharNum < iCount; ++iCharNum )
{
'y' ) )
space control character to overwrite the character sent */
}
if ( send (m_iSocket, m_vOutBuf, iCount * 2, 0) <= 0 )
}
2-10
www.BDTIC.com/ADI
c = m_vInBuf [ iCharNum ];
if ( ( c >= 'A' && c <= 'Y' ) || ( c >= 'a' && c <=
++c;
else if ( c == 'Z' || c == 'z' )
c -= ( 'Z' - 'A' );
m_vOutBuf [ iCharNum ] = '\x8';
m_vOutBuf [ iCharNum + iCount ] = c;
break;
Getting Started with ADSP-BF537 EZ-KIT Lite
Type letters
/* telnet back-

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ADSP-BF537 EZ-KIT Lite and is the answer not in the manual?

Table of Contents