~cyphermox/bluez/5.23

« back to all changes in this revision

Viewing changes to audio/headset.c

  • Committer: Package Import Robot
  • Author(s): Nobuhiro Iwamatsu
  • Date: 2012-01-24 05:35:09 UTC
  • mfrom: (1.5.11) (7.1.6 experimental)
  • Revision ID: package-import@ubuntu.com-20120124053509-uwpwqi783lz08wm3
Tags: 4.98-1
* New upstream release.
* Update debian/bluetooth-dbus.conf.
* Update debian/control.
  Add Multi-Arch: foreign to bluez.

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
#include "error.h"
54
54
#include "telephony.h"
55
55
#include "headset.h"
56
 
#include "glib-helper.h"
 
56
#include "glib-compat.h"
 
57
#include "sdp-client.h"
57
58
#include "btio.h"
58
59
#include "dbus-common.h"
59
60
#include "../src/adapter.h"
167
168
 
168
169
        gboolean hfp_active;
169
170
        gboolean search_hfp;
 
171
        gboolean rfcomm_initiator;
170
172
 
171
173
        headset_state_t state;
172
174
        struct pending_connect *pending;
1329
1331
                if (err == -EINVAL) {
1330
1332
                        error("Badly formated or unrecognized command: %s",
1331
1333
                                        &slc->buf[slc->data_start]);
1332
 
                        err = headset_send(hs, "\r\nERROR\r\n");
 
1334
                        err = telephony_generic_rsp(device,
 
1335
                                                CME_ERROR_NOT_SUPPORTED);
1333
1336
                        if (err < 0)
1334
1337
                                goto failed;
1335
1338
                } else if (err < 0)
1513
1516
 
1514
1517
                sdp_list_free(classes, free);
1515
1518
 
1516
 
 
1517
1519
                if (sdp_uuid_cmp(&class, &uuid) == 0)
1518
1520
                        break;
1519
1521
        }
1536
1538
        if (err < 0) {
1537
1539
                error("Unable to connect: %s (%d)", strerror(-err), -err);
1538
1540
                p->err = -err;
1539
 
                error_connect_failed(dev->conn, p->msg, p->err);
 
1541
                if (p->msg != NULL)
 
1542
                        error_connect_failed(dev->conn, p->msg, p->err);
1540
1543
                goto failed;
1541
1544
        }
1542
1545
 
1633
1636
        }
1634
1637
 
1635
1638
        hs->hfp_active = hs->hfp_handle != 0 ? TRUE : FALSE;
 
1639
        hs->rfcomm_initiator = FALSE;
1636
1640
 
1637
1641
        headset_set_state(dev, HEADSET_STATE_CONNECTING);
1638
1642
 
2428
2432
        return id;
2429
2433
}
2430
2434
 
2431
 
gboolean get_hfp_active(struct audio_device *dev)
 
2435
gboolean headset_get_hfp_active(struct audio_device *dev)
2432
2436
{
2433
2437
        struct headset *hs = dev->headset;
2434
2438
 
2435
2439
        return hs->hfp_active;
2436
2440
}
2437
2441
 
2438
 
void set_hfp_active(struct audio_device *dev, gboolean active)
 
2442
void headset_set_hfp_active(struct audio_device *dev, gboolean active)
2439
2443
{
2440
2444
        struct headset *hs = dev->headset;
2441
2445
 
2442
2446
        hs->hfp_active = active;
2443
2447
}
2444
2448
 
 
2449
gboolean headset_get_rfcomm_initiator(struct audio_device *dev)
 
2450
{
 
2451
        struct headset *hs = dev->headset;
 
2452
 
 
2453
        return hs->rfcomm_initiator;
 
2454
}
 
2455
 
 
2456
void headset_set_rfcomm_initiator(struct audio_device *dev,
 
2457
                                        gboolean initiator)
 
2458
{
 
2459
        struct headset *hs = dev->headset;
 
2460
 
 
2461
        hs->rfcomm_initiator = initiator;
 
2462
}
 
2463
 
2445
2464
GIOChannel *headset_get_rfcomm(struct audio_device *dev)
2446
2465
{
2447
2466
        struct headset *hs = dev->headset;