Return-Path: Message-ID: <7e36c64c0611060046j3d04ee1ibab63a54509a0532@mail.gmail.com> Date: Mon, 6 Nov 2006 14:16:33 +0530 From: "shantibhushan sale" To: bluez-devel@lists.sourceforge.net MIME-Version: 1.0 Subject: [Bluez-devel] BT Reply-To: BlueZ development List-Id: BlueZ development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============1355343382==" Sender: bluez-devel-bounces@lists.sourceforge.net Errors-To: bluez-devel-bounces@lists.sourceforge.net --===============1355343382== Content-Type: multipart/alternative; boundary="----=_Part_47694_19589922.1162802793223" ------=_Part_47694_19589922.1162802793223 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Can i get any info how about Bluetooth On/OFF.I tried a program that doesnt help out much for me.Does anyone help me here. Here is this program which works as hciconfig hci0 up int start_device(uint16_t dev_id) { struct hci_dev *dev; struct hci_version ver; uint8_t features[8], inqmode; int dd; ASSERT_DEV_ID; dev = &devices[dev_id]; if (dev->ignore) return 0; dd = hci_open_dev(dev_id); if (dd < 0) { error("Can't open device hci%d", dev_id, strerror(errno), errno); return -errno; } if (hci_read_local_version(dd, &ver, 1000) < 0) { int err = errno; error("Can't read version info for hci%d: %s (%d)", dev_id, strerror(errno), errno); hci_close_dev(dd); return -err; } dev->hci_rev = ver.hci_rev; dev->lmp_ver = ver.lmp_ver; dev->lmp_subver = ver.lmp_subver; dev->manufacturer = ver.manufacturer; if (hci_read_local_features(dd, features, 1000) < 0) { int err = errno; error("Can't read features for hci%d: %s (%d)", dev_id, strerror(errno), errno); hci_close_dev(dd); return -err; } memcpy(dev->features, features, 8); inqmode = get_inquiry_mode(dev); if (inqmode < 1) goto done; if (hci_write_inquiry_mode(dd, inqmode, 1000) < 0) { int err = errno; error("Can't write inquiry mode for hci%d: %s (%d)", dev_id, strerror(errno), errno); hci_close_dev(dd); return -err; } done: hci_close_dev(dd); printf("Device hci%d has been activated", dev_id); return 0; } ------=_Part_47694_19589922.1162802793223 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Can i get any info how about Bluetooth On/OFF.I tried a program that doesnt help out much for me.Does anyone help me here.
Here is this program which works as hciconfig hci0 up

int start_device(uint16_t dev_id)
{
    struct hci_dev *dev;
    struct hci_version ver;
    uint8_t features[8], inqmode;
    int dd;

    ASSERT_DEV_ID;

    dev = &devices[dev_id];

    if (dev->ignore)
        return 0;

    dd = hci_open_dev(dev_id);
    if (dd < 0) {
        error("Can't open device hci%d",
                    dev_id, strerror(errno), errno);
        return -errno;
    }

    if (hci_read_local_version(dd, &ver, 1000) < 0) {
        int err = errno;
        error("Can't read version info for hci%d: %s (%d)",
                    dev_id, strerror(errno), errno);
        hci_close_dev(dd);
        return -err;
    }

    dev->hci_rev = ver.hci_rev;
    dev->lmp_ver = ver.lmp_ver;
    dev->lmp_subver = ver.lmp_subver;
    dev->manufacturer = ver.manufacturer;

    if (hci_read_local_features(dd, features, 1000) < 0) {
        int err = errno;
        error("Can't read features for hci%d: %s (%d)",
                    dev_id, strerror(errno), errno);
        hci_close_dev(dd);
        return -err;
    }

    memcpy(dev->features, features, 8);

    inqmode = get_inquiry_mode(dev);
    if (inqmode < 1)
        goto done;

    if (hci_write_inquiry_mode(dd, inqmode, 1000) < 0) {
        int err = errno;
        error("Can't write inquiry mode for hci%d: %s (%d)",
                    dev_id, strerror(errno), errno);
        hci_close_dev(dd);
        return -err;
    }

done:
    hci_close_dev(dd);

    printf("Device hci%d has been activated", dev_id);

    return 0;
}

------=_Part_47694_19589922.1162802793223-- --===============1355343382== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 --===============1355343382== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel --===============1355343382==--