Hi all,
I am beginner in Java, I have experince just with assembler and C. I did only one app before in java, with Laird libraries, because we have Laird boards using Nordic chips. The Laird libraries are not so great, so I decided to use Nordic libraries for BLE connection. The connection works perfect. I would like to use some parts of nRF Toolbox code, mainly from UART activity. I am using easy communication Rx Tx with commands to our device (Motor Regulator). I do not actually understand how work callbacks in UART activity, what I am trying to do is to have all "UARTManagerCallbacks" in UARTActivity, not only in UARTService. Because I need to know in UARTActivity that for example the Ble data are received and visualize the data in the UARTActivity. So mainly functions onDataReceived, onDataSent, and next my functions from UARTService or UARTManager. In other features Nordic is using initialize manager for bridge the callbacks if I understand it right, like here HRS
@Override
protected BleManager<HRSManagerCallbacks> initializeManager() {
final HRSManager manager = HRSManager.getInstance(getApplicationContext());
manager.setGattCallbacks(this);
return manager;
}
I would like to have in UARTActivity for example this function:
@Override
public void onDataReceived(final BluetoothDevice device, final String data) {
Log.d("UART_ACTIVITY","comming data: "+data);
}
Please could you help me and write me an example how to do it? I cant continue without this big Help. Thank you