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

Issue sending data from UART over mesh

Hi, 

I've been working on a project where I need to send data from UART over mesh, I managed to create custom model for sending string data over mesh, I did merge UART example with mesh SDK, I started with light switch demo from mesh SDK v2.0.1 and with nRF5 SDK v15, now I'm trying to get the data received on UART to send it over mesh, but I didn't do it correctly, the send_my_message function kept sending the same random data, Any idea on how to make that work, it would be greatly appreciated.

Here is a snippet of my code:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//function to send data over mesh
void send_my_message (char s[])
{
uint32_t status=0;
uint8_t buffer[5];
strcpy(buffer, (uint8_t) s);
uint8_t length;
uint16_t address;
access_message_tx_t msg;
length= sizeof(buffer);
if (length)
{
msg.opcode.opcode = simple_message_OPCODE_SEND;
msg.opcode.company_id = 0x0059; // Nordic's company ID
msg.p_buffer = (const uint8_t *) &buffer[0];
msg.length =length;
status= simple_message_client_set_unreliable(&m_clients[0], buffer, length);
__LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "Status : %u \n", status);
if (status == NRF_ERROR_INVALID_STATE ||
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

here is my log 

Thank you,

A.