这篇教程C++ unix_ipc_sendmsg函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中unix_ipc_sendmsg函数的典型用法代码示例。如果您正苦于以下问题:C++ unix_ipc_sendmsg函数的具体用法?C++ unix_ipc_sendmsg怎么用?C++ unix_ipc_sendmsg使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了unix_ipc_sendmsg函数的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: gateway_resume_completestatic void gateway_resume_complete(struct audio_device *dev, GError *err, void *user_data){ struct unix_client *client = user_data; char buf[BT_SUGGESTED_BUFFER_SIZE]; struct bt_start_stream_rsp *rsp = (void *) buf; struct bt_new_stream_ind *ind = (void *) buf; if (err) { unix_ipc_error(client, BT_START_STREAM, err->code); return; } memset(buf, 0, sizeof(buf)); rsp->h.type = BT_RESPONSE; rsp->h.name = BT_START_STREAM; rsp->h.length = sizeof(*rsp); unix_ipc_sendmsg(client, &rsp->h); memset(buf, 0, sizeof(buf)); ind->h.type = BT_INDICATION; ind->h.name = BT_NEW_STREAM; ind->h.length = sizeof(*ind); unix_ipc_sendmsg(client, &ind->h); client->data_fd = gateway_get_sco_fd(dev); if (unix_sendmsg_fd(client->sock, client->data_fd) < 0) { error("unix_sendmsg_fd: %s(%d)", strerror(errno), errno); unix_ipc_error(client, BT_START_STREAM, EIO); } client->req_id = 0;}
开发者ID:crow89,项目名称:Alcatel_OT_985_kernel,代码行数:34,
示例2: a2dp_resume_completestatic void a2dp_resume_complete(struct avdtp *session, struct avdtp_error *err, void *user_data){ struct unix_client *client = user_data; char buf[BT_SUGGESTED_BUFFER_SIZE]; struct bt_start_stream_rsp *rsp = (void *) buf; struct bt_new_stream_ind *ind = (void *) buf; struct a2dp_data *a2dp = &client->d.a2dp; if (err) goto failed; memset(buf, 0, sizeof(buf)); rsp->h.type = BT_RESPONSE; rsp->h.name = BT_START_STREAM; rsp->h.length = sizeof(*rsp); unix_ipc_sendmsg(client, &rsp->h); memset(buf, 0, sizeof(buf)); ind->h.type = BT_RESPONSE; ind->h.name = BT_NEW_STREAM; rsp->h.length = sizeof(*ind); unix_ipc_sendmsg(client, &ind->h); if (unix_sendmsg_fd(client->sock, client->data_fd) < 0) { error("unix_sendmsg_fd: %s(%d)", strerror(errno), errno); goto failed; } return;failed: error("resume failed"); unix_ipc_error(client, BT_START_STREAM, EIO); if (client->cb_id > 0) { avdtp_stream_remove_cb(a2dp->session, a2dp->stream, client->cb_id); client->cb_id = 0; } if (a2dp->sep) { a2dp_sep_unlock(a2dp->sep, a2dp->session); a2dp->sep = NULL; } avdtp_unref(a2dp->session); a2dp->session = NULL; a2dp->stream = NULL;}
开发者ID:crow89,项目名称:Alcatel_OT_985_kernel,代码行数:53,
示例3: a2dp_suspend_completestatic void a2dp_suspend_complete(struct avdtp *session, struct avdtp_error *err, void *user_data){ struct unix_client *client = user_data; char buf[BT_SUGGESTED_BUFFER_SIZE]; struct bt_stop_stream_rsp *rsp = (void *) buf; struct a2dp_data *a2dp = &client->d.a2dp; if (err) goto failed; memset(buf, 0, sizeof(buf)); rsp->h.type = BT_RESPONSE; rsp->h.name = BT_STOP_STREAM; rsp->h.length = sizeof(*rsp); unix_ipc_sendmsg(client, &rsp->h); return;failed: error("suspend failed"); unix_ipc_error(client, BT_STOP_STREAM, EIO); if (a2dp->sep) { a2dp_sep_unlock(a2dp->sep, a2dp->session); a2dp->sep = NULL; } avdtp_unref(a2dp->session); a2dp->session = NULL; a2dp->stream = NULL;}
开发者ID:crow89,项目名称:Alcatel_OT_985_kernel,代码行数:34,
示例4: a2dp_config_completestatic void a2dp_config_complete(struct avdtp *session, struct a2dp_sep *sep, struct avdtp_stream *stream, struct avdtp_error *err, void *user_data){ struct unix_client *client = user_data; char buf[BT_SUGGESTED_BUFFER_SIZE]; struct bt_set_configuration_rsp *rsp = (void *) buf; struct a2dp_data *a2dp = &client->d.a2dp; uint16_t imtu, omtu; GSList *caps; client->req_id = 0; if (err) goto failed; memset(buf, 0, sizeof(buf)); if (!stream) goto failed; if (client->cb_id > 0) avdtp_stream_remove_cb(a2dp->session, a2dp->stream, client->cb_id); a2dp->sep = sep; a2dp->stream = stream; if (!avdtp_stream_get_transport(stream, &client->data_fd, &imtu, &omtu, &caps)) { error("Unable to get stream transport"); goto failed; } rsp->h.type = BT_RESPONSE; rsp->h.name = BT_SET_CONFIGURATION; rsp->h.length = sizeof(*rsp); /* FIXME: Use imtu when fd_opt is CFG_FD_OPT_READ */ rsp->link_mtu = omtu; unix_ipc_sendmsg(client, &rsp->h); client->cb_id = avdtp_stream_add_cb(session, stream, stream_state_changed, client); return;failed: error("config failed"); unix_ipc_error(client, BT_SET_CONFIGURATION, EIO); avdtp_unref(a2dp->session); a2dp->session = NULL; a2dp->stream = NULL; a2dp->sep = NULL;}
开发者ID:crow89,项目名称:Alcatel_OT_985_kernel,代码行数:60,
示例5: gateway_setup_completestatic void gateway_setup_complete(struct audio_device *dev, GError *err, void *user_data){ struct unix_client *client = user_data; char buf[BT_SUGGESTED_BUFFER_SIZE]; struct bt_set_configuration_rsp *rsp = (void *) buf; if (err) { unix_ipc_error(client, BT_SET_CONFIGURATION, err->code); return; } client->req_id = 0; memset(buf, 0, sizeof(buf)); rsp->h.type = BT_RESPONSE; rsp->h.name = BT_SET_CONFIGURATION; rsp->h.length = sizeof(*rsp); rsp->link_mtu = 48; client->data_fd = gateway_get_sco_fd(dev); unix_ipc_sendmsg(client, &rsp->h);}
开发者ID:crow89,项目名称:Alcatel_OT_985_kernel,代码行数:25,
示例6: headset_discovery_completestatic void headset_discovery_complete(struct audio_device *dev, void *user_data){ struct unix_client *client = user_data; char buf[BT_SUGGESTED_BUFFER_SIZE]; struct bt_get_capabilities_rsp *rsp = (void *) buf; uint8_t length; client->req_id = 0; if (!dev) goto failed; memset(buf, 0, sizeof(buf)); length = headset_generate_capability(dev, (void *) rsp->data); rsp->h.type = BT_RESPONSE; rsp->h.name = BT_GET_CAPABILITIES; rsp->h.length = sizeof(*rsp) + length; ba2str(&dev->src, rsp->source); ba2str(&dev->dst, rsp->destination); strncpy(rsp->object, dev->path, sizeof(rsp->object)); unix_ipc_sendmsg(client, &rsp->h); return;failed: error("discovery failed"); unix_ipc_error(client, BT_SET_CONFIGURATION, EIO);}
开发者ID:crow89,项目名称:Alcatel_OT_985_kernel,代码行数:32,
示例7: headset_setup_completestatic void headset_setup_complete(struct audio_device *dev, void *user_data){ struct unix_client *client = user_data; char buf[BT_SUGGESTED_BUFFER_SIZE]; struct bt_set_configuration_rsp *rsp = (void *) buf; client->req_id = 0; if (!dev) goto failed; memset(buf, 0, sizeof(buf)); rsp->h.type = BT_RESPONSE; rsp->h.name = BT_SET_CONFIGURATION; rsp->h.length = sizeof(*rsp); rsp->link_mtu = 48; client->data_fd = headset_get_sco_fd(dev); unix_ipc_sendmsg(client, &rsp->h); return;failed: error("config failed"); unix_ipc_error(client, BT_SET_CONFIGURATION, EIO);}
开发者ID:crow89,项目名称:Alcatel_OT_985_kernel,代码行数:29,
示例8: headset_resume_completestatic void headset_resume_complete(struct audio_device *dev, void *user_data){ struct unix_client *client = user_data; char buf[BT_SUGGESTED_BUFFER_SIZE]; struct bt_start_stream_rsp *rsp = (void *) buf; struct bt_new_stream_ind *ind = (void *) buf; client->req_id = 0; if (!dev) goto failed; client->data_fd = headset_get_sco_fd(dev); if (client->data_fd < 0) { error("Unable to get a SCO fd"); goto failed; } memset(buf, 0, sizeof(buf)); rsp->h.type = BT_RESPONSE; rsp->h.name = BT_START_STREAM; rsp->h.length = sizeof(*rsp); unix_ipc_sendmsg(client, &rsp->h); memset(buf, 0, sizeof(buf)); ind->h.type = BT_INDICATION; ind->h.name = BT_NEW_STREAM; ind->h.length = sizeof(*ind); unix_ipc_sendmsg(client, &ind->h); if (unix_sendmsg_fd(client->sock, client->data_fd) < 0) { error("unix_sendmsg_fd: %s(%d)", strerror(errno), errno); goto failed; } return;failed: error("headset_resume_complete: resume failed"); unix_ipc_error(client, BT_START_STREAM, EIO);}
开发者ID:crow89,项目名称:Alcatel_OT_985_kernel,代码行数:43,
示例9: handle_control_reqstatic void handle_control_req(struct unix_client *client, struct bt_control_req *req){ /* FIXME: really implement that */ char buf[BT_SUGGESTED_BUFFER_SIZE]; struct bt_set_configuration_rsp *rsp = (void *) buf; memset(buf, 0, sizeof(buf)); rsp->h.type = BT_RESPONSE; rsp->h.name = BT_CONTROL; rsp->h.length = sizeof(*rsp); unix_ipc_sendmsg(client, &rsp->h);}
开发者ID:crow89,项目名称:Alcatel_OT_985_kernel,代码行数:14,
示例10: handle_delay_report_reqstatic void handle_delay_report_req(struct unix_client *client, struct bt_delay_report_req *req){ char buf[BT_SUGGESTED_BUFFER_SIZE]; struct bt_set_configuration_rsp *rsp = (void *) buf; struct a2dp_data *a2dp; int err; if (!client->dev) { err = -ENODEV; goto failed; } switch (client->type) { case TYPE_HEADSET: case TYPE_GATEWAY: err = -EINVAL; goto failed; case TYPE_SOURCE: case TYPE_SINK: a2dp = &client->d.a2dp; if (a2dp->session && a2dp->stream) { err = avdtp_delay_report(a2dp->session, a2dp->stream, req->delay); if (err < 0) goto failed; } else { err = -EINVAL; goto failed; } break; default: error("No known services for device"); err = -EINVAL; goto failed; } memset(buf, 0, sizeof(buf)); rsp->h.type = BT_RESPONSE; rsp->h.name = BT_DELAY_REPORT; rsp->h.length = sizeof(*rsp); unix_ipc_sendmsg(client, &rsp->h); return;failed: unix_ipc_error(client, BT_DELAY_REPORT, -err);}
开发者ID:crow89,项目名称:Alcatel_OT_985_kernel,代码行数:49,
示例11: close_completestatic void close_complete(struct audio_device *dev, void *user_data){ struct unix_client *client = user_data; char buf[BT_SUGGESTED_BUFFER_SIZE]; struct bt_close_rsp *rsp = (void *) buf; memset(buf, 0, sizeof(buf)); rsp->h.type = BT_RESPONSE; rsp->h.name = BT_CLOSE; rsp->h.length = sizeof(*rsp); unix_ipc_sendmsg(client, &rsp->h); return;}
开发者ID:crow89,项目名称:Alcatel_OT_985_kernel,代码行数:16,
示例12: unix_ipc_errorstatic void unix_ipc_error(struct unix_client *client, uint8_t name, int err){ char buf[BT_SUGGESTED_BUFFER_SIZE]; bt_audio_error_t *rsp = (void *) buf; if (!g_slist_find(clients, client)) return; memset(buf, 0, sizeof(buf)); rsp->h.type = BT_ERROR; rsp->h.name = name; rsp->h.length = sizeof(*rsp); rsp->posix_errno = err; unix_ipc_sendmsg(client, &rsp->h);}
开发者ID:Mcjesus15,项目名称:Zio_Other,代码行数:17,
示例13: open_completestatic void open_complete(struct audio_device *dev, void *user_data){ struct unix_client *client = user_data; char buf[BT_SUGGESTED_BUFFER_SIZE]; struct bt_open_rsp *rsp = (void *) buf; memset(buf, 0, sizeof(buf)); rsp->h.type = BT_RESPONSE; rsp->h.name = BT_OPEN; rsp->h.length = sizeof(*rsp); ba2str(&dev->src, rsp->source); ba2str(&dev->dst, rsp->destination); strncpy(rsp->object, dev->path, sizeof(rsp->object)); unix_ipc_sendmsg(client, &rsp->h);}
开发者ID:crow89,项目名称:Alcatel_OT_985_kernel,代码行数:18,
示例14: headset_suspend_completestatic void headset_suspend_complete(struct audio_device *dev, void *user_data){ struct unix_client *client = user_data; char buf[BT_SUGGESTED_BUFFER_SIZE]; struct bt_stop_stream_rsp *rsp = (void *) buf; if (!dev) goto failed; memset(buf, 0, sizeof(buf)); rsp->h.type = BT_RESPONSE; rsp->h.name = BT_STOP_STREAM; rsp->h.length = sizeof(*rsp); unix_ipc_sendmsg(client, &rsp->h); return;failed: error("suspend failed"); unix_ipc_error(client, BT_STOP_STREAM, EIO);}
开发者ID:crow89,项目名称:Alcatel_OT_985_kernel,代码行数:22,
示例15: unix_delay_reportvoid unix_delay_report(struct audio_device *dev, uint8_t seid, uint16_t delay){ GSList *l; struct bt_delay_report_ind ind; DBG("unix_delay_report(%p): %u.%ums", dev, delay / 10, delay % 10); memset(&ind, 0, sizeof(ind)); ind.h.type = BT_INDICATION; ind.h.name = BT_DELAY_REPORT; ind.h.length = sizeof(ind); ind.delay = delay; for (l = clients; l != NULL; l = g_slist_next(l)) { struct unix_client *client = l->data; if (client->dev != dev || client->seid != seid) continue; unix_ipc_sendmsg(client, (void *) &ind); }}
开发者ID:crow89,项目名称:Alcatel_OT_985_kernel,代码行数:22,
示例16: a2dp_discovery_completestatic void a2dp_discovery_complete(struct avdtp *session, GSList *seps, struct avdtp_error *err, void *user_data){ struct unix_client *client = user_data; char buf[BT_SUGGESTED_BUFFER_SIZE]; struct bt_get_capabilities_rsp *rsp = (void *) buf; struct a2dp_data *a2dp = &client->d.a2dp; GSList *l; if (!g_slist_find(clients, client)) { DBG("Client disconnected during discovery"); return; } if (err) goto failed; memset(buf, 0, sizeof(buf)); client->req_id = 0; rsp->h.type = BT_RESPONSE; rsp->h.name = BT_GET_CAPABILITIES; rsp->h.length = sizeof(*rsp); ba2str(&client->dev->src, rsp->source); ba2str(&client->dev->dst, rsp->destination); strncpy(rsp->object, client->dev->path, sizeof(rsp->object)); for (l = seps; l; l = g_slist_next(l)) { struct avdtp_remote_sep *rsep = l->data; struct a2dp_sep *sep; struct avdtp_service_capability *cap; struct avdtp_stream *stream; uint8_t type, seid, configured = 0, lock = 0; GSList *cl; type = avdtp_get_type(rsep); if (type != AVDTP_SEP_TYPE_SINK && type != AVDTP_SEP_TYPE_SOURCE) continue; cap = avdtp_get_codec(rsep); if (cap->category != AVDTP_MEDIA_CODEC) continue; seid = avdtp_get_seid(rsep); if (client->seid != 0 && client->seid != seid) continue; stream = avdtp_get_stream(rsep); if (stream) { configured = 1; if (client->seid == seid) cap = avdtp_stream_get_codec(stream); } for (cl = clients; cl; cl = cl->next) { struct unix_client *c = cl->data; struct a2dp_data *ca2dp = &c->d.a2dp; if (ca2dp->session == session && c->seid == seid) { lock = c->lock; break; } } sep = a2dp_get_sep(session, stream); if (sep && a2dp_sep_get_lock(sep)) lock = BT_WRITE_LOCK; a2dp_append_codec(rsp, cap, seid, type, configured, lock); } unix_ipc_sendmsg(client, &rsp->h); return;failed: error("discovery failed"); unix_ipc_error(client, BT_GET_CAPABILITIES, EIO); if (a2dp->sep) { a2dp_sep_unlock(a2dp->sep, a2dp->session); a2dp->sep = NULL; } avdtp_unref(a2dp->session); a2dp->session = NULL; a2dp->stream = NULL;}
开发者ID:crow89,项目名称:Alcatel_OT_985_kernel,代码行数:93,
注:本文中的unix_ipc_sendmsg函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ unix_open函数代码示例 C++ unix_ipc_error函数代码示例 |