⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.xmece.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
4 posts / 0 new
Last post
邓昌永
Offline
Last seen:3 months 4 days ago
加入:2020-02-10 02:23
BLE issues

这就跟你问声好!

I am using the sample to develop my own Bluetooth private service, and now I have encountered a few problems and need to ask.

1. Why do I use the Bluetooth broadcast data of this routine to have only the Bluetooth name, the other fields are blank. How to add data such as Bluetooth service and Bluetooth mac address in Bluetooth broadcast package?

2.I use a mobile phone to connect to this device, and I use my mobile phone to send data to the device. Why ca n’t the device receive it?

Hope to reply as soon as possible, thank you very much! Below is my code。

ble_peripheral_start();
ble_register_app ();

ble_gap_device_name_set("Custom BLE Service", ATT_PERM_NONE);

const mcs_characteristic_config_t custom_service_1[] = {

/* Initialized Characteristic Attribute */

CHARACTERISTIC_DECLARATION(ff02, CHARACTERISTIC_ATTR_VALUE_MAX_BYTES,
CHAR_WRITE_PROP_EN, CHAR_READ_PROP_DIS, CHAR_NOTIF_NONE, NULL,
set_var_value_cb1, NULL, NULL),

CHARACTERISTIC_DECLARATION(ff01, CHARACTERISTIC_ATTR_VALUE_MAX_BYTES,
CHAR_WRITE_PROP_DIS, CHAR_READ_PROP_DIS, CHAR_NOTIF_NOTIF_EN, NULL,
get_var_value_cb, set_var_value_cb, event_sent_cb)
};
SERVICE_DECLARATION(custom_service_1, ff00)
/ *设置Bluetooth address */
ble_gap_address_set(&user_bd_address, 0x00FF);

ble_gap_adv_intv_set(MIN_INTERVAL_MS,MAX_INTERVAL_MS);

ble_gap_adv_data_set(sizeof(adv_data), adv_data, 0, NULL);
ble_gap_adv_start(GAP_CONN_MODE_UNDIRECTED);

Device:
PM_Dialog
Offline
Last seen:2 days 7 hours ago
Staff
加入:2018-02-08 11:03
Hi There,

Hi There,

Thanks for your question online. Would it be possible to provide more clarifications on your issues?

  1. Do you mean the advertising data? If yes, please check the adv_data[]. Only the device name is stored in the advertising string. However, you can modify it according to the BEL specifications. Otherwise, please indicate what you are trying to accomplish.
  2. Are you sending data over notifications to the mobile app?

Thanks, PM_Dialog

邓昌永
Offline
Last seen:3 months 4 days ago
加入:2020-02-10 02:23
Hi,

Hi,

Thank you very much!Broadcasting issues have been resolved.

PM_Dialog
Offline
Last seen:2 days 7 hours ago
Staff
加入:2018-02-08 11:03
Hi There,

Hi There,

Glad that you resolved your issue and thanks for accepting my answer.

Thanks, PM_Dialog