Skip to content

jamesruan/bluetooth

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bluetooth

An embryo for an Erlang bluetooth application.

Prerequisites

  1. Install Bluez (5.10)
  2. To enable the bluetooth adapter and put it in scan mode, do:
   sudo hciconfig hci0 up
   sudo hciconfig hci0 piscan

Example run - handling names

1> bluetooth_interface:get_local_name().
{ok,"Azure:Dec  3 2010,00:24:03"}

2> bluetooth_interface:set_local_name("pepparkakehus").
ok
3> bluetooth_interface:get_local_name().
{ok,"pepparkakehus"}

4> {ok, Addrs} = bluetooth_interface:discover().
{ok,["00:02:72:C0:63:F4"]}
5> bluetooth_interface:get_remote_name(hd(Addrs)).
{ok,"datorbebis"}

Debugging

Install package bluez-hcidump and dump all traffic with

  sudo hcidump hci0 -X

About

An embryo for an Erlang bluetooth application

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 50.2%
  • Erlang 49.8%