Thingy Sound Service implementation.
More...
|
typedef void(* | ble_tss_evt_handler_t )(ble_tss_t *p_tss, ble_tss_evt_type_t evt_type, uint8_t *p_data, uint16_t length) |
| Thingy Sound Service event handler type.
|
|
Thingy Sound Service implementation.
The Thingy Sound Service is a simple GATT-based service with multiple characteristics for reading sensor data and configuring the sensors.
- Note
- The application must propagate S110 SoftDevice events to the Thingy Sound Service module by calling the ble_tss_on_ble_evt() function from the ble_stack_handler callback.
#define BLE_TSS_MAX_DATA_LEN (GATT_MTU_SIZE_DEFAULT - 3) |
Maximum length of data (in bytss) that can be transmitted to the peer by the Thingy Sound service module.
#define BLE_UUID_TSS_SERVICE 0x0500 |
The UUID of the Thingy Sound Service.
Function for initializing the Thingy Sound Service.
- Parameters
-
[out] | p_tss | Thingy Sound Service structure. This structure must be supplied by the application. It is initialized by this function and will later be used to identify this particular service instance. |
[in] | p_tss_init | Information needed to initialize the service. |
- Return values
-
NRF_SUCCESS | If the service was successfully initialized. Otherwise, an error code is returned. |
NRF_ERROR_NULL | If either of the pointers p_tss or p_tss_init is NULL. |
uint32_t ble_tss_mic_set |
( |
ble_tss_t * |
p_tss, |
|
|
uint8_t * |
p_data, |
|
|
uint16_t |
size |
|
) |
| |
Function for sending microphone data.
This function sends the microphone input as an microphone characteristic notification to the peer.
- Parameters
-
[in] | p_tss | Pointer to the Thingy Sound Service structure. |
[in] | p_data | Pointer to the mic data. |
[in] | size | Mic data size. |
- Return values
-
NRF_SUCCESS | If the string was sent successfully. Otherwise, an error code is returned. |
void ble_tss_on_ble_evt |
( |
ble_tss_t * |
p_tss, |
|
|
ble_evt_t * |
p_ble_evt |
|
) |
| |
Function for handling the Thingy Sound Service's BLE events.
The Thingy Sound Service expects the application to call this function each time an event is received from the S110 SoftDevice. This function processes the event if it is relevant and calls the Thingy Sound Service event handler of the application if necessary.
- Parameters
-
[in] | p_tss | Thingy Sound Service structure. |
[in] | p_ble_evt | Event received from the S110 SoftDevice. |
uint32_t ble_tss_spkr_stat_set |
( |
ble_tss_t * |
p_tss, |
|
|
ble_tss_spkr_stat_t |
status |
|
) |
| |
Function for sending speaker status.
This function sends the speaker status as an speaker status characteristic notification to the peer.
- Parameters
-
[in] | p_tss | Pointer to the Thingy Sound Service structure. |
[in] | p_data | Pointer to the mic data. |
- Return values
-
NRF_SUCCESS | If the string was sent successfully. Otherwise, an error code is returned. |