Welcome to mirror list, hosted at ThFree Co, Russian Federation.

app_ble_common.c « App « STM32_WPAN « BLE_MultiAppAt « BLE « Applications « P-NUCLEO-WB55.Nucleo « Projects - github.com/Flipper-Zero/STM32CubeWB.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2101401a154709e7a0d9c7436065f6c3fa3df6e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
/* USER CODE BEGIN Header */
/**
 ******************************************************************************
 * @file    app_ble_common.c
 * @author  MCD Application Team
 * @brief   BLE Application
 ******************************************************************************
 * @attention
 *
 * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
 * All rights reserved.</center></h2>
 *
 * This software component is licensed by ST under Ultimate Liberty license
 * SLA0044, the "License"; You may not use this file except in compliance with
 * the License. You may obtain a copy of the License at:
 *                             www.st.com/SLA0044
 *
 ******************************************************************************
 */
/* USER CODE END Header */

/* Includes ------------------------------------------------------------------*/
#include "main.h"

#include "app_common.h"

#include "ble.h"
#include "tl.h"
#include "app_ble_common.h"
#include "app_ble_sv.h"
#include "app_ble_hr.h"
#include "app_ble_cl.h"

#include "stm32_seq.h"
#include "shci.h"
#include "stm32_lpm.h"
#include "otp.h"

extern APP_Mode_t app_mode;
/* Private includes ----------------------------------------------------------*/

/* Private typedef -----------------------------------------------------------*/

/* Private defines -----------------------------------------------------------*/

/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/

/* Private function prototypes -----------------------------------------------*/
void APP_BLE_Common_Init( void );

/* Functions Definition ------------------------------------------------------*/
void APP_BLE_Common_Init( void )
{

  return;
}

SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification( void *pckt )
{
  switch(app_mode){
    case P2P_SERVER :
      SVCCTL_App_SV_Notification(pckt);
      break;
    case P2P_CLIENT :
      SVCCTL_App_CL_Notification(pckt);
      break;
    case HEART_RATE :
      SVCCTL_App_HR_Notification(pckt);
      break;
    default : break;
  }

  return (SVCCTL_UserEvtFlowEnable);
}

void SVCCTL_SvcInit(void)
{
  if(app_mode == HEART_RATE)
  {
    DIS_Init();
  }

  if(app_mode == HEART_RATE)
  {
    HRS_Init();
  }

  if((app_mode == P2P_SERVER) || (app_mode == P2P_CLIENT))
  {
    P2PS_STM_Init();
  }
  
  return;
}

/*************************************************************
 *
 * WRAP FUNCTIONS
 *
 *************************************************************/
void hci_notify_asynch_evt(void* pdata)
{
  UTIL_SEQ_SetTask(1 << CFG_TASK_HCI_ASYNCH_EVT_ID, CFG_SCH_PRIO_0);
  return;
}

void hci_cmd_resp_release(uint32_t flag)
{
  UTIL_SEQ_SetEvt(1 << CFG_IDLEEVT_SYSTEM_HCI_CMD_EVT_RSP_ID);
  return;
}

void hci_cmd_resp_wait(uint32_t timeout)
{
  UTIL_SEQ_WaitEvt(1 << CFG_IDLEEVT_SYSTEM_HCI_CMD_EVT_RSP_ID);
  return;
}

void SVCCTL_ResumeUserEventFlow( void )
{
  hci_resume_flow();
  return;
}

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/