kanamu / broadcom-bluetooth

Automatically exported from code.google.com/p/broadcom-bluetooth
0 stars 0 forks source link

Why does brcm_patchram_plus wait almost infinite after Done setting line discpline #3

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
During use with the option enable_hci the program waits for almost infinite:

        if (enable_hci) {
                proc_enable_hci();

                while (1) {
                        sleep(UINT_MAX);
                }
        }

UINT_MAX is a very big value.

While ending the program with ^C after the message "Done setting line 
discpline" seem to be working fine.

Is the sleep really requered ? 

Original issue reported on code.google.com by k.eenkho...@gmail.com on 25 May 2014 at 6:51

GoogleCodeExporter commented 8 years ago
I have removed the while(1) loop from the code as test and it works fine for a 
cubietruck board.

Command sequence:

root@cubian:~# echo -n "" > /dev/ttyS1  # i have to open the ttyS1 line as 
mentioned earlyer.

root@cubian:~# brcm_patchram_plus -d  --patchram 
/lib/firmware/ap6210/bcm20710a1.hcd --enable_hci --bd_addr 11:22:33:44:55:66 
--no2bytes --tosleep 1000 /dev/ttyS1

root@cubian:~# hciattach /dev/ttyS1 any
Device setup complete
root@cubian:~# hcitool dev
Devices:
    hci0    11:22:33:44:55:66
root@cubian:~# hciconfig -a
hci0:   Type: BR/EDR  Bus: UART
    BD Address: 11:22:33:44:55:66  ACL MTU: 1021:8  SCO MTU: 64:1
    UP RUNNING PSCAN 
    RX bytes:848 acl:0 sco:0 events:32 errors:0
    TX bytes:906 acl:0 sco:0 commands:32 errors:0
    Features: 0xbf 0xfe 0xcf 0xfe 0xdb 0xff 0x7b 0x87
    Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 
    Link policy: RSWITCH SNIFF 
    Link mode: SLAVE ACCEPT 
    Name: 'cubian-0'
    Class: 0x420100
    Service Classes: Networking, Telephony
    Device Class: Computer, Uncategorized
    HCI Version: 4.0 (0x6)  Revision: 0x1000
    LMP Version: 4.0 (0x6)  Subversion: 0x220e
    Manufacturer: Broadcom Corporation (15)

root@cubian:~# hcitool scan
Scanning ...
    AX:EX:1X:FX:4X:BX   Nokia 3720c
root@cubian:~# 

Original comment by k.eenkho...@gmail.com on 25 May 2014 at 7:09