这篇教程C++ uinfo函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中uinfo函数的典型用法代码示例。如果您正苦于以下问题:C++ uinfo函数的具体用法?C++ uinfo怎么用?C++ uinfo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了uinfo函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: do_prod_lostint do_prod_lost( BUFF_HDR *buff_hdr, ACQ_TABLE *acq_tbl){ long prod_errors; if(acq_tbl->proc_base_prod_seqno_last == 0){ prod_errors = 0; }else{ prod_errors = (buff_hdr->proc_prod_seqno - (acq_tbl->proc_base_prod_seqno_last + 1)); } if(prod_errors <= 0){ prod_errors = 0; }else{ /* Now generate retransmission request */ generate_retrans_rqst(acq_tbl,(acq_tbl->proc_base_prod_seqno_last + 1), (buff_hdr->proc_prod_seqno-1), RETRANS_RQST_CAUSE_RCV_ERR); } acq_tbl->proc_tot_prods_lost_errs += prod_errors; /* Need to log prod_errors */ if(acq_tbl->proc_base_prod_seqno_last == 0){ uinfo("LOST=%ld total(%ld) %s prod(%ld) prod_seqno was RESET to 0 /n", prod_errors,acq_tbl->proc_tot_prods_lost_errs, GET_PROD_TYPE_NAME(buff_hdr->proc_prod_type),buff_hdr->proc_prod_seqno); }else{ uinfo("LOST=%ld total(%ld) %s prod(%ld) expect prod(%ld)/n", prod_errors, acq_tbl->proc_tot_prods_lost_errs, GET_PROD_TYPE_NAME(buff_hdr->proc_prod_type),buff_hdr->proc_prod_seqno, acq_tbl->proc_base_prod_seqno_last + 1); } return (0);}
开发者ID:rmlawton,项目名称:LDM,代码行数:35,
示例2: tweak_set_configuration_cmdstatic int tweak_set_configuration_cmd(struct urb *urb){ struct usb_ctrlrequest *req; __u16 config; req = (struct usb_ctrlrequest *) urb->setup_packet; config = le16_to_cpu(req->wValue); /* * I have never seen a multi-config device. Very rare. * For most devices, this will be called to choose a default * configuration only once in an initialization phase. * * set_configuration may change a device configuration and its device * drivers will be unbound and assigned for a new device configuration. * This means this usbip driver will be also unbound when called, then * eventually reassigned to the device as far as driver matching * condition is kept. * * Unfortunatelly, an existing usbip connection will be dropped * due to this driver unbinding. So, skip here. * A user may need to set a special configuration value before * exporting the device. */#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30) uinfo("set_configuration (%d) to %s/n", config, urb->dev->dev.bus_id);#else uinfo("set_configuration (%d) to %s/n", config, dev_name(&urb->dev->dev));#endif uinfo("but, skip!/n"); return 0; //return usb_driver_set_configuration(urb->dev, config);}
开发者ID:wl500g,项目名称:usbip-no-glib,代码行数:34,
示例3: tweak_clear_halt_cmdstatic int tweak_clear_halt_cmd(struct urb *urb){ struct usb_ctrlrequest *req; int target_endp; int target_dir; int target_pipe; int ret; req = (struct usb_ctrlrequest *) urb->setup_packet; /* * The stalled endpoint is specified in the wIndex value. The endpoint * of the urb is the target of this clear_halt request (i.e., control * endpoint). */ target_endp = le16_to_cpu(req->wIndex) & 0x000f; /* the stalled endpoint direction is IN or OUT?. USB_DIR_IN is 0x80. */ target_dir = le16_to_cpu(req->wIndex) & 0x0080; if (target_dir) target_pipe = usb_rcvctrlpipe(urb->dev, target_endp); else target_pipe = usb_sndctrlpipe(urb->dev, target_endp); ret = usb_clear_halt(urb->dev, target_pipe); if (ret < 0) uinfo("clear_halt error: devnum %d endp %d, %d/n", urb->dev->devnum, target_endp, ret); else uinfo("clear_halt done: devnum %d endp %d/n", urb->dev->devnum, target_endp); return ret;}
开发者ID:wl500g,项目名称:usbip-no-glib,代码行数:35,
示例4: usbhost_waiterstatic int usbhost_waiter(struct usbhost_connection_s *dev)#endif{ struct usbhost_hubport_s *hport; uinfo("Running/n"); for (;;) { /* Wait for the device to change state */ DEBUGVERIFY(CONN_WAIT(dev, &hport)); uinfo("%s/n", hport->connected ? "connected" : "disconnected"); /* Did we just become connected? */ if (hport->connected) { /* Yes.. enumerate the newly connected device */ (void)CONN_ENUMERATE(dev, hport); } } /* Keep the compiler from complaining */ return 0;}
开发者ID:a1ien,项目名称:nuttx,代码行数:27,
示例5: stm32_usbhost_initializeint stm32_usbhost_initialize(void){ int pid; int ret; /* First, register all of the class drivers needed to support the drivers * that we care about: */ uinfo("Register class drivers/n");#ifdef CONFIG_USBHOST_MSC /* Register the USB mass storage class class */ ret = usbhost_msc_initialize(); if (ret != OK) { uerr("ERROR: Failed to register the mass storage class: %d/n", ret); }#endif#ifdef CONFIG_USBHOST_CDCACM /* Register the CDC/ACM serial class */ ret = usbhost_cdcacm_initialize(); if (ret != OK) { uerr("ERROR: Failed to register the CDC/ACM serial class: %d/n", ret); }#endif /* Then get an instance of the USB host interface */ uinfo("Initialize USB host/n"); g_usbconn = stm32_otgfshost_initialize(0); if (g_usbconn) { /* Start a thread to handle device connection. */ uinfo("Start usbhost_waiter/n"); pid = task_create("usbhost", CONFIG_USBHOST_DEFPRIO, CONFIG_USBHOST_STACKSIZE, (main_t)usbhost_waiter, (FAR char * const *)NULL); return pid < 0 ? -ENOEXEC : OK; } return -ENODEV;}
开发者ID:a1ien,项目名称:nuttx,代码行数:49,
示例6: stm32_usbinitializevoid stm32_usbinitialize(void){ uinfo("called/n"); /* USB Soft Connect Pullup */ stm32_configgpio(GPIO_USB_PULLUP);}
开发者ID:AlexShiLucky,项目名称:NuttX,代码行数:7,
示例7: log_prod_lostint log_prod_lost(long in_prod_errors, long in_tot_prods_lost_errs, long in_prod_seqno){ static char FNAME[]="log_prod_lost"; char prod_log_buff[256]; /* prod log buffer */ time_t now_time; /* now time */ struct tm *tmtime; /* time */ /* "STATUS LOST %ld product(s) total(%ld) before prod(%ld)", */ sprintf(prod_log_buff, "STATUS LOST %ld product(s) before prod(%ld) total(%ld)", in_prod_errors, in_prod_seqno, in_tot_prods_lost_errs); time(&now_time); tmtime = (struct tm *)gmtime(&now_time); /* time */ sprintf(prod_log_buff, "%s %s", prod_log_buff, get_date_time(tmtime, global_time_zone)); uinfo("%s %s /n",get_date_time(tmtime, global_time_zone),prod_log_buff); return(0);}
开发者ID:rmlawton,项目名称:LDM,代码行数:25,
示例8: ehci_waiterstatic int ehci_waiter(int argc, char *argv[]){ FAR struct usbhost_hubport_s *hport; uinfo("ehci_waiter: Running/n"); for (;;) { /* Wait for the device to change state */ DEBUGVERIFY(CONN_WAIT(g_ehciconn, &hport)); syslog(LOG_INFO, "ehci_waiter: %s/n", hport->connected ? "connected" : "disconnected"); /* Did we just become connected? */ if (hport->connected) { /* Yes.. enumerate the newly connected device */ (void)CONN_ENUMERATE(g_ehciconn, hport); } } /* Keep the compiler from complaining */ return 0;}
开发者ID:a1ien,项目名称:nuttx,代码行数:27,
示例9: tweak_reset_device_cmdstatic int tweak_reset_device_cmd(struct urb *urb){ struct usb_ctrlrequest *req; __u16 value; __u16 index; int ret; req = (struct usb_ctrlrequest *) urb->setup_packet; value = le16_to_cpu(req->wValue); index = le16_to_cpu(req->wIndex);#if 0 /* hided by tf, for reason that "bus_id" isn't supported in kernel2.6.31 */ uinfo("reset_device (port %d) to %s/n", index, urb->dev->dev.bus_id);#endif /* all interfaces should be owned by usbip driver, so just reset it. */ ret = usb_lock_device_for_reset(urb->dev, NULL); if (ret < 0) { uerr("lock for reset/n"); return ret; }#if 0 /* hided it temporarily */ /* try to reset the device */ ret = usb_reset_composite_device(urb->dev, NULL); if (ret < 0) uerr("device reset/n");#endif usb_unlock_device(urb->dev); return ret;}
开发者ID:vilpalu,项目名称:GPL_2.6.31,代码行数:30,
示例10: fiQString PreviewGenerator::CreateAccessibleFilename( const QString &pathname, const QString &outFileName){ QString outname = pathname + ".png"; if (outFileName.isEmpty()) return outname; outname = outFileName; QFileInfo fi(outname); if (outname == fi.fileName()) { QString dir = QString::null; if (pathname.contains(':')) { QUrl uinfo(pathname); uinfo.setPath(""); dir = uinfo.toString(); } else { dir = QFileInfo(pathname).path(); } outname = dir + "/" + fi.fileName(); LOG(VB_FILE, LOG_INFO, LOC + QString("outfile '%1' -> '%2'") .arg(outFileName).arg(outname)); } return outname;}
开发者ID:Openivo,项目名称:mythtv,代码行数:30,
示例11: tweak_reset_device_cmdstatic int tweak_reset_device_cmd(struct urb *urb){ struct usb_ctrlrequest *req; __u16 value; __u16 index; int ret; req = (struct usb_ctrlrequest *) urb->setup_packet; value = le16_to_cpu(req->wValue); index = le16_to_cpu(req->wIndex); uinfo("reset_device (port %d) to %s/n", index, urb->dev->dev.bus->name); /* all interfaces should be owned by usbip driver, so just reset it. */ ret = usb_lock_device_for_reset(urb->dev, NULL); if (ret < 0) { uerr("lock for reset/n"); return ret; } /* try to reset the device */ ret = usb_reset_device(urb->dev); if (ret < 0) uerr("device reset/n"); usb_unlock_device(urb->dev); return ret;}
开发者ID:pjump,项目名称:usbip,代码行数:29,
示例12: board_mscclassobjectstatic int board_mscclassobject(int minor, FAR struct usbdev_devinfo_s *devinfo, FAR struct usbdevclass_driver_s **classdev){ int ret; DEBUGASSERT(g_mschandle == NULL); /* Configure the mass storage device */ uinfo("Configuring with NLUNS=1/n"); ret = usbmsc_configure(1, &g_mschandle); if (ret < 0) { uerr("ERROR: usbmsc_configure failed: %d/n", -ret); return ret; } uinfo("MSC handle=%p/n", g_mschandle); /* Bind the LUN(s) */ uinfo("Bind LUN=0 to /dev/mmcsd0/n"); ret = usbmsc_bindlun(g_mschandle, "/dev/mmcsd0", 0, 0, 0, false); if (ret < 0) { uerr("ERROR: usbmsc_bindlun failed for LUN 1 at /dev/mmcsd0: %d/n", ret); usbmsc_uninitialize(g_mschandle); g_mschandle = NULL; return ret; } /* Get the mass storage device's class object */ ret = usbmsc_classobject(g_mschandle, devinfo, classdev); if (ret < 0) { uerr("ERROR: usbmsc_classobject failed: %d/n", -ret); usbmsc_uninitialize(g_mschandle); g_mschandle = NULL; } return ret;}
开发者ID:AlexShiLucky,项目名称:NuttX,代码行数:45,
示例13: notifymeprog_5/* * The RPC dispatch routine for this program. * Registered as a callback by svc_register() below. * Note that only NULLPROC and NOTIFICATION rpc procs are * handled by this program. */static voidnotifymeprog_5(struct svc_req *rqstp, SVCXPRT *transp){ prod_info notice; switch (rqstp->rq_proc) { case NULLPROC: svc_sendreply(transp, (xdrproc_t)xdr_void, (caddr_t)NULL); return; case NOTIFICATION: (void) memset((char*)¬ice, 0, sizeof(notice)); if (!svc_getargs(transp, (xdrproc_t)xdr_prod_info, (caddr_t)¬ice)) { svcerr_decode(transp); return; } (void)exitIfDone(0); /* * Update the request filter with the timestamp * we just recieved. * N.B.: There can still be duplicates after * a reconnect. */ clss.from = notice.arrival; timestamp_incr(&clss.from); /* * your code here, example just logs it */ uinfo("%s", s_prod_info(NULL, 0, ¬ice, ulogIsDebug())); if(!svc_sendreply(transp, (xdrproc_t)xdr_ldm_replyt, (caddr_t) &reply)) { svcerr_systemerr(transp); } (void)exitIfDone(0); if(!svc_freeargs(transp, xdr_prod_info, (caddr_t) ¬ice)) { uerror("unable to free arguments"); exit(1); } default: svcerr_noproc(transp); return; }}
开发者ID:KeithLatteri,项目名称:awips2,代码行数:63,
示例14: send_product_5/* * Send a product from file-descriptor to clnt using LDM-5 protocol. */static voidsend_product_5(CLIENT *clnt, int fd, prod_info *infop){ static ldm_replyt reply; enum clnt_stat rpc_stat; datapkt pkt; ssize_t unsent; ssize_t nread; char buf[DBUFMAX]; rpc_stat = my_comingsoon_5(clnt, infop, DBUFMAX, &reply); if(rpc_stat != RPC_SUCCESS) { uerror("send_product_5: %s %s", infop->ident, clnt_sperrno(rpc_stat)); return; } /* else */ if(reply.code != OK) { if(reply.code == DONT_SEND) uinfo("send_product_5: %s: %s", infop->ident, s_ldm_errt(reply.code)); else uerror("send_product_5: %s: %s", infop->ident, s_ldm_errt(reply.code)); return; } pkt.signaturep = &infop->signature; pkt.pktnum = 0; for(unsent = (ssize_t)infop->sz; unsent > 0; unsent -= nread ) { nread = read(fd, buf, DBUFMAX); if(nread <= 0) { serror("read: %s (seqno %d)", infop->ident, infop->seqno); break; } /* else */ pkt.data.dbuf_len = (u_int)nread; pkt.data.dbuf_val = buf; rpc_stat = my_blkdata_5(clnt, &pkt, &reply); if(rpc_stat != RPC_SUCCESS) break; if(reply.code != OK) break; pkt.pktnum++; }}
开发者ID:KeithLatteri,项目名称:awips2,代码行数:59,
示例15: socketDWORD WINAPI EM_UserLogin::Proc_UDP_Recv(LPVOID lParam){ //CEIM02Dlg* pDlg = ((CEIM02Dlg*)AfxGetMainWnd()); CEIM02Dlg *pDlg = (CEIM02Dlg*)AfxGetApp()->m_pMainWnd; SOCKET s = socket(AF_INET, SOCK_DGRAM, 0); if (s == INVALID_SOCKET) { ::MessageBox(NULL, _T("Socket creating error."), _T("接受线程错误"), MB_OK); return -1; } SOCKADDR_IN sin; sin.sin_addr.s_addr = htonl(INADDR_ANY); sin.sin_family = AF_INET; sin.sin_port = htons(UDP_RECV_MSG_PORT); if (bind(s, (PSOCKADDR)&sin, sizeof(sin)) == SOCKET_ERROR) { ::MessageBox(NULL, _T("Socket binding error."), _T("接受线程错误"), MB_OK); } SOCKADDR_IN client; int sinLen; int ret; char buf[8192]; char ip[128]; while(1) { sinLen = sizeof(SOCKADDR_IN); if ((ret = recvfrom(s, buf, 8192, 0, (PSOCKADDR)&client, &sinLen)) == SOCKET_ERROR) { ::MessageBox(0,"UDP recvfrom failed.", "Alert", MB_OK); break; } EM_DATA data(buf, ret); if (data.msg == EM_USERLOGIN || data.msg == EM_USERLOGOUT) { strcpy(ip, inet_ntoa(client.sin_addr)); char name[256]; char hostName[256]; char groupName[128]; EM_UserInfo *ui = ((EM_UserInfo*)data.buf); ui->GetDisplayName(name); ui->GetHostName(hostName); ui->GetGroupName(groupName); // Add to tree --------------------------------------------------- EM_USERINFO uinfo(strupr(hostName), ip, groupName); pDlg->_User_AddNewUser(name, uinfo); // =============================================================== } } return 0;}
开发者ID:test2zhou,项目名称:MyIM,代码行数:56,
示例16: addtostats/*ARGSUSED*/static intaddtostats(const prod_info *infop, const void *datap, void *xprod, size_t size, void *notused){ struct timeval tv; pq_ctimestamp(pq, &tv); if(tvIsNone(tv)) tv = TS_ZERO; if(ulogIsVerbose()) uinfo("%s", s_prod_info(NULL, 0, infop, ulogIsDebug())); binstats(infop, &tv); return 0;}
开发者ID:khallock,项目名称:LDM,代码行数:14,
示例17: tweak_set_interface_cmdstatic int tweak_set_interface_cmd(struct urb *urb){ struct usb_ctrlrequest *req; __u16 alternate; __u16 interface; int ret; req = (struct usb_ctrlrequest *) urb->setup_packet; alternate = le16_to_cpu(req->wValue); interface = le16_to_cpu(req->wIndex); dbg_stub_rx("set_interface: inf %u alt %u/n", interface, alternate); ret = usb_set_interface(urb->dev, interface, alternate); if (ret < 0) uinfo("set_interface error: inf %u alt %u, %d/n", interface, alternate, ret); else uinfo("set_interface done: inf %u alt %u/n", interface, alternate); return ret;}
开发者ID:wl500g,项目名称:usbip-no-glib,代码行数:22,
示例18: tweak_reset_device_cmdstatic int tweak_reset_device_cmd(struct urb *urb){ struct usb_ctrlrequest *req; __u16 value; __u16 index; int ret; req = (struct usb_ctrlrequest *) urb->setup_packet; value = le16_to_cpu(req->wValue); index = le16_to_cpu(req->wIndex);#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30) uinfo("reset_device (port %d) to %s/n", index, urb->dev->dev.bus_id);#else uinfo("reset_device (port %d) to %s/n", index, dev_name(&urb->dev->dev));#endif /* all interfaces should be owned by usbip driver, so just reset it. */ ret = usb_lock_device_for_reset(urb->dev, NULL); if (ret < 0) { uerr("lock for reset/n"); return ret; } /* try to reset the device */#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27) ret = usb_reset_composite_device(urb->dev, NULL);#else ret = usb_reset_device(urb->dev);#endif if (ret < 0) uerr("device reset/n"); usb_unlock_device(urb->dev); return ret;}
开发者ID:wl500g,项目名称:usbip-no-glib,代码行数:37,
示例19: prod_retrans_abort_entryint prod_retrans_abort_entry (ACQ_TABLE *p_acqtable, long prod_seqno, int err_cause){ static char FNAME[]="retrans_abort_entry"; int index_value; /* index for prod_seqno */ int retrans_table_typ; /* retrans table type */ PROD_RETRANS_ENTRY *p_retrans_entry; PROD_RETRANS_ENTRY_INFO *p_retrans_entry_info; if(prod_retrans_get_addr(p_acqtable->proc_base_channel_type_last, p_prod_retrans_table, &p_retrans_entry_info, &p_retrans_entry, &retrans_table_typ) < 0){ uerror("%s ignore abort /n",FNAME); return(ERROR); } /* Now get the index value */ index_value = prod_seqno % p_retrans_entry_info->numb_entries; if(index_value < 0) { index_value = -index_value; } if(index_value >= p_retrans_entry_info->numb_entries) { index_value = 0; } if(ulogIsVerbose ()){ uinfo("%s ok abort %s tbl[%d]=%ld/n",FNAME, GET_SBN_TYP_NAME(p_acqtable->proc_base_channel_type_last), index_value, p_retrans_entry[index_value].prod_seqno); } prod_retrans_update_entry(p_acqtable, (BUFF_HDR *)NULL, p_retrans_entry_info, &p_retrans_entry[index_value], index_value, prod_seqno, p_acqtable->proc_prod_run_id, RETRANS_ENTRY_FLAG_AVAIL, err_cause); return(0); }
开发者ID:rmlawton,项目名称:LDM,代码行数:44,
示例20: usbhost_detectstatic void* usbhost_detect(void *arg){ (void)arg; struct usbhost_hubport_s *hport; uinfo("INFO: Starting usb detect thread/n"); for (;;) { CONN_WAIT(g_usbconn, &hport); if (hport->connected) { CONN_ENUMERATE(g_usbconn, hport); } } return 0;}
开发者ID:AlexShiLucky,项目名称:NuttX,代码行数:19,
示例21: split_prodstatic intsplit_prod(const prod_info *infop, const void *datap, void *xprod, size_t size, void *vp){ size_t *nsp = (size_t *)vp; int ns; if(ulogIsVerbose()) uinfo("%s", s_prod_info(NULL, 0, infop, ulogIsDebug())); ns = surf_split(infop, datap, doOne); nprods++; (void)kill(SIGCONT, act_pid); if(nsp != NULL && ns >= 0) *nsp = (size_t)ns; return 0;}
开发者ID:funnelfiasco,项目名称:LDM,代码行数:21,
示例22: lpc31_usbhost_vbusdrivevoid lpc31_usbhost_vbusdrive(int rhport, bool enable){ uinfo("RHPort%d: enable=%d/n", rhport+1, enable); /* The LPC3131 has only a single root hub port */ if (rhport == 0) { /* Then enable or disable VBUS power */ if (enable) { /* Enable the Power Switch by driving the enable pin low */#warning Missing logic } else { /* Disable the Power Switch by driving the enable pin high */#warning Missing logic } }}
开发者ID:AlexShiLucky,项目名称:NuttX,代码行数:22,
示例23: lpc31_usbhost_vbusdrivevoid lpc31_usbhost_vbusdrive(int rhport, bool enable){ uinfo("RHPort%d: enable=%d/n", rhport+1, enable); /* The LPC3131 has only a single root hub port */ if (rhport == 0) { /* Then enable or disable VBUS power */ if (enable) { /* Enable the Power Switch by driving the enable pin low */ gpio_outputlow(LPC31_IOCONFIG_GPIO, GPIO_NOTG_PWR_E); } else { /* Disable the Power Switch by driving the enable pin high */ gpio_outputhigh(LPC31_IOCONFIG_GPIO, GPIO_NOTG_PWR_E); } }}
开发者ID:a1ien,项目名称:nuttx,代码行数:24,
示例24: doOnestatic intdoOne(const prod_info *infop, const void *datap){ struct product prod; int status = ENOERR; if(ulogIsDebug()) udebug("%s", s_prod_info(NULL, 0, infop, 1)); prod.info = *infop; prod.data = (void *)datap; /* cast away const */ nsplit++; /* ?? Do it here on only on success ?? */ status = pq_insertNoSig(opq, &prod); if(status == ENOERR) { return status; /* Normal return */ } /* else */ if(status == PQUEUE_DUP) { ndups++; if(ulogIsVerbose()) uinfo("Product already in queue: %s", s_prod_info(NULL, 0, &prod.info, ulogIsDebug())); return status; } /* else, error */ uerror("pq_insert: %s/n", strerror(status)); return status;}
开发者ID:funnelfiasco,项目名称:LDM,代码行数:36,
示例25: handle_connection//.........这里部分代码省略......... unotice("Denying connection from [%s] because not " "allowed", remote->astr); } else { unotice("Denying connection from /"%s/" because not " "allowed", remote_name()); } /* * Try to tell the other guy. * TODO: Why doesn't this work? */ xprt = svcfd_create(xp_sock, remote->sendsz, remote->recvsz); if (xprt != NULL ) { xprt->xp_raddr = raddr; xprt->xp_addrlen = (int) len; svcerr_weakauth(xprt); svc_destroy(xprt); } goto unwind_sock; } } /* else */ endpriv(); portIsMapped = 0; /* don't call pmap_unset() from child */ (void) close(sock); /* Set the ulog identifier, optional. */ set_abbr_ident(remote_name(), NULL ); uinfo("Connection from %s", remote_name()); xprt = svcfd_create(xp_sock, remote->sendsz, remote->recvsz); if (xprt == NULL ) { uerror("Can't create fd service."); goto unwind_sock; } /* hook up the remote address to the xprt. */ /* xprt->xp_raddr = raddr; */ xprt->xp_raddr = raddr; xprt->xp_addrlen = (int) len; if (!svc_register(xprt, LDMPROG, 4, ldmprog_4, 0)) { uerror("unable to register LDM-4 service."); svc_destroy(xprt); goto unwind_sock; } if (!svc_register(xprt, LDMPROG, FIVE, ldmprog_5, 0)) { uerror("unable to register LDM-5 service."); svc_destroy(xprt); goto unwind_sock; } if (!svc_register(xprt, LDMPROG, SIX, ldmprog_6, 0)) { uerror("unable to register LDM-6 service."); svc_destroy(xprt); goto unwind_sock; }#if WANT_MULTICAST if (!svc_register(xprt, LDMPROG, SEVEN, ldmprog_7, 0)) { uerror("unable to register LDM-7 service.");
开发者ID:dgaer,项目名称:LDM,代码行数:67,
示例26: composite_setupstatic int composite_setup(FAR struct usbdevclass_driver_s *driver, FAR struct usbdev_s *dev, FAR const struct usb_ctrlreq_s *ctrl, FAR uint8_t *dataout, size_t outlen){ FAR struct composite_dev_s *priv; FAR struct usbdev_req_s *ctrlreq; uint16_t value; uint16_t index; uint16_t len; bool dispatched = false; int ret = -EOPNOTSUPP;#ifdef CONFIG_DEBUG_FEATURES if (!driver || !dev || !dev->ep0 || !ctrl) { usbtrace(TRACE_CLSERROR(USBCOMPOSITE_TRACEERR_SETUPINVALIDARGS), 0); return -EIO; }#endif /* Extract a reference to private data */ usbtrace(TRACE_CLASSSETUP, ctrl->req); priv = ((FAR struct composite_driver_s *)driver)->dev;#ifdef CONFIG_DEBUG_FEATURES if (!priv) { usbtrace(TRACE_CLSERROR(USBCOMPOSITE_TRACEERR_EP0NOTBOUND2), 0); return -ENODEV; }#endif ctrlreq = priv->ctrlreq; /* Extract the little-endian 16-bit values to host order */ value = GETUINT16(ctrl->value); index = GETUINT16(ctrl->index); len = GETUINT16(ctrl->len); uinfo("type=%02x req=%02x value=%04x index=%04x len=%04x/n", ctrl->type, ctrl->req, value, index, len); UNUSED(index); if ((ctrl->type & USB_REQ_TYPE_MASK) == USB_REQ_TYPE_STANDARD) { /********************************************************************** * Standard Requests **********************************************************************/ switch (ctrl->req) { case USB_REQ_GETDESCRIPTOR: { /* The value field specifies the descriptor type in the MS byte and the * descriptor index in the LS byte (order is little endian) */ switch (ctrl->value[1]) { case USB_DESC_TYPE_DEVICE: { ret = USB_SIZEOF_DEVDESC; memcpy(ctrlreq->buf, composite_getdevdesc(), ret); } break;#ifdef CONFIG_USBDEV_DUALSPEED case USB_DESC_TYPE_DEVICEQUALIFIER: { ret = USB_SIZEOF_QUALDESC; memcpy(ctrlreq->buf, composite_getqualdesc(), ret); } break; case USB_DESC_TYPE_OTHERSPEEDCONFIG:#endif case USB_DESC_TYPE_CONFIG: {#ifdef CONFIG_USBDEV_DUALSPEED ret = composite_mkcfgdesc(ctrlreq->buf, dev->speed, ctrl->value[1]);#else ret = composite_mkcfgdesc(ctrlreq->buf);#endif } break; case USB_DESC_TYPE_STRING: { /* value == string index. Zero is the language ID. */ uint8_t strid = ctrl->value[0]; FAR struct usb_strdesc_s *buf = (FAR struct usb_strdesc_s *)ctrlreq->buf; if (strid <= COMPOSITE_NSTRIDS) { ret = composite_mkstrdesc(strid, buf);//.........这里部分代码省略.........
开发者ID:a1ien,项目名称:nuttx,代码行数:101,
示例27: hiya_6_svchiya_reply_t*hiya_6_svc( prod_class_t *offered, struct svc_req *rqstp){ const char* const pqfname = getQueuePath(); static hiya_reply_t reply; SVCXPRT * const xprt = rqstp->rq_xprt; struct sockaddr_in *upAddr = (struct sockaddr_in*) svc_getcaller(xprt); const char *upName = hostbyaddr(upAddr); int error; int isPrimary; unsigned int maxHereis; static prod_class_t *accept; /* * Open the product-queue for writing. It will be closed by cleanup() * during process termination. */ if (pq) { (void) pq_close(pq); pq = NULL; } error = pq_open(pqfname, PQ_DEFAULT, &pq); if (error) { err_log_and_free(ERR_NEW2(error, NULL, "Couldn't open product-queue /"%s/" for writing: %s", pqfname, PQ_CORRUPT == error ? "The product-queue is inconsistent" : strerror(error)), ERR_FAILURE); svcerr_systemerr(xprt); svc_destroy(xprt); exit(error); } /* else */ error = down6_init(upName, upAddr, pqfname, pq); if (error) { uerror("Couldn't initialize downstream LDM"); svcerr_systemerr(xprt); svc_destroy(xprt); exit(error); } else { uinfo("Downstream LDM initialized"); } /* * The previous "accept" is freed here -- rather than freeing the * soon-to-be-allocated "accept" at the end of its block -- because it can * be used in the reply. */ if (accept) { free_prod_class(accept); /* NULL safe */ accept = NULL; } error = lcf_reduceToAcceptable(upName, inet_ntoa(upAddr->sin_addr), offered, &accept, &isPrimary); maxHereis = isPrimary ? UINT_MAX : 0; if (error) { serror("Couldn't validate HIYA"); svcerr_systemerr(xprt); svc_destroy(xprt); exit(error); } else { if (ulogIsDebug()) udebug("intersection: %s", s_prod_class(NULL, 0, accept)); if (accept->psa.psa_len == 0) { uwarn("Empty intersection of HIYA offer from %s (%s) and ACCEPT " "entries", upName, s_prod_class(NULL, 0, offered)); svcerr_weakauth(xprt); svc_destroy(xprt); exit(0); } else { error = down6_set_prod_class(accept); if (error) { if (DOWN6_SYSTEM_ERROR == error) { serror("Couldn't set product class: %s", s_prod_class(NULL, 0, accept)); } else { uerror("Couldn't set product class: %s", s_prod_class(NULL, 0, accept)); } svcerr_systemerr(xprt); svc_destroy(xprt); exit(EXIT_FAILURE); } /* else *///.........这里部分代码省略.........
开发者ID:khallock,项目名称:LDM,代码行数:101,
示例28: main//.........这里部分代码省略......... signatureFromId ? mm_md5(md5ctxp, prod.info.ident, strlen(prod.info.ident), prod.info.signature) : mm_md5(md5ctxp, prod.data, prod.info.sz, prod.info.signature); (void)exitIfDone(1); if (status != 0) { serror("mm_md5: %s", filename); (void) munmap(prod.data, prod.info.sz); (void) close(fd); exitCode = exit_infile; continue; } /* These members, and seqno, vary over the loop. */ status = set_timestamp(&prod.info.arrival); if(status != ENOERR) { serror("set_timestamp: %s, filename"); exitCode = exit_infile; continue; } /* * Do the deed */ status = pq_insert(pq, &prod); switch (status) { case ENOERR: /* no error */ if(ulogIsVerbose()) uinfo("%s", s_prod_info(NULL, 0, &prod.info, ulogIsDebug())) ; break; case PQUEUE_DUP: uerror("Product already in queue: %s", s_prod_info(NULL, 0, &prod.info, 1)); exitCode = exit_dup; break; case PQUEUE_BIG: uerror("Product too big for queue: %s", s_prod_info(NULL, 0, &prod.info, 1)); exitCode = exit_infile; break; case ENOMEM: uerror("queue full?"); exitCode = exit_system; break; case EINTR:#if defined(EDEADLOCK) && EDEADLOCK != EDEADLK case EDEADLOCK: /*FALLTHROUGH*/#endif case EDEADLK: /* TODO: retry ? */ /*FALLTHROUGH*/ default: uerror("pq_insert: %s", status > 0 ? strerror(status) : "Internal error"); break; } (void) munmap(prod.data, prod.info.sz);#else // USE_MMAP above; !USE_MMAP below
开发者ID:khallock,项目名称:LDM,代码行数:67,
示例29: sam_usbsuspendvoid sam_usbsuspend(FAR struct usbdev_s *dev, bool resume){ uinfo("resume: %d/n", resume);}
开发者ID:a1ien,项目名称:nuttx,代码行数:4,
注:本文中的uinfo函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ uint函数代码示例 C++ uid_valid函数代码示例 |