public NITag(string name, string path, bool active, NITagType type) : this() { this.name = name; this.path = path; this.active = active; this.type = type; }
public string CreateOrGetTag(string path, NITagType type, bool permanent) { Create(path, type, permanent); string tagJson = NetworkUtil.HttpGetString(GETTAGVALUE + path, NIAUTHHEADER); JsonNITagWrap tag = JsonConvert.DeserializeObject <JsonNITagWrap>(tagJson); return(tag.GetValue()); }
public void Create(string path, NITagType type, bool permanent = false) { NITag tag = new NITag(path, type); if (permanent) { tag.nitagRetention = NITagRetention.PERMANENT; } Create(tag); }
public void UpdateTagMultipleValues(string path, NITagType type, List <NITagValue> values) { string data = "["; foreach (NITagValue value in values) { data += "{ \"value\": { \"type\": \"" + type + "\", \"value\": \"" + value.value + "\" }, \"timestamp\":\"" + value.timestamp + "\"},"; } data += "]"; NetworkUtil.HttpPostString(TAGS + "/" + path + "/update-values", NIAUTHHEADER, data); }
public NITag(string path, NITagType type) : this(path, path, false, type) { }
public void UpdateTag(string path, string value, NITagType type) { NetworkUtil.HttpPutString(TAGS + "/" + path + "/values/current", NIAUTHHEADER, "{ \"value\": { \"type\": \"" + type + "\", \"value\": \"" + value + "\" }}"); }
public void CreateOrUpdateTag(string path, string value, NITagType type, bool permanent) { Create(path, type, permanent); UpdateTag(path, value, type); }