
32
the school’s website and parsing information for that particular classroom. It then uses
this data to create a text file version of the schedule and then converts it to a JPG
picture file. Each classroom will have a separate JPG file for each day of the current
week. The program can be set to create files on intervals of every 30 minutes so as to
keep the schedules up to date for display. The JPG files will be stored with names
corresponding to the class number so that upon a request the server program can
easily find and send the correct file. The extent of development of the server program
for this project was given to be delivery of the picture files. The parsing of the
information from the school schedule website will be developed at a further date.
6.3 Connection and Delivery of Schedule Files
The second function of the server program is the delivery of the schedule files.
The program is designed to listen on a particular port for any requests being
made by the electronic class schedules. For the project development, port 2000
was utilized. When a connection is requested, it is accepted and a network
stream is created [20, 172-180]. The listbox at this point will show that a
connection has been made. The electronic class schedule that has made the
request then sends out the name of the file it is requesting. The server program
will scan incoming data and wait until it reads the letter f, as all files that will be
requested will start with the letter f, for example file1. The file name that is
being requested is sent without the file extension. When the file server program
receives the name of the file, it is then added to a prewritten character string.
This string represents the file directory for the file server’s local storage where
the schedule pictures are stored. The extension JPG is then added to the end of
the string and the program uses the string to locate the file. Once the file is
located, a file reader function is opened, and the raw file data can be accessed.
[20, 134.]
When the raw data is opened for access, the size of the file is found and sent back to
the electronic class schedule. The number of 512 byte sectors is then calculated and
sent back. This will be used for SD card writing purposes by the MCU of the electronic
class schedule, as the writing function of the SD card is accomplished in groups of 512
bytes. A note on the listbox is put up showing that the file size has been sent. The
server program then waits for the electronic class schedule to send the hex byte 0x53
Comentarios a estos manuales