/**
  * <summary>
  *   Returns the hardware identifier of the function, without reference to the module.
  * <para>
  *   For example
  *   <c>relay1</c>
  * </para>
  * <para>
  * </para>
  * </summary>
  * <returns>
  *   a string that identifies the function (ex: <c>relay1</c>)
  * </returns>
  * <para>
  *   On failure, throws an exception or returns  <c>YFunction.FUNCTIONID_INVALID</c>.
  * </para>
  */
 public string get_functionId()
 {
     if (_func == null)
     {
         string msg = "No Function connected";
         throw new YoctoApiProxyException(msg);
     }
     return(_func.get_functionId());
 }
Ejemplo n.º 2
0
        // Callback function for compass and tilt
        //
        static void valueCallback(YFunction function, string value)
        {
            string functionId = function.get_functionId();
            double dblValue;

            if (!Double.TryParse(value, out dblValue))
            {
                return;
            }
            if (functionId == "compass")
            {
                _compass = dblValue; eventCount[0]++;
            }
            if (functionId == "tilt1")
            {
                _tilt1 = dblValue; eventCount[1]++;
            }
            if (functionId == "tilt2")
            {
                _tilt2 = dblValue; eventCount[2]++;
            }
        }