




免费预览已结束,剩余3页可下载查看
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
Do the following three main points: 1 find out the weak. Review process is to sum up the knowledge on the one hand, make the knowledge more coherent system and regularity, but also let the students themselves, looks up the deficiencies. So, we teachers to understand the students knowledge of the situation prior to the review, students not only found widespread deficiencies, but also some shortcomings, for these well designed programs, reasonable arrangement of time, this review is more targeted and more effective. For example, you can design a form for investigation, understanding students weaknesses in each knowledge, put it as a review of key, combined with the problem of textbooks to review, both to avoid casting a net tihaizhanshu, and improve the efficiency of review. 2, good collation. Through six years of study, students in the basics, reading method, exercises, and so already have a certain degree of accumulation, the review stage, teachers should know how to guide the students to label the accumulation, process, form a system of knowledge networks. Exercises for students to be representative, fine, complete, to live, and earnestly do a problem learning a method, class of pass was to get time efficient review results. 3, pay attention to use. The accumulation of knowledge is ultimately to use, therefore, review the situation and life situation to be created in a variety of languages, guide students on the basis of the previous accumulation of knowledge to use to the maximum, and really apply what they have learned. Second, review the content and strategy of the first part: the basics (a) 1, review the main points of Hanyu Pinyin is able to recite and write down the alphabet of Hanyu Pinyin; accurate spelling pronunciation (after reading cacuminal, nasal sound, light, and retroflex sounds), the correct write consonants, vowels and syllables. 2,. main types according to the order of the alphabet of Hanyu Pinyin alphabetical order; fill in the appropriate uppercase and lowercase letters; see phonetic writing words; pinyin to write sentences with dot to select the correct pronunciation of the word; to bring some initial consonants or vowels, word selection. Second, the main types of words (1) Ruby written words; (2) to bring Word to select the correct pronunciation; (3) use a sequencer and radical character lookup method仰恩大学计算机与信息学院 课题设计报告嵌入式系统设计与应用课程设计报告专 业: 班 级: 姓 名: 学 号: 指导教师: 目 录一、设计目的3二、开发环境3三、设计任务及要求3四、实现过程34.1用户应用程序设计34.2服务器端程序34.3客户端程序54.3 编译与运行结果7五、总结7一、设计目的(1)、熟悉并掌握在Linux开发环境下C语言程序设计及编译方法、嵌入式系统;(2)、掌握嵌入式linux下基础网络编程:socket编程(3)、独立编写客户机/服务器通信程序;二、开发环境(1) 编程环境:在Linux开发环境下设计及编译C语言程序。(2) 硬件设备:PXA270开发板,PC机。三、设计任务及要求设计一套可远程调用求和函数并返回客户端的程序。四、实现过程4.1用户应用程序设计1.程序sum.hint sum();2.程序sum.c#include int sum()int i=1,sum=0; while(i=100) sum=sum+i; i+; return sum;4.2服务器端程序/* 服务器端程序 server.c * */ #include #include #include #include #include #include #include #include #include “sum.h”main() int sockfd,new_fd,numbytes; struct sockaddr_in my_addr; struct sockaddr_in their_addr; int sin_size,sum; char buff100 ,temp100; sum=sum();itoa(sum, temp, 10); /服务器端建立TCP协议的socked套接字描述符 if(sockfd = socket(AF_INET,SOCK_STREAM,0)=-1) perror(socket); exit(1); printf(socket success!,sockfd=%dn,sockfd); /服务器端初始化sockaddr结构体,绑定2323端口 my_addr.sin_family = AF_INET; my_addr.sin_port = htons(2323); my_addr.sin_addr.s_addr = INADDR_ANY; bzero(&(my_addr.sin_zero),8); /绑定套接字描述符sockfd if(bind(sockfd,(struct sockaddr *)&my_addr,sizeof(struct sockaddr)=-1) perror(bind); exit(1); printf(bind success!n); /创建监听套接字描述符sockfd if(listen(sockfd,10)=-1) perror(listen); exit(1); printf(listening.n); /服务器阻塞监听套接字,循环等待客户端程序连接 while(1) sin_size = sizeof(struct sockaddr_in); /如果建立连接,将产生一个全新的套接字 if(new_fd = accept(sockfd,(struct sockaddr *)&their_addr,&sin_size)=-1) perror(accept); exit(1); /生成一个子进程来完成和客户端的会话,父进程继续监听 if(!fork() /读取客户端发来的信息 if(numbytes = recv(new_fd,buff,strlen(buff),0)=-1) perror(recv); exit(1); /将从客户端接收到的信息再发回客户端 if(send(new_fd,temp,strlen(buff),0)=-1) perror(send); /* 本次通信结束 */ close(new_fd); exit(0); /* 下一个循环 */ / close(new_fd); close(sockfd); 4.3客户端程序/* 客户端程序 client.c * */ #include #include #include #include #include #include #include #include int main(int argc,char *argv) int sockfd,numbytes; char buf100; struct hostent *he; struct sockaddr_in their_addr; int i = 0; /转换主机名或IP地址 he = gethostbyname(argv1); /客户端程序建立TCP协议的socked套接字描述符 if(sockfd = socket(AF_INET,SOCK_STREAM,0)=-1) perror(socket); exit(1); /客户端程序初始化sockaddr结构体,连接到服务器的2323端口 their_addr.sin_family = AF_INET; their_addr.sin_port = htons(2323); their_addr.sin_addr = *(struct in_addr *)he-h_addr); bzero(&(their_addr.sin_zero),8); /向服务器发起连接 if(connect(sockfd,(struct sockaddr *)&their_addr,sizeof(struct sockaddr)=-1) perror(connect); exit(1); /向服务器发送字符串hello! if(send(sockfd,Hello! I am Client.,100,0)=-1) perror(send); exit(1); /接受从服务器返回的信息 if(numbytes = recv(sockfd,buf,100,0)=-1) perror(recv); exit(1); printf(result: %s n,buf); /* 通信结束 */ close(sockfd); return 0; 4.3 编译与运行结果 (1)、编译客户端文件、服务器端文件 # gcc client.c -o client.o# arm-linux-gcc server.c sum.c -o server.o (2)、连接串口线和网线(3)、把server.o下载到开发板中 (4)、在开发板上运
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 公司节假日安全培训课件
- 建筑施工防火安全技术措施
- 综合部主任竞聘报告
- 企业安全管理工作计划三篇
- 《记承天诗夜游》课件
- 静脉溶栓术后护理措施
- 事诸父如事父课件
- 研究生学习进展与心得汇报
- 公司级安全培训签到表课件
- 公司级安全培训意义课件
- 2025年度反洗钱阶段考试培训试考试题库(含答案)
- 收割芦苇施工方案
- 普通黄金现货购买合同8篇
- 三力测试考试题库及答案视频讲解
- 2025年河南省人民法院聘用书记员考试试题及答案
- 2025年中学教师资格考试《综合素质》核心考点与解析
- 口腔冠延长术
- 部编版七年级语文上册《闻王昌龄左迁龙标遥有此寄》课件
- 诊所经营管理课件
- 2024年江苏省连云港市辅警协警笔试笔试模拟考试(含答案)
- 企业知识管理培训课件
评论
0/150
提交评论