diff --git a/src/kernel/peripherals/Peripherals.hx b/src/kernel/peripherals/Peripherals.hx index 0582b83..9d40485 100644 --- a/src/kernel/peripherals/Peripherals.hx +++ b/src/kernel/peripherals/Peripherals.hx @@ -54,6 +54,25 @@ class Peripheral { return addr; } + public function inspect(addr: String): Null<{ types: Array, methods: Array}> { + if (!isPresent(addr)) { + return null; + } + + var types = getTypes(addr); + var methodsMap = cc.Peripheral.getMethods(addr).toArray(); + var methods: Array = []; + + for (method in methodsMap) { + methods.push(method); + } + + return { + types: types, + methods: methods + }; + } + public function getScreen(addr: String): Null { var addr = safeGetAddr(addr, Screen.TYPE_NAME); if (addr == null) return null;