sock = g_io_channel_unix_get_fd(io);
switch (type) {
- case BT_IO_L2RAW:
case BT_IO_L2CAP:
case BT_IO_L2ERTM:
return l2cap_get(sock, err, opt1, args);
sock = g_io_channel_unix_get_fd(io);
switch (type) {
- case BT_IO_L2RAW:
case BT_IO_L2CAP:
case BT_IO_L2ERTM:
return l2cap_set(sock, opts.sec_level, opts.imtu, opts.omtu,
GIOChannel *io;
switch (type) {
- case BT_IO_L2RAW:
- sock = socket(PF_BLUETOOTH, SOCK_RAW, BTPROTO_L2CAP);
- if (sock < 0) {
- ERROR_FAILED(err, "socket(RAW, L2CAP)", errno);
- return NULL;
- }
- if (l2cap_bind(sock, &opts->src, server ? opts->psm : 0,
- opts->cid, err) < 0)
- goto failed;
- if (!l2cap_set(sock, opts->sec_level, 0, 0, 0, -1, -1, 0, err))
- goto failed;
- break;
case BT_IO_L2CAP:
sock = socket(PF_BLUETOOTH, SOCK_SEQPACKET, BTPROTO_L2CAP);
if (sock < 0) {
sock = g_io_channel_unix_get_fd(io);
switch (type) {
- case BT_IO_L2RAW:
- err = l2cap_connect(sock, &opts.dst, opts.dst_type, 0,
- opts.cid);
- break;
case BT_IO_L2CAP:
case BT_IO_L2ERTM:
err = l2cap_connect(sock, &opts.dst, opts.dst_type,
int sock;
gboolean ret;
- if (type == BT_IO_L2RAW) {
- ERROR_FAILED(err, "Server L2CAP RAW sockets not supported",
- EINVAL);
- return NULL;
- }
-
va_start(args, opt1);
ret = parse_set_opts(&opts, err, opt1, args);
va_end(args);