text:
<?php

namespace Rayku\ApiBundle\Controller;

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use Nelmio\ApiDocBundle\Annotation\ApiDoc;
use FOS\RestBundle\Controller\Annotations\View;
use FOS\UserBundle\Controller\RegistrationController as BaseController;

use Rayku\ApiBundle\Entity\User;
use Rayku\ApiBundle\Form\UserType;
use Rayku\ApiBundle\Form\UserSettingType;
use Rayku\UserBundle\Form\Type\RegistrationAndProfileFormType;

/**
 * User controller.
 */
class UserController extends Controller
{

	/**
	 * @ApiDoc(
	 *     description="Register a user",
	 *     input="Rayku\UserBundle\Form\Type\RegistrationAndProfileFormType"
	 * )
	 */
	public function postUsersRegistrationAction()
	{
		$user = new User();

		$form = $this->createForm(new RegistrationAndProfileFormType(get_class($user)), $user, array('csrf_protection' => false));
		$form->bind($this->getRequest());
		if ($form->isValid()) {
			$confirmationEnabled = $this->container->getParameter('fos_user.registration.confirmation.enabled');
			$this->container->get('fos_user.registration.form.handler')->processReferral($user, $confirmationEnabled);

			if ($confirmationEnabled) {
				$this->container->get('session')->set('fos_user_send_confirmation_email/email', $user->getEmail());
				$route = 'fos_user_registration_check_email';
			} else {
				$response = new RedirectResponse($this->container->get('router')->generate('fos_user_registration_confirmed'));
				$this->authenticateUser($user, $response);
				$route = 'fos_user_registration_confirmed';
			}

			$url = $this->container->get('router')->generate($route, array(), true);
			return array('success' => true, 'redirect' => $url);
		}

		return array(
			'entity' => $user,
			'form'   => $form,
		);
	}

	/**
	 * @see \FOS\UserBundle\Controller\RegistrationController
	 * @param \User $user
	 * @param \RedirectResponse $response
	 */
	protected function authenticateUser($user, $response)
	{
		try {
			$this->container->get('fos_user.security.login_manager')->loginUser(
				$this->container->getParameter('fos_user.firewall_name'),
				$user,
				$response);
		} catch (AccountStatusException $ex) {
			// We simply do not authenticate users which do not pass the user
			// checker (not enabled, expired, etc.).
		}
	}

	/**
	 * @ApiDoc(
	 *   description="Get user accounts - not implemneted",
	 *   resource=true
	 * )
	 */
	public function getUsersAction()
	{
		throw new \Exception('not implemented');
	}

	/**
	 * @View(serializerGroups={"user.view"})
	 * @ApiDoc(
	 *   statusCodes={
	 *     200="Returned when successful"
	 *   },
	 *   description="Get a user record",
	 *   output="Rayku\ApiBundle\Entity\User"
	 * )
	 */
	public function getUserAction(User $entity)
	{
		return $entity;
	}

	/**
	 * @ApiDoc(
	 *   description="Update a user profile settings",
	 *   input="Rayku\ApiBundle\Form\UserSettingType"
	 * )
	 */
	public function postUsersProfileAction(User $user)
	{
		if($user->getId() !== $this->getUser()->getId()){
			throw new AccessDeniedException();
		}
		$request = $this->getRequest();
		$editForm = $this->createForm(new UserSettingType(), $user);
		$editForm->bind($request);

		if ($editForm->isValid()) {
			$em = $this->getDoctrine()->getEntityManager();
			$em->persist($user);
			$em->flush();
			return $user;
		}
		return array(
				'entity'      => $user,
				'edit_form'   => $editForm,
		);
	}

    /**
     * @ApiDoc(
     *   description="Update a user profile settings",
     *   input="Rayku\ApiBundle\Form\UserType"
     * )
     */
    public function postUsersAction(User $user)
    {
    	if($user->getId() !== $this->getUser()->getId()){
    		throw new AccessDeniedException();
    	}
    	$request = $this->getRequest();
        $editForm = $this->createForm(new UserType(), $user);
        $editForm->bind($request);

        if ($editForm->isValid()) {
        	$em = $this->getDoctrine()->getEntityManager();
            $em->persist($user);
            $em->flush();
            return $user;
        }
        return array(
            'entity'      => $user,
            'edit_form'   => $editForm->createView(),
        );
    }
}


text:
/** @file
 *  @brief Bluetooth Mesh Generic Client Model APIs.
 */

#ifndef _ESP_BLE_MESH_GENERIC_MODEL_API_H_
#define _ESP_BLE_MESH_GENERIC_MODEL_API_H_

#include "esp_ble_mesh_defs.h"

#ifdef __cplusplus
extern "C" {
#endif

/** @def    ESP_BLE_MESH_MODEL_GEN_ONOFF_CLI
 *
 *  @brief  Define a new Generic OnOff Client Model.
 *
 *  @note   This API needs to be called for each element on which
 *          the application needs to have a Generic OnOff Client Model.
 *
 *  @param  cli_pub  Pointer to the unique struct esp_ble_mesh_model_pub_t.
 *  @param  cli_data Pointer to the unique struct esp_ble_mesh_client_t.
 *
 *  @return New Generic OnOff Client Model instance.
 */
#define ESP_BLE_MESH_MODEL_GEN_ONOFF_CLI(cli_pub, cli_data)         \
        ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_GEN_ONOFF_CLI, \
                    NULL, cli_pub, cli_data)

/** @def    ESP_BLE_MESH_MODEL_GEN_LEVEL_CLI
 *
 *  @brief  Define a new Generic Level Client Model.
 *
 *  @note   This API needs to be called for each element on which
 *          the application needs to have a Generic Level Client Model.
 *
 *  @param  cli_pub  Pointer to the unique struct esp_ble_mesh_model_pub_t.
 *  @param  cli_data Pointer to the unique struct esp_ble_mesh_client_t.
 *
 *  @return New Generic Level Client Model instance.
 */

#define ESP_BLE_MESH_MODEL_GEN_LEVEL_CLI(cli_pub, cli_data)         \
        ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_GEN_LEVEL_CLI, \
                    NULL, cli_pub, cli_data)

/** @def    ESP_BLE_MESH_MODEL_GEN_DEF_TRANS_TIME_CLI
 *
 *  @brief  Define a new Generic Default Transition Time Client Model.
 *
 *  @note   This API needs to be called for each element on which
 *          the application needs to have a Generic Default Transition
 *          Time Client Model.
 *
 *  @param  cli_pub  Pointer to the unique struct esp_ble_mesh_model_pub_t.
 *  @param  cli_data Pointer to the unique struct esp_ble_mesh_client_t.
 *
 *  @return New Generic Default Transition Time Client Model instance.
 */
#define ESP_BLE_MESH_MODEL_GEN_DEF_TRANS_TIME_CLI(cli_pub, cli_data)            \
        ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_GEN_DEF_TRANS_TIME_CLI,    \
                    NULL, cli_pub, cli_data)

/** @def    ESP_BLE_MESH_MODEL_GEN_POWER_ONOFF_CLI
 *
 *  @brief  Define a new Generic Power OnOff Client Model.
 *
 *  @note   This API needs to be called for each element on which
 *          the application needs to have a Generic Power OnOff Client Model.
 *
 *  @param  cli_pub  Pointer to the unique struct esp_ble_mesh_model_pub_t.
 *  @param  cli_data Pointer to the unique struct esp_ble_mesh_client_t.
 *
 *  @return New Generic Power OnOff Client Model instance.
 */
#define ESP_BLE_MESH_MODEL_GEN_POWER_ONOFF_CLI(cli_pub, cli_data)           \
        ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_GEN_POWER_ONOFF_CLI,   \
                    NULL, cli_pub, cli_data)

/** @def    ESP_BLE_MESH_MODEL_GEN_POWER_LEVEL_CLI
 *
 *  @brief  Define a new Generic Power Level Client Model.
 *
 *  @note   This API needs to be called for each element on which
 *          the application needs to have a Generic Power Level Client Model.
 *
 *  @param  cli_pub  Pointer to the unique struct esp_ble_mesh_model_pub_t.
 *  @param  cli_data Pointer to the unique struct esp_ble_mesh_client_t.
 *
 *  @return New Generic Power Level Client Model instance.
 */
#define ESP_BLE_MESH_MODEL_GEN_POWER_LEVEL_CLI(cli_pub, cli_data)           \
        ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_GEN_POWER_LEVEL_CLI,   \
                    NULL, cli_pub, cli_data)

/** @def    ESP_BLE_MESH_MODEL_GEN_BATTERY_CLI
 *
 *  @brief  Define a new Generic Battery Client Model.
 *
 *  @note   This API needs to be called for each element on which
 *          the application needs to have a Generic Battery Client Model.
 *
 *  @param  cli_pub  Pointer to the unique struct esp_ble_mesh_model_pub_t.
 *  @param  cli_data Pointer to the unique struct esp_ble_mesh_client_t.
 *
 *  @return New Generic Battery Client Model instance.
 */
#define ESP_BLE_MESH_MODEL_GEN_BATTERY_CLI(cli_pub, cli_data)           \
        ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_GEN_BATTERY_CLI,   \
                    NULL, cli_pub, cli_data)

/** @def    ESP_BLE_MESH_MODEL_GEN_LOCATION_CLI
 *
 *  @brief  Define a new Generic Location Client Model.
 *
 *  @note   This API needs to be called for each element on which
 *          the application needs to have a Generic Location Client Model.
 *
 *  @param  cli_pub  Pointer to the unique struct esp_ble_mesh_model_pub_t.
 *  @param  cli_data Pointer to the unique struct esp_ble_mesh_client_t.
 *
 *  @return New Generic Location Client Model instance.
 */
#define ESP_BLE_MESH_MODEL_GEN_LOCATION_CLI(cli_pub, cli_data)          \
        ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_GEN_LOCATION_CLI,  \
                    NULL, cli_pub, cli_data)

/** @def    ESP_BLE_MESH_MODEL_GEN_PROPERTY_CLI
 *
 *  @brief  Define a new Generic Property Client Model.
 *
 *  @note   This API needs to be called for each element on which
 *          the application needs to have a Generic Property Client Model.
 *
 *  @param  cli_pub  Pointer to the unique struct esp_ble_mesh_model_pub_t.
 *  @param  cli_data Pointer to the unique struct esp_ble_mesh_client_t.
 *
 *  @return New Generic Location Client Model instance.
 */
#define ESP_BLE_MESH_MODEL_GEN_PROPERTY_CLI(cli_pub, cli_data)          \
        ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_GEN_PROP_CLI,      \
                    NULL, cli_pub, cli_data)

/**
 *  @brief Bluetooth Mesh Generic Client Model Get and Set parameters structure.
 */

/** Parameters of Generic OnOff Set. */
typedef struct {
    bool    op_en;      /*!< Indicate if optional parameters are included */
    uint8_t onoff;      /*!< Target value of Generic OnOff state */
    uint8_t tid;        /*!< Transaction ID */
    uint8_t trans_time; /*!< Time to complete state transition (optional) */
    uint8_t delay;      /*!< Indicate message execution delay (C.1) */
} esp_ble_mesh_gen_onoff_set_t;

/** Parameters of Generic Level Set. */
typedef struct {
    bool    op_en;      /*!< Indicate if optional parameters are included */
    int16_t level;      /*!< Target value of Generic Level state */
    uint8_t tid;        /*!< Transaction ID */
    uint8_t trans_time; /*!< Time to complete state transition (optional) */
    uint8_t delay;      /*!< Indicate message execution delay (C.1) */
} esp_ble_mesh_gen_level_set_t;

/** Parameters of Generic Delta Set. */
typedef struct {
    bool    op_en;      /*!< Indicate if optional parameters are included */
    int32_t level;      /*!< Delta change of Generic Level state */
    uint8_t tid;        /*!< Transaction ID */
    uint8_t trans_time; /*!< Time to complete state transition (optional) */
    uint8_t delay;      /*!< Indicate message execution delay (C.1) */
} esp_ble_mesh_gen_delta_set_t;

/** Parameters of Generic Move Set. */
typedef struct {
    bool    op_en;          /*!< Indicate if optional parameters are included */
    int16_t delta_level;    /*!< Delta Level step to calculate Move speed for Generic Level state */
    uint8_t tid;            /*!< Transaction ID */
    uint8_t trans_time;     /*!< Time to complete state transition (optional) */
    uint8_t delay;          /*!< Indicate message execution delay (C.1) */
} esp_ble_mesh_gen_move_set_t;

/** Parameter of Generic Default Transition Time Set. */
typedef struct {
    uint8_t trans_time; /*!< The value of the Generic Default Transition Time state */
} esp_ble_mesh_gen_def_trans_time_set_t;

/** Parameter of Generic OnPowerUp Set. */
typedef struct {
    uint8_t onpowerup;  /*!< The value of the Generic OnPowerUp state */
} esp_ble_mesh_gen_onpowerup_set_t;

/** Parameters of Generic Power Level Set. */
typedef struct {
    bool     op_en;         /*!< Indicate if optional parameters are included */
    uint16_t power;         /*!< Target value of Generic Power Actual state */
    uint8_t  tid;           /*!< Transaction ID */
    uint8_t  trans_time;    /*!< Time to complete state transition (optional) */
    uint8_t  delay;         /*!< Indicate message execution delay (C.1) */
} esp_ble_mesh_gen_power_level_set_t;

/** Parameter of Generic Power Default Set. */
typedef struct {
    uint16_t power;         /*!< The value of the Generic Power Default state */
} esp_ble_mesh_gen_power_default_set_t;

/** Parameters of Generic Power Range Set. */
typedef struct {
    uint16_t range_min;     /*!< Value of Range Min field of Generic Power Range state */
    uint16_t range_max;     /*!< Value of Range Max field of Generic Power Range state */
} esp_ble_mesh_gen_power_range_set_t;

/** Parameters of Generic Location Global Set. */
typedef struct {
    int32_t global_latitude;    /*!< Global Coordinates (Latitude) */
    int32_t global_longitude;   /*!< Global Coordinates (Longitude) */
    int16_t global_altitude;    /*!< Global Altitude */
} esp_ble_mesh_gen_loc_global_set_t;

/** Parameters of Generic Location Local Set. */
typedef struct {
    int16_t  local_north;       /*!< Local Coordinates (North) */
    int16_t  local_east;        /*!< Local Coordinates (East) */
    int16_t  local_altitude;    /*!< Local Altitude */
    uint8_t  floor_number;      /*!< Floor Number */
    uint16_t uncertainty;       /*!< Uncertainty */
} esp_ble_mesh_gen_loc_local_set_t;

/** Parameter of Generic User Property Get. */
typedef struct {
    uint16_t property_id;       /*!< Property ID identifying a Generic User Property */
} esp_ble_mesh_gen_user_property_get_t;

/** Parameters of Generic User Property Set. */
typedef struct {
    uint16_t property_id;   /*!< Property ID identifying a Generic User Property */
    struct net_buf_simple *property_value;  /*!< Raw value for the User Property */
} esp_ble_mesh_gen_user_property_set_t;

/** Parameter of Generic Admin Property Get. */
typedef struct {
    uint16_t property_id;   /*!< Property ID identifying a Generic Admin Property */
} esp_ble_mesh_gen_admin_property_get_t;

/** Parameters of Generic Admin Property Set. */
typedef struct {
    uint16_t property_id;   /*!< Property ID identifying a Generic Admin Property */
    uint8_t  user_access;   /*!< Enumeration indicating user access */
    struct net_buf_simple *property_value;  /*!< Raw value for the Admin Property */
} esp_ble_mesh_gen_admin_property_set_t;

/** Parameter of Generic Manufacturer Property Get. */
typedef struct {
    uint16_t property_id;   /*!< Property ID identifying a Generic Manufacturer Property */
} esp_ble_mesh_gen_manufacturer_property_get_t;

/** Parameters of Generic Manufacturer Property Set. */
typedef struct {
    uint16_t property_id;   /*!< Property ID identifying a Generic Manufacturer Property */
    uint8_t  user_access;   /*!< Enumeration indicating user access */
} esp_ble_mesh_gen_manufacturer_property_set_t;

/** Parameter of Generic Client Properties Get. */
typedef struct {
    uint16_t property_id;   /*!< A starting Client Property ID present within an element */
} esp_ble_mesh_gen_client_properties_get_t;

/**
 * @brief Generic Client Model get message union
 */
typedef union {
    esp_ble_mesh_gen_user_property_get_t         user_property_get;         /*!< For ESP_BLE_MESH_MODEL_OP_GEN_USER_PROPERTY_GET */
    esp_ble_mesh_gen_admin_property_get_t        admin_property_get;        /*!< For ESP_BLE_MESH_MODEL_OP_GEN_ADMIN_PROPERTY_GET*/
    esp_ble_mesh_gen_manufacturer_property_get_t manufacturer_property_get; /*!< For ESP_BLE_MESH_MODEL_OP_GEN_MANUFACTURER_PROPERTY_SET */
    esp_ble_mesh_gen_client_properties_get_t     client_properties_get;     /*!< For ESP_BLE_MESH_MODEL_OP_GEN_CLIENT_PROPERTIES_GET */
} esp_ble_mesh_generic_client_get_state_t;

/**
 * @brief Generic Client Model set message union
 */
typedef union {
    esp_ble_mesh_gen_onoff_set_t          onoff_set;            /*!< For ESP_BLE_MESH_MODEL_OP_GEN_ONOFF_SET & ESP_BLE_MESH_MODEL_OP_GEN_ONOFF_SET_UNACK */
    esp_ble_mesh_gen_level_set_t          level_set;            /*!< For ESP_BLE_MESH_MODEL_OP_GEN_LEVEL_SET & ESP_BLE_MESH_MODEL_OP_GEN_LEVEL_SET_UNACK */
    esp_ble_mesh_gen_delta_set_t          delta_set;            /*!< For ESP_BLE_MESH_MODEL_OP_GEN_DELTA_SET & ESP_BLE_MESH_MODEL_OP_GEN_DELTA_SET_UNACK */
    esp_ble_mesh_gen_move_set_t           move_set;             /*!< For ESP_BLE_MESH_MODEL_OP_GEN_MOVE_SET & ESP_BLE_MESH_MODEL_OP_GEN_MOVE_SET_UNACK */
    esp_ble_mesh_gen_def_trans_time_set_t def_trans_time_set;   /*!< For ESP_BLE_MESH_MODEL_OP_GEN_DEF_TRANS_TIME_SET & ESP_BLE_MESH_MODEL_OP_GEN_DEF_TRANS_TIME_SET_UNACK */
    esp_ble_mesh_gen_onpowerup_set_t      power_set;            /*!< For ESP_BLE_MESH_MODEL_OP_GEN_ONPOWERUP_SET & ESP_BLE_MESH_MODEL_OP_GEN_ONPOWERUP_SET_UNACK */
    esp_ble_mesh_gen_power_level_set_t    power_level_set;      /*!< For ESP_BLE_MESH_MODEL_OP_GEN_POWER_LEVEL_SET & ESP_BLE_MESH_MODEL_OP_GEN_POWER_LEVEL_SET_UNACK */
    esp_ble_mesh_gen_power_default_set_t  power_default_set;    /*!< For ESP_BLE_MESH_MODEL_OP_GEN_POWER_DEFAULT_SET & ESP_BLE_MESH_MODEL_OP_GEN_POWER_DEFAULT_SET_UNACK */
    esp_ble_mesh_gen_power_range_set_t    power_range_set;      /*!< For ESP_BLE_MESH_MODEL_OP_GEN_POWER_RANGE_SET & ESP_BLE_MESH_MODEL_OP_GEN_POWER_RANGE_SET_UNACK */
    esp_ble_mesh_gen_loc_global_set_t     loc_global_set;       /*!< For ESP_BLE_MESH_MODEL_OP_GEN_LOC_GLOBAL_SET & ESP_BLE_MESH_MODEL_OP_GEN_LOC_GLOBAL_SET_UNACK */
    esp_ble_mesh_gen_loc_local_set_t      loc_local_set;        /*!< For ESP_BLE_MESH_MODEL_OP_GEN_LOC_LOCAL_SET & ESP_BLE_MESH_MODEL_OP_GEN_LOC_LOCAL_SET_UNACK */
    esp_ble_mesh_gen_user_property_set_t  user_property_set;    /*!< For ESP_BLE_MESH_MODEL_OP_GEN_USER_PROPERTY_SET & ESP_BLE_MESH_MODEL_OP_GEN_USER_PROPERTY_SET_UNACK */
    esp_ble_mesh_gen_admin_property_set_t admin_property_set;   /*!< For ESP_BLE_MESH_MODEL_OP_GEN_ADMIN_PROPERTY_SET & ESP_BLE_MESH_MODEL_OP_GEN_ADMIN_PROPERTY_SET_UNACK */
    esp_ble_mesh_gen_manufacturer_property_set_t manufacturer_property_set; /*!< For ESP_BLE_MESH_MODEL_OP_GEN_MANUFACTURER_PROPERTY_SET & ESP_BLE_MESH_MODEL_OP_GEN_MANUFACTURER_PROPERTY_SET_UNACK */
} esp_ble_mesh_generic_client_set_state_t;

/**
 *  @brief Bluetooth Mesh Generic Client Model Get and Set callback parameters structure.
 */

/** Parameters of Generic OnOff Status. */
typedef struct {
    bool    op_en;          /*!< Indicate if optional parameters are included */
    uint8_t present_onoff;  /*!< Current value of Generic OnOff state */
    uint8_t target_onoff;   /*!< Target value of Generic OnOff state (optional) */
    uint8_t remain_time;    /*!< Time to complete state transition (C.1) */
} esp_ble_mesh_gen_onoff_status_cb_t;

/** Parameters of Generic Level Status. */
typedef struct {
    bool    op_en;          /*!< Indicate if optional parameters are included */
    int16_t present_level;  /*!< Current value of Generic Level state */
    int16_t target_level;   /*!< Target value of the Generic Level state (optional) */
    uint8_t remain_time;    /*!< Time to complete state transition (C.1) */
} esp_ble_mesh_gen_level_status_cb_t;

/** Parameter of Generic Default Transition Time Status. */
typedef struct {
    uint8_t trans_time;     /*!< The value of the Generic Default Transition Time state */
} esp_ble_mesh_gen_def_trans_time_status_cb_t;

/** Parameter of Generic OnPowerUp Status. */
typedef struct {
    uint8_t onpowerup;      /*!< The value of the Generic OnPowerUp state */
} esp_ble_mesh_gen_onpowerup_status_cb_t;

/** Parameters of Generic Power Level Status. */
typedef struct {
    bool     op_en;         /*!< Indicate if optional parameters are included */
    uint16_t present_power; /*!< Current value of Generic Power Actual state */
    uint16_t target_power;  /*!< Target value of Generic Power Actual state (optional) */
    uint8_t  remain_time;   /*!< Time to complete state transition (C.1) */
} esp_ble_mesh_gen_power_level_status_cb_t;

/** Parameter of Generic Power Last Status. */
typedef struct {
    uint16_t power;         /*!< The value of the Generic Power Last state */
} esp_ble_mesh_gen_power_last_status_cb_t;

/** Parameter of Generic Power Default Status. */
typedef struct {
    uint16_t power;         /*!< The value of the Generic Default Last state */
} esp_ble_mesh_gen_power_default_status_cb_t;

/** Parameters of Generic Power Range Status. */
typedef struct {
    uint8_t  status_code;   /*!< Status Code for the request message */
    uint16_t range_min;     /*!< Value of Range Min field of Generic Power Range state */
    uint16_t range_max;     /*!< Value of Range Max field of Generic Power Range state */
} esp_ble_mesh_gen_power_range_status_cb_t;

/** Parameters of Generic Battery Status. */
typedef struct {
    uint32_t battery_level     : 8;  /*!< Value of Generic Battery Level state */
    uint32_t time_to_discharge : 24; /*!< Value of Generic Battery Time to Discharge state */
    uint32_t time_to_charge    : 24; /*!< Value of Generic Battery Time to Charge state */
    uint32_t flags             : 8;  /*!< Value of Generic Battery Flags state */
} esp_ble_mesh_gen_battery_status_cb_t;

/** Parameters of Generic Location Global Status. */
typedef struct {
    int32_t global_latitude;  /*!< Global Coordinates (Latitude) */
    int32_t global_longitude; /*!< Global Coordinates (Longitude) */
    int16_t global_altitude;  /*!< Global Altitude */
} esp_ble_mesh_gen_loc_global_status_cb_t;

/** Parameters of Generic Location Local Status. */
typedef struct {
    int16_t  local_north;     /*!< Local Coordinates (North) */
    int16_t  local_east;      /*!< Local Coordinates (East) */
    int16_t  local_altitude;  /*!< Local Altitude */
    uint8_t  floor_number;    /*!< Floor Number */
    uint16_t uncertainty;     /*!< Uncertainty */
} esp_ble_mesh_gen_loc_local_status_cb_t;

/** Parameter of Generic User Properties Status. */
typedef struct {
    struct net_buf_simple *property_ids;    /*!< Buffer contains a sequence of N User Property IDs */
} esp_ble_mesh_gen_user_properties_status_cb_t;

/** Parameters of Generic User Property Status. */
typedef struct {
    bool     op_en;         /*!< Indicate if optional parameters are included */
    uint16_t property_id;   /*!< Property ID identifying a Generic User Property */
    uint8_t  user_access;   /*!< Enumeration indicating user access (optional) */
    struct net_buf_simple *property_value;  /*!< Raw value for the User Property (C.1) */
} esp_ble_mesh_gen_user_property_status_cb_t;

/** Parameter of Generic Admin Properties Status. */
typedef struct {
    struct net_buf_simple *property_ids; /*!< Buffer contains a sequence of N Admin Property IDs */
} esp_ble_mesh_gen_admin_properties_status_cb_t;

/** Parameters of Generic Admin Property Status. */
typedef struct {
    bool     op_en;         /*!< Indicate if optional parameters are included */
    uint16_t property_id;   /*!< Property ID identifying a Generic Admin Property */
    uint8_t  user_access;   /*!< Enumeration indicating user access (optional) */
    struct net_buf_simple *property_value;  /*!< Raw value for the Admin Property (C.1) */
} esp_ble_mesh_gen_admin_property_status_cb_t;

/** Parameter of Generic Manufacturer Properties Status. */
typedef struct {
    struct net_buf_simple *property_ids;    /*!< Buffer contains a sequence of N Manufacturer Property IDs */
} esp_ble_mesh_gen_manufacturer_properties_status_cb_t;

/** Parameters of Generic Manufacturer Property Status. */
typedef struct {
    bool     op_en;         /*!< Indicate if optional parameters are included */
    uint16_t property_id;   /*!< Property ID identifying a Generic Manufacturer Property */
    uint8_t  user_access;   /*!< Enumeration indicating user access (optional) */
    struct net_buf_simple *property_value;  /*!< Raw value for the Manufacturer Property (C.1) */
} esp_ble_mesh_gen_manufacturer_property_status_cb_t;

/** Parameter of Generic Client Properties Status. */
typedef struct {
    struct net_buf_simple *property_ids;    /*!< Buffer contains a sequence of N Client Property IDs */
} esp_ble_mesh_gen_client_properties_status_cb_t;

/**
 * @brief Generic Client Model received message union
 */
typedef union {
    esp_ble_mesh_gen_onoff_status_cb_t             onoff_status;            /*!< For ESP_BLE_MESH_MODEL_OP_GEN_ONOFF_STATUS */
    esp_ble_mesh_gen_level_status_cb_t             level_status;            /*!< For ESP_BLE_MESH_MODEL_OP_GEN_LEVEL_STATUS */
    esp_ble_mesh_gen_def_trans_time_status_cb_t    def_trans_time_status;   /*!< For ESP_BLE_MESH_MODEL_OP_GEN_DEF_TRANS_TIME_STATUS */
    esp_ble_mesh_gen_onpowerup_status_cb_t         onpowerup_status;        /*!< For ESP_BLE_MESH_MODEL_OP_GEN_ONPOWERUP_STATUS */
    esp_ble_mesh_gen_power_level_status_cb_t       power_level_status;      /*!< For ESP_BLE_MESH_MODEL_OP_GEN_POWER_LEVEL_STATUS */
    esp_ble_mesh_gen_power_last_status_cb_t        power_last_status;       /*!< For ESP_BLE_MESH_MODEL_OP_GEN_POWER_LAST_STATUS */
    esp_ble_mesh_gen_power_default_status_cb_t     power_default_status;    /*!< For ESP_BLE_MESH_MODEL_OP_GEN_POWER_DEFAULT_STATUS */
    esp_ble_mesh_gen_power_range_status_cb_t       power_range_status;      /*!< For ESP_BLE_MESH_MODEL_OP_GEN_POWER_RANGE_STATUS */
    esp_ble_mesh_gen_battery_status_cb_t           battery_status;          /*!< For ESP_BLE_MESH_MODEL_OP_GEN_BATTERY_STATUS */
    esp_ble_mesh_gen_loc_global_status_cb_t        location_global_status;  /*!< For ESP_BLE_MESH_MODEL_OP_GEN_LOC_GLOBAL_STATUS */
    esp_ble_mesh_gen_loc_local_status_cb_t         location_local_status;   /*!< ESP_BLE_MESH_MODEL_OP_GEN_LOC_LOCAL_STATUS */
    esp_ble_mesh_gen_user_properties_status_cb_t   user_properties_status;  /*!< ESP_BLE_MESH_MODEL_OP_GEN_USER_PROPERTIES_STATUS */
    esp_ble_mesh_gen_user_property_status_cb_t     user_property_status;    /*!< ESP_BLE_MESH_MODEL_OP_GEN_USER_PROPERTY_STATUS */
    esp_ble_mesh_gen_admin_properties_status_cb_t  admin_properties_status; /*!< ESP_BLE_MESH_MODEL_OP_GEN_ADMIN_PROPERTIES_STATUS */
    esp_ble_mesh_gen_admin_property_status_cb_t    admin_property_status;   /*!< ESP_BLE_MESH_MODEL_OP_GEN_ADMIN_PROPERTY_STATUS */
    esp_ble_mesh_gen_manufacturer_properties_status_cb_t manufacturer_properties_status; /*!< ESP_BLE_MESH_MODEL_OP_GEN_MANUFACTURER_PROPERTIES_STATUS */
    esp_ble_mesh_gen_manufacturer_property_status_cb_t   manufacturer_property_status;   /*!< ESP_BLE_MESH_MODEL_OP_GEN_MANUFACTURER_PROPERTY_STATUS */
    esp_ble_mesh_gen_client_properties_status_cb_t       client_properties_status;       /*!< ESP_BLE_MESH_MODEL_OP_GEN_CLIENT_PROPERTIES_STATUS */
} esp_ble_mesh_gen_client_status_cb_t;

/** Generic Client Model callback parameters */
typedef struct {
    int error_code;                                 /*!< Appropriate error code */
    esp_ble_mesh_client_common_param_t *params;     /*!< The client common parameters. */
    esp_ble_mesh_gen_client_status_cb_t status_cb;  /*!< The generic status message callback values */
} esp_ble_mesh_generic_client_cb_param_t;

/** This enum value is the event of Generic Client Model */
typedef enum {
    ESP_BLE_MESH_GENERIC_CLIENT_GET_STATE_EVT,
    ESP_BLE_MESH_GENERIC_CLIENT_SET_STATE_EVT,
    ESP_BLE_MESH_GENERIC_CLIENT_PUBLISH_EVT,
    ESP_BLE_MESH_GENERIC_CLIENT_TIMEOUT_EVT,
    ESP_BLE_MESH_GENERIC_CLIENT_EVT_MAX,
} esp_ble_mesh_generic_client_cb_event_t;

/**
 *  @brief Bluetooth Mesh Generic Client Model function.
 */

/**
 * @brief   Generic Client Model callback function type
 * @param   event: Event type
 * @param   param: Pointer to callback parameter
 */
typedef void (* esp_ble_mesh_generic_client_cb_t)(esp_ble_mesh_generic_client_cb_event_t event,
                                                  esp_ble_mesh_generic_client_cb_param_t *param);

/**
 * @brief       Register BLE Mesh Generic Client Model callback.
 *
 * @param[in]   callback: Pointer to the callback function.
 *
 * @return      ESP_OK on success or error code otherwise.
 *
 */
esp_err_t esp_ble_mesh_register_generic_client_callback(esp_ble_mesh_generic_client_cb_t callback);

/**
 * @brief       Get the value of Generic Server Model states using the Generic Client Model get messages.
 *
 * @note        If you want to find the opcodes and corresponding meanings accepted by this API,
 *              please refer to esp_ble_mesh_generic_message_opcode_t in esp_ble_mesh_defs.h
 *
 * @param[in]   params:    Pointer to BLE Mesh common client parameters.
 * @param[in]   get_state: Pointer to generic get message value.
 *                         Shall not be set to NULL.
 *
 * @return      ESP_OK on success or error code otherwise.
 *
 */
esp_err_t esp_ble_mesh_generic_client_get_state(esp_ble_mesh_client_common_param_t *params,
                                                esp_ble_mesh_generic_client_get_state_t *get_state);

/**
 * @brief       Set the value of Generic Server Model states using the Generic Client Model set messages.
 *
 * @note        If you want to find the opcodes and corresponding meanings accepted by this API,
 *              please refer to esp_ble_mesh_generic_message_opcode_t in esp_ble_mesh_defs.h
 *
 * @param[in]   params:    Pointer to BLE Mesh common client parameters.
 * @param[in]   set_state: Pointer to generic set message value.
 *                         Shall not be set to NULL.
 *
 * @return      ESP_OK on success or error code otherwise.
 *
 */
esp_err_t esp_ble_mesh_generic_client_set_state(esp_ble_mesh_client_common_param_t *params,
                                                esp_ble_mesh_generic_client_set_state_t *set_state);

/**
 * @brief Generic Server Models related context.
 */

/** @def    ESP_BLE_MESH_MODEL_GEN_ONOFF_SRV
 *
 *  @brief  Define a new Generic OnOff Server Model.
 *
 *  @note   1. The Generic OnOff Server Model is a root model.
 *          2. This model shall support model publication and model subscription.
 *
 *  @param  srv_pub  Pointer to the unique struct esp_ble_mesh_model_pub_t.
 *  @param  srv_data Pointer to the unique struct esp_ble_mesh_gen_onoff_srv_t.
 *
 *  @return New Generic OnOff Server Model instance.
 */
#define ESP_BLE_MESH_MODEL_GEN_ONOFF_SRV(srv_pub, srv_data)             \
        ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_GEN_ONOFF_SRV,     \
                    NULL, srv_pub, srv_data)

/** @def    ESP_BLE_MESH_MODEL_GEN_LEVEL_SRV
 *
 *  @brief  Define a new Generic Level Server Model.
 *
 *  @note   1. The Generic Level Server Model is a root model.
 *          2. This model shall support model publication and model subscription.
 *
 *  @param  srv_pub  Pointer to the unique struct esp_ble_mesh_model_pub_t.
 *  @param  srv_data Pointer to the unique struct esp_ble_mesh_gen_level_srv_t.
 *
 *  @return New Generic Level Server Model instance.
 */
#define ESP_BLE_MESH_MODEL_GEN_LEVEL_SRV(srv_pub, srv_data)             \
        ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_GEN_LEVEL_SRV,     \
                    NULL, srv_pub, srv_data)

/** @def    ESP_BLE_MESH_MODEL_GEN_DEF_TRANS_TIME_SRV
 *
 *  @brief  Define a new Generic Default Transition Time Server Model.
 *
 *  @note   1. The Generic Default Transition Time Server Model is a root model.
 *          2. This model shall support model publication and model subscription.
 *
 *  @param  srv_pub  Pointer to the unique struct esp_ble_mesh_model_pub_t.
 *  @param  srv_data Pointer to the unique struct esp_ble_mesh_gen_def_trans_time_srv_t.
 *
 *  @return New Generic Default Transition Time Server Model instance.
 */
#define ESP_BLE_MESH_MODEL_GEN_DEF_TRANS_TIME_SRV(srv_pub, srv_data)             \
        ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_GEN_DEF_TRANS_TIME_SRV,     \
                    NULL, srv_pub, srv_data)

/** @def    ESP_BLE_MESH_MODEL_GEN_POWER_ONOFF_SRV
 *
 *  @brief  Define a new Generic Power OnOff Server Model.
 *
 *  @note   1. The Generic Power OnOff Server model extends the Generic OnOff Server
 *             model. When this model is present on an element, the corresponding
 *             Generic Power OnOff Setup Server model shall also be present.
 *          2. This model may be used to represent a variety of devices that do not
 *             fit any of the model descriptions that have been defined but support
 *             the generic properties of On/Off.
 *          3. This model shall support model publication and model subscription.
 *
 *  @param  srv_pub  Pointer to the unique struct esp_ble_mesh_model_pub_t.
 *  @param  srv_data Pointer to the unique struct esp_ble_mesh_gen_power_onoff_srv_t.
 *
 *  @return New Generic Power OnOff Server Model instance.
 */
#define ESP_BLE_MESH_MODEL_GEN_POWER_ONOFF_SRV(srv_pub, srv_data)             \
        ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_GEN_POWER_ONOFF_SRV,     \
                    NULL, srv_pub, srv_data)

/** @def    ESP_BLE_MESH_MODEL_GEN_POWER_ONOFF_SETUP_SRV
 *
 *  @brief  Define a new Generic Power OnOff Setup Server Model.
 *
 *  @note   1. The Generic Power OnOff Setup Server model extends the Generic Power
 *             OnOff Server model and the Generic Default Transition Time Server model.
 *          2. This model shall support model subscription.
 *
 *  @param  srv_pub  Pointer to the unique struct esp_ble_mesh_model_pub_t.
 *  @param  srv_data Pointer to the unique struct esp_ble_mesh_gen_power_onoff_setup_srv_t.
 *
 *  @return New Generic Power OnOff Setup Server Model instance.
 */
#define ESP_BLE_MESH_MODEL_GEN_POWER_ONOFF_SETUP_SRV(srv_pub, srv_data)             \
        ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_GEN_POWER_ONOFF_SETUP_SRV,     \
                    NULL, srv_pub, srv_data)

/** @def    ESP_BLE_MESH_MODEL_GEN_POWER_LEVEL_SRV
 *
 *  @brief  Define a new Generic Power Level Server Model.
 *
 *  @note   1. The Generic Power Level Server model extends the Generic Power OnOff
 *             Server model and the Generic Level Server model. When this model is
 *             present on an Element, the corresponding Generic Power Level Setup
 *             Server model shall also be present.
 *          2. This model shall support model publication and model subscription.
 *
 *  @param  srv_pub  Pointer to the unique struct esp_ble_mesh_model_pub_t.
 *  @param  srv_data Pointer to the unique struct esp_ble_mesh_gen_power_level_srv_t.
 *
 *  @return New Generic Power Level Server Model instance.
 */
#define ESP_BLE_MESH_MODEL_GEN_POWER_LEVEL_SRV(srv_pub, srv_data)             \
        ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_GEN_POWER_LEVEL_SRV,     \
                    NULL, srv_pub, srv_data)

/** @def    ESP_BLE_MESH_MODEL_GEN_POWER_LEVEL_SETUP_SRV
 *
 *  @brief  Define a new Generic Power Level Setup Server Model.
 *
 *  @note   1. The Generic Power Level Setup Server model extends the Generic Power
 *             Level Server model and the Generic Power OnOff Setup Server model.
 *          2. This model shall support model subscription.
 *
 *  @param  srv_pub  Pointer to the unique struct esp_ble_mesh_model_pub_t.
 *  @param  srv_data Pointer to the unique struct esp_ble_mesh_gen_power_level_setup_srv_t.
 *
 *  @return New Generic Power Level Setup Server Model instance.
 */
#define ESP_BLE_MESH_MODEL_GEN_POWER_LEVEL_SETUP_SRV(srv_pub, srv_data)             \
        ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_GEN_POWER_LEVEL_SETUP_SRV,     \
                    NULL, srv_pub, srv_data)

/** @def    ESP_BLE_MESH_MODEL_GEN_BATTERY_SRV
 *
 *  @brief  Define a new Generic Battery Server Model.
 *
 *  @note   1. The Generic Battery Server Model is a root model.
 *          2. This model shall support model publication and model subscription.
 *          3. The model may be used to represent an element that is powered by a battery.
 *
 *  @param  srv_pub  Pointer to the unique struct esp_ble_mesh_model_pub_t.
 *  @param  srv_data Pointer to the unique struct esp_ble_mesh_gen_battery_srv_t.
 *
 *  @return New Generic Battery Server Model instance.
 */
#define ESP_BLE_MESH_MODEL_GEN_BATTERY_SRV(srv_pub, srv_data)             \
        ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_GEN_BATTERY_SRV,     \
                    NULL, srv_pub, srv_data)

/** @def    ESP_BLE_MESH_MODEL_GEN_LOCATION_SRV
 *
 *  @brief  Define a new Generic Location Server Model.
 *
 *  @note   1. The Generic Location Server model is a root model. When this model
 *             is present on an Element, the corresponding Generic Location Setup
 *             Server model shall also be present.
 *          2. This model shall support model publication and model subscription.
 *          3. The model may be used to represent an element that knows its
 *             location (global or local).
 *
 *  @param  srv_pub  Pointer to the unique struct esp_ble_mesh_model_pub_t.
 *  @param  srv_data Pointer to the unique struct esp_ble_mesh_gen_location_srv_t.
 *
 *  @return New Generic Location Server Model instance.
 */
#define ESP_BLE_MESH_MODEL_GEN_LOCATION_SRV(srv_pub, srv_data)             \
        ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_GEN_LOCATION_SRV,     \
                    NULL, srv_pub, srv_data)

/** @def    ESP_BLE_MESH_MODEL_GEN_LOCATION_SETUP_SRV
 *
 *  @brief  Define a new Generic Location Setup Server Model.
 *
 *  @note   1. The Generic Location Setup Server model extends the Generic Location
 *             Server model.
 *          2. This model shall support model subscription.
 *
 *  @param  srv_pub  Pointer to the unique struct esp_ble_mesh_model_pub_t.
 *  @param  srv_data Pointer to the unique struct esp_ble_mesh_gen_location_setup_srv_t.
 *
 *  @return New Generic Location Setup Server Model instance.
 */
#define ESP_BLE_MESH_MODEL_GEN_LOCATION_SETUP_SRV(srv_pub, srv_data)             \
        ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_GEN_LOCATION_SETUP_SRV,     \
                    NULL, srv_pub, srv_data)

/** @def    ESP_BLE_MESH_MODEL_GEN_USER_PROP_SRV
 *
 *  @brief  Define a new Generic User Property Server Model.
 *
 *  @note   1. The Generic User Property Server model is a root model.
 *          2. This model shall support model publication and model subscription.
 *
 *  @param  srv_pub  Pointer to the unique struct esp_ble_mesh_model_pub_t.
 *  @param  srv_data Pointer to the unique struct esp_ble_mesh_gen_user_prop_srv_t.
 *
 *  @return New Generic User Property Server Model instance.
 */
#define ESP_BLE_MESH_MODEL_GEN_USER_PROP_SRV(srv_pub, srv_data)             \
        ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_GEN_USER_PROP_SRV,     \
                    NULL, srv_pub, srv_data)

/** @def    ESP_BLE_MESH_MODEL_GEN_ADMIN_PROP_SRV
 *
 *  @brief  Define a new Generic Admin Property Server Model.
 *
 *  @note   1. The Generic Admin Property Server model extends the Generic User
 *             Property Server model.
 *          2. This model shall support model publication and model subscription.
 *
 *  @param  srv_pub  Pointer to the unique struct esp_ble_mesh_model_pub_t.
 *  @param  srv_data Pointer to the unique struct esp_ble_mesh_gen_admin_prop_srv_t.
 *
 *  @return New Generic Admin Property Server Model instance.
 */
#define ESP_BLE_MESH_MODEL_GEN_ADMIN_PROP_SRV(srv_pub, srv_data)            \
        ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_GEN_ADMIN_PROP_SRV,    \
                    NULL, srv_pub, srv_data)

/** @def    ESP_BLE_MESH_MODEL_GEN_MANUFACTURER_PROP_SRV
 *
 *  @brief  Define a new Generic Manufacturer Property Server Model.
 *
 *  @note   1. The Generic Manufacturer Property Server model extends the Generic
 *             User Property Server model.
 *          2. This model shall support model publication and model subscription.
 *
 *  @param  srv_pub  Pointer to the unique struct esp_ble_mesh_model_pub_t.
 *  @param  srv_data Pointer to the unique struct esp_ble_mesh_gen_manu_prop_srv_t.
 *
 *  @return New Generic Manufacturer Property Server Model instance.
 */
#define ESP_BLE_MESH_MODEL_GEN_MANUFACTURER_PROP_SRV(srv_pub, srv_data)            \
        ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_GEN_MANUFACTURER_PROP_SRV,    \
                    NULL, srv_pub, srv_data)

/** @def    ESP_BLE_MESH_MODEL_GEN_CLIENT_PROP_SRV
 *
 *  @brief  Define a new Generic User Property Server Model.
 *
 *  @note   1. The Generic Client Property Server model is a root model.
 *          2. This model shall support model publication and model subscription.
 *
 *  @param  srv_pub  Pointer to the unique struct esp_ble_mesh_model_pub_t.
 *  @param  srv_data Pointer to the unique struct esp_ble_mesh_gen_client_prop_srv_t.
 *
 *  @return New Generic Client Property Server Model instance.
 */
#define ESP_BLE_MESH_MODEL_GEN_CLIENT_PROP_SRV(srv_pub, srv_data)             \
        ESP_BLE_MESH_SIG_MODEL(ESP_BLE_MESH_MODEL_ID_GEN_CLIENT_PROP_SRV,     \
                    NULL, srv_pub, srv_data)

/** Parameters of Generic OnOff state */
typedef struct {
    uint8_t onoff;          /*!< The present value of the Generic OnOff state */
    uint8_t target_onoff;   /*!< The target value of the Generic OnOff state */
} esp_ble_mesh_gen_onoff_state_t;

/** User data of Generic OnOff Server Model */
typedef struct {
    esp_ble_mesh_model_t *model;                /*!< Pointer to the Generic OnOff Server Model. Initialized internally. */
    esp_ble_mesh_server_rsp_ctrl_t rsp_ctrl;    /*!< Response control of the server model received messages */
    esp_ble_mesh_gen_onoff_state_t state;       /*!< Parameters of the Generic OnOff state */
    esp_ble_mesh_last_msg_info_t last;          /*!< Parameters of the last received set message */
    esp_ble_mesh_state_transition_t transition; /*!< Parameters of state transition */
} esp_ble_mesh_gen_onoff_srv_t;

/** Parameters of Generic Level state */
typedef struct {
    int16_t level;          /*!< The present value of the Generic Level state */
    int16_t target_level;   /*!< The target value of the Generic Level state */

    /**
     * When a new transaction starts, level should be set to last_last, and use
     * "level + incoming delta" to calculate the target level. In another word,
     * "last_level" is used to record "level" of the last transaction, and
     * "last_delta" is used to record the previously received delta_level value.
     */
    int16_t last_level; /*!< The last value of the Generic Level state */
    int32_t last_delta; /*!< The last delta change of the Generic Level state */

    bool move_start;    /*!< Indicate if the transition of the Generic Level state has been started */
    bool positive;      /*!< Indicate if the transition is positive or negative */
} esp_ble_mesh_gen_level_state_t;

/** User data of Generic Level Server Model */
typedef struct {
    esp_ble_mesh_model_t *model;                /*!< Pointer to the Generic Level Server Model. Initialized internally. */
    esp_ble_mesh_server_rsp_ctrl_t rsp_ctrl;    /*!< Response control of the server model received messages */
    esp_ble_mesh_gen_level_state_t state;       /*!< Parameters of the Generic Level state */
    esp_ble_mesh_last_msg_info_t last;          /*!< Parameters of the last received set message */
    esp_ble_mesh_state_transition_t transition; /*!< Parameters of state transition */
    int32_t tt_delta_level;                     /*!< Delta change value of level state transition */
} esp_ble_mesh_gen_level_srv_t;

/** Parameter of Generic Default Transition Time state */
typedef struct {
    uint8_t trans_time;     /*!< The value of the Generic Default Transition Time state */
} esp_ble_mesh_gen_def_trans_time_state_t;

/** User data of Generic Default Transition Time Server Model */
typedef struct {
    esp_ble_mesh_model_t *model;                    /*!< Pointer to the Generic Default Transition Time Server Model. Initialized internally. */
    esp_ble_mesh_server_rsp_ctrl_t rsp_ctrl;        /*!< Response control of the server model received messages */
    esp_ble_mesh_gen_def_trans_time_state_t state;  /*!< Parameters of the Generic Default Transition Time state */
} esp_ble_mesh_gen_def_trans_time_srv_t;

/** Parameter of Generic OnPowerUp state */
typedef struct {
    uint8_t onpowerup;      /*!< The value of the Generic OnPowerUp state */
} esp_ble_mesh_gen_onpowerup_state_t;

/** User data of Generic Power OnOff Server Model */
typedef struct {
    esp_ble_mesh_model_t *model;                /*!< Pointer to the Generic Power OnOff Server Model. Initialized internally. */
    esp_ble_mesh_server_rsp_ctrl_t rsp_ctrl;    /*!< Response control of the server model received messages */
    esp_ble_mesh_gen_onpowerup_state_t *state;  /*!< Parameters of the Generic OnPowerUp state */
} esp_ble_mesh_gen_power_onoff_srv_t;

/** User data of Generic Power OnOff Setup Server Model */
typedef struct {
    esp_ble_mesh_model_t *model;                /*!< Pointer to the Generic Power OnOff Setup Server Model. Initialized internally. */
    esp_ble_mesh_server_rsp_ctrl_t rsp_ctrl;    /*!< Response control of the server model received messages */
    esp_ble_mesh_gen_onpowerup_state_t *state;  /*!< Parameters of the Generic OnPowerUp state */
} esp_ble_mesh_gen_power_onoff_setup_srv_t;

/** Parameters of Generic Power Level state */
typedef struct {
    uint16_t power_actual;          /*!< The present value of the Generic Power Actual state */
    uint16_t target_power_actual;   /*!< The target value of the Generic Power Actual state */

    uint16_t power_last;            /*!< The value of the Generic Power Last state */
    uint16_t power_default;         /*!< The value of the Generic Power Default state */

    uint8_t  status_code;           /*!< The status code of setting Generic Power Range state */
    uint16_t power_range_min;       /*!< The minimum value of the Generic Power Range state */
    uint16_t power_range_max;       /*!< The maximum value of the Generic Power Range state */
} esp_ble_mesh_gen_power_level_state_t;

/** User data of Generic Power Level Server Model */
typedef struct {
    esp_ble_mesh_model_t *model;                    /*!< Pointer to the Generic Power Level Server Model. Initialized internally. */
    esp_ble_mesh_server_rsp_ctrl_t rsp_ctrl;        /*!< Response control of the server model received messages */
    esp_ble_mesh_gen_power_level_state_t *state;    /*!< Parameters of the Generic Power Level state */
    esp_ble_mesh_last_msg_info_t last;              /*!< Parameters of the last received set message */
    esp_ble_mesh_state_transition_t transition;     /*!< Parameters of state transition */
    int32_t tt_delta_level;                         /*!< Delta change value of level state transition */
} esp_ble_mesh_gen_power_level_srv_t;

/** User data of Generic Power Level Setup Server Model */
typedef struct {
    esp_ble_mesh_model_t *model;                    /*!< Pointer to the Generic Power Level Setup Server Model. Initialized internally. */
    esp_ble_mesh_server_rsp_ctrl_t rsp_ctrl;        /*!< Response control of the server model received messages */
    esp_ble_mesh_gen_power_level_state_t *state;    /*!< Parameters of the Generic Power Level state */
} esp_ble_mesh_gen_power_level_setup_srv_t;

/** Parameters of Generic Battery state */
typedef struct {
    uint32_t battery_level : 8,         /*!< The value of the Generic Battery Level state */
             time_to_discharge : 24;    /*!< The value of the Generic Battery Time to Discharge state */
    uint32_t time_to_charge : 24,       /*!< The value of the Generic Battery Time to Charge state */
             battery_flags : 8;         /*!< The value of the Generic Battery Flags state */
} esp_ble_mesh_gen_battery_state_t;

/** User data of Generic Battery Server Model */
typedef struct {
    esp_ble_mesh_model_t *model;                /*!< Pointer to the Generic Battery Server Model. Initialized internally. */
    esp_ble_mesh_server_rsp_ctrl_t rsp_ctrl;    /*!< Response control of the server model received messages */
    esp_ble_mesh_gen_battery_state_t state;     /*!< Parameters of the Generic Battery state */
} esp_ble_mesh_gen_battery_srv_t;

/** Parameters of Generic Location state */
typedef struct {
    int32_t  global_latitude;   /*!< The value of the Global Latitude field */
    int32_t  global_longitude;  /*!< The value of the Global Longitude field */
    int16_t  global_altitude;   /*!< The value of the Global Altitude field */
    int16_t  local_north;       /*!< The value of the Local North field */
    int16_t  local_east;        /*!< The value of the Local East field */
    int16_t  local_altitude;    /*!< The value of the Local Altitude field */
    uint8_t  floor_number;      /*!< The value of the Floor Number field */
    uint16_t uncertainty;       /*!< The value of the Uncertainty field */
} esp_ble_mesh_gen_location_state_t;

/** User data of Generic Location Server Model */
typedef struct {
    esp_ble_mesh_model_t *model;                /*!< Pointer to the Generic Location Server Model. Initialized internally. */
    esp_ble_mesh_server_rsp_ctrl_t rsp_ctrl;    /*!< Response control of the server model received messages */
    esp_ble_mesh_gen_location_state_t *state;   /*!< Parameters of the Generic Location state */
} esp_ble_mesh_gen_location_srv_t;

/** User data of Generic Location Setup Server Model */
typedef struct {
    esp_ble_mesh_model_t *model;                /*!< Pointer to the Generic Location Setup Server Model. Initialized internally. */
    esp_ble_mesh_server_rsp_ctrl_t rsp_ctrl;    /*!< Response control of the server model received messages */
    esp_ble_mesh_gen_location_state_t *state;   /*!< Parameters of the Generic Location state */
} esp_ble_mesh_gen_location_setup_srv_t;

/** This enum value is the access value of Generic User Property */
typedef enum {
    ESP_BLE_MESH_GEN_USER_ACCESS_PROHIBIT,
    ESP_BLE_MESH_GEN_USER_ACCESS_READ,
    ESP_BLE_MESH_GEN_USER_ACCESS_WRITE,
    ESP_BLE_MESH_GEN_USER_ACCESS_READ_WRITE,
} esp_ble_mesh_gen_user_prop_access_t;

/** This enum value is the access value of Generic Admin Property */
typedef enum {
    ESP_BLE_MESH_GEN_ADMIN_NOT_USER_PROP,
    ESP_BLE_MESH_GEN_ADMIN_ACCESS_READ,
    ESP_BLE_MESH_GEN_ADMIN_ACCESS_WRITE,
    ESP_BLE_MESH_GEN_ADMIN_ACCESS_READ_WRITE,
} esp_ble_mesh_gen_admin_prop_access_t;

/** This enum value is the access value of Generic Manufacturer Property */
typedef enum {
    ESP_BLE_MESH_GEN_MANU_NOT_USER_PROP,
    ESP_BLE_MESH_GEN_MANU_ACCESS_READ,
} esp_ble_mesh_gen_manu_prop_access_t;

/** Parameters of Generic Property states */
typedef struct {
    uint16_t id;            /*!< The value of User/Admin/Manufacturer Property ID */
    uint8_t  user_access;   /*!< The value of User Access field */
    uint8_t  admin_access;  /*!< The value of Admin Access field */
    uint8_t  manu_access;   /*!< The value of Manufacturer Access field */
    struct net_buf_simple *val; /*!< The value of User/Admin/Manufacturer Property */
} esp_ble_mesh_generic_property_t;

/** User data of Generic User Property Server Model */
typedef struct {
    esp_ble_mesh_model_t *model;                    /*!< Pointer to the Generic User Property Server Model. Initialized internally. */
    esp_ble_mesh_server_rsp_ctrl_t rsp_ctrl;        /*!< Response control of the server model received messages */
    uint8_t property_count;                         /*!< Generic User Property count */
    esp_ble_mesh_generic_property_t *properties;    /*!< Parameters of the Generic User Property state */
} esp_ble_mesh_gen_user_prop_srv_t;

/** User data of Generic Admin Property Server Model */
typedef struct {
    esp_ble_mesh_model_t *model;                    /*!< Pointer to the Generic Admin Property Server Model. Initialized internally. */
    esp_ble_mesh_server_rsp_ctrl_t rsp_ctrl;        /*!< Response control of the server model received messages */
    uint8_t property_count;                         /*!< Generic Admin Property count */
    esp_ble_mesh_generic_property_t *properties;    /*!< Parameters of the Generic Admin Property state */
} esp_ble_mesh_gen_admin_prop_srv_t;

/** User data of Generic Manufacturer Property Server Model */
typedef struct {
    esp_ble_mesh_model_t *model;                    /*!< Pointer to the Generic Manufacturer Property Server Model. Initialized internally. */
    esp_ble_mesh_server_rsp_ctrl_t rsp_ctrl;        /*!< Response control of the server model received messages */
    uint8_t property_count;                         /*!< Generic Manufacturer Property count */
    esp_ble_mesh_generic_property_t *properties;    /*!< Parameters of the Generic Manufacturer Property state */
} esp_ble_mesh_gen_manu_prop_srv_t;

/** User data of Generic Client Property Server Model */
typedef struct {
    esp_ble_mesh_model_t *model;                /*!< Pointer to the Generic Client Property Server Model. Initialized internally. */
    esp_ble_mesh_server_rsp_ctrl_t rsp_ctrl;    /*!< Response control of the server model received messages */
    uint8_t id_count;                           /*!< Generic Client Property ID count */
    uint16_t *property_ids;                     /*!< Parameters of the Generic Client Property state */
} esp_ble_mesh_gen_client_prop_srv_t;

/** Parameter of Generic OnOff Set state change event */
typedef struct {
    uint8_t onoff;          /*!< The value of Generic OnOff state */
} esp_ble_mesh_state_change_gen_onoff_set_t;

/** Parameter of Generic Level Set state change event */
typedef struct {
    int16_t level;          /*!< The value of Generic Level state */
} esp_ble_mesh_state_change_gen_level_set_t;

/** Parameter of Generic Delta Set state change event */
typedef struct {
    int16_t level;          /*!< The value of Generic Level state */
} esp_ble_mesh_state_change_gen_delta_set_t;

/** Parameter of Generic Move Set state change event */
typedef struct {
    int16_t level;          /*!< The value of Generic Level state */
} esp_ble_mesh_state_change_gen_move_set_t;

/** Parameter of Generic Default Transition Time Set state change event */
typedef struct {
    uint8_t trans_time;     /*!< The value of Generic Default Transition Time state */
} esp_ble_mesh_state_change_gen_def_trans_time_set_t;

/** Parameter of Generic OnPowerUp Set state change event */
typedef struct {
    uint8_t onpowerup;      /*!< The value of Generic OnPowerUp state */
} esp_ble_mesh_state_change_gen_onpowerup_set_t;

/** Parameter of Generic Power Level Set state change event */
typedef struct {
    uint16_t power;         /*!< The value of Generic Power Actual state */
} esp_ble_mesh_state_change_gen_power_level_set_t;

/** Parameter of Generic Power Default Set state change event */
typedef struct {
    uint16_t power;         /*!< The value of Generic Power Default state */
} esp_ble_mesh_state_change_gen_power_default_set_t;

/** Parameters of Generic Power Range Set state change event */
typedef struct {
    uint16_t range_min;     /*!< The minimum value of Generic Power Range state */
    uint16_t range_max;     /*!< The maximum value of Generic Power Range state */
} esp_ble_mesh_state_change_gen_power_range_set_t;

/** Parameters of Generic Location Global Set state change event */
typedef struct {
    int32_t latitude;       /*!< The Global Latitude value of Generic Location state */
    int32_t longitude;      /*!< The Global Longitude value of Generic Location state */
    int16_t altitude;       /*!< The Global Altitude value of Generic Location state */
} esp_ble_mesh_state_change_gen_loc_global_set_t;

/** Parameters of Generic Location Local Set state change event */
typedef struct {
    int16_t  north;         /*!< The Local North value of Generic Location state */
    int16_t  east;          /*!< The Local East value of Generic Location state */
    int16_t  altitude;      /*!< The Local Altitude value of Generic Location state */
    uint8_t  floor_number;  /*!< The Floor Number value of Generic Location state */
    uint16_t uncertainty;   /*!< The Uncertainty value of Generic Location state */
} esp_ble_mesh_state_change_gen_loc_local_set_t;

/** Parameters of Generic User Property Set state change event */
typedef struct {
    uint16_t id;    /*!< The property id of Generic User Property state */
    struct net_buf_simple *value;   /*!< The property value of Generic User Property state */
} esp_ble_mesh_state_change_gen_user_property_set_t;

/** Parameters of Generic Admin Property Set state change event */
typedef struct {
    uint16_t id;        /*!< The property id of Generic Admin Property state */
    uint8_t  access;    /*!< The property access of Generic Admin Property state */
    struct net_buf_simple *value;   /*!< The property value of Generic Admin Property state */
} esp_ble_mesh_state_change_gen_admin_property_set_t;

/** Parameters of Generic Manufacturer Property Set state change event */
typedef struct {
    uint16_t id;        /*!< The property id of Generic Manufacturer Property state */
    uint8_t  access;    /*!< The property value of Generic Manufacturer Property state */
} esp_ble_mesh_state_change_gen_manu_property_set_t;

/**
 * @brief Generic Server Model state change value union
 */
typedef union {
    /**
     * The recv_op in ctx can be used to decide which state is changed.
     */
    esp_ble_mesh_state_change_gen_onoff_set_t          onoff_set;           /*!< Generic OnOff Set */
    esp_ble_mesh_state_change_gen_level_set_t          level_set;           /*!< Generic Level Set */
    esp_ble_mesh_state_change_gen_delta_set_t          delta_set;           /*!< Generic Delta Set */
    esp_ble_mesh_state_change_gen_move_set_t           move_set;            /*!< Generic Move Set */
    esp_ble_mesh_state_change_gen_def_trans_time_set_t def_trans_time_set;  /*!< Generic Default Transition Time Set */
    esp_ble_mesh_state_change_gen_onpowerup_set_t      onpowerup_set;       /*!< Generic OnPowerUp Set */
    esp_ble_mesh_state_change_gen_power_level_set_t    power_level_set;     /*!< Generic Power Level Set */
    esp_ble_mesh_state_change_gen_power_default_set_t  power_default_set;   /*!< Generic Power Default Set */
    esp_ble_mesh_state_change_gen_power_range_set_t    power_range_set;     /*!< Generic Power Range Set */
    esp_ble_mesh_state_change_gen_loc_global_set_t     loc_global_set;      /*!< Generic Location Global Set */
    esp_ble_mesh_state_change_gen_loc_local_set_t      loc_local_set;       /*!< Generic Location Local Set */
    esp_ble_mesh_state_change_gen_user_property_set_t  user_property_set;   /*!< Generic User Property Set */
    esp_ble_mesh_state_change_gen_admin_property_set_t admin_property_set;  /*!< Generic Admin Property Set */
    esp_ble_mesh_state_change_gen_manu_property_set_t  manu_property_set;   /*!< Generic Manufacturer Property Set */
} esp_ble_mesh_generic_server_state_change_t;

/** Context of the received Generic User Property Get message */
typedef struct {
    uint16_t property_id;       /*!< Property ID identifying a Generic User Property */
} esp_ble_mesh_server_recv_gen_user_property_get_t;

/** Context of the received Generic Admin Property Get message */
typedef struct {
    uint16_t property_id;   /*!< Property ID identifying a Generic Admin Property */
} esp_ble_mesh_server_recv_gen_admin_property_get_t;

/** Context of the received Generic Manufacturer Property message */
typedef struct {
    uint16_t property_id;   /*!< Property ID identifying a Generic Manufacturer Property */
} esp_ble_mesh_server_recv_gen_manufacturer_property_get_t;

/** Context of the received Generic Client Properties Get message */
typedef struct {
    uint16_t property_id;   /*!< A starting Client Property ID present within an element */
} esp_ble_mesh_server_recv_gen_client_properties_get_t;

/**
 * @brief Generic Server Model received get message union
 */
typedef union {
    esp_ble_mesh_server_recv_gen_user_property_get_t         user_property;     /*!< Generic User Property Get */
    esp_ble_mesh_server_recv_gen_admin_property_get_t        admin_property;    /*!< Generic Admin Property Get */
    esp_ble_mesh_server_recv_gen_manufacturer_property_get_t manu_property;     /*!< Generic Manufacturer Property Get */
    esp_ble_mesh_server_recv_gen_client_properties_get_t     client_properties; /*!< Generic Client Properties Get */
} esp_ble_mesh_generic_server_recv_get_msg_t;

/** Context of the received Generic OnOff Set message */
typedef struct {
    bool    op_en;          /*!< Indicate if optional parameters are included */
    uint8_t onoff;          /*!< Target value of Generic OnOff state */
    uint8_t tid;            /*!< Transaction ID */
    uint8_t trans_time;     /*!< Time to complete state transition (optional) */
    uint8_t delay;          /*!< Indicate message execution delay (C.1) */
} esp_ble_mesh_server_recv_gen_onoff_set_t;

/** Context of the received Generic Level Set message */
typedef struct {
    bool    op_en;          /*!< Indicate if optional parameters are included */
    int16_t level;          /*!< Target value of Generic Level state */
    uint8_t tid;            /*!< Transaction ID */
    uint8_t trans_time;     /*!< Time to complete state transition (optional) */
    uint8_t delay;          /*!< Indicate message execution delay (C.1) */
} esp_ble_mesh_server_recv_gen_level_set_t;

/** Context of the received Generic Delta Set message */
typedef struct {
    bool    op_en;          /*!< Indicate if optional parameters are included */
    int32_t delta_level;    /*!< Delta change of Generic Level state */
    uint8_t tid;            /*!< Transaction ID */
    uint8_t trans_time;     /*!< Time to complete state transition (optional) */
    uint8_t delay;          /*!< Indicate message execution delay (C.1) */
} esp_ble_mesh_server_recv_gen_delta_set_t;

/** Context of the received Generic Move Set message */
typedef struct {
    bool    op_en;          /*!< Indicate if optional parameters are included */
    int16_t delta_level;    /*!< Delta Level step to calculate Move speed for Generic Level state */
    uint8_t tid;            /*!< Transaction ID */
    uint8_t trans_time;     /*!< Time to complete state transition (optional) */
    uint8_t delay;          /*!< Indicate message execution delay (C.1) */
} esp_ble_mesh_server_recv_gen_move_set_t;

/** Context of the received Generic Default Transition Time Set message */
typedef struct {
    uint8_t trans_time;     /*!< The value of the Generic Default Transition Time state */
} esp_ble_mesh_server_recv_gen_def_trans_time_set_t;

/** Context of the received Generic OnPowerUp Set message */
typedef struct {
    uint8_t onpowerup;      /*!< The value of the Generic OnPowerUp state */
} esp_ble_mesh_server_recv_gen_onpowerup_set_t;

/** Context of the received Generic Power Level Set message */
typedef struct {
    bool     op_en;         /*!< Indicate if optional parameters are included */
    uint16_t power;         /*!< Target value of Generic Power Actual state */
    uint8_t  tid;           /*!< Transaction ID */
    uint8_t  trans_time;    /*!< Time to complete state transition (optional) */
    uint8_t  delay;         /*!< Indicate message execution delay (C.1) */
} esp_ble_mesh_server_recv_gen_power_level_set_t;

/** Context of the received Generic Power Default Set message */
typedef struct {
    uint16_t power;         /*!< The value of the Generic Power Default state */
} esp_ble_mesh_server_recv_gen_power_default_set_t;

/** Context of the received Generic Power Range Set message */
typedef struct {
    uint16_t range_min;     /*!< Value of Range Min field of Generic Power Range state */
    uint16_t range_max;     /*!< Value of Range Max field of Generic Power Range state */
} esp_ble_mesh_server_recv_gen_power_range_set_t;

/** Context of the received Generic Location Global Set message */
typedef struct {
    int32_t global_latitude;    /*!< Global Coordinates (Latitude) */
    int32_t global_longitude;   /*!< Global Coordinates (Longitude) */
    int16_t global_altitude;    /*!< Global Altitude */
} esp_ble_mesh_server_recv_gen_loc_global_set_t;

/** Context of the received Generic Location Local Set message */
typedef struct {
    int16_t  local_north;       /*!< Local Coordinates (North) */
    int16_t  local_east;        /*!< Local Coordinates (East) */
    int16_t  local_altitude;    /*!< Local Altitude */
    uint8_t  floor_number;      /*!< Floor Number */
    uint16_t uncertainty;       /*!< Uncertainty */
} esp_ble_mesh_server_recv_gen_loc_local_set_t;

/** Context of the received Generic User Property Set message */
typedef struct {
    uint16_t property_id;   /*!< Property ID identifying a Generic User Property */
    struct net_buf_simple *property_value;  /*!< Raw value for the User Property */
} esp_ble_mesh_server_recv_gen_user_property_set_t;

/** Context of the received Generic Admin Property Set message */
typedef struct {
    uint16_t property_id;   /*!< Property ID identifying a Generic Admin Property */
    uint8_t  user_access;   /*!< Enumeration indicating user access */
    struct net_buf_simple *property_value;  /*!< Raw value for the Admin Property */
} esp_ble_mesh_server_recv_gen_admin_property_set_t;

/** Context of the received Generic Manufacturer Property Set message */
typedef struct {
    uint16_t property_id;   /*!< Property ID identifying a Generic Manufacturer Property */
    uint8_t  user_access;   /*!< Enumeration indicating user access */
} esp_ble_mesh_server_recv_gen_manufacturer_property_set_t;

/**
 * @brief Generic Server Model received set message union
 */
typedef union {
    esp_ble_mesh_server_recv_gen_onoff_set_t                 onoff;             /*!< Generic OnOff Set/Generic OnOff Set Unack */
    esp_ble_mesh_server_recv_gen_level_set_t                 level;             /*!< Generic Level Set/Generic Level Set Unack */
    esp_ble_mesh_server_recv_gen_delta_set_t                 delta;             /*!< Generic Delta Set/Generic Delta Set Unack */
    esp_ble_mesh_server_recv_gen_move_set_t                  move;              /*!< Generic Move Set/Generic Move Set Unack */
    esp_ble_mesh_server_recv_gen_def_trans_time_set_t        def_trans_time;    /*!< Generic Default Transition Time Set/Generic Default Transition Time Set Unack */
    esp_ble_mesh_server_recv_gen_onpowerup_set_t             onpowerup;         /*!< Generic OnPowerUp Set/Generic OnPowerUp Set Unack */
    esp_ble_mesh_server_recv_gen_power_level_set_t           power_level;       /*!< Generic Power Level Set/Generic Power Level Set Unack */
    esp_ble_mesh_server_recv_gen_power_default_set_t         power_default;     /*!< Generic Power Default Set/Generic Power Default Set Unack */
    esp_ble_mesh_server_recv_gen_power_range_set_t           power_range;       /*!< Generic Power Range Set/Generic Power Range Set Unack */
    esp_ble_mesh_server_recv_gen_loc_global_set_t            location_global;   /*!< Generic Location Global Set/Generic Location Global Set Unack */
    esp_ble_mesh_server_recv_gen_loc_local_set_t             location_local;    /*!< Generic Location Local Set/Generic Location Local Set Unack */
    esp_ble_mesh_server_recv_gen_user_property_set_t         user_property;     /*!< Generic User Property Set/Generic User Property Set Unack */
    esp_ble_mesh_server_recv_gen_admin_property_set_t        admin_property;    /*!< Generic Admin Property Set/Generic Admin Property Set Unack */
    esp_ble_mesh_server_recv_gen_manufacturer_property_set_t manu_property;     /*!< Generic Manufacturer Property Set/Generic Manufacturer Property Set Unack */
} esp_ble_mesh_generic_server_recv_set_msg_t;

/**
 * @brief Generic Server Model callback value union
 */
typedef union {
    esp_ble_mesh_generic_server_state_change_t state_change;    /*!< ESP_BLE_MESH_GENERIC_SERVER_STATE_CHANGE_EVT */
    esp_ble_mesh_generic_server_recv_get_msg_t get;     /*!< ESP_BLE_MESH_GENERIC_SERVER_RECV_GET_MSG_EVT */
    esp_ble_mesh_generic_server_recv_set_msg_t set;     /*!< ESP_BLE_MESH_GENERIC_SERVER_RECV_SET_MSG_EVT */
} esp_ble_mesh_generic_server_cb_value_t;

/** Generic Server Model callback parameters */
typedef struct {
    esp_ble_mesh_model_t  *model;   /*!< Pointer to Generic Server Models */
    esp_ble_mesh_msg_ctx_t ctx;     /*!< Context of the received messages */
    esp_ble_mesh_generic_server_cb_value_t value;   /*!< Value of the received Generic Messages */
} esp_ble_mesh_generic_server_cb_param_t;

/** This enum value is the event of Generic Server Model */
typedef enum {
    /**
     * 1. When get_auto_rsp is set to ESP_BLE_MESH_SERVER_AUTO_RSP, no event will be
     *    callback to the application layer when Generic Get messages are received.
     * 2. When set_auto_rsp is set to ESP_BLE_MESH_SERVER_AUTO_RSP, this event will
     *    be callback to the application layer when Generic Set/Set Unack messages
     *    are received.
     */
    ESP_BLE_MESH_GENERIC_SERVER_STATE_CHANGE_EVT,
    /**
     * When get_auto_rsp is set to ESP_BLE_MESH_SERVER_RSP_BY_APP, this event will be
     * callback to the application layer when Generic Get messages are received.
     */
    ESP_BLE_MESH_GENERIC_SERVER_RECV_GET_MSG_EVT,
    /**
     * When set_auto_rsp is set to ESP_BLE_MESH_SERVER_RSP_BY_APP, this event will be
     * callback to the application layer when Generic Set/Set Unack messages are received.
     */
    ESP_BLE_MESH_GENERIC_SERVER_RECV_SET_MSG_EVT,
    ESP_BLE_MESH_GENERIC_SERVER_EVT_MAX,
} esp_ble_mesh_generic_server_cb_event_t;

/**
 *  @brief Bluetooth Mesh Generic Server Model function.
 */

/**
 * @brief   Generic Server Model callback function type
 * @param   event: Event type
 * @param   param: Pointer to callback parameter
 */
typedef void (* esp_ble_mesh_generic_server_cb_t)(esp_ble_mesh_generic_server_cb_event_t event,
                                                  esp_ble_mesh_generic_server_cb_param_t *param);

/**
 * @brief       Register BLE Mesh Generic Server Model callback.
 *
 * @param[in]   callback: Pointer to the callback function.
 *
 * @return      ESP_OK on success or error code otherwise.
 *
 */
esp_err_t esp_ble_mesh_register_generic_server_callback(esp_ble_mesh_generic_server_cb_t callback);

#ifdef __cplusplus
}
#endif

#endif /* _ESP_BLE_MESH_GENERIC_MODEL_API_H_ */

redpajama_set_name: RedPajamaGithub


text:
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) > [puppeteer](./puppeteer.md) > [Protocol](./puppeteer.protocol.md) > [CSS](./puppeteer.protocol.css.md) > [SetStyleSheetTextResponse](./puppeteer.protocol.css.setstylesheettextresponse.md) > [sourceMapURL](./puppeteer.protocol.css.setstylesheettextresponse.sourcemapurl.md)

## Protocol.CSS.SetStyleSheetTextResponse.sourceMapURL property

URL of source map associated with script (if any).

<b>Signature:</b>

```typescript
sourceMapURL?: string;
```


text:
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _reactAddonsPureRenderMixin = require('react-addons-pure-render-mixin');

var _reactAddonsPureRenderMixin2 = _interopRequireDefault(_reactAddonsPureRenderMixin);

var _svgIcon = require('../../svg-icon');

var _svgIcon2 = _interopRequireDefault(_svgIcon);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var SocialNotifications = _react2.default.createClass({
  displayName: 'SocialNotifications',

  mixins: [_reactAddonsPureRenderMixin2.default],

  render: function render() {
    return _react2.default.createElement(
      _svgIcon2.default,
      this.props,
      _react2.default.createElement('path', { d: 'M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z' })
    );
  }
});

exports.default = SocialNotifications;
module.exports = exports['default'];


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.analyticsdata.v1beta.model;

/**
 * Filters for numeric or date values.
 *
 *
 This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Google Analytics Data API. For a detailed explanation
 * see:
 * https://developers.google.com/api-client-library/java/google-http-java-client/json
 *

 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class NumericFilter extends com.google.api.client.json.GenericJson {

  /**
   * The operation type for this filter.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String operation;

  /**
   * A numeric value or a date value.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private NumericValue value;

  /**
   * The operation type for this filter.
   * @return value or {@code null} for none
   */
  public java.lang.String getOperation() {
    return operation;
  }

  /**
   * The operation type for this filter.
   * @param operation operation or {@code null} for none
   */
  public NumericFilter setOperation(java.lang.String operation) {
    this.operation = operation;
    return this;
  }

  /**
   * A numeric value or a date value.
   * @return value or {@code null} for none
   */
  public NumericValue getValue() {
    return value;
  }

  /**
   * A numeric value or a date value.
   * @param value value or {@code null} for none
   */
  public NumericFilter setValue(NumericValue value) {
    this.value = value;
    return this;
  }

  @Override
  public NumericFilter set(String fieldName, Object value) {
    return (NumericFilter) super.set(fieldName, value);
  }

  @Override
  public NumericFilter clone() {
    return (NumericFilter) super.clone();
  }

}


text:
- Elm 0.17 (npm install -g elm)

### Follow the instructions on 01-write-simple-elm-project
### Create index.html
```
# use this js for start app
Elm.Main.fullscreen();
```
### Main.elm use model, update, view architecture
### Command to build elm.js
```
elm-make Main.elm --output elm.js
```
### Open index.html


text:
<!DOCTYPE html >

          <meta http-equiv="X-UA-Compatible" content="IE=edge" />
          <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
          <title></title>
          <meta name="description" content="" />
          <meta name="keywords" content="" />
          <meta http-equiv="content-type" content="text/html; charset=UTF-8" />

      <link href="../../../../lib/index.css" media="screen" type="text/css" rel="stylesheet" />
      <link href="../../../../lib/template.css" media="screen" type="text/css" rel="stylesheet" />
      <link href="../../../../lib/diagrams.css" media="screen" type="text/css" rel="stylesheet" id="diagrams-css" />

        < Back

            <input autocapitalize="none" placeholder="Search" id="index-input" type="text" accesskey="/" />
            
            

Packages

        

        package

              root

Definition Classes

root

        

        package

              kr

Definition Classes

root

        

        package

              bydelta

Definition Classes

kr

        

        package

              koala

각 Package의 Parser와 Tagger를 참조하세요.

 KoalaNLP

 통합 Scala 한국어 분석기, Koala

각 Package의 Parser와 Tagger를 참조하세요.

Definition Classes

bydelta

        

        package

              kkma

꼬꼬마 분석기 패키지입니다.

꼬꼬마 분석기 패키지입니다.

Definition Classes

koala

                          Dictionary

                          JavaDictionary

                          Parser

                          Tagger

c

kr.bydelta.koala.kkma

Parser

        

        class

        Parser extends CanDepParse

꼬꼬마 의존구문분석기.

            Linear Supertypes

CanDepParse, AnyRef, Any

          

            <input id="mbrsel-input" placeholder="Filter all members" type="text" accesskey="/" />

          

            Ordering

Alphabetic

By Inheritance

                  Inherited

Parser

CanDepParse

AnyRef

Any

Hide All

Show All

              Visibility

Public

All

Instance Constructors

        

        new

        Parser()

Value Members

        

        final
        def

        !=(arg0: Any): Boolean

Definition Classes

AnyRef → Any

        

        final
        def

        ##(): Int

Definition Classes

AnyRef → Any

        

        final
        def

        ==(arg0: Any): Boolean

Definition Classes

AnyRef → Any

        

        final
        def

        asInstanceOf[T0]: T0

Definition Classes

Any

        

        def

        clone(): AnyRef

Attributes

protected[java.lang]

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

        

        final
        def

        eq(arg0: AnyRef): Boolean

Definition Classes

AnyRef

        

        def

        equals(arg0: Any): Boolean

Definition Classes

AnyRef → Any

        

        def

        finalize(): Unit

Attributes

protected[java.lang]

Definition Classes

AnyRef

Annotations

                @throws(

      classOf[java.lang.Throwable]
    )

        

        final
        def

        getClass(): Class[_]

Definition Classes

AnyRef → Any

        

        def

        hashCode(): Int

Definition Classes

AnyRef → Any

        

        final
        def

        isInstanceOf[T0]: Boolean

Definition Classes

Any

        

        def

        jParse(sentences: List[Sentence]): List[Sentence]

(Java) Sentence List의 의존구문을 분석함.

(Java) Sentence List의 의존구문을 분석함.

sentences

의존구문분석을 할 Sentence Sequence.

returns

의존구문분석 결과가 포함된 Sentence List. (입력값과 동일한 객체의 Sequence)

Definition Classes

CanDepParse

        

        def

        jParse(sentence: String): List[Sentence]

(Java) String 텍스트의 의존구문을 분석함.

(Java) String 텍스트의 의존구문을 분석함.

sentence

의존구문분석을 할 String.

returns

의존구문분석 결과가 포함된 Sentence 객체의 List

Definition Classes

CanDepParse

        

        final
        def

        ne(arg0: AnyRef): Boolean

Definition Classes

AnyRef

        

        final
        def

        notify(): Unit

Definition Classes

AnyRef

        

        final
        def

        notifyAll(): Unit

Definition Classes

AnyRef

        

        def

        parse(sentence: Sentence): Sentence

Sentence 객체의 의존구문을 분석함.

Sentence 객체의 의존구문을 분석함.

sentence

의존구문분석을 할 Sentence 객체.

returns

의존구문분석 결과가 포함된 Sentence 객체. (입력값과 동일한 객체)

Definition Classes

Parser → CanDepParse

        

        def

        parse(sentence: String): Seq[Sentence]

String 텍스트의 의존구문을 분석함.

String 텍스트의 의존구문을 분석함.

sentence

의존구문분석을 할 String.

returns

의존구문분석 결과가 포함된 Sentence 객체의 Sequence

Definition Classes

Parser → CanDepParse

        

        def

        parse(sentences: Seq[Sentence]): Seq[Sentence]

Sentence Sequence의 의존구문을 분석함.

Sentence Sequence의 의존구문을 분석함.

sentences

의존구문분석을 할 Sentence Sequence.

returns

의존구문분석 결과가 포함된 Sentence Sequence. (입력값과 동일한 객체의 Sequence)

Definition Classes

CanDepParse

        

        lazy val

        parser: org.snu.ids.kkma.sp.Parser

의존관계분석기 *

        

        final
        def

        synchronized[T0](arg0: ⇒ T0): T0

Definition Classes

AnyRef

        

        lazy val

        tagger: Tagger

형태소분석기 *

        

        def

        toString(): String

Definition Classes

AnyRef → Any

        

        final
        def

        wait(): Unit

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

        

        final
        def

        wait(arg0: Long, arg1: Int): Unit

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

        

        final
        def

        wait(arg0: Long): Unit

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

Inherited from CanDepParse

Inherited from AnyRef

Inherited from Any

Ungrouped


text:
from django.test import TestCase

from .models import Article, Author, Comment, Forum, Post, SystemInfo

class NullFkOrderingTests(TestCase):

    def test_ordering_across_null_fk(self):
        """
        Regression test for #7512

        ordering across nullable Foreign Keys shouldn't exclude results
        """
        author_1 = Author.objects.create(name='Tom Jones')
        author_2 = Author.objects.create(name='Bob Smith')
        Article.objects.create(title='No author on this article')
        Article.objects.create(author=author_1, title='This article written by Tom Jones')
        Article.objects.create(author=author_2, title='This article written by Bob Smith')

        # We can't compare results directly (since different databases sort NULLs to
        # different ends of the ordering), but we can check that all results are
        # returned.
        self.assertEqual(len(list(Article.objects.all())), 3)

        s = SystemInfo.objects.create(system_name='System Info')
        f = Forum.objects.create(system_info=s, forum_name='First forum')
        p = Post.objects.create(forum=f, title='First Post')
        Comment.objects.create(post=p, comment_text='My first comment')
        Comment.objects.create(comment_text='My second comment')
        s2 = SystemInfo.objects.create(system_name='More System Info')
        f2 = Forum.objects.create(system_info=s2, forum_name='Second forum')
        p2 = Post.objects.create(forum=f2, title='Second Post')
        Comment.objects.create(comment_text='Another first comment')
        Comment.objects.create(post=p2, comment_text='Another second comment')

        # We have to test this carefully. Some databases sort NULL values before
        # everything else, some sort them afterward. So we extract the ordered list
        # and check the length. Before the fix, this list was too short (some values
        # were omitted).
        self.assertEqual(len(list(Comment.objects.all())), 4)


text:
Docker Image to Manage your Cassandra Ring. Versioning based on Cassandra DB

`docker run -it --rm billyteves/alpine-cassandra-toolkits:<tag> <cassandra-endpoint>`

Default endpoint is set to cqlsh. You can do overwrite the endpoint let's say set to nodetool status etc.


text:
function calcEqualTemperament(key) {
    return 440 * (Math.pow(Math.pow(2,1/12), (key - 49)));
}

module.exports = {
	calcEqualTemperament: calcEqualTemperament
};


text:
<?php

namespace common\models;

use Yii;
use yii\db\ActiveRecord;

/**
 * This is the model class for table "tag".
 *
 * @property integer $id
 * @property integer $frequency
 * @property string $name
 *
 * @property ContentRecord[] $contents
 */
class TagRecord extends ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'tag';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['frequency'], 'integer'],
            [['name'], 'required'],
            [['name'], 'string', 'max' => 255]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('app', 'ID'),
            'frequency' => Yii::t('app', 'Frequency'),
            'name' => Yii::t('app', 'Name'),
        ];
    }
}


text:
package it.polimi.genomics.spark.test

//import it.polimi.genomics.GMQLServer.GmqlServer

/**
 * The entry point of the application
 * It initialize the server, call server's methods to build the query and invoke the server's run method to start the execution.
 */
object JoinAmazon {

  def main(args : Array[String]) {
    /*
        val env = ExecutionEnvironment.getExecutionEnvironment
        env.readTextFile("hdfs://127.0.0.1:9000/user/bert/exp/").print
        env.execute("prova")
    */

    for (i <- args){
      println(i)
    }

//    val server = new GmqlServer(new GMQLSparkExecutor)

    /*
        val ex_data_path = "s3://genomic.s3-us-west-2.amazonaws.com/flink/ref/"
        val ex_data_path_optional = "s3://genomic.s3-us-west-2.amazonaws.com/flink/exp/"
        val output_path = "s3://genomic.s3-us-west-2.amazonaws.com/flink/res/"
    */
    /*
        val ex_data_path = "hdfs://172.31.32.33:9000/user/ref3/"
        val ex_data_path_optional = "hdfs://172.31.32.33:9000/user/exp3/"
        val output_path = "hdfs://172.31.32.33:9000/user/res/"
    */

    //val mainPath = "/Users/michelebertoni/Workspaces/IdeaProjects/genomic_computing/GMQLv2Scala/scalav2/trunk/GMQL-Flink/src/test/datasets/join2/"

    val mainPath = "hdfs://172.31.10.183:9000/" + args(0) + "/"
    //val ex_data_path = "hdfs://127.0.0.1:9000/user/Inputs/flinkInput/"
    val ex_data_path = List(mainPath + "ref/exp/*")
    val ex_data_path_optional = List(mainPath + "exp/exp/*")
    val output_path = mainPath + "res/"

/*

    val dataAsTheyAre = server READ ex_data_path USING BedScoreParser()
    val optionalDS = server READ ex_data_path_optional USING BedScoreParser()

    val choice = args(1).toInt
    val join = choice match{

      case 0 =>
        dataAsTheyAre.JOIN(None, List(new JoinQuadruple(Some(DistLess(100000)))), RegionBuilder.CONTIG, optionalDS)

      case 1 =>
        dataAsTheyAre.JOIN(None, List(new JoinQuadruple(Some(DistLess(50000)), Some(new MinDistance(2)))), RegionBuilder.CONTIG, optionalDS)

      case 2 =>
        dataAsTheyAre.JOIN(None, List(new JoinQuadruple(Some(DistGreater(50000)), Some(new Upstream()), (Some(DistLess(100000))), Some(new MinDistance(1)))), RegionBuilder.CONTIG, optionalDS)

      case 3 =>
        dataAsTheyAre.JOIN(None, List(new JoinQuadruple(Some(DistGreater(50000)), Some(new Upstream()), (Some(DistLess(100000))))), RegionBuilder.CONTIG, optionalDS)

      case 4 =>
        dataAsTheyAre.JOIN(None, List(new JoinQuadruple(Some(DistLess(200000)), Some(new MinDistance(1)), Some(new Upstream))), RegionBuilder.CONTIG, optionalDS)

      case 5 =>
        dataAsTheyAre.JOIN(None, List(new JoinQuadruple(Some(new MinDistance(1)))), RegionBuilder.CONTIG, optionalDS)

      case 6 =>
        dataAsTheyAre.JOIN(None, List(new JoinQuadruple(Some(new MinDistance(1)), Some(new DownStream), Some(new DistGreater(100)))), RegionBuilder.CONTIG, optionalDS)

      case 7 =>
        dataAsTheyAre.JOIN(None, List(new JoinQuadruple(Some(DistLess(200000)), Some(new MinDistance(2)), Some(DistGreater(50000)))), RegionBuilder.CONTIG, optionalDS)

    }
    server setOutputPath output_path MATERIALIZE join

*/

    //READ
    //server setOutputPath output_path MATERIALIZE dataAsTheyAre

    //META SELECTION
    /*
    val metaSelection = dataAsTheyAre.SELECT(
        meta_con =
            Predicate("cell", META_OP.EQ, "1")
      )
    server setOutputPath output_path MATERIALIZE metaSelection
    */

/*
    //REGION SELECTION
    val regionSelection =
      dataAsTheyAre.SELECT(
        reg_con =
            Predicate(0, REG_OP.GTE, 90)
      )
    server setOutputPath output_path MATERIALIZE regionSelection
*/

    /*
    //REGION SELECTION
    val regionSelection = dataAsTheyAre.SELECT(
      reg_con =
        DataStructures.RegionCondition.AND(
          DataStructures.RegionCondition.Predicate(1, DataStructures.RegionCondition.REG_OP.EQ, "179,45,0"),
          //DataStructures.RegionCondition.Predicate(0, DataStructures.RegionCondition.REG_OP.EQ, "400")
          DataStructures.RegionCondition.Predicate(0, DataStructures.RegionCondition.REG_OP.EQ, DataStructures.RegionCondition.MetaAccessor("bert_value_meta"))
        )
      )
    server setOutputPath output_path MATERIALIZE regionSelection
    */

    /*
    //REGION META SELECTION
    val selection = dataAsTheyAre.SELECT(
      meta_con =
        DataStructures.MetadataCondition.AND(
          DataStructures.MetadataCondition.Predicate("bert_value1",DataStructures.MetadataCondition.META_OP.GTE, "11"),
          DataStructures.MetadataCondition.NOT(
            DataStructures.MetadataCondition.Predicate("bert_value2", DataStructures.MetadataCondition.META_OP.EQ, "11")
          )
        ),
      reg_con =
        DataStructures.RegionCondition.AND(
          DataStructures.RegionCondition.Predicate(1, DataStructures.RegionCondition.REG_OP.GTE, 10),
          DataStructures.RegionCondition.Predicate(1, DataStructures.RegionCondition.REG_OP.EQ, DataStructures.RegionCondition.MetaAccessor("bert_value1"))
        )
      )
    server setOutputPath output_path MATERIALIZE selection
    */

    /*
    //SEMI JOIN ON META
    val semi_join = dataAsTheyAre.SELECT(
      MetaJoinCondition(List("bert_value1", "bert_value2")),
      optionalDS
    )
    server setOutputPath output_path MATERIALIZE semi_join
    */

    /*
    //PROJECT MD
    val projectmd = dataAsTheyAre.PROJECT(Some(List("tableName","bert_value1", "bert_value2", "bert_value3")), None, None, None, None, None)
    server setOutputPath output_path MATERIALIZE projectmd
    */

    /*
    //PROJECT MD ATTRIBUTE AND AGGREGATE MD
    val fun = new MetaAggregateStruct {override val newAttributeName: String = "computed_bert_value1"
      override val inputAttributeName: String = "bert_value1"
      override val fun: (Traversable[String]) => String =
      //average of the double
        (l : Traversable[String]) => {
          val r =
            l
              .map((a: String) => (a.toDouble * 2, 1))
              .reduce((a: (Double, Int), b: (Double, Int)) => (a._1 + b._1, a._2 + b._2))

          (r._1 / r._2).toString
        }

    }

    val projectmd = dataAsTheyAre.PROJECT(Some(List("tableName","bert_value1", "bert_value2", "bert_value3")),
      Some(fun), None, None, None, None)
    server setOutputPath output_path MATERIALIZE projectmd
    */

    /*
    //PROJECT MD/RD ATTRIBUTE AND AGGREGATE RD TUPLE
    val fun = new RegionTupleAggregateStruct {
      override val inputIndexes: List[Int] = List(0,1)
      override val fun: (Array[GValue]) => GValue =
      //Concatenation of strand and value
        (l : Array[GValue]) => {
          l.reduce( (a : GValue, b : GValue) => GString ( a.asInstanceOf[GString].v + " " + b.asInstanceOf[GDouble].v.toString ) )
        }
    }

    val projectrd = dataAsTheyAre.PROJECT(Some(List("tableName","bert_value1", "bert_value2", "bert_value3")), None, None, Some(List(0,1)), Some(fun), None)
    val projectrd2 = projectrd.PROJECT(None, None, None, Some(List(2)), None, None)
    val selectrd = projectrd2.SELECT(reg_con = DataStructures.RegionCondition.Predicate(0, DataStructures.RegionCondition.REG_OP.EQ, "+ 1000.0"))
    server setOutputPath output_path MATERIALIZE selectrd
    */

    /*
    //PROJECT AGGREGATE RD
    val fun = new RegionAggregateStruct {
      override val newAttributeName: String = "computed_bert_value1_region_aggregate"
      override val inputIndex: Int = 1
      override val fun: (GValue, GValue) => GValue =
      //sum of values
        (in1 : GValue, in2 : GValue) => {
          GDouble(in1.asInstanceOf[GDouble].v + in2.asInstanceOf[GDouble].v)
        }
    }

    val projectrd = dataAsTheyAre.PROJECT(Some(List("tableName","bert_value1", "bert_value2", "bert_value3")), None, None, None, None, Some(fun))
    server setOutputPath output_path MATERIALIZE projectrd
    */

    //GROUP

    //GROUPMD

    /*
    val sum =
      (l : List[GValue]) => {
        l.reduce((a,b) => GDouble(a.asInstanceOf[GDouble].v + b.asInstanceOf[GDouble].v))
      }
    val regionsToMeta = new RegionsToMeta{
      override val newAttributeName = "Psum"
      override val inputIndex = 2
      override val fun = sum
    }
    val groupMD = dataAsTheyAre.GROUP(Some(MetaGroupByCondition(List("bert_value1"))), Some(List(regionsToMeta)), "bert_value_1_group", None, None)

    server setOutputPath output_path MATERIALIZE groupMD
    */

    //GROUPRD
    /*
    val sum =
      (l : List[GValue]) => {
        l.reduce((a,b) => GDouble(a.asInstanceOf[GDouble].v + b.asInstanceOf[GDouble].v))
      }
    val regionsToRegion = new RegionsToRegion{
      override val index = 1
      override val fun = sum
    }
    val groupRD = dataAsTheyAre.GROUP(None, None, "pvalue", None, None)
    //val groupRD = dataAsTheyAre.GROUP(None, None, "pvalue", None, Some(List(regionsToRegion)))
    //val groupRD = dataAsTheyAre.GROUP(None, None, "pvalue", Some(List(new FIELD(1))), Some(List(regionsToRegion)))

    server setOutputPath output_path MATERIALIZE groupRD
    */

    //UNION
    /*
    //val union = dataAsTheyAre.UNION(None)
    val union = dataAsTheyAre.UNION(Some(List("bert_value2")))
    server setOutputPath output_path MATERIALIZE union
    */

    //MERGE
    /*
    val merge = dataAsTheyAre.MERGE(List(-1,1,2), optionalDS)
    server setOutputPath output_path MATERIALIZE merge
    */

    //ORDER

    //ORDERMD
    /*
    //val orderMD = dataAsTheyAre.ORDER(Some(List(("bert_value2", Direction.DESC), ("bert_value1", Direction.ASC))), "group_ordering", NoTop(), None, NoTop())
    //val orderMD = dataAsTheyAre.ORDER(Some(List(("bert_value2", Direction.DESC), ("bert_value1", Direction.ASC))), "group_ordering", Top(2), None, NoTop())
    val orderMD = dataAsTheyAre.ORDER(Some(List(("bert_value2", Direction.DESC), ("bert_value1", Direction.ASC))), "group_ordering", TopG(1), None, NoTop())
    server setOutputPath output_path MATERIALIZE orderMD
    */

    //ORDERRD
    /*
    //val orderRD = dataAsTheyAre.ORDER(None, "groupName", NoTop(), Some(List((1, Direction.DESC))), NoTop())
    //val orderRD = dataAsTheyAre.ORDER(None, "groupName", NoTop(), Some(List((1, Direction.DESC))), Top(3))
    val orderRD = dataAsTheyAre.ORDER(None, "groupName", NoTop(), Some(List((0, Direction.ASC), (1, Direction.DESC))), TopG(3))
    server setOutputPath output_path MATERIALIZE orderRD
    */

    /*
    //MAP
    val map = dataAsTheyAre.MAP(
      List(new RegionAggregateMap {
        override val index: Int = 1
        override val fun: (List[GValue]) => GValue = {
          (l) => GDouble(l.map((g) => g.asInstanceOf[GDouble].v).reduce(_ + _))
        }
      }),
      optionalDS)

    server setOutputPath output_path MATERIALIZE map
    */

    /*
    //COVER
    val cover = dataAsTheyAre.COVER(CoverFlag.COVER, N(1), N(5), List(), None )
    server setOutputPath output_path MATERIALIZE cover
    */

    //MAP
    /*
    val map = dataAsTheyAre.MAP(
      List(),
      optionalDS)

    server setOutputPath output_path MATERIALIZE map
    */

    /*
        //MAP with group
        val map = dataAsTheyAre.MAP(
          new MetaJoinCondition(List("bert_value1")),
          List(
            new RegionsToRegion {
              override val index: Int = 1
              override val fun: (List[GValue]) => GValue = {
                (line) => GDouble(line.map((gvalue) => gvalue.asInstanceOf[GDouble].v).reduce(_ + _))
              }
            },
            new RegionsToRegion {
              override val index: Int = 2
              override val fun: (List[GValue]) => GValue = {
                (list) => GString(list.map((gvalue) => gvalue.asInstanceOf[GString].v).reduce((word1 : String, word2 : String) => word1 + " " + word2))
              }
            }),
          optionalDS)

        server setOutputPath output_path MATERIALIZE map

    */
//    server.run()

    //-----------------------------

    //val mapped = dataAsTheyAre MAP something
    // println(dataAsTheyAre)

    //val env = ExecutionEnvironment.getExecutionEnvironment

    /*
        val text = env.fromElements("To be, or not to be,--that is the question:--",
          "Whether 'tis nobler in the mind to suffer", "The slings and arrows of outrageous fortune",
          "Or to take arms against a sea of troubles,")

        val one : List[Any] = List(1)
        val counts = text.flatMap { _.toLowerCase.split("\\W+") }
          .map { (_,1) }
          .groupBy(0)
          .sum(1)

        counts.writeAsCsv("/home/pietro/Desktop/result.csv")

        env.execute("WordCount Example")*/
  }

}