/** * 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); }
/** * 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); }
/** * 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]); }
/** * 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]); }
/** * Creates a configuration and directly adds the option * * @param option * @param value */ public TransportConfig(TransportConfigOption option, object value) { _request[option] = value; }