File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,10 @@ NetworkTables Interface
9393
9494 :param key: A networktables key
9595 :returns: true if a key is present in NetworkTables, false otherwise
96+
97+ .. js :function :: NetworkTables .getKeys ()
98+
99+ :returns: all the keys in the NetworkTables
96100
97101.. js :function :: NetworkTables .getValue (key[, defaultValue])
98102
Original file line number Diff line number Diff line change @@ -37,6 +37,12 @@ var NetworkTables = new function () {
3737 return this . _ [ d3_map_escape ( key ) ] ;
3838 } ;
3939
40+ this . getKeys = function ( ) {
41+ var keys = [ ] ;
42+ for ( var key in this . _ ) keys . push ( d3_map_unescape ( key ) ) ;
43+ return keys ;
44+ } ;
45+
4046 this . has = function ( key ) {
4147 return d3_map_escape ( key ) in this . _ ;
4248 } ;
@@ -181,6 +187,11 @@ var NetworkTables = new function () {
181187 return ntCache . has ( key ) ;
182188 } ;
183189
190+ // Returns all the keys in the NetworkTables
191+ this . getKeys = function ( ) {
192+ return ntCache . getKeys ( ) ;
193+ } ;
194+
184195 /**
185196 Returns the value that the key maps to. If the websocket is not
186197 open, this will always return the default value specified.
You can’t perform that action at this time.
0 commit comments