资源简介
从文件中读取数据,发送到DSP中,DSP处理后,返回数据,写入到输出文件中
代码片段和文件信息
/*
* testudp.c
*
* Test the crude echo by sending to port 7 and waiting
* for replies.
*
* Copyright (C) 1999 Texas Instruments Incorporated - http://www.ti.com/
*
*
* Redistribution and use in source and binary forms with or without
* modification are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* “AS IS“ AND ANY EXPRESS OR IMPLIED WARRANTIES INCLUDING BUT NOT
* LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT INDIRECT INCIDENTAL
* SPECIAL EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING BUT NOT
* LIMITED TO PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE
* DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY WHETHER IN CONTRACT STRICT LIABILITY OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include
#include
#include
#include
#include “sockets.h“
#define UDP_LOW 16
#define UDP_HIGH 1468 /* Note: Windows FRAGMENTS higher UDP sizes!!! */
#define COPY_NUM 4
#define TIMEOUT 10 /* seconds */
#define BUFSIZE 1500
#define PORT 801
/*
* ======== main ========
*/
int main(int argc char *argv[])
{
SOCKET s;
struct sockaddr_in sin;
struct in_addr dst;
unsigned short port = PORT;
char * buf = NULL;
char * name = argv[0];
char cnt;
int testsize;
int nr;
int ijk;
fd_set readfds;
struct timeval timeout;
time_t ts;
int status;
/*Begin:Add by sxf 20140801*/
char *tInputFile = “InputEth.txt“;
char *tOutputFile = “OutputEth.txt“;
FILE *fInputEth;
FILE *fOutputEth;
char testbuf[100];
char testOutbuf[100];
char *temptestbuf;
char *tempOutbuf;
/*End:Add by sxf 20140801*/
argc =2;
argv[1] = “192.168.2.100“;
if (argc < 2) {
fprintf(stderr “Usage: %s ip-addr [update] [port]\n“ name);
exit(EXIT_FAILURE);
}
if (inet_pton(AF_INET argv[1] &dst) != 1) {
fprintf(stderr “%s: invalid ip-addr (%s)\n“ name argv[1]);
exit(EXIT_FAILURE);
}
/* updat
- 上一篇:海思3531GPIO测试
- 下一篇:S7imgRD-S7imgWR
相关资源
- 基于UDP的P2P小Demo (穿透NAT)delphi源码
- 串口 网络调试工具
- esp8266的SDK开发 TCP、UDP服务器端
- udp发送接收图片含demo
- 5个qt多线程
- 实验2,TCP+UDP通信实验
- 基于UDP,P2P的网络通信
- 新版sockettool for mac
- udp分包组包通信
- linux ipv6简单tcp/udp socket通信
- 最好用的TCP+UDP+UART调试工具
- TCP_UDP_PerformanceTest.exe
- TCP/UDP/ICMP/IGMP发包工具
- 使用Winsock控件的UDP方式实现网络聊天
- UDP动态温度曲线图
- EHCACHE集群配置-JGroup篇
- UDP 通信实验
- LWIP裸机实现TCPUDP通讯
- 基于UDP协议网上聊天程序
- vc编写UDP封装类实用
- UDP协议通信演示Delphi源码
- UDP实现P2P
- Socket Raw实现的IPV4INIPV6 UDP数据包发送
- QUdpSocket 多线程编程 moveToThread
- qt udp多线程收发数据
- Qt使用udp协议,简单易懂
- Labview的UDP发送与接收程序
- socket通信 基于udp
- linux tcp udp 调试工具
- 网络调试助手,用了很多这个最好用
评论
共有 条评论