'Starts a control setting procedure. Verifies the fields,
sets the data and (if needed) and calls the callback.
Arguments:
fields   -- List of control fields in tuple format:
(name, typename, value)
session  -- Session id, only used in the callback as identifier
callback -- Callback function to call when control set is complete.
The callback function must support the following arguments:
session     -- Session id, as supplied in the
request_fields call
nodeId      -- Identifier for this device
result      -- The current result status of the readout.
Valid values are:
"error"  - Set fields failed.
"ok"     - All fields were set.
error_field -- [optional] Only applies when result == "error"
The field name that failed
(usually means it is missing)
error_msg   -- [optional] Only applies when result == "error".
Error details when a request failed.'

def set_control_fields(self, fields, session, callback):

    if (len(fields) > 0):
        for (name, typename, value) in fields:
            if (not self.has_control_field(name, typename)):
                self._send_control_reject(session, name, 'NotFound', callback)
                return False
    for (name, typename, value) in fields:
        self._set_field_value(name, value)
    callback(session, result='ok', nodeId=self.nodeId)
    return True
