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

S120 unable to receive data larger than 1 byte?

Hello Nordevzone:

8.0 multilink example

I tried to use this modified handler to receive notification data from a s110 based application. The centerpiece of the handler is to read the value of this member:

p_ble_evt->evt.gattc_evt.params.hvx.data[i]

And the function is:

    static void on_evt_hvx(ble_evt_t * p_ble_evt, client_t * p_client, uint32_t index)
{
    int i;
	if ((p_client != NULL) && (p_client->state == STATE_RUNNING))
    {
        if (
                (
                        p_ble_evt->evt.gattc_evt.params.hvx.handle
                        ==
                                p_client->srv_db.services[0].charateristics[p_client->char_index].characteristic.handle_value
                )
                
        )
        {


				for(i=0;i<=7;i++)
			{
			
			
			
			
				  printf ("%x",p_ble_evt->evt.gattc_evt.params.hvx.data[i]);
			

				nrf_delay_ms(500);
				
			}
					 
		

        }
    }
}

When I try to receive only 1 byte, everything was fine. But when I try to send 8 bytes as shown in this function, instead of the proper content I programmed in the s110 application, I get random numbers as the printf result. I wasn't able to tell if the "sending" function of my s110 application worked correctly i.e. it send anything over the radio at all, or it's just that the s120 function as shown above failed to correctly receive those data.

Anyhow, I don't know which direction to go on. Can someone please kindly help me? Enlighten me a bit on where to proceed next.

Thanks in advance.

Parents Reply Children
No Data
Related