Espruino/targets/esp32/BLE/esp32_gap_func.h
jumjum123 9d6b6ea7b6 Added init security and implementation for jsble_xxxxx_connection
esp32_gap_func.c
- support event ESP_GAP_BLE_SEC_REQ_EVT
- restructured addAdvertisingDeviceName restructured
- added function addAdvertisingUart
- added handling of UART in bluetooth_gap_getAdvertisingData
- added function gap_init_security
esp32_gap_func.h
- added definition for gap_init_security();
bluetooth.c
- added call of gap_initSecurity in jsble_init
- added implementation for jsble_has_connection()
- added implementation for jsble_has_central_connection()
- added implementation jsble_has_simple_connection()
2018-06-08 12:40:51 +02:00

37 lines
1.1 KiB
C

/*
* This file is part of Espruino, a JavaScript interpreter for Microcontrollers
*
* Copyright (C) 2017 Gordon Williams <gw@pur3.co.uk>
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* ----------------------------------------------------------------------------
* ESP32 specific GAP functions
* ----------------------------------------------------------------------------
*/
#ifndef GAP_FUNC_H_
#define GAP_FUNC_H_
#include "esp_gap_ble_api.h"
#include "jsvar.h"
#define BLE_DEVICE_NAME "BLE_DEV_N"
void bluetooth_gap_setScan(bool enabled);
void gap_init_security();
esp_err_t bluetooth_setDeviceName(JsVar *deviceName);
void bluetooth_initDeviceName();
esp_err_t bluetooth_gap_startAdvertizing(bool enable);
esp_err_t bluetooth_gap_setAdvertizing(JsVar *advArray);
JsVar *bluetooth_gap_getAdvertisingData(JsVar *data, JsVar *options);
void gap_event_handler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param);
#endif /* GAP_FUNC_H_ */