8.14.11 BLE Peripheral Mode Example For BlueZ 5.28 and Earlier
BlueZ can be used to run in the BLE Peripheral mode using the Low Energy Advertise
command (leadv
). The Bluetooth Daemon (bluetoothd) is also
used to provide the time profile using the following commands:
# modprobe wilc-sdio
Registering wifi device
Max scan ids= 10,Max scan IE len= 1000,Signal Type= 1,Interface Modes= 844
Initializing Locks ...
wifi_pm : 0
wilc_sdio mmc0:0001:1: succesfully got gpio_reset
wilc_sdio mmc0:0001:1: succesfully got gpio_chip_en
wifi_pm : 1
wilc_sdio mmc0:0001:1: succesfully got gpio_reset
wilc_sdio mmc0:0001:1: succesfully got gpio_chip_en
wilc_sdio mmc0:0001:1: Driver Initializing success
# wilc_sdio mmc0:0001:1 wlan0: INFO [wilc_netdev_cleanup]Unregistering netdev d45a4000
De-Initializing Locks
Freeing wiphy
Module_exit Done.
at_pwr_dev: deinit
at_pwr_dev: unregistered
mmc0: card 0001 removed
mmc0: new high speed SDIO card at address 0001
Registering wifi device
Max scan ids= 10,Max scan IE len= 1000,Signal Type= 1,Interface Modes= 844
Initializing Locks ...
wilc_sdio mmc0:0001:1: Driver Initializing success
#
# echo BT_POWER_UP > /dev/wilc_bt
at_pwr_dev: open()
AT PWR: bt_power_up
wilc_sdio mmc0:0001:1: SDIO speed: 50000000
wilc_sdio mmc0:0001:1: chipid 003000d0
WILC POWER UP
at_pwr_dev: close()
#
# echo BT_FW_CHIP_WAKEUP > /dev/wilc_bt
at_pwr_dev: open()
at_pwr_dev: close()
#
# echo BT_DOWNLOAD_FW > /dev/wilc_bt
at_pwr_dev: open()
AT PWR: bt_download_fw
Bluetooth firmware: mchp/wilc3000_ble_firmware.bin
Downloading BT firmware size = 58704 ...
Starting BT firmware
BT Start Succeeded
at_pwr_dev: close()
#
# echo BT_FW_CHIP_ALLOW_SLEEP > /dev/wilc_bt
at_pwr_dev: open()
at_pwr_dev: close()
#
# hciattach ttyS1 any 115200 noflow
atmel_usart fc010000.serial: using dma0chan10 for rx DMA transfers
atmel_usart fc010000.serial: using dma0chan11 for tx DMA transfers
Device setup complete
#
# hciconfig hci0 up
#
# hciconfig -a
hci0: Type: BR/EDR Bus: UART
BD Address: F8:F0:05:F6:53:89 ACL MTU: 27:30 SCO MTU: 0:0
UP RUNNING
RX bytes:382 acl:0 sco:0 events:24 errors:0
TX bytes:128 acl:0 sco:0 commands:24 errors:0
Features: 0x00 0x00 0x00 0x00 0x60 0x00 0x00 0x00
Packet type: DM1 DH1 HV1
Link policy:
Link mode: SLAVE ACCEPT
Can't read local name on hci0: Input/output error (5)
#
# ln -svf /usr/libexec/bluetooth/bluetoothd /usr/sbin '/usr/sbin/bluetoothd' -> '/usr/libexec/bluetooth/bluetoothd'
#
# bluetoothd -p time -n &
# bluetoothd[230]: Bluetooth daemon 5.27
bluetoothd[230]: Starting SDP server
bluetoothd[230]: Ignoring (cli) hostname
bluetoothd[230]: Ignoring (cli) wiimote
bluetoothd[230]: Ignoring (cli) autopair
bluetoothd[230]: Ignoring (cli) policy
bluetoothd[230]: Ignoring (cli) neard
bluetoothd[230]: Ignoring (cli) sap
bluetoothd[230]: Ignoring (cli) a2dp
bluetoothd[230]: Ignoring (cli) avrcp
bluetoothd[230]: Ignoring (cli) network
bluetoothd[230]: Ignoring (cli) input
bluetoothd[230]: Ignoring (cli) hog
bluetoothd[230]: Ignoring (cli) health
bluetoothd[230]: Ignoring (cli) gap
bluetoothd[230]: Ignoring (cli) scanparam
bluetoothd[230]: Ignoring (cli) deviceinfo
bluetoothd[230]: Ignoring (cli) alert
bluetoothd[230]: Ignoring (cli) proximity
bluetoothd[230]: Ignoring (cli) thermometer
bluetoothd[230]: Ignoring (cli) heartrate
bluetoothd[230]: Ignoring (cli) cyclingspeed
bluetoothd[230]: Bluetooth management interface 1.14 initialized
bluetoothd[230]: Failed to set local name: Failed (0x03)
# hciconfig hci0 leadv