my fork

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

sensor_service.c File Reference

sensor_service.c File Reference

Add a sample service using a vendor specific profile. More...

Go to the source code of this file.

Functions

tBleStatus Add_Acc_Service (void)
 Add an accelerometer service using a vendor specific profile.
tBleStatus Free_Fall_Notify (void)
 Send a notification for a Free Fall detection.
tBleStatus Acc_Update (AxesRaw_t *data)
 Update acceleration characteristic value.
tBleStatus Add_Environmental_Sensor_Service (void)
 Add the Environmental Sensor service.
tBleStatus Temp_Update (int16_t temp)
 Update temperature characteristic value.
tBleStatus Press_Update (int32_t press)
 Update pressure characteristic value.
tBleStatus Humidity_Update (uint16_t humidity)
 Update humidity characteristic value.
void setConnectable (void)
 Puts the device in connectable mode.
void GAP_ConnectionComplete_CB (uint8_t addr[6], uint16_t handle)
 This function is called when there is a LE Connection Complete event.
void GAP_DisconnectionComplete_CB (void)
 This function is called when the peer device get disconnected.
void Read_Request_CB (uint16_t handle)
 Read request callback.
void HCI_Event_CB (void *pckt)
 Callback processing the ACI events.

Detailed Description

Add a sample service using a vendor specific profile.

Author:
MCD Application Team
Version:
V1.0.0
Date:
04-July-2014
Attention:

© COPYRIGHT(c) 2014 STMicroelectronics

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file sensor_service.c.


Function Documentation

tBleStatus Acc_Update ( AxesRaw_t *  data )

Update acceleration characteristic value.

Parameters:
Structurecontaining acceleration value in mg
Return values:
Status

Definition at line 138 of file sensor_service.c.

tBleStatus Add_Acc_Service ( void   )

Add an accelerometer service using a vendor specific profile.

Parameters:
None
Return values:
tBleStatusStatus

Definition at line 76 of file sensor_service.c.

tBleStatus Add_Environmental_Sensor_Service ( void   )

Add the Environmental Sensor service.

Parameters:
None
Return values:
Status

Definition at line 162 of file sensor_service.c.

tBleStatus Free_Fall_Notify ( void   )

Send a notification for a Free Fall detection.

Parameters:
None
Return values:
tBleStatusStatus

Definition at line 116 of file sensor_service.c.

void GAP_ConnectionComplete_CB ( uint8_t  addr[6],
uint16_t  handle 
)

This function is called when there is a LE Connection Complete event.

Parameters:
uint8_tAddress of peer device
uint16_tConnection handle
Return values:
None

Definition at line 380 of file sensor_service.c.

void GAP_DisconnectionComplete_CB ( void   )

This function is called when the peer device get disconnected.

Parameters:
None
Return values:
None

Definition at line 397 of file sensor_service.c.

void HCI_Event_CB ( void *  pckt )

Callback processing the ACI events.

Callback used to pass events to application.

Note:
Inside this function each event must be identified and correctly parsed.
Parameters:
void*Pointer to the ACI packet
Return values:
None

Definition at line 454 of file sensor_service.c.

tBleStatus Humidity_Update ( uint16_t  humidity )

Update humidity characteristic value.

Parameters:
uint16_thumidityRH (Relative Humidity) in thenths of %
Return values:
tBleStatusStatus

Definition at line 324 of file sensor_service.c.

tBleStatus Press_Update ( int32_t  press )

Update pressure characteristic value.

Parameters:
int32_tPressure in mbar
Return values:
tBleStatusStatus

Definition at line 304 of file sensor_service.c.

void Read_Request_CB ( uint16_t  handle )

Read request callback.

Parameters:
uint16_tHandle of the attribute
Return values:
None

Definition at line 411 of file sensor_service.c.

void setConnectable ( void   )

Puts the device in connectable mode.

If you want to specify a UUID list in the advertising data, those data can be specified as a parameter in aci_gap_set_discoverable(). For manufacture data, aci_gap_update_adv_data must be called.

Parameters:
None
Return values:
None

Definition at line 359 of file sensor_service.c.

tBleStatus Temp_Update ( int16_t  temp )

Update temperature characteristic value.

Parameters:
Temperaturein tenths of degree
Return values:
Status

Definition at line 284 of file sensor_service.c.