ble_connect

Presentation

ble_connect allows to connect to a specific target device as a master. This module must be used in order to connect to a specific device before the use of some specific modules requiring an established connection (such as ble_discover or ble_discover). If the connection cannot be established, the module fails, stopping the sequential execution.

Compatible devices

Input parameters

Name

Default value

Possible values

Description

INTERFACE

hci0

hciX

Interface to use

TARGET

<BD address>

Target address

CONNECTION_TYPE

public

public|random

Connection mode

TIMEOUT

3

<integer>

Timeout (in seconds)

Output parameters

Name

Possible values

Description

INTERFACE

hciX

Interface used

Usage

If you want to establish a connection, just provide the TARGET input parameters (and optionally CONNECTION_TYPE) :

$ sudo mirage "ble_connect|ble_discover" ble_connect1.TARGET=1F:46:05:0E:35:44
[INFO] Module ble_connect loaded !
[INFO] Module ble_discover loaded !
[SUCCESS] HCI Device (hci0) successfully instanciated !
[INFO] Trying to connect to : 1F:46:05:0E:35:44 (type : public)
[INFO] Updating connection handle : 16
[SUCCESS] Connected on device : 1F:46:05:0E:35:44
[INFO] Services discovery ...
[...]