ble_ant_app_hrm.rarHi!! I want to design dual mode(BLE UART +ANT) but unfortunately I can not built it well. Can anyone tell me what kind of function or parameter? I based on example of ble_ant_app_hrm in nRF51_SDK_10.0.0_dc26b5e.
ble_ant_app_hrm.rarHi!! I want to design dual mode(BLE UART +ANT) but unfortunately I can not built it well. Can anyone tell me what kind of function or parameter? I based on example of ble_ant_app_hrm in nRF51_SDK_10.0.0_dc26b5e.
What do you mean by "can not built it well"?
That is mean that my code can not work. Do you have sample code for this dual mode(?
We do not have a combinded BLE UART and ANT example, but it shouldn't be too hard replacing the HRS with NUS in the ble_ant_app_hrm example. If you are stuck, maybe you can include your complete project so I can have a look?
Hi!! Petter I attach my complete project. Please check it for me.ble_ant_app_hrm.rar
It compiles well, but you have functions that returns errors when you run the program. You should try compiling without optimizations (set Options for Target->C/C++->Optimization->Level 0) and use the debugger.
If you put at breakpoint at APP_ERROR_CHECK(err_code); below ble_advdata_set() in advertising_init() you can see that it returns error code 0x00000007, which comes from a sd_ble_uuid_encode() call. 0x00000007 returned from this function means: NRF_ERROR_INVALID_PARAM Invalid UUID type. The UUID type is invalid because you have not added the base UUID of the NUS service. This is added in services_init() which you are calling after advertising_init(). Change the order of these and the error goes away.
You will however still get an error from ble_advdata_set(), but now it is 0x0000000C which means NRF_ERROR_DATA_SIZE. You are trying to put too much information into the advertising packet. There are several questions on here that answers how to solve this issue.