I want to send sensor data using sensor_server_status_publish function, however struggling with data marshalling. I get unknown property ID or no data at all displayed in nRF Mesh app. Property ID (=0x004F) is correct as device properly responds to get messages.
I have tried to use both data Formats as described in Mesh Model specification (Page 121). Bellow image of data marshalling taken from the specification.
And the code:
uint8_t * p_out = (uint8_t *)m_sensor_server.p_message_buffer;
uint16_t bytes;
// Format B
bytes = 4;
p_out[0] = ((1 << 1) | 0x01); // Sensor Data Lenght 1 Byte
p_out[1] = (uint8_t)(SENSOR_PRESENT_AMB_TEMP_PROPERTY_ID << 8);
p_out[2] = (uint8_t)(SENSOR_PRESENT_AMB_TEMP_PROPERTY_ID & 0xff);
p_out[3] = 0xFF; // Sensor Data
sensor_server_status_publish(&m_sensor_server.server.sensor_srv,
p_out, bytes, SENSOR_OPCODE_STATUS);