// // direct blink(1) control url handling // // /blink1/id -- Display blink1_id and blink1 serial numbers (if any) static string Ublink1Id(HttpRequest request, Blink1Server blink1Server) { Blink1 blink1 = blink1Server.blink1; Dictionary <string, object> result = new Dictionary <string, object>(); result.Add("blink1_id", blink1.blink1Id); List <string> serialnums = new List <string>(); for (int i = 0; i < blink1.getCachedCount(); i++) // FIXME: surely a smarter way to do this { serialnums.Add(blink1.getCachedSerial(i)); } result.Add("blink1_serialnums", serialnums); result.Add("status", "blink1 id"); return(JsonConvert.SerializeObject(result, Formatting.Indented, jsonSerializerSettings)); }