179 void (*
on_error)(
void *user_data,
int error),
180 const void *user_data);
223 void (*on_enabled)(
void *data,
bool powered),
224 const void *user_data);
334 const void *user_data);
void sol_bt_conn_unref(struct sol_bt_conn *conn)
Decreases the reference count of a connection.
Representation of a Bluetooth UUID.
Definition: sol-bluetooth.h:77
bool in_range
Whether the devices is currently in range.
Definition: sol-bluetooth.h:271
enum sol_bt_transport sol_bt_transport_from_str(const char *str)
Converts string to a transport,.
struct sol_bt_conn sol_bt_conn
Represents an active connection to a Bluetooth device.
Definition: sol-bluetooth.h:128
int16_t rssi
Received signal strength, measured in dBm.
Definition: sol-bluetooth.h:259
Discover devices over the Bluetooth Low Energy transport.
Definition: sol-bluetooth.h:279
static bool on_connect(void *user_data, struct sol_bt_conn *conn)
Definition: browse.c:91
uint8_t val128[16]
Definition: sol-bluetooth.h:82
const char * sol_bt_transport_to_str(enum sol_bt_transport transport)
Converts a transport to a string,.
int sol_bt_uuid_to_str(const struct sol_bt_uuid *uuid, struct sol_buffer *buffer)
Convert a string to a UUID.
uint32_t val32
Definition: sol-bluetooth.h:81
static void on_error(void *user_data, int error)
Definition: browse.c:39
sol_bt_uuid_type
Set of types of UUIDs.
Definition: sol-bluetooth.h:62
Represents a information about a remote device.
Definition: sol-bluetooth.h:243
struct sol_bt_scan_pending sol_bt_scan_pending
Represents a pending scan session.
Definition: sol-bluetooth.h:313
struct sol_bt_scan_pending * sol_bt_start_scan(enum sol_bt_transport transport, void(*on_found)(void *user_data, const struct sol_bt_device_info *device), const void *user_data)
Start scanning for devices.
String slice type.
Definition: sol-str-slice.h:84
Definition: sol-bluetooth.h:63
Structure to represent a network address, both IPv6 and IPv4 are valid.
Definition: sol-network.h:145
struct sol_bt_device_info sol_bt_device_info
Represents a information about a remote device.
uint16_t val16
Definition: sol-bluetooth.h:80
char * name
Friendly name of the device.
Definition: sol-bluetooth.h:255
Discover devices over All transports.
Definition: sol-bluetooth.h:283
int sol_bt_disconnect(struct sol_bt_conn *conn)
Terminates a connection, or connection attempt.
Discover devices over the Bluetooth Basic Rate transport.
Definition: sol-bluetooth.h:281
struct sol_bt_session sol_bt_session
Represents a Bluetooth usage session.
Definition: sol-bluetooth.h:205
struct sol_bt_conn * sol_bt_conn_ref(struct sol_bt_conn *conn)
Increases the reference count of a connection.
bool connected
Whether the device is connected.
Definition: sol-bluetooth.h:267
int sol_bt_uuid_from_str(struct sol_bt_uuid *uuid, const struct sol_str_slice str)
Convert a string to a UUID.
uint8_t val[0]
Definition: sol-bluetooth.h:83
sol_bt_transport
Over which transport should a scan be performed.
Definition: sol-bluetooth.h:277
struct sol_bt_conn * sol_bt_connect(const struct sol_network_link_addr *addr, bool(*on_connect)(void *user_data, struct sol_bt_conn *conn), void(*on_disconnect)(void *user_data, struct sol_bt_conn *conn), void(*on_error)(void *user_data, int error), const void *user_data)
Attempts to establish a connection with a remote device.
static void on_disconnect(void *user_data, struct sol_bt_conn *conn)
Definition: browse.c:107
int sol_bt_stop_scan(struct sol_bt_scan_pending *handle)
Stop a scanning session.
Definition: sol-bluetooth.h:65
bool sol_bt_uuid_eq(const struct sol_bt_uuid *u1, const struct sol_bt_uuid *u2)
Compare two UUIDs.
struct sol_bt_session * sol_bt_enable(void(*on_enabled)(void *data, bool powered), const void *user_data)
Enables the local Bluetooth controller.
Definition: sol-bluetooth.h:64
bool paired
Whether the device is paired.
Definition: sol-bluetooth.h:263
int sol_bt_disable(struct sol_bt_session *session)
Disables a session, returning the controller to its previous state.
Soletta vector is an array that grows dynamically.
Definition: sol-vector.h:58
enum sol_bt_uuid_type type
Definition: sol-bluetooth.h:78
A sol_buffer is a dynamic array, that can be resized if needed.
Definition: sol-buffer.h:130
static struct sol_bt_session * session
Definition: browse.c:31
struct sol_vector uuids
Vector of service UUIDs discovered, may be empty.
Definition: sol-bluetooth.h:251
struct sol_bt_uuid sol_bt_uuid
Representation of a Bluetooth UUID.
These are routines that Soletta provides for handling network link interfaces, making it possible to ...
const struct sol_network_link_addr * sol_bt_conn_get_addr(const struct sol_bt_conn *conn)
Returns the network address of the remote device.