Changeset 387 for asp3_tinet_ecnl_arm/trunk/ntshell/src/ntp_cli.c
- Timestamp:
- May 22, 2019, 4:09:18 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
asp3_tinet_ecnl_arm/trunk/ntshell/src/ntp_cli.c
r374 r387 277 277 } 278 278 279 printf("[NTP CLI,%d] recv time: %s .%09u\n",279 syslog(LOG_NOTICE, "[NTP CLI,%d] recv time: %s .%09u", 280 280 nc->cepid, nc->buf, tp.tv_nsec); 281 281 } … … 309 309 line = lookup_ipaddr(&nc->ipaddr6, NTP_SRV_URL, API_PROTO_IPV4); 310 310 if (line == NULL || !in6_is_addr_ipv4mapped(&nc->ipaddr6)) { 311 printf("[NTP CLI,%d] sleep %d.%03u[s], unknown host.",311 syslog(LOG_NOTICE, "[NTP CLI,%d] sleep %d.%03u[s], unknown host.", 312 312 nc->cepid, SLP_ITV / SYSTIM_HZ, SLP_ITV % SYSTIM_HZ); 313 313 nc->timer = SLP_ITV; … … 317 317 #else /* of #if defined(SUPPORT_INET6) && defined(SUPPORT_INET4) */ 318 318 if ((line = lookup_ipaddr(&nc->snd_rmt.ipaddr, NTP_SRV_URL, DEFAULT_API_PROTO)) == NULL) { 319 printf("[NTP CLI,%d] sleep %d.%03u[s], unknown host.",319 syslog(LOG_NOTICE, "[NTP CLI,%d] sleep %d.%03u[s], unknown host.", 320 320 nc->cepid, SLP_ITV / SYSTIM_HZ, SLP_ITV % SYSTIM_HZ); 321 321 nc->timer = SLP_ITV; … … 421 421 422 422 if ((error = udp_snd_dat(nc->cepid, &nc->snd_rmt, ntp, len, TMO_NBLK)) != E_WBLK) { 423 printf("[NTP CLI,%d] udp_snd_dat error: %s",423 syslog(LOG_NOTICE, "[NTP CLI,%d] udp_snd_dat error: %s", 424 424 nc->cepid, itron_strerror(error)); 425 425 return error; 426 426 } 427 427 else 428 syslog(LOG_DEBUG, "[NTP CLI,%d] udp_snd_dat: to: %s.%d \n",428 syslog(LOG_DEBUG, "[NTP CLI,%d] udp_snd_dat: to: %s.%d", 429 429 nc->cepid, ip2str(NULL, &nc->snd_rmt.ipaddr), nc->snd_rmt.portno); 430 430 … … 439 439 ret = get_tim(&time); 440 440 if (ret != E_OK) { 441 printf("[NTP CLI,%d] get_tim error: %s",441 syslog(LOG_NOTICE, "[NTP CLI,%d] get_tim error: %s", 442 442 nc->cepid, itron_strerror(ret)); 443 443 tp->tv_sec = 0; … … 459 459 ret = set_tim(time); 460 460 if (ret != E_OK) { 461 printf("[NTP CLI,%d] set_tim error: %s",461 syslog(LOG_NOTICE, "[NTP CLI,%d] set_tim error: %s", 462 462 nc->cepid, itron_strerror(ret)); 463 463 } … … 477 477 if (len < 0 && len != E_RLWAI) { 478 478 /* E_RLWAI 以外で、0 以下の場合は、エラーを意味している。*/ 479 printf("[NTP CLI,%d] callback error: %s, fncd: %s", nc->cepid,479 syslog(LOG_NOTICE, "[NTP CLI,%d] callback error: %s, fncd: %s", nc->cepid, 480 480 itron_strerror(len), in_strtfn(fncd)); 481 481 } … … 484 484 if ((len = udp_rcv_dat(nc->cepid, &nc->rcv_rmt, &nc->ntp_msg, len, TMO_POL)) < 0) 485 485 { 486 printf("[NTP CLI,%d] udp_rcv_dat error: %s", nc->cepid,486 syslog(LOG_NOTICE, "[NTP CLI,%d] udp_rcv_dat error: %s", nc->cepid, 487 487 itron_strerror(len)); 488 488 } … … 516 516 517 517 get_tid(&nc->tskid); 518 printf("[NTP CLI:%d,%d] started.", nc->tskid, (ID)exinf);518 syslog(LOG_NOTICE, "[NTP CLI:%d,%d] started.", nc->tskid, (ID)exinf); 519 519 520 520 /* 初期化 */ … … 523 523 ret = get_tim(&time); 524 524 if (ret != E_OK) { 525 printf("[NTP CLI,%d] get_tim error: %7lu,%s",525 syslog(LOG_NOTICE, "[NTP CLI,%d] get_tim error: %7lu,%s", 526 526 nc->cepid, time / SYSTIM_HZ, itron_strerror(ret)); 527 527 return; … … 537 537 error = tslp_tsk(timer); 538 538 if ((error != E_OK) && (error != E_TMOUT)) { 539 printf("[NTP CLI,%d] tslp_tsk error: %s %d",539 syslog(LOG_NOTICE, "[NTP CLI,%d] tslp_tsk error: %s %d", 540 540 nc->cepid, itron_strerror(error), timer); 541 541 break; … … 544 544 ret = get_tim(&time); 545 545 if (ret != E_OK) { 546 printf("[NTP CLI,%d] get_tim error: %s",546 syslog(LOG_NOTICE, "[NTP CLI,%d] get_tim error: %s", 547 547 nc->cepid, itron_strerror(ret)); 548 548 break;
Note:
See TracChangeset
for help on using the changeset viewer.