Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bloodpressure.c #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions Projects/ble/BloodPressure/Source/bloodPressure.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
its documentation for any purpose.

YOU FURTHER ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE
PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,
PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,
INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE,
NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL
TEXAS INSTRUMENTS OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT,
Expand Down Expand Up @@ -1042,6 +1042,8 @@ static void bpServiceCB(uint8 event)
*/
static void timeAppPairStateCB( uint16 connHandle, uint8 state, uint8 status )
{
linkDBItem_t *pItem;
pItem = (linkDBItem_t *)malloc(sizeof(linkDBItem_t *));
if ( state == GAPBOND_PAIRING_STATE_STARTED )
{
timeAppPairingStarted = TRUE;
Expand All @@ -1052,8 +1054,8 @@ static void timeAppPairStateCB( uint16 connHandle, uint8 state, uint8 status )

if ( status == SUCCESS )
{
linkDBItem_t *pItem;

// linkDBItem_t *pItem;
if(pItem){
if ( (pItem = linkDB_Find( gapConnHandle )) != NULL )
{
// Store bonding state of pairing
Expand All @@ -1064,14 +1066,18 @@ static void timeAppPairStateCB( uint16 connHandle, uint8 state, uint8 status )
osal_memcpy( timeAppBondedAddr, pItem->addr, B_ADDR_LEN );
}
}
}

// If discovery was postponed start discovery
if ( timeAppDiscPostponed && timeAppDiscoveryCmpl == FALSE )
if ( (timeAppDiscPostponed && timeAppDiscoveryCmpl) == FALSE )
{
timeAppDiscPostponed = FALSE;
osal_set_event( bloodPressureTaskId, BP_START_DISCOVERY_EVT );
}
}
free(pItem);
pItem = NULL;

}
}

Expand Down Expand Up @@ -1115,7 +1121,7 @@ static void cuffMeas(void)
*p++ = flags;

//bloodpressure components
// IEEE The 16bit value contains a 4-bit exponent to base 10,
// IEEE The 16bit value contains a 4-bit exponent to base 10,
// followed by a 12-bit mantissa. Each is in twoscomplementform.
*p++ = bpSystolic; //120 = 0x0078 SFloat little endian = 0x7800
*p++;
Expand Down