diff --git a/src/main/aciodrv/device.c b/src/main/aciodrv/device.c index f370f3b..a444394 100644 --- a/src/main/aciodrv/device.c +++ b/src/main/aciodrv/device.c @@ -300,6 +300,7 @@ static bool aciodrv_device_get_version(struct aciodrv_device_ctx *device, uint8_ msg.cmd.version.time); memcpy(version->product, msg.cmd.version.product_code, ACIO_NODE_PRODUCT_CODE_LEN); + version->type = ac_io_u32(msg.cmd.version.type); version->major = msg.cmd.version.major; version->minor = msg.cmd.version.minor; version->revision = msg.cmd.version.revision; @@ -392,6 +393,14 @@ bool aciodrv_device_get_node_product_ident(struct aciodrv_device_ctx *device, ui memcpy(product, device->node_versions[node_id].product, ACIO_NODE_PRODUCT_CODE_LEN); return true; } +uint32_t aciodrv_device_get_node_product_type(struct aciodrv_device_ctx *device, uint8_t node_id) +{ + if (device->node_count == 0 || node_id > device->node_count) { + return 0; + } + + return device->node_versions[node_id].type; +} const struct aciodrv_device_node_version *aciodrv_device_get_node_product_version(struct aciodrv_device_ctx *device, uint8_t node_id) { diff --git a/src/main/aciodrv/device.h b/src/main/aciodrv/device.h index d0e4b76..58cbf41 100644 --- a/src/main/aciodrv/device.h +++ b/src/main/aciodrv/device.h @@ -13,6 +13,7 @@ struct aciodrv_device_ctx; struct aciodrv_device_node_version { char product[ACIO_NODE_PRODUCT_CODE_LEN]; + uint32_t type; uint8_t major; uint8_t minor; uint8_t revision; @@ -52,6 +53,15 @@ uint8_t aciodrv_device_get_node_count(struct aciodrv_device_ctx *device); */ bool aciodrv_device_get_node_product_ident(struct aciodrv_device_ctx *device, uint8_t node_id, char product[ACIO_NODE_PRODUCT_CODE_LEN]); +/** + * Get the product identifier of an enumerated node. + * + * @param device Context of opened device + * @param node_id Id of the node. Needs to be in range of the total node count. + * @return product type ID on success, or 0 on failure + */ +uint32_t aciodrv_device_get_node_product_type(struct aciodrv_device_ctx *device, uint8_t node_id); + /** * Get the product version of an enumerated node. *