示例#1
0
 /**
  * Adds a {@link TransportConfigOption} and its value. The same option can't be added to the configuration twice.
  *
  * @param option the {@link TransportConfigOption} to set
  * @return true if the option was added, false if the option already existed
  */
 public bool AddOption(TransportConfigOption option, object value)
 {
     if (_request.ContainsKey(option))
     {
         return(false);
     }
     _request.Add(option, value);
     return(true);
 }
示例#2
0
        /**
         * Sets the {@link ZigBeeStatus} for a configuration setting
         *
         * @param option the {@link TransportConfigOption} to set the result
         * @param value the {@link ZigBeeStatus}
         * @return true if the result was set, false if the option did not exist or the result was already set
         */
        public bool SetResult(TransportConfigOption option, ZigBeeStatus value)
        {
            if (_request.ContainsKey(option) == false || _request[option] == null || _response.ContainsKey(option))
            {
                return(false);
            }
            _response[option] = value;

            return(true);
        }
示例#3
0
 /**
  * Gets the the {@link TransportConfigResult} for a {@link TransportConfigOption} if it is configured
  *
  * @param option the {@link TransportConfigOption} to retrieve the result
  * @return the result {@link ZigBeeStatus} for the requested {@link TransportConfigOption}
  */
 public ZigBeeStatus GetResult(TransportConfigOption option)
 {
     if (_request.ContainsKey(option) == false)
     {
         return(ZigBeeStatus.INVALID_ARGUMENTS);
     }
     if (_response.ContainsKey(option) == false)
     {
         return(ZigBeeStatus.BAD_RESPONSE);
     }
     return(_response[option]);
 }
示例#4
0
 /**
  * Gets a value for the specified {@link TransportConfigOption}
  *
  * @param option the {@link TransportConfigOption} to retrieve
  * @return the {@link Object}
  */
 public object GetValue(TransportConfigOption option)
 {
     return(_request[option]);
 }
示例#5
0
 /**
  * Creates a configuration and directly adds the option
  *
  * @param option
  * @param value
  */
 public TransportConfig(TransportConfigOption option, object value)
 {
     _request[option] = value;
 }