(type)
| 167 | } |
| 168 | |
| 169 | export async function getAllControllerByType(type) { |
| 170 | const result = []; |
| 171 | // wait for last addPort action in queue to finish |
| 172 | await addPortQueue.queue[addPortQueue.queue.length - 1]; |
| 173 | for (const [, contr] of controllerPool.map.entries()) { |
| 174 | if (contr.mainType === type) { |
| 175 | await allPortsConnected(contr.id); |
| 176 | result.push(contr); |
| 177 | } |
| 178 | } |
| 179 | return result; |
| 180 | } |
| 181 | |
| 182 | export const controllerPool = new ControllerMap(); |
| 183 |
no test coverage detected