Getting Started with ADSP-BF537 EZ-KIT Lite
2-7
Running a TCP/IP application on an ADSP-BF537 EZ-KIT Lite
To enable multiple clients (computers) to connect concurrently to the
same host (the EZ-KIT Lite), TCP/IP applications typically use multiple
operating system threads of execution as follows.
1. The main application thread begins polling the port number(s) rel-
evant to the application.
2. When a client connects, a new “worker” thread is spawned to inter-
act with the client.
3. Meanwhile, the main application thread continues polling for new
connections.
The following procedure creates a Caesar Cipher application from the
skeleton template. The steps implement a thread to interact with the cli-
ent, producing a Caesar Cipher on input received from the client.
Alternatively, the project
<
install_path
>\Blackfin\Examples\ADSP-BF537 EZ-Kit Lite\Getting
Started Examples\Part_2_1\Caesar_Cipher.dpj
can be loaded to the PC
if you are unconcerned about the details herein and want to avoid typing
in source code. (If you load the project, skip the following procedure).
To create a new thread type,
Caesar_Cipher_ThreadType
:
1. From the
Kernel
page of Vi+
Project
window, navigate
to
Kernel
–>
Threads
–>
Thread Types
. Right-click and select
New
thread type. Type
Caesar_Cipher_ThreadType
in the
Name
field,
leave
Source File
and
Header File
as is, automatic source code gen-
eration as
Yes
, and leave the
Language
as
C++
(
).
2. Click
OK
. The new thread displays in the
Vi+ Kernel
tab.
3. Switch back to the
Project
page and open the newly-created source
file
Caesar_Cipher_ThreadType.cpp
. Replace the method
Caesar_Cipher_ThreadType::Run()
with the contents of
2-1. Caesar_Cipher_ThreadType::Run() Implementation” on
www.BDTIC.com/ADI