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

Is it possible to send entire array over ble

Hi, 

Is it possible to send entire array over ble? 

Char *data100];

For (I=0, I<100, I++)

{

Data[i] =timestamp_data;

Ble_nus_data_send(&m_nus, &data,size of (data), m_conn_handle);

}

Is this format correct??? 

Parents
  • Yes; I just posted this elsewhere and it might be helpful; note your "size of (data)" is an address of a variable containing the number of bytes - see the Nordic code describing ble_nus_data_send() for more details:

    uint32_t StoredPacketTransmit(BlePacketFormat_t *pPacketToTransmit, uint16_t PacketLength)
    {
        uint32_t err_code = SOMETHING_BAD;
        // Define the structure to identify the Nordic UART Service
        ble_nus_t * p_m_nus = get_mNUS();
        if (pPacketToTransmit && PacketLength && p_m_nus)
        {
            err_code = ble_nus_data_send(p_m_nus, pPacketToTransmit, &PacketLength);
            if (err_code == NRF_SUCCESS)
            {
                // Packet sent, allow next packet to be built when sufficent SAADC samples available
            }
            else
            {
                // Packet not sent, next packet build is disallowed until current packet is sent
                mDelayedPacketCount++;
            }
        }
        // Allow caller to see if packet actually went out
        return err_code;
    }

  • i don't understand your code  . please explain for my content above code 

Reply Children
Related