static void bt_ready(int err) { if (err) { printk("Bluetooth init failed (err %d)\n", err); return; } printk("Bluetooth initialized\n"); gap_init(DEVICE_NAME, HEART_RATE_APPEARANCE); hrs_init(0x01); bas_init(); cts_init(); dis_init(CONFIG_SOC, "Manufacturer"); bt_gatt_register(vnd_attrs, ARRAY_SIZE(vnd_attrs)); err = bt_le_adv_start(BT_LE_ADV_CONN, ad, ARRAY_SIZE(ad), sd, ARRAY_SIZE(sd)); if (err) { printk("Advertising failed to start (err %d)\n", err); return; } printk("Advertising successfully started\n"); }
/**@brief Function for initializing the services that will be used by the application. */ static void services_init(void) { tps_init(); ias_init(); lls_init(); bas_init(); ias_client_init(); }
/**@brief Initialize services that will be used by the application. */ void services_init(void) { tps_init(); // add Tx power service ias_init(); // add immediate Alert Service lls_init(); // add Link Loss Service bas_init(); // add Battery alert service ias_client_init(); // add imediate alert service client }
/**@brief Function for initializing services that will be used by the application. */ static void services_init(void) { dis_init(); bas_init(); therm_init(); // Configure the Temp. Sensor Service { srv_TempSensor_init_t tss_init; CLEAR(tss_init); tss_init.support_notification= true; // Here the sec level for the Battery Service can be changed/increased. BLE_GAP_CONN_SEC_MODE_SET_OPEN(&tss_init.battery_level_char_attr_md.cccd_write_perm); BLE_GAP_CONN_SEC_MODE_SET_OPEN(&tss_init.battery_level_char_attr_md.read_perm); BLE_GAP_CONN_SEC_MODE_SET_NO_ACCESS(&tss_init.battery_level_char_attr_md.write_perm); srv_TempSensor_init(&m_tss, &tss_init); } }
static void bt_ready(int err) { if (err) { printk("Bluetooth init failed (err %d)\n", err); return; } printk("Bluetooth initialized\n"); gap_init(DEVICE_NAME, CSC_APPEARANCE); bas_init(); dis_init(CONFIG_SOC, "ACME"); bt_gatt_register(csc_attrs, ARRAY_SIZE(csc_attrs)); err = bt_le_adv_start(BT_LE_ADV(BT_LE_ADV_IND), ad, ARRAY_SIZE(ad), sd, ARRAY_SIZE(sd)); if (err) { printk("Advertising failed to start (err %d)\n", err); return; } printk("Advertising successfully started\n"); }
/**@brief Initialize services that will be used by the application. */ static void services_init(void) { dis_init(); bas_init(); hids_init(); }