2015-11-13 03:50 AM
Hi all!
Please, can you help me. I have next problem. In My device I use BlueNRG-MS (HSI-16MHz, LSE ext - 32.768). BlueNRG init Ok, but not available in RF. He is active with a period of 30 seconds (name ''atn_B41'')But, then I made CS on SPI active (set ''0'') - BlueNRG-MS - active all timeCode init module:''main(){....getBlueNRGVersion(&hwVersion,&fwVersion); printk(''hwVersion = 0x%X fwVersion = 0x%X'',hwVersion,fwVersion); /* Reset BlueNRG hardware */ BlueNRG_RST(); wait_IRQ_SPI_FLAG(); Osal_MemCpy(bdaddr, SERVER_BDADDR, sizeof(SERVER_BDADDR)); ret = aci_hal_write_config_data(CONFIG_DATA_PUBADDR_OFFSET,CONFIG_DATA_PUBADDR_LEN,bdaddr); ret = aci_gatt_init(); ret = aci_gap_init(GAP_PERIPHERAL_ROLE, 0, 7, &service_handle, &dev_name_char_handle, &appearance_char_handle); //appearance_char_handle - 8; //service_handle - 5; //dev_name_char_handle - 6; aci_gatt_update_char_value(service_handle, dev_name_char_handle, 0,strlen(name), (uint8_t *)name); ret = aci_gap_set_auth_requirement(MITM_PROTECTION_REQUIRED,OOB_AUTH_DATA_ABSENT,0, 7,16,USE_FIXED_PIN_FOR_PAIRING,123456,BONDING); ret = Add_Acc_Service(); ret = Add_Environmental_Sensor_Service(); ret = aci_hal_set_tx_power_level(1,4); while(1) {HCI_Process();
User_Process(&axes_data); }...}....void setConnectable(void){ tBleStatus ret; const char local_name[] = {AD_TYPE_COMPLETE_LOCAL_NAME,'a','t','n','_','B','4','1'}; /* disable scan response */ hci_le_set_scan_resp_data(0,NULL); printk(''General Discoverable Mode.\n''); ret = aci_gap_set_discoverable(ADV_IND, 0, 0, PUBLIC_ADDR, NO_WHITE_LIST_USE, sizeof(local_name), local_name, 0, NULL, 0, 0); printk_co(GREEN,''aci_gap_set_discoverable() ret=0x%X'',ret); if (ret != BLE_STATUS_SUCCESS) { printk(''Error while setting discoverable mode (%d)\n'', ret); } }'' #avalible #init #bluenrg-ms