Ignore:
Timestamp:
Apr 5, 2019, 9:26:53 PM (5 years ago)
Author:
coas-nagasima
Message:

mbed関連を更新
シリアルドライバをmbedのHALを使うよう変更
ファイルディスクリプタの処理を更新

File:
1 edited

Legend:

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

    r364 r374  
    5050#include <t_syslog.h>
    5151#include "kernel_cfg.h"
    52 #include "util/ntstdio.h"
    53 
    54 extern ntstdio_t ntstdio;
     52#include <stdio.h>
    5553
    5654#endif  /* of #if defined(TARGET_KERNEL_ASP) */
     
    279277        }
    280278
    281         ntstdio_printf(&ntstdio, "[NTP CLI,%d] recv time: %s .%09u\n",
     279        printf("[NTP CLI,%d] recv time: %s .%09u\n",
    282280                nc->cepid, nc->buf, tp.tv_nsec);
    283281}
     
    311309                line = lookup_ipaddr(&nc->ipaddr6, NTP_SRV_URL, API_PROTO_IPV4);
    312310                if (line == NULL || !in6_is_addr_ipv4mapped(&nc->ipaddr6)) {
    313                         ntstdio_printf(&ntstdio, "[NTP CLI,%d] sleep %d.%03u[s], unknown host.",
     311                        printf("[NTP CLI,%d] sleep %d.%03u[s], unknown host.",
    314312                                nc->cepid, SLP_ITV / SYSTIM_HZ, SLP_ITV % SYSTIM_HZ);
    315313                        nc->timer = SLP_ITV;
     
    319317#else   /* of #if defined(SUPPORT_INET6) && defined(SUPPORT_INET4) */
    320318                if ((line = lookup_ipaddr(&nc->snd_rmt.ipaddr, NTP_SRV_URL, DEFAULT_API_PROTO)) == NULL) {
    321                         ntstdio_printf(&ntstdio, "[NTP CLI,%d] sleep %d.%03u[s], unknown host.",
     319                        printf("[NTP CLI,%d] sleep %d.%03u[s], unknown host.",
    322320                                nc->cepid, SLP_ITV / SYSTIM_HZ, SLP_ITV % SYSTIM_HZ);
    323321                        nc->timer = SLP_ITV;
     
    423421
    424422        if ((error = udp_snd_dat(nc->cepid, &nc->snd_rmt, ntp, len, TMO_NBLK)) != E_WBLK) {
    425                 ntstdio_printf(&ntstdio, "[NTP CLI,%d] udp_snd_dat error: %s",
     423                printf("[NTP CLI,%d] udp_snd_dat error: %s",
    426424                        nc->cepid, itron_strerror(error));
    427425                return error;
     
    441439        ret = get_tim(&time);
    442440        if (ret != E_OK) {
    443                 ntstdio_printf(&ntstdio, "[NTP CLI,%d] get_tim error: %s",
     441                printf("[NTP CLI,%d] get_tim error: %s",
    444442                        nc->cepid, itron_strerror(ret));
    445443                tp->tv_sec = 0;
     
    461459        ret = set_tim(time);
    462460        if (ret != E_OK) {
    463                 ntstdio_printf(&ntstdio, "[NTP CLI,%d] set_tim error: %s",
     461                printf("[NTP CLI,%d] set_tim error: %s",
    464462                        nc->cepid, itron_strerror(ret));
    465463        }
     
    479477        if (len < 0 && len != E_RLWAI) {
    480478                /* E_RLWAI 以外で、0 以下の場合は、エラーを意味している。*/
    481                 ntstdio_printf(&ntstdio, "[NTP CLI,%d] callback error: %s, fncd: %s", nc->cepid,
     479                printf("[NTP CLI,%d] callback error: %s, fncd: %s", nc->cepid,
    482480                        itron_strerror(len), in_strtfn(fncd));
    483481        }
     
    486484                        if ((len = udp_rcv_dat(nc->cepid, &nc->rcv_rmt, &nc->ntp_msg, len, TMO_POL)) < 0)
    487485                        {
    488                                 ntstdio_printf(&ntstdio, "[NTP CLI,%d] udp_rcv_dat error: %s", nc->cepid,
     486                                printf("[NTP CLI,%d] udp_rcv_dat error: %s", nc->cepid,
    489487                                        itron_strerror(len));
    490488                        }
     
    518516
    519517        get_tid(&nc->tskid);
    520         ntstdio_printf(&ntstdio, "[NTP CLI:%d,%d] started.", nc->tskid, (ID)exinf);
     518        printf("[NTP CLI:%d,%d] started.", nc->tskid, (ID)exinf);
    521519
    522520        /* 初期化 */
     
    525523        ret = get_tim(&time);
    526524        if (ret != E_OK) {
    527                 ntstdio_printf(&ntstdio, "[NTP CLI,%d] get_tim error: %7lu,%s",
     525                printf("[NTP CLI,%d] get_tim error: %7lu,%s",
    528526                        nc->cepid, time / SYSTIM_HZ, itron_strerror(ret));
    529527                return;
     
    539537                error = tslp_tsk(timer);
    540538                if ((error != E_OK) && (error != E_TMOUT)) {
    541                         ntstdio_printf(&ntstdio, "[NTP CLI,%d] tslp_tsk error: %s %d",
     539                        printf("[NTP CLI,%d] tslp_tsk error: %s %d",
    542540                                nc->cepid, itron_strerror(error), timer);
    543541                        break;
     
    546544                ret = get_tim(&time);
    547545                if (ret != E_OK) {
    548                         ntstdio_printf(&ntstdio, "[NTP CLI,%d] get_tim error: %s",
     546                        printf("[NTP CLI,%d] get_tim error: %s",
    549547                                nc->cepid, itron_strerror(ret));
    550548                        break;
Note: See TracChangeset for help on using the changeset viewer.