Ignore:
Timestamp:
Jun 20, 2018, 7:59:22 PM (6 years ago)
Author:
coas-nagasima
Message:

SDカードの挿抜を検知するよう更新

File:
1 edited

Legend:

Unmodified
Added
Removed
  • asp3_tinet_ecnl_arm/trunk/ntshell/src/ntp_cli.c

    r352 r359  
    5050#include <t_syslog.h>
    5151#include "kernel_cfg.h"
     52#include "util/ntstdio.h"
     53
     54extern ntstdio_t ntstdio;
    5255
    5356#endif  /* of #if defined(TARGET_KERNEL_ASP) */
     
    276279        }
    277280
    278         syslog(LOG_NOTICE, "[NTP CLI,%d] recv time: %s .%09u",
     281        ntstdio_printf(&ntstdio, "[NTP CLI,%d] recv time: %s .%09u\n",
    279282                nc->cepid, nc->buf, tp.tv_nsec);
    280283}
     
    308311                line = lookup_ipaddr(&nc->ipaddr6, NTP_SRV_URL, API_PROTO_IPV4);
    309312                if (line == NULL || !in6_is_addr_ipv4mapped(&nc->ipaddr6)) {
    310                         syslog(LOG_NOTICE, "[NTP CLI,%d] sleep %d.%03u[s], unknown host.",
     313                        ntstdio_printf(&ntstdio, "[NTP CLI,%d] sleep %d.%03u[s], unknown host.",
    311314                                nc->cepid, SLP_ITV / SYSTIM_HZ, SLP_ITV % SYSTIM_HZ);
    312315                        nc->timer = SLP_ITV;
     
    316319#else   /* of #if defined(SUPPORT_INET6) && defined(SUPPORT_INET4) */
    317320                if ((line = lookup_ipaddr(&nc->snd_rmt.ipaddr, NTP_SRV_URL, DEFAULT_API_PROTO)) == NULL) {
    318                         syslog(LOG_NOTICE, "[NTP CLI,%d] sleep %d.%03u[s], unknown host.",
     321                        ntstdio_printf(&ntstdio, "[NTP CLI,%d] sleep %d.%03u[s], unknown host.",
    319322                                nc->cepid, SLP_ITV / SYSTIM_HZ, SLP_ITV % SYSTIM_HZ);
    320323                        nc->timer = SLP_ITV;
     
    420423
    421424        if ((error = udp_snd_dat(nc->cepid, &nc->snd_rmt, ntp, len, TMO_NBLK)) != E_WBLK) {
    422                 syslog(LOG_NOTICE, "[NTP CLI,%d] udp_snd_dat error: %s",
     425                ntstdio_printf(&ntstdio, "[NTP CLI,%d] udp_snd_dat error: %s",
    423426                        nc->cepid, itron_strerror(error));
    424427                return error;
     
    438441        ret = get_tim(&time);
    439442        if (ret != E_OK) {
    440                 syslog(LOG_NOTICE, "[NTP CLI,%d] get_tim error: %s",
     443                ntstdio_printf(&ntstdio, "[NTP CLI,%d] get_tim error: %s",
    441444                        nc->cepid, itron_strerror(ret));
    442445                tp->tv_sec = 0;
     
    458461        ret = set_tim(time);
    459462        if (ret != E_OK) {
    460                 syslog(LOG_NOTICE, "[NTP CLI,%d] set_tim error: %s",
     463                ntstdio_printf(&ntstdio, "[NTP CLI,%d] set_tim error: %s",
    461464                        nc->cepid, itron_strerror(ret));
    462465        }
     
    476479        if (len < 0 && len != E_RLWAI) {
    477480                /* E_RLWAI 以外で、0 以下の場合は、エラーを意味している。*/
    478                 syslog(LOG_NOTICE, "[NTP CLI,%d] callback error: %s, fncd: %s", nc->cepid,
     481                ntstdio_printf(&ntstdio, "[NTP CLI,%d] callback error: %s, fncd: %s", nc->cepid,
    479482                        itron_strerror(len), in_strtfn(fncd));
    480483        }
     
    483486                        if ((len = udp_rcv_dat(nc->cepid, &nc->rcv_rmt, &nc->ntp_msg, len, TMO_POL)) < 0)
    484487                        {
    485                                 syslog(LOG_NOTICE, "[NTP CLI,%d] udp_rcv_dat error: %s", nc->cepid,
     488                                ntstdio_printf(&ntstdio, "[NTP CLI,%d] udp_rcv_dat error: %s", nc->cepid,
    486489                                        itron_strerror(len));
    487490                        }
     
    515518
    516519        get_tid(&nc->tskid);
    517         syslog(LOG_NOTICE, "[NTP CLI:%d,%d] started.", nc->tskid, (ID)exinf);
     520        ntstdio_printf(&ntstdio, "[NTP CLI:%d,%d] started.", nc->tskid, (ID)exinf);
    518521
    519522        /* 初期化 */
     
    522525        ret = get_tim(&time);
    523526        if (ret != E_OK) {
    524                 syslog(LOG_NOTICE, "[NTP CLI,%d] get_tim error: %7lu,%s",
     527                ntstdio_printf(&ntstdio, "[NTP CLI,%d] get_tim error: %7lu,%s",
    525528                        nc->cepid, time / SYSTIM_HZ, itron_strerror(ret));
    526529                return;
     
    536539                error = tslp_tsk(timer);
    537540                if ((error != E_OK) && (error != E_TMOUT)) {
    538                         syslog(LOG_NOTICE, "[NTP CLI,%d] tslp_tsk error: %s %d",
     541                        ntstdio_printf(&ntstdio, "[NTP CLI,%d] tslp_tsk error: %s %d",
    539542                                nc->cepid, itron_strerror(error), timer);
    540543                        break;
     
    543546                ret = get_tim(&time);
    544547                if (ret != E_OK) {
    545                         syslog(LOG_NOTICE, "[NTP CLI,%d] get_tim error: %s",
     548                        ntstdio_printf(&ntstdio, "[NTP CLI,%d] get_tim error: %s",
    546549                                nc->cepid, itron_strerror(ret));
    547550                        break;
Note: See TracChangeset for help on using the changeset viewer.