Send.c example details
UDP details
#include <stdlib.h>
#include <stdio.h>
#include <stddef.h>
#include <inttypes.h>
#include <time.h>
#include <string.h>
#ifdef __cplusplus
extern "C" {
#endif
#pragma CODE_SECTION(SendTimeStamp , ".commontext")
#ifdef __cplusplus
}
#endif
#define PC_IP_ADDR "192.168.168.255"
#define PC_PORT 5062
#define DSP_PORT 5032
{
struct tm *local_time;
{
return;
}
udp_data[0] = (local_time->tm_hour / 10) +
'0';
udp_data[1] = (local_time->tm_hour % 10) +
'0';
udp_data[3] = (local_time->tm_min / 10) +
'0';
udp_data[4] = (local_time->tm_min % 10) +
'0';
udp_data[6] = (local_time->tm_sec / 10) +
'0';
udp_data[7] = (local_time->tm_sec % 10) +
'0';
10);
{
{
}
}
}
#pragma CODE_SECTION(main , ".commontext");
{
int main_loop = 1;
time_t seconds;
struct tm *local_time;
CPrintf (
" *** timer %d mapped to CPU int %d ***\r\n",
{
}
CPuts (
" network startup time [sec]: ");
"%"PRId32".%03"PRId32"\r\n"
CPrintf (
" System start time: %s\r", asctime (local_time));
CPuts (
"\r\n Entering main loop ...\r\n");
while ( main_loop )
{
{
}
}
return(0);
}