/*JSON{ "type" : "constructor", "class" : "Queue", "name" : "Queue", "generate" : "jswrap_Queue_constructor", "params" : [ ["queueName", "JsVar", "Name of the queue"] ], "return" : ["JsVar","A Queue object"] } Creates a Queue Object */ JsVar *jswrap_Queue_constructor(JsVar *queueName){ int idx; char name[20]; JsVar *queue = jspNewObject(0, "Queue"); if (!queue) return 0; name[jsvGetString(queueName, name, sizeof(name))] = '\0'; idx = queue_indexByName(name); jsvObjectSetChildAndUnLock(queue, "index", jsvNewFromInteger(idx)); return queue; }
QueueHandle_t queue_handleByName(char *queueName){ int idx; idx = queue_indexByName(queueName); return RTOSqueues[idx].handle; }