LoRa-BLE-Sensor
Loading...
Searching...
No Matches
Classes | Functions | Variables
sensor_ble.c File Reference

This is a library to handle the BLE functionality for the sensor. More...

#include "sensor_ble.h"
#include <zephyr/kernel.h>
#include <zephyr/logging/log.h>
#include <zephyr/bluetooth/bluetooth.h>
#include <zephyr/bluetooth/conn.h>
#include <zephyr/mgmt/mcumgr/transport/smp_bt.h>
Include dependency graph for sensor_ble.c:

Classes

struct  ble_adv_params_t
 

Functions

 LOG_MODULE_REGISTER (SENSOR_BLE, LOG_LEVEL_INF)
 
int ble_setup (ble_config_t *config)
 Setup the BLE device, with advertisement and connection parameters.
 
int ble_end (void)
 
int is_ble_advertising (void)
 Check if the BLE device is advertising.
 
int ble_change_name (ble_config_t *config)
 Change the name of the BLE device.
 
adv_interval_t get_ble_adv_interval (void)
 Get the advertising interval of the BLE device.
 

Variables

struct bt_conn_cb connection_callbacks
 

Detailed Description

This is a library to handle the BLE functionality for the sensor.

Author
Tyler Garcia
Version
0.1
Date
2025-05-05

Function Documentation

◆ ble_change_name()

int ble_change_name ( ble_config_t config)

Change the name of the BLE device.

Parameters
configThe configuration of the BLE device.
Returns
int 0 on success, negative on failure.

◆ ble_setup()

int ble_setup ( ble_config_t config)

Setup the BLE device, with advertisement and connection parameters.

Parameters
configThe configuration of the BLE device.
Returns
int 0 on success, negative on failure.

◆ get_ble_adv_interval()

adv_interval_t get_ble_adv_interval ( void  )

Get the advertising interval of the BLE device.

Returns
adv_interval_t The advertising interval of the BLE device.

◆ is_ble_advertising()

int is_ble_advertising ( void  )

Check if the BLE device is advertising.

Returns
int 1 if advertising, 0 if not.

Variable Documentation

◆ connection_callbacks

struct bt_conn_cb connection_callbacks
Initial value:
= {
.connected = on_connected,
.disconnected = on_disconnected,
.recycled = on_recycled,
}