1928 views|0 replies

2015

Posts

0

Resources
The OP
 

Implementation of TCP/IP Protocol Stack on TI C6000DSP [Copy link]

Development of network applications
  
  If programmers are familiar with the use of SOCKET on the Windows platform, they can also easily develop network applications on the DSP platform, and they don't even need to understand the hardware structure, because the function names and functions of the NDK API and Windows SOCKET API are very similar. The following program uses the DHCP protocol to dynamically obtain IP and the UDP protocol to transmit data, as follows:
  //Network initialization
  NC_SystemOpen();
  hCfg = CfgNew();
  CfgAddEntry( hCfg,CFGTAG_SYSINFO,CFGITEM_DHCP_HOS
  TNAME,0,strlen(HostName),(UINT8 *)HostName,0);

……
  //Configure DHCP protocol to dynamically obtain IP
  CI_SERVICE_DHCPC dhcpc;
  bzero(&dhcpc, sizeof(dhcpc));
  dhcpc.cisargs.Mode = CIS_FLG_IFIDXVALID;
  dhcpc.cisargs.IfIdx = 1;
  dhcpc.cisargs.pCbSrv = &ServiceReport;
  CfgAddEntry(hCfg,CFGTAG_SERVICE,CFGITEM_SERVICE_D
  HCPCLIENT,0,sizeof(dhcpc),(UINT8 *)&dhcpc,0);
  ……
  //Configure SOCKET buffer size
  rc = 8704;
  CfgAddEntry(hCfg,CFGTAG_IP,CFGITEM_IP_SOCKBUFMAX,
  CFG_ADDMODE_UNIQUE,sizeof(uint),(UINT8 *)&rc,0);
  //Start network service
  do
  {rc = NC_NetStart(hCfg,NetworkOpen,NetworkClose,NetworkIPA
  ddr);
  } while(rc > 0);
  ……
  //Configure application layer protocol, this program uses UDP
  SOCKET s;
  struct sockaddr_in sin1;
  s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
  if(bind(s,(PSA) &sin1, sizeof(sin1)) < 0)

This post is from DSP and ARM Processors
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list