This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

NUS only receives the first byte

Hi,

I'm currently playing around with the NUS example in the SDK and still trying to understand how it works. My BLE event handler only receives the first byte of the string of bytes I send using a BLE debugger app on Android (BLE debugger by Syntronix), though, it receives all bytes if sent from the nRF Connect app. I have been using Syntronix's debugger for a while with no problems. 

What I care about the most here is knowing if there's any special implementation the nRF Connect is taking care of in the background while Syntronix's debugger app is not. 

FYI: nRF in our application is the peripheral and the central is an Android application.

Parents
  • 	public void send(final String text) {
    
    		// Are we connected?
    		if (mRXCharacteristic == null)
    			return;
    
    		if (!TextUtils.isEmpty(text)) {
    			final WriteRequest request = writeCharacteristic(mRXCharacteristic, text.getBytes())
    					.with((device, data) -> log(LogContract.Log.Level.APPLICATION,
    							"\"" + data.getStringValue(0) + "\" senttoMCU"));
    
    			if (!mUseLongWrite) {
    				// This will automatically split the long data into MTU-3-byte long packets.
    				request.split();
    			}
    			request.enqueue();
    		}
    	}
    
    

    This is the code for sending. Already try using UART toolbox apps and nrfblinky apps . 244 bytes is default transfer packet. Maybe the code in Syntronix's debugger app is the problem.

  • I'm receiving all bytes when using nRFToolbox. 
    I'll try capturing the sniffer trace and get back.

    From your answer I understand that there's no special drivers needed on the Android side to communicate over NUS. Right? This could be a problem with the debugger app.

Reply Children
Related