Soletta™ Framework
Framework for making IoT devices

Full online documentation | C API Index
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Typedefs | Enumerations | Functions
sol-bluetooth.h File Reference

Routines to handle common Bluetooth communications. More...

#include <sol-network.h>

Go to the source code of this file.

Data Structures

struct  sol_bt_device_info
 Represents a information about a remote device. More...
 
struct  sol_bt_uuid
 Representation of a Bluetooth UUID. More...
 

Typedefs

typedef struct sol_bt_conn sol_bt_conn
 Represents an active connection to a Bluetooth device. More...
 
typedef struct sol_bt_device_info sol_bt_device_info
 Represents a information about a remote device. More...
 
typedef struct sol_bt_scan_pending sol_bt_scan_pending
 Represents a pending scan session. More...
 
typedef struct sol_bt_session sol_bt_session
 Represents a Bluetooth usage session. More...
 
typedef struct sol_bt_uuid sol_bt_uuid
 Representation of a Bluetooth UUID. More...
 

Enumerations

enum  sol_bt_transport { SOL_BT_TRANSPORT_LE = 1, SOL_BT_TRANSPORT_BREDR, SOL_BT_TRANSPORT_ALL = SOL_BT_TRANSPORT_LE | SOL_BT_TRANSPORT_BREDR }
 Over which transport should a scan be performed. More...
 
enum  sol_bt_uuid_type { SOL_BT_UUID_TYPE_16 = 2, SOL_BT_UUID_TYPE_32 = 4, SOL_BT_UUID_TYPE_128 = 16 }
 Set of types of UUIDs. More...
 

Functions

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. More...
 
struct sol_bt_connsol_bt_conn_ref (struct sol_bt_conn *conn)
 Increases the reference count of a connection. More...
 
void sol_bt_conn_unref (struct sol_bt_conn *conn)
 Decreases the reference count of a connection. More...
 
struct sol_bt_connsol_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. More...
 
int sol_bt_disable (struct sol_bt_session *session)
 Disables a session, returning the controller to its previous state. More...
 
int sol_bt_disconnect (struct sol_bt_conn *conn)
 Terminates a connection, or connection attempt. More...
 
struct sol_bt_sessionsol_bt_enable (void(*on_enabled)(void *data, bool powered), const void *user_data)
 Enables the local Bluetooth controller. More...
 
struct sol_bt_scan_pendingsol_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. More...
 
int sol_bt_stop_scan (struct sol_bt_scan_pending *handle)
 Stop a scanning session. More...
 
enum sol_bt_transport sol_bt_transport_from_str (const char *str)
 Converts string to a transport,. More...
 
const char * sol_bt_transport_to_str (enum sol_bt_transport transport)
 Converts a transport to a string,. More...
 
bool sol_bt_uuid_eq (const struct sol_bt_uuid *u1, const struct sol_bt_uuid *u2)
 Compare two UUIDs. More...
 
int sol_bt_uuid_from_str (struct sol_bt_uuid *uuid, const struct sol_str_slice str)
 Convert a string to a UUID. More...
 
int sol_bt_uuid_to_str (const struct sol_bt_uuid *uuid, struct sol_buffer *buffer)
 Convert a string to a UUID. More...
 

Detailed Description

Routines to handle common Bluetooth communications.

Bluetooth[1] is a standardised technology for short distance communications. Its defined by an open standard, governed by the Bluetooth Special Interest Group (SIG).

Bluetooth defines two kinds of functionality, Bluetooth Smart, also referred as Bluetooth Low Energy (BLE), and Bluetooth Basic Rate. Bluetooth Basic Rate most popular application is wireless audio, Bluetooth Low Energy is becoming popular for wearable devices.

[1] https://www.bluetooth.com/