CodePudding user response:
How you imagine the teacher class name, is also a person as a server needs to obtain information on the multiple terminals, two kinds of methods:1, the teacher call names, each one was called to scream and name, silent is not to, this is initiated by the service side take the initiative to ask
2, according to the student number began to take turns to count off from 1, each to a teacher, in the list in the final without a hook is not coming, this is the terminal initiate data report,
Your PC PC and single chip microcomputer principle is the same,
First, make sure the communication way, between teachers and students in air compressor vibration (sound) as a means of communication of single-chip microcomputer and PC just because you use the wifi, so the first thing to determine ways to communicate using TCP or UDP,
Determine the communication methods, communication protocol later arrive to ensure the data accurate and effective, the teacher and the student agreed I shout you hear called shouted to himself alone, shout, heard others shut up, no one to answer the teacher shouted again name, if the second still nobody cried even truancy, this agreement confirms that the packet content, format, packet response feedback mode, abnormal reproduction rules, etc., your SCM and PC to also want to have a similar agreement,
Because there are a lot of students, the teacher want to distinguish the different students sends a message, also want to distinguish between different student feedback, the teacher with the name or student id as a call of identification, students can in each response contains its own unique characteristics such as speaking at first student id or stood up to let the teacher know who is speaking and so on, can use the IP in your system, terminal number, and so on to distinguish between the I2C address,
After above foundation played well is to choose two of the most front said one of the way of naming, thought the teacher how to call the roll, implement it,
CodePudding user response:
On the top floor, the concept is the foundation, must understand.To the specific implementation, if through the WIFI, the easiest way is to TCP passthrough, namely microcontroller through the WIFI module directly send data to a particular domain name + port.
Which involves the identification of what upstairs, I generally is the only ID using single chip microcomputer, if not just his own definition for each board a.
Then there is the communication protocol, TCP server to accept a new connection when the first thing to do is ask a unique ID, this determines the issued to the data such as to which device name.
The next step is to send data, such as server disconnected after confirm OK, completed.