Jump to content

How to use UBUS commands for Bluetooth device scanning / pairing: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 5: Line 5:
  ...
  ...
  root@Teltonika-RUTX11:~# ubus
  root@Teltonika-RUTX11:~# ubus
  Usage: ubus [<options>] <command> [arguments...]
  Usage: ubus [<options>] <nowiki><command></nowiki> [arguments...]
  Options:
  Options:
  -s <socket>:          Set the unix domain socket to connect to
  -s <socket>:          Set the unix domain socket to connect to
Line 19: Line 19:
  - listen [<path>...]                  Listen for events
  - listen [<path>...]                  Listen for events
  - send <type> [<message>]              Send an event
  - send <type> [<message>]              Send an event
- wait_for <object> [<object>...]      Wait for multiple objects to appear on ubus
- wait_for <nowiki><object> [<object>...]      Wait for multiple objects to appear on ubus</nowiki>
  - monitor                              Monitor ubus traffic
  - monitor                              Monitor ubus traffic
  ...
  ...
Line 25: Line 25:
Steps to use '''ubus''' for '''blesem''' service on RUTX:
Steps to use '''ubus''' for '''blesem''' service on RUTX:


* Enable Bluetooth in Web UI menu '''Network -> Bluetooth -> General'''. Click ''"Save&Apply"''.
*Enable Bluetooth in Web UI menu '''Network -> Bluetooth -> General'''. Click ''"Save&Apply"''.
 
 
    
    
* Login using [[CLI]] and run '''scan.start''' command to start Bluetooth scan:
*Login using [[CLI]] and run '''scan.start''' command to start Bluetooth scan:


  ...
  ...
Line 35: Line 33:
  ...
  ...


* To see scan results, use command '''scan.result''':
*To see scan results, use command '''scan.result''':


  ...
  ...
Line 75: Line 73:
  ...
  ...


* Device pairing command:
*Device pairing command:


  ...
  ...
Line 96: Line 94:
  ...
  ...


* Device unpairing command:
*Device unpairing command:


  ...
  ...
Line 102: Line 100:
  ...
  ...


* To get statistic from paired devices, use '''stat''' command:
*To get statistic from paired devices, use '''stat''' command:


  ...
  ...