diff --git a/epicardium/ble/ble.c b/epicardium/ble/ble.c index dc8664067b67e1d6679d1b2f411964e845ec6d60..ae4ce225350d369b955be95d005c3680834894c7 100644 --- a/epicardium/ble/ble.c +++ b/epicardium/ble/ble.c @@ -4,7 +4,7 @@ #include "wsf_timer.h" #include "wsf_trace.h" #include "app_ui.h" -#include "fit/fit_api.h" +#include "ble_api.h" #include "hci_vs.h" #include "att_defs.h" diff --git a/epicardium/ble/ble_main.c b/epicardium/ble/ble_main.c index 6c30970f5d544bdb4628c4659405d9b1e1e434ac..eefbb58e57c5cca3dfa08836e91e09a0adba4806 100644 --- a/epicardium/ble/ble_main.c +++ b/epicardium/ble/ble_main.c @@ -220,6 +220,8 @@ static uint16_t fitRscmPeriod = FIT_DEFAULT_RSCM_PERIOD; /* Heart Rate Monitor feature flags */ static uint8_t fitHrmFlags = CH_HRM_FLAGS_VALUE_8BIT | CH_HRM_FLAGS_ENERGY_EXP; + +static void FitHandler(wsfEventMask_t event, wsfMsgHdr_t *pMsg); /*************************************************************************************************/ /*! * \brief Application DM callback. @@ -661,12 +663,12 @@ static void fitProcMsg(fitMsg_t *pMsg) * \return None. */ /*************************************************************************************************/ -void FitHandlerInit(wsfHandlerId_t handlerId) +static void FitHandlerInit(void) { APP_TRACE_INFO0("FitHandlerInit"); /* store handler ID */ - fitHandlerId = handlerId; + fitHandlerId =WsfOsSetNextHandler(FitHandler); /* Set configuration pointers */ pAppAdvCfg = (appAdvCfg_t *) &fitAdvCfg; @@ -681,11 +683,11 @@ void FitHandlerInit(wsfHandlerId_t handlerId) pSmpCfg = (smpCfg_t *) &fitSmpCfg; /* initialize heart rate profile sensor */ - HrpsInit(handlerId, (hrpsCfg_t *) &fitHrpsCfg); + HrpsInit(fitHandlerId, (hrpsCfg_t *) &fitHrpsCfg); HrpsSetFlags(fitHrmFlags); /* initialize battery service server */ - BasInit(handlerId, (basCfg_t *) &fitBasCfg); + BasInit(fitHandlerId, (basCfg_t *) &fitBasCfg); } /*************************************************************************************************/ @@ -698,7 +700,7 @@ void FitHandlerInit(wsfHandlerId_t handlerId) * \return None. */ /*************************************************************************************************/ -void FitHandler(wsfEventMask_t event, wsfMsgHdr_t *pMsg) +static void FitHandler(wsfEventMask_t event, wsfMsgHdr_t *pMsg) { if (pMsg != NULL) { @@ -727,6 +729,9 @@ void FitHandler(wsfEventMask_t event, wsfMsgHdr_t *pMsg) /*************************************************************************************************/ void FitStart(void) { + + FitHandlerInit(); + /* Register for stack callbacks */ DmRegister(fitDmCback); DmConnRegister(DM_CLIENT_ID_APP, fitDmCback); diff --git a/epicardium/ble/stack.c b/epicardium/ble/stack.c index f100d3902d49b1360cd843802c26d0a5c6baa599..07c73353485018d8554abdb07002233a075cddc9 100644 --- a/epicardium/ble/stack.c +++ b/epicardium/ble/stack.c @@ -34,7 +34,7 @@ #include "wsf_types.h" #include "wsf_os.h" #include "util/bstream.h" -#include "fit/fit_api.h" +#include "ble_api.h" #include "hci_handler.h" #include "dm_handler.h" #include "l2c_handler.h" @@ -187,7 +187,4 @@ void StackInitFit(void) * mixed a lot. */ handlerId = WsfOsSetNextHandler(AppHandler); AppHandlerInit(handlerId); - - handlerId = WsfOsSetNextHandler(FitHandler); - FitHandlerInit(handlerId); }