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

Sensor Model for Mesh

I have to send 6 bytes of sensor data from mesh server to mesh client. Is it possible to use simple_on/off model or have to create new model. Any sensor model example is available in mesh?

Parents Reply
  • yes if i send 6 bytes of data from server, i receive as different data as 16bit data

    uint64_t val[6] ={0xFE, 0xEA, 0x10, 0x06, 0x6D, 0x00};

    uint64_t simple_sensor_server_status_publish(simple_sensor_server_t * p_server, uint64_t * value)
    {
    simple_sensor_msg_status_t status;
    status.rawval = *value;
    access_message_tx_t msg;
    msg.opcode.opcode = SIMPLE_SENSOR_OPCODE_STATUS;
    msg.opcode.company_id = SIMPLE_SENSOR_COMPANY_ID;
    msg.p_buffer = (const uint8_t *)&status;
    msg.length = sizeof(status);
    msg.force_segmented = false;
    msg.transmic_size = NRF_MESH_TRANSMIC_SIZE_DEFAULT;
    msg.access_token = nrf_mesh_unique_token_get();
    return access_model_publish(p_server->model_handle, &msg);
    }

Children
Related