本文整理汇总了C++中sd_ble_gap_appearance_set函数的典型用法代码示例。如果您正苦于以下问题:C++ sd_ble_gap_appearance_set函数的具体用法?C++ sd_ble_gap_appearance_set怎么用?C++ sd_ble_gap_appearance_set使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sd_ble_gap_appearance_set函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BLE_GAP_CONN_SEC_MODE_SET_OPEN
//This function configures the Generic access Profile
//GAP is a service that must be implemented on all BLE devices
//These are some basic values that other devices can request
//Some of these values might be writable over the air
//The current characteristics are
// Device name
// Appearance
// Peripheral Preferred Connection Parameters
void GAPController::bleConfigureGAP(){
u32 err = 0;
//Set up an open link write permission
//There are multiple security modes defined in the BLE spec
//Use these macros: http://developer.nordicsemi.com/nRF51_SDK/doc/7.1.0/s110/html/a00813.html
ble_gap_conn_sec_mode_t secPermissionOpen;
BLE_GAP_CONN_SEC_MODE_SET_OPEN(&secPermissionOpen);
//Set the GAP device name
err = sd_ble_gap_device_name_set(&secPermissionOpen, (u8*)DEVICE_NAME, strlen(DEVICE_NAME));
APP_ERROR_CHECK(err);
//Set the appearance of the device as defined in http://developer.nordicsemi.com/nRF51_SDK/doc/7.1.0/s110/html/a00837.html
err = sd_ble_gap_appearance_set(BLE_APPEARANCE_GENERIC_COMPUTER);
APP_ERROR_CHECK(err);
//Set gap peripheral preferred connection parameters (not used by the mesh implementation)
ble_gap_conn_params_t gapConnectionParams;
memset(&gapConnectionParams, 0, sizeof(gapConnectionParams));
gapConnectionParams.min_conn_interval = Config->meshMinConnectionInterval;
gapConnectionParams.max_conn_interval = Config->meshMaxConnectionInterval;
gapConnectionParams.slave_latency = Config->meshPeripheralSlaveLatency;
gapConnectionParams.conn_sup_timeout = Config->meshConnectionSupervisionTimeout;
err = sd_ble_gap_ppcp_set(&gapConnectionParams);
APP_ERROR_CHECK(err);
}
示例2: gap_params_init
/**@brief Function for the GAP initialization.
*
* @details This function sets up all the necessary GAP (Generic Access Profile) parameters of the
* device including the device name, appearance, and the preferred connection parameters.
*/
static void gap_params_init(void)
{
uint32_t err_code;
ble_gap_conn_params_t gap_conn_params;
ble_gap_conn_sec_mode_t sec_mode;
ble_gap_addr_t device_mac;
#ifdef RANDOM_MAC
device_mac.addr_type = BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE;
err_code = sd_ble_gap_address_set(BLE_GAP_ADDR_CYCLE_MODE_AUTO, &device_mac);
#else
uint8_t mac_addr[] = {0x00,0x19,0x25,0x39,0x54,0x95};
device_mac.addr_type = BLE_GAP_ADDR_TYPE_PUBLIC;
memcpy(device_mac.addr, mac_addr,6);
err_code = sd_ble_gap_address_set(BLE_GAP_ADDR_CYCLE_MODE_NONE, &device_mac);
APP_ERROR_CHECK(err_code);
#endif
BLE_GAP_CONN_SEC_MODE_SET_OPEN(&sec_mode);
err_code = sd_ble_gap_device_name_set(&sec_mode,
(const uint8_t *)DEVICE_NAME,
strlen(DEVICE_NAME));
APP_ERROR_CHECK(err_code);
err_code = sd_ble_gap_appearance_set(BLE_APPEARANCE_GENERIC_TAG);
APP_ERROR_CHECK(err_code);
memset(&gap_conn_params, 0, sizeof(gap_conn_params));
gap_conn_params.min_conn_interval = MIN_CONN_INTERVAL;
gap_conn_params.max_conn_interval = MAX_CONN_INTERVAL;
gap_conn_params.slave_latency = SLAVE_LATENCY;
gap_conn_params.conn_sup_timeout = CONN_SUP_TIMEOUT;
err_code = sd_ble_gap_ppcp_set(&gap_conn_params);
APP_ERROR_CHECK(err_code);
err_code = sd_ble_gap_tx_power_set(4);
APP_ERROR_CHECK(err_code);
}
示例3: gap_params_init
// gap name/appearance/connection parameters
static void gap_params_init (void) {
uint32_t err_code;
ble_gap_conn_sec_mode_t sec_mode;
ble_gap_conn_params_t gap_conn_params;
// Full strength signal
sd_ble_gap_tx_power_set(4);
// Let anyone connect and set the name given the platform
BLE_GAP_CONN_SEC_MODE_SET_OPEN(&sec_mode);
err_code = sd_ble_gap_device_name_set(&sec_mode,
(const uint8_t *)"BEES", strlen("BEES"));
//(const uint8_t *)DEVICE_NAME, strlen(DEVICE_NAME));
APP_ERROR_CHECK(err_code);
// Not sure what this is useful for, but why not set it
err_code = sd_ble_gap_appearance_set(BLE_APPEARANCE_GENERIC_COMPUTER);
APP_ERROR_CHECK(err_code);
// Specify parameters for a connection
memset(&gap_conn_params, 0, sizeof(gap_conn_params));
gap_conn_params.min_conn_interval = MIN_CONN_INTERVAL;
gap_conn_params.max_conn_interval = MAX_CONN_INTERVAL;
gap_conn_params.slave_latency = SLAVE_LATENCY;
gap_conn_params.conn_sup_timeout = CONN_SUP_TIMEOUT;
err_code = sd_ble_gap_ppcp_set(&gap_conn_params);
APP_ERROR_CHECK(err_code);
}
示例4: gap_params_init
////////////////////////////////////////////////////////////////////////////////
//
// GAP Initialization
static void gap_params_init(void)
{
// Create the scan response name
memset(_scanResponse, 0, sizeof(_scanResponse));
memcpy(_scanResponse, SCAN_RESPONSE_BASE, strlen(SCAN_RESPONSE_BASE));
memcpy(_scanResponse + strlen(SCAN_RESPONSE_BASE), STR(BUILD_NUM), 4);
uint32_t err_code;
ble_gap_conn_params_t gap_conn_params;
ble_gap_conn_sec_mode_t sec_mode;
BLE_GAP_CONN_SEC_MODE_SET_OPEN(&sec_mode);
err_code = sd_ble_gap_device_name_set(&sec_mode,
(const uint8_t *)_scanResponse,
strlen(_scanResponse));
APP_ERROR_CHECK(err_code);
err_code = sd_ble_gap_appearance_set(BLE_APPEARANCE_UNKNOWN);
APP_ERROR_CHECK(err_code);
err_code = sd_ble_gap_tx_power_set(4);
APP_ERROR_CHECK(err_code);
memset(&gap_conn_params, 0, sizeof(gap_conn_params));
gap_conn_params.min_conn_interval = MIN_CONN_INTERVAL;
gap_conn_params.max_conn_interval = MAX_CONN_INTERVAL;
gap_conn_params.slave_latency = SLAVE_LATENCY;
gap_conn_params.conn_sup_timeout = CONN_SUP_TIMEOUT;
err_code = sd_ble_gap_ppcp_set(&gap_conn_params);
APP_ERROR_CHECK(err_code);
}
示例5: gap_params_init
/**@brief Function for the GAP initialization.
*
* @details This function sets up all the necessary GAP (Generic Access Profile) parameters of the
* device including the device name, appearance, and the preferred connection parameters.
*/
static void gap_params_init(void)
{
uint32_t err_code;
ble_gap_conn_params_t gap_conn_params;
ble_gap_conn_sec_mode_t sec_mode;
BLE_GAP_CONN_SEC_MODE_SET_OPEN(&sec_mode);
err_code = sd_ble_gap_device_name_set(&sec_mode,
(const uint8_t *)DEVICE_NAME,
strlen(DEVICE_NAME));
APP_ERROR_CHECK(err_code);
err_code = sd_ble_gap_appearance_set(BLE_APPEARANCE_GENERIC_KEYRING);
APP_ERROR_CHECK(err_code);
memset(&gap_conn_params, 0, sizeof(gap_conn_params));
gap_conn_params.min_conn_interval = MIN_CONN_INTERVAL;
gap_conn_params.max_conn_interval = MAX_CONN_INTERVAL;
gap_conn_params.slave_latency = SLAVE_LATENCY;
gap_conn_params.conn_sup_timeout = CONN_SUP_TIMEOUT;
err_code = sd_ble_gap_ppcp_set(&gap_conn_params);
APP_ERROR_CHECK(err_code);
err_code = sd_ble_gap_tx_power_set(TX_POWER_LEVEL);
APP_ERROR_CHECK(err_code);
}
示例6: gap_params_init
*/
static void gap_params_init(void)
{
uint32_t err_code;
char deviceaddr_name[16];
ble_gap_conn_params_t gap_conn_params;
ble_gap_conn_sec_mode_t sec_mode;
snprintf(&deviceaddr_name,14,"%s-%.4X%.2X\0",
DEVICE_NAME,
NRF_FICR->DEVICEADDR[0],
NRF_FICR->DEVICEADDR[1]);
BLE_GAP_CONN_SEC_MODE_SET_OPEN(&sec_mode);
err_code = sd_ble_gap_device_name_set(&sec_mode, (const uint8_t *)deviceaddr_name, strlen(deviceaddr_name));
APP_ERROR_CHECK(err_code);
err_code = sd_ble_gap_appearance_set(BLE_APPEARANCE_CYCLING_CADENCE_SENSOR);
APP_ERROR_CHECK(err_code);
memset(&gap_conn_params, 0, sizeof(gap_conn_params));
gap_conn_params.min_conn_interval = MIN_CONN_INTERVAL;
gap_conn_params.max_conn_interval = MAX_CONN_INTERVAL;
gap_conn_params.slave_latency = SLAVE_LATENCY;
gap_conn_params.conn_sup_timeout = CONN_SUP_TIMEOUT;
err_code = sd_ble_gap_ppcp_set(&gap_conn_params);
APP_ERROR_CHECK(err_code);
示例7: gap_params_init
/**@brief Function for the GAP initialization.
*
* @details This function sets up all the necessary GAP (Generic Access Profile) parameters of the
* device including the device name, appearance, and the preferred connection parameters.
*/
static void gap_params_init(void)
{
uint32_t err_code;
ble_gap_conn_params_t gap_conn_params;
ble_gap_conn_sec_mode_t sec_mode;
BLE_GAP_CONN_SEC_MODE_SET_OPEN(&sec_mode);
err_code = sd_ble_gap_device_name_set(&sec_mode,
(const uint8_t *)DEVICE_NAME,
strlen(DEVICE_NAME));
APP_ERROR_CHECK(err_code);
/* YOUR_JOB: Use an appearance value matching the application's use case.
err_code = sd_ble_gap_appearance_set(BLE_APPEARANCE_);
APP_ERROR_CHECK(err_code); */
memset(&gap_conn_params, 0, sizeof(gap_conn_params));
gap_conn_params.min_conn_interval = MIN_CONN_INTERVAL;
gap_conn_params.max_conn_interval = MAX_CONN_INTERVAL;
gap_conn_params.slave_latency = SLAVE_LATENCY;
gap_conn_params.conn_sup_timeout = CONN_SUP_TIMEOUT;
err_code = sd_ble_gap_ppcp_set(&gap_conn_params);
APP_ERROR_CHECK(err_code);
// Set appearence
sd_ble_gap_appearance_set(0);
APP_ERROR_CHECK(err_code);// Check for errors
}
示例8:
ble_error_t nRF5xGap::setAppearance(GapAdvertisingData::Appearance appearance)
{
if (sd_ble_gap_appearance_set(appearance) == NRF_SUCCESS) {
return BLE_ERROR_NONE;
} else {
return BLE_ERROR_PARAM_OUT_OF_RANGE;
}
}
示例9: bluetooth_init
static void bluetooth_init(void)
{
uint32_t err_code;
ble_gap_conn_params_t gppcp;
ble_advdata_t advdata;
ble_gap_conn_sec_mode_t sec_mode;
uint8_t flags = BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE;
// Initialise SoftDevice, and enable BLE event interrupt.
BLE_STACK_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_XTAL_20_PPM,
BLE_L2CAP_MTU_DEF,
ble_evt_dispatch,
false);
// Set GAP parameters
BLE_GAP_CONN_SEC_MODE_SET_OPEN(&sec_mode);
err_code = sd_ble_gap_device_name_set(&sec_mode, DEVICE_NAME, strlen(DEVICE_NAME));
APP_ERROR_CHECK(err_code);
err_code = sd_ble_gap_appearance_set(BLE_APPEARANCE_GENERIC_TAG);
APP_ERROR_CHECK(err_code);
memset(&gppcp, 0, sizeof(gppcp));
gppcp.min_conn_interval = MIN_CONN_INTERVAL;
gppcp.max_conn_interval = MAX_CONN_INTERVAL;
gppcp.slave_latency = SLAVE_LATENCY;
gppcp.conn_sup_timeout = CONN_SUP_TIMEOUT;
err_code = sd_ble_gap_ppcp_set(&gppcp);
APP_ERROR_CHECK(err_code);
// Build and set advertising data.
memset(&advdata, 0, sizeof(advdata));
advdata.name_type = BLE_ADVDATA_FULL_NAME;
advdata.include_appearance = true;
advdata.flags.size = sizeof(flags);
advdata.flags.p_data = &flags;
err_code = ble_advdata_set(&advdata, NULL);
APP_ERROR_CHECK(err_code);
// Initialise advertising parameters (used when starting advertising).
memset(&m_adv_params, 0, sizeof(m_adv_params));
m_adv_params.type = BLE_GAP_ADV_TYPE_ADV_IND;
m_adv_params.p_peer_addr = NULL; // Undirected advertisement.
m_adv_params.fp = BLE_GAP_ADV_FP_ANY;
m_adv_params.interval = APP_ADV_INTERVAL;
m_adv_params.timeout = APP_ADV_TIMEOUT_IN_SECONDS;
// Start advertising when entering main loop.
m_start_adv_flag = true;
}
示例10: gap_appearance_set_handle
/**@brief Function for decoding a command packet with RPC_SD_BLE_GAP_APPEARANCE_SET opcode.
*
* This function will decode the command, call the BLE Stack API, and also send command response
* to the peer through the the transport layer.
*
* @param[in] p_command The encoded structure that needs to be decoded and passed on
* to the BLE Stack API.
* @param[in] command_len The length of the encoded command read from transport layer.
*
* @retval NRF_SUCCESS If the decoding of the command was successful, the SoftDevice
* API was called, and the command response was sent to peer,
* otherwise an error code.
* @retval NRF_ERROR_INVALID_LENGTH If the content length of the packet is not conforming to the
* codec specification.
*/
static uint32_t gap_appearance_set_handle(uint8_t * p_command, uint32_t command_len)
{
uint16_t appearance = uint16_decode(&(p_command[0]));
RPC_DECODER_LENGTH_CHECK(command_len, sizeof(appearance), SD_BLE_GAP_APPEARANCE_SET);
uint32_t err_code = sd_ble_gap_appearance_set(appearance);
return ble_rpc_cmd_resp_send(SD_BLE_GAP_APPEARANCE_SET, err_code);
}
示例11: gap_params_init
/**@brief Function for the GAP initialization.
*
* @details This function sets up all the necessary GAP (Generic Access Profile) parameters of the
* device including the device name, appearance, and the preferred connection parameters.
*/
static void gap_params_init(void)
{
uint32_t err_code;
ble_gap_conn_params_t gap_conn_params;
ble_gap_conn_sec_mode_t sec_mode;
BLE_GAP_CONN_SEC_MODE_SET_OPEN(&sec_mode);
err_code = sd_ble_gap_device_name_set(&sec_mode,
(const uint8_t *)DEVICE_NAME,
strlen(DEVICE_NAME));
APP_ERROR_CHECK(err_code);
err_code = sd_ble_gap_appearance_set(BLE_APPEARANCE_UNKNOWN);
APP_ERROR_CHECK(err_code);
memset(&gap_conn_params, 0, sizeof(gap_conn_params));
gap_conn_params.min_conn_interval = MIN_CONN_INTERVAL;
gap_conn_params.max_conn_interval = MAX_CONN_INTERVAL;
gap_conn_params.slave_latency = SLAVE_LATENCY;
gap_conn_params.conn_sup_timeout = CONN_SUP_TIMEOUT;
err_code = sd_ble_gap_ppcp_set(&gap_conn_params);
APP_ERROR_CHECK(err_code);
err_code = sd_ble_gap_tx_power_set(INITIAL_TX_POWER_LEVEL);
APP_ERROR_CHECK(err_code);
ble_opt_t ble_opt;
uint8_t passkey[6] = { 0 };
// Fetch pin from UICR
uint8_t val = (*((uint32_t *)UICR_PIN_ADDRESS)) & 0x000000FF;
passkey[0] = (val == 0xFF) ? 0x31 : val;
val = ((*((uint32_t *)UICR_PIN_ADDRESS)) & 0x0000FF00) >> 8;
passkey[1] = (val == 0xFF) ? 0x32 : val;
val = ((*((uint32_t *)UICR_PIN_ADDRESS)) & 0x00FF0000) >> 16;
passkey[2] = (val == 0xFF) ? 0x33 : val;
val = ((*((uint32_t *)UICR_PIN_ADDRESS)) & 0xFF000000) >> 24;
passkey[3] = (val == 0xFF) ? 0x34 : val;
val = (*((uint32_t *)(UICR_PIN_ADDRESS+4))) & 0x000000FF;
passkey[4] = (val == 0xFF) ? 0x35 : val;
val = ((*((uint32_t *)(UICR_PIN_ADDRESS+4))) & 0x0000FF00) >> 8;
passkey[5] = (val == 0xFF) ? 0x36 : val;
ble_opt.gap_opt.passkey.p_passkey = passkey;
err_code = sd_ble_opt_set(BLE_GAP_OPT_PASSKEY, &ble_opt);
APP_ERROR_CHECK(err_code);
}
示例12: btle_gap_init
error_t btle_gap_init(void)
{
ble_gap_conn_params_t gap_conn_params = {0};
gap_conn_params.min_conn_interval = msec_to_1_25msec(
CFG_GAP_CONNECTION_MIN_INTERVAL_MS); // in 1.25ms units
gap_conn_params.max_conn_interval = msec_to_1_25msec(
CFG_GAP_CONNECTION_MAX_INTERVAL_MS); // in 1.25ms unit
gap_conn_params.slave_latency = CFG_GAP_CONNECTION_SLAVE_LATENCY;
gap_conn_params.conn_sup_timeout =
CFG_GAP_CONNECTION_SUPERVISION_TIMEOUT_MS / 10; // in 10ms unit
ble_gap_conn_sec_mode_t sec_mode;
BLE_GAP_CONN_SEC_MODE_SET_OPEN(&sec_mode); // no security is needed
// ASSERT_STATUS( sd_ble_gap_device_name_set(&sec_mode, //_modify
// (const uint8_t *)
// CFG_GAP_LOCAL_NAME,
// strlen(CFG_GAP_LOCAL_NAME)));
// ASSERT_STATUS( sd_ble_gap_appearance_set(CFG_GAP_APPEARANCE));
// ASSERT_STATUS( sd_ble_gap_ppcp_set(&gap_conn_params));
// ASSERT_STATUS( sd_ble_gap_tx_power_set(CFG_BLE_TX_POWER_LEVEL));
nrf_err_check( sd_ble_gap_device_name_set(&sec_mode,
(const uint8_t *)
CFG_GAP_LOCAL_NAME,
strlen(CFG_GAP_LOCAL_NAME)) );
nrf_err_check( sd_ble_gap_appearance_set(CFG_GAP_APPEARANCE) );
nrf_err_check( sd_ble_gap_ppcp_set(&gap_conn_params) );
nrf_err_check( sd_ble_gap_tx_power_set(CFG_BLE_TX_POWER_LEVEL) );
/* Connection Parameters */
enum {
FIRST_UPDATE_DELAY = APP_TIMER_TICKS(5000, CFG_TIMER_PRESCALER),
NEXT_UPDATE_DELAY = APP_TIMER_TICKS(5000, CFG_TIMER_PRESCALER),
MAX_UPDATE_COUNT = 3
};
ble_conn_params_init_t cp_init = {0};
cp_init.p_conn_params = NULL;
cp_init.first_conn_params_update_delay = FIRST_UPDATE_DELAY;
cp_init.next_conn_params_update_delay = NEXT_UPDATE_DELAY;
cp_init.max_conn_params_update_count = MAX_UPDATE_COUNT;
cp_init.start_on_notify_cccd_handle = BLE_GATT_HANDLE_INVALID;
cp_init.disconnect_on_fail = true;
cp_init.evt_handler = NULL;
cp_init.error_handler = error_callback;
//ASSERT_STATUS ( ble_conn_params_init(&cp_init)); //_modify
nrf_err_check( ble_conn_params_init(&cp_init) );
return ERROR_NONE;
}
示例13: gap_params_init
static void gap_params_init(void)
{
uint32_t err_code;
ble_gap_conn_sec_mode_t sec_mode;
BLE_GAP_CONN_SEC_MODE_SET_OPEN(&sec_mode); //no security needed
//set BLE name
err_code = sd_ble_gap_device_name_set(&sec_mode,(const uint8_t *)DEVICE_NAME,strlen(DEVICE_NAME));
BLE_ERROR_CHECK(err_code);
//set BLE appearance
err_code = sd_ble_gap_appearance_set(BLE_APPEARANCE_GENERIC_TAG);
BLE_ERROR_CHECK(err_code);
}
示例14: gap_params_init
/**@brief Function for the GAP initialization.
*
* @details This function sets up all the necessary GAP (Generic Access Profile) parameters of the
* device including the device name, appearance, and the preferred connection parameters.
*/
static void gap_params_init(void)
{
uint32_t err_code;
ble_gap_conn_params_t gap_conn_params;
ble_gap_conn_sec_mode_t sec_mode;
BLE_GAP_CONN_SEC_MODE_SET_OPEN(&sec_mode);
err_code = sd_ble_gap_device_name_set(&sec_mode,
(const uint8_t *)DEVICE_NAME,
strlen(DEVICE_NAME));
if (err_code == NRF_SUCCESS)
debug_printf("Device name set!\r\n");
else
{
debug_printf("Ooops.. Something went wrong with setting the name..\r\n");
APP_ERROR_CHECK(err_code);
}
err_code = sd_ble_gap_appearance_set(BLE_APPEARANCE_UNKNOWN);
if (err_code == NRF_SUCCESS)
debug_printf("Appearance set!\r\n");
else
{
debug_printf("Ooops.. Something is wrong with setting the appearrance..\r\n");
APP_ERROR_CHECK(err_code);
}
memset(&gap_conn_params, 0, sizeof(gap_conn_params));
gap_conn_params.min_conn_interval = MIN_CONN_INTERVAL;
gap_conn_params.max_conn_interval = MAX_CONN_INTERVAL;
gap_conn_params.slave_latency = SLAVE_LATENCY;
gap_conn_params.conn_sup_timeout = CONN_SUP_TIMEOUT;
err_code = sd_ble_gap_ppcp_set(&gap_conn_params);
if (err_code == NRF_SUCCESS)
debug_printf("Connection parameters set!\r\n");
else
{
debug_printf("Ooops.. Something is wrong with setting connection parameters..\r\n");
APP_ERROR_CHECK(err_code);
}
sd_ble_gap_tx_power_set(4);
}
示例15: ASSERT_TRUE
ble_error_t nRF5xGap::setAdvertisingData(const GapAdvertisingData &advData, const GapAdvertisingData &scanResponse)
{
/* Make sure we don't exceed the advertising payload length */
if (advData.getPayloadLen() > GAP_ADVERTISING_DATA_MAX_PAYLOAD) {
return BLE_ERROR_BUFFER_OVERFLOW;
}
/* Make sure we have a payload! */
if (advData.getPayloadLen() == 0) {
return BLE_ERROR_PARAM_OUT_OF_RANGE;
}
/* Check the scan response payload limits */
//if ((params.getAdvertisingType() == GapAdvertisingParams::ADV_SCANNABLE_UNDIRECTED))
//{
// /* Check if we're within the upper limit */
// if (advData.getPayloadLen() > GAP_ADVERTISING_DATA_MAX_PAYLOAD)
// {
// return BLE_ERROR_BUFFER_OVERFLOW;
// }
// /* Make sure we have a payload! */
// if (advData.getPayloadLen() == 0)
// {
// return BLE_ERROR_PARAM_OUT_OF_RANGE;
// }
//}
/* Send advertising data! */
ASSERT_TRUE(ERROR_NONE ==
sd_ble_gap_adv_data_set(advData.getPayload(),
advData.getPayloadLen(),
scanResponse.getPayload(),
scanResponse.getPayloadLen()),
BLE_ERROR_PARAM_OUT_OF_RANGE);
/* Make sure the GAP Service appearance value is aligned with the
*appearance from GapAdvertisingData */
ASSERT_TRUE(ERROR_NONE == sd_ble_gap_appearance_set(advData.getAppearance()),
BLE_ERROR_PARAM_OUT_OF_RANGE);
/* ToDo: Perform some checks on the payload, for example the Scan Response can't */
/* contains a flags AD type, etc. */
return BLE_ERROR_NONE;
}