Getting Started with ADSP-BF537 EZ-KIT Lite
3-19
Controlling a real-time application via TCP/IP
Listing 3-1.
Caesar_Cipher_ThreadType::Run() New
Implementation
void
Caesar_Cipher_ThreadType::Run()
{
static char *pszWelcome = "Welcome to Blackfin. Press \"+\" and
\"-\" to change volume level.\xa\xd";
if ( 0 >= send ( m_iSocket, pszWelcome, strlen ( pszWelcome ),
0 ))
return;
float volume = 48.0;
VDK::MessageID msg = VDK::CreateMessage ( VOL_CHANGE, volume,
NULL );
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 )
{
c = m_vInBuf [ iCharNum ];
if ( c == '+' || c == '-' )
{
if ( c == '+' )
= 1.0;
else
volume -= 1.0;
/* Volume must in a range from 0.0 to 48.0 */
www.BDTIC.com/ADI
Содержание EZ-KIT Lite ADSP-BF537
Страница 4: ...www BDTIC com ADI ...
Страница 8: ...CONTENTS viii Getting Started with ADSP BF537 EZ KIT Lite www BDTIC com ADI ...
Страница 52: ...Listing 1 3 Exercise 1 Part 3 1 30 Getting Started with ADSP BF537 EZ KIT Lite www BDTIC com ADI ...
Страница 88: ...What s Next 3 22 Getting Started with ADSP BF537 EZ KIT Lite www BDTIC com ADI ...