diff --git a/lib/pbio/drv/ioport/ioport_lpf2.c b/lib/pbio/drv/ioport/ioport_lpf2.c index bfe6334af..8277add69 100644 --- a/lib/pbio/drv/ioport/ioport_lpf2.c +++ b/lib/pbio/drv/ioport/ioport_lpf2.c @@ -66,15 +66,6 @@ static const basic_info_t basic_infos[] = { }, .num_values = 1, .data_type = PBIO_IODEV_DATA_TYPE_INT8, - .digits = 4, - .decimals = 0, - .raw_min = -100.0, - .raw_max = 100.0, - .pct_min = -100.0, - .pct_max = 100.0, - .si_min = -100.0, - .si_max = 100.0, - .uom = "", .input_flags = 0, .output_flags = LPF2_MAPPING_FLAG_ABSOLUTE, }, @@ -91,15 +82,6 @@ static const basic_info_t basic_infos[] = { }, .num_values = 1, .data_type = PBIO_IODEV_DATA_TYPE_INT8, - .digits = 4, - .decimals = 0, - .raw_min = -100.0, - .raw_max = 100.0, - .pct_min = -100.0, - .pct_max = 100.0, - .si_min = -100.0, - .si_max = 100.0, - .uom = "", .input_flags = 0, .output_flags = LPF2_MAPPING_FLAG_RELATIVE | LPF2_MAPPING_FLAG_ABSOLUTE, }, @@ -115,15 +97,6 @@ static const basic_info_t basic_infos[] = { }, .num_values = 1, .data_type = PBIO_IODEV_DATA_TYPE_INT8, - .digits = 1, - .decimals = 0, - .raw_min = 0.0, - .raw_max = 1.0, - .pct_min = 0.0, - .pct_max = 100.0, - .si_min = 0.0, - .si_max = 1.0, - .uom = "", .input_flags = 0, .output_flags = LPF2_MAPPING_FLAG_DISCRETE | LPF2_MAPPING_FLAG_ABSOLUTE, }, @@ -139,15 +112,6 @@ static const basic_info_t basic_infos[] = { }, .num_values = 1, .data_type = PBIO_IODEV_DATA_TYPE_INT8, - .digits = 1, - .decimals = 0, - .raw_min = -100.0, - .raw_max = 100.0, - .pct_min = -100.0, - .pct_max = 100.0, - .si_min = -100.0, - .si_max = 100.0, - .uom = "", .input_flags = 0, .output_flags = LPF2_MAPPING_FLAG_DISCRETE | LPF2_MAPPING_FLAG_ABSOLUTE, }, @@ -163,15 +127,6 @@ static const basic_info_t basic_infos[] = { }, .num_values = 1, .data_type = PBIO_IODEV_DATA_TYPE_INT8, - .digits = 1, - .decimals = 0, - .raw_min = 0.0, - .raw_max = 1.0, - .pct_min = 0.0, - .pct_max = 100.0, - .si_min = 0.0, - .si_max = 1.0, - .uom = "", .input_flags = 0, .output_flags = LPF2_MAPPING_FLAG_DISCRETE | LPF2_MAPPING_FLAG_ABSOLUTE, }, diff --git a/lib/pbio/include/pbio/iodev.h b/lib/pbio/include/pbio/iodev.h index fc9cfe31f..a979b5520 100644 --- a/lib/pbio/include/pbio/iodev.h +++ b/lib/pbio/include/pbio/iodev.h @@ -266,46 +266,6 @@ typedef struct { * The binary format of the data for this mode. */ pbio_iodev_data_type_t data_type; - /** - * The number of digits for display, including the decimal point. - */ - uint8_t digits; - /** - * The number of digits after the decimal point. - */ - uint8_t decimals; - /** - * The minimum raw data value. This is just used for scaling an may not - * actually be the minimum possible value. - */ - float raw_min; - /** - * The maximum raw data value. This is just used for scaling an may not - * actually be the maximum possible value. - */ - float raw_max; - /** - * The minimum percent data value. This will be either 0.0 or -100.0. - */ - float pct_min; - /** - * The maximum percent data value. This will always be 100.0. - */ - float pct_max; - /** - * The minimum scaled data value. This is just used for scaling an may not - * actually be the minimum possible value. - */ - float si_min; - /** - * The maximum scaled data value. This is just used for scaling an may not - * actually be the maximum possible value. - */ - float si_max; - /** - * The units of measurement. - */ - char uom[PBIO_IODEV_UOM_SIZE + 1]; /** * Input value mapping flags. */ diff --git a/lib/pbio/src/uartdev.c b/lib/pbio/src/uartdev.c index 77f180912..7d2e54aba 100644 --- a/lib/pbio/src/uartdev.c +++ b/lib/pbio/src/uartdev.c @@ -222,13 +222,6 @@ static uartdev_port_data_t dev_data[PBIO_CONFIG_UARTDEV_NUM_DEV]; static pbdrv_counter_dev_t *counter_devs; -static const pbio_iodev_mode_t ev3_uart_default_mode_info = { - .raw_max = 1023, - .pct_max = 100, - .si_max = 1, - .digits = 4, -}; - #define PBIO_PT_WAIT_READY(pt, expr) PT_WAIT_UNTIL((pt), (expr) != PBIO_ERROR_AGAIN) pbio_error_t pbio_uartdev_get(uint8_t id, pbio_iodev_t **iodev) { @@ -499,73 +492,12 @@ static void pbio_uartdev_parse_msg(uartdev_port_data_t *data) { flags->flags3, flags->flags4, flags->flags5); } break; + // Ignore RAW, PCT, SI, UNITS info. This is never used and can + // be looked up by device type if necessary. case LUMP_INFO_RAW: - if (data->new_mode != mode) { - DBG_ERR(data->last_err = "Received INFO for incorrect mode"); - goto err; - } - if (test_and_set_bit(EV3_UART_INFO_BIT_INFO_RAW, &data->info_flags)) { - DBG_ERR(data->last_err = "Received duplicate raw scaling INFO"); - goto err; - } - data->info->mode_info[mode].raw_min = float_le(data->rx_msg + 2); - data->info->mode_info[mode].raw_max = float_le(data->rx_msg + 6); - - debug_pr("raw: %f %f\n", (double)data->info->mode_info[mode].raw_min, - (double)data->info->mode_info[mode].raw_max); - - break; case LUMP_INFO_PCT: - if (data->new_mode != mode) { - DBG_ERR(data->last_err = "Received INFO for incorrect mode"); - goto err; - } - if (test_and_set_bit(EV3_UART_INFO_BIT_INFO_PCT, &data->info_flags)) { - DBG_ERR(data->last_err = "Received duplicate percent scaling INFO"); - goto err; - } - data->info->mode_info[mode].pct_min = float_le(data->rx_msg + 2); - data->info->mode_info[mode].pct_max = float_le(data->rx_msg + 6); - - debug_pr("pct: %f %f\n", (double)data->info->mode_info[mode].pct_min, - (double)data->info->mode_info[mode].pct_max); - - break; case LUMP_INFO_SI: - if (data->new_mode != mode) { - DBG_ERR(data->last_err = "Received INFO for incorrect mode"); - goto err; - } - if (test_and_set_bit(EV3_UART_INFO_BIT_INFO_SI, - &data->info_flags)) { - DBG_ERR(data->last_err = "Received duplicate SI scaling INFO"); - goto err; - } - data->info->mode_info[mode].si_min = float_le(data->rx_msg + 2); - data->info->mode_info[mode].si_max = float_le(data->rx_msg + 6); - - debug_pr("si: %f %f\n", (double)data->info->mode_info[mode].si_min, - (double)data->info->mode_info[mode].si_max); - - break; case LUMP_INFO_UNITS: - if (data->new_mode != mode) { - DBG_ERR(data->last_err = "Received INFO for incorrect mode"); - goto err; - } - if (test_and_set_bit(EV3_UART_INFO_BIT_INFO_UNITS, &data->info_flags)) { - DBG_ERR(data->last_err = "Received duplicate SI units INFO"); - goto err; - } - // Units may not have null terminator and we are done with the - // checksum at this point so we are writing 0 over the checksum to - // ensure a null terminator for the string functions. - data->rx_msg[msg_size - 1] = 0; - snprintf(data->info->mode_info[mode].uom, PBIO_IODEV_UOM_SIZE + 1, - "%s", data->rx_msg + 2); - - debug_pr("uom: %s\n", data->info->mode_info[mode].uom); - break; case LUMP_INFO_MAPPING: if (data->new_mode != mode) { @@ -640,16 +572,12 @@ static void pbio_uartdev_parse_msg(uartdev_port_data_t *data) { goto err; } data->info->mode_info[mode].data_type = data->rx_msg[3]; - data->info->mode_info[mode].digits = data->rx_msg[4]; - data->info->mode_info[mode].decimals = data->rx_msg[5]; if (data->new_mode) { data->new_mode--; } debug_pr("num_values: %d\n", data->info->mode_info[mode].num_values); debug_pr("data_type: %d\n", data->info->mode_info[mode].data_type); - debug_pr("digits: %d\n", data->info->mode_info[mode].digits); - debug_pr("decimals: %d\n", data->info->mode_info[mode].decimals); break; } @@ -905,10 +833,6 @@ static PT_THREAD(pbio_uartdev_update(uartdev_port_data_t * data)) { data->info->num_modes = 1; data->info->num_view_modes = 1; - for (int i = 0; i < PBIO_IODEV_MAX_NUM_MODES; i++) { - data->info->mode_info[i] = ev3_uart_default_mode_info; - } - data->type_id = data->rx_msg[1]; data->info_flags = EV3_UART_INFO_FLAG_CMD_TYPE; data->data_rec = false; diff --git a/lib/pbio/test/src/uartdev.c b/lib/pbio/test/src/uartdev.c index 2848b2c76..94e994e55 100644 --- a/lib/pbio/test/src/uartdev.c +++ b/lib/pbio/test/src/uartdev.c @@ -364,201 +364,102 @@ static PT_THREAD(test_boost_color_distance_sensor(struct pt *pt)) { tt_want_uint_op(iodev->info->mode_info[0].flags.flags1, ==, LUMP_MODE_FLAGS1_NONE); tt_want_uint_op(iodev->info->mode_info[0].flags.flags4, ==, LUMP_MODE_FLAGS4_NONE); tt_want_uint_op(iodev->info->mode_info[0].flags.flags5, ==, LUMP_MODE_FLAGS5_NONE); - tt_want_float_op(iodev->info->mode_info[0].raw_min, ==, 0.0); - tt_want_float_op(iodev->info->mode_info[0].raw_max, ==, 10.0); - tt_want_float_op(iodev->info->mode_info[0].pct_min, ==, 0.0); - tt_want_float_op(iodev->info->mode_info[0].pct_max, ==, 100.0); - tt_want_float_op(iodev->info->mode_info[0].si_min, ==, 0.0); - tt_want_float_op(iodev->info->mode_info[0].si_max, ==, 10.0); - tt_want_str_op(iodev->info->mode_info[0].uom, ==, "IDX"); tt_want_uint_op(iodev->info->mode_info[0].input_flags, ==, LPF2_MAPPING_FLAG_NULL | LPF2_MAPPING_FLAG_2_0 | LPF2_MAPPING_FLAG_DISCRETE); tt_want_uint_op(iodev->info->mode_info[0].output_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[0].num_values, ==, 1); tt_want_uint_op(iodev->info->mode_info[0].data_type, ==, PBIO_IODEV_DATA_TYPE_INT8); - tt_want_uint_op(iodev->info->mode_info[0].digits, ==, 3); - tt_want_uint_op(iodev->info->mode_info[0].decimals, ==, 0); tt_want_uint_op(iodev->info->mode_info[1].flags.flags0, ==, LUMP_MODE_FLAGS0_NONE); tt_want_uint_op(iodev->info->mode_info[1].flags.flags1, ==, LUMP_MODE_FLAGS1_NONE); tt_want_uint_op(iodev->info->mode_info[1].flags.flags4, ==, LUMP_MODE_FLAGS4_NONE); tt_want_uint_op(iodev->info->mode_info[1].flags.flags5, ==, LUMP_MODE_FLAGS5_NONE); - tt_want_float_op(iodev->info->mode_info[1].raw_min, ==, 0.0); - tt_want_float_op(iodev->info->mode_info[1].raw_max, ==, 10.0); - tt_want_float_op(iodev->info->mode_info[1].pct_min, ==, 0.0); - tt_want_float_op(iodev->info->mode_info[1].pct_max, ==, 100.0); - tt_want_float_op(iodev->info->mode_info[1].si_min, ==, 0.0); - tt_want_float_op(iodev->info->mode_info[1].si_max, ==, 10.0); - tt_want_str_op(iodev->info->mode_info[1].uom, ==, "DIS"); tt_want_uint_op(iodev->info->mode_info[1].input_flags, ==, LPF2_MAPPING_FLAG_2_0 | LPF2_MAPPING_FLAG_ABSOLUTE); tt_want_uint_op(iodev->info->mode_info[1].output_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[1].num_values, ==, 1); tt_want_uint_op(iodev->info->mode_info[1].data_type, ==, PBIO_IODEV_DATA_TYPE_INT8); - tt_want_uint_op(iodev->info->mode_info[1].digits, ==, 3); - tt_want_uint_op(iodev->info->mode_info[1].decimals, ==, 0); tt_want_uint_op(iodev->info->mode_info[2].flags.flags0, ==, LUMP_MODE_FLAGS0_NONE); tt_want_uint_op(iodev->info->mode_info[2].flags.flags1, ==, LUMP_MODE_FLAGS1_NONE); tt_want_uint_op(iodev->info->mode_info[2].flags.flags4, ==, LUMP_MODE_FLAGS4_NONE); tt_want_uint_op(iodev->info->mode_info[2].flags.flags5, ==, LUMP_MODE_FLAGS5_NONE); - tt_want_float_op(iodev->info->mode_info[2].raw_min, ==, 0.0); - tt_want_float_op(iodev->info->mode_info[2].raw_max, ==, 100.0); - tt_want_float_op(iodev->info->mode_info[2].pct_min, ==, 0.0); - tt_want_float_op(iodev->info->mode_info[2].pct_max, ==, 100.0); - tt_want_float_op(iodev->info->mode_info[2].si_min, ==, 0.0); - tt_want_float_op(iodev->info->mode_info[2].si_max, ==, 100.0); - tt_want_str_op(iodev->info->mode_info[2].uom, ==, "CNT"); tt_want_uint_op(iodev->info->mode_info[2].input_flags, ==, LPF2_MAPPING_FLAG_RELATIVE); tt_want_uint_op(iodev->info->mode_info[2].output_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[2].num_values, ==, 1); tt_want_uint_op(iodev->info->mode_info[2].data_type, ==, PBIO_IODEV_DATA_TYPE_INT32); - tt_want_uint_op(iodev->info->mode_info[2].digits, ==, 4); - tt_want_uint_op(iodev->info->mode_info[2].decimals, ==, 0); tt_want_uint_op(iodev->info->mode_info[3].flags.flags0, ==, LUMP_MODE_FLAGS0_NONE); tt_want_uint_op(iodev->info->mode_info[3].flags.flags1, ==, LUMP_MODE_FLAGS1_NONE); tt_want_uint_op(iodev->info->mode_info[3].flags.flags4, ==, LUMP_MODE_FLAGS4_NONE); tt_want_uint_op(iodev->info->mode_info[3].flags.flags5, ==, LUMP_MODE_FLAGS5_NONE); - tt_want_float_op(iodev->info->mode_info[3].raw_min, ==, 0.0); - tt_want_float_op(iodev->info->mode_info[3].raw_max, ==, 100.0); - tt_want_float_op(iodev->info->mode_info[3].pct_min, ==, 0.0); - tt_want_float_op(iodev->info->mode_info[3].pct_max, ==, 100.0); - tt_want_float_op(iodev->info->mode_info[3].si_min, ==, 0.0); - tt_want_float_op(iodev->info->mode_info[3].si_max, ==, 100.0); - tt_want_str_op(iodev->info->mode_info[3].uom, ==, "PCT"); tt_want_uint_op(iodev->info->mode_info[3].input_flags, ==, LPF2_MAPPING_FLAG_ABSOLUTE); tt_want_uint_op(iodev->info->mode_info[3].output_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[3].num_values, ==, 1); tt_want_uint_op(iodev->info->mode_info[3].data_type, ==, PBIO_IODEV_DATA_TYPE_INT8); - tt_want_uint_op(iodev->info->mode_info[3].digits, ==, 3); - tt_want_uint_op(iodev->info->mode_info[3].decimals, ==, 0); tt_want_uint_op(iodev->info->mode_info[4].flags.flags0, ==, LUMP_MODE_FLAGS0_NONE); tt_want_uint_op(iodev->info->mode_info[4].flags.flags1, ==, LUMP_MODE_FLAGS1_NONE); tt_want_uint_op(iodev->info->mode_info[4].flags.flags4, ==, LUMP_MODE_FLAGS4_NONE); tt_want_uint_op(iodev->info->mode_info[4].flags.flags5, ==, LUMP_MODE_FLAGS5_NONE); - tt_want_float_op(iodev->info->mode_info[4].raw_min, ==, 0.0); - tt_want_float_op(iodev->info->mode_info[4].raw_max, ==, 100.0); - tt_want_float_op(iodev->info->mode_info[4].pct_min, ==, 0.0); - tt_want_float_op(iodev->info->mode_info[4].pct_max, ==, 100.0); - tt_want_float_op(iodev->info->mode_info[4].si_min, ==, 0.0); - tt_want_float_op(iodev->info->mode_info[4].si_max, ==, 100.0); - tt_want_str_op(iodev->info->mode_info[4].uom, ==, "PCT"); tt_want_uint_op(iodev->info->mode_info[4].input_flags, ==, LPF2_MAPPING_FLAG_ABSOLUTE); tt_want_uint_op(iodev->info->mode_info[4].output_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[4].num_values, ==, 1); tt_want_uint_op(iodev->info->mode_info[4].data_type, ==, PBIO_IODEV_DATA_TYPE_INT8); - tt_want_uint_op(iodev->info->mode_info[4].digits, ==, 3); - tt_want_uint_op(iodev->info->mode_info[4].decimals, ==, 0); tt_want_uint_op(iodev->info->mode_info[5].flags.flags0, ==, LUMP_MODE_FLAGS0_NONE); tt_want_uint_op(iodev->info->mode_info[5].flags.flags1, ==, LUMP_MODE_FLAGS1_NONE); tt_want_uint_op(iodev->info->mode_info[5].flags.flags4, ==, LUMP_MODE_FLAGS4_NONE); tt_want_uint_op(iodev->info->mode_info[5].flags.flags5, ==, LUMP_MODE_FLAGS5_NONE); - tt_want_float_op(iodev->info->mode_info[5].raw_min, ==, 0.0); - tt_want_float_op(iodev->info->mode_info[5].raw_max, ==, 10.0); - tt_want_float_op(iodev->info->mode_info[5].pct_min, ==, 0.0); - tt_want_float_op(iodev->info->mode_info[5].pct_max, ==, 100.0); - tt_want_float_op(iodev->info->mode_info[5].si_min, ==, 0.0); - tt_want_float_op(iodev->info->mode_info[5].si_max, ==, 10.0); - tt_want_str_op(iodev->info->mode_info[5].uom, ==, "IDX"); tt_want_uint_op(iodev->info->mode_info[5].input_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[5].output_flags, ==, LPF2_MAPPING_FLAG_DISCRETE); tt_want_uint_op(iodev->info->mode_info[5].num_values, ==, 1); tt_want_uint_op(iodev->info->mode_info[5].data_type, ==, PBIO_IODEV_DATA_TYPE_INT8); - tt_want_uint_op(iodev->info->mode_info[5].digits, ==, 3); - tt_want_uint_op(iodev->info->mode_info[5].decimals, ==, 0); tt_want_uint_op(iodev->info->mode_info[6].flags.flags0, ==, LUMP_MODE_FLAGS0_NONE); tt_want_uint_op(iodev->info->mode_info[6].flags.flags1, ==, LUMP_MODE_FLAGS1_NONE); tt_want_uint_op(iodev->info->mode_info[6].flags.flags4, ==, LUMP_MODE_FLAGS4_NONE); tt_want_uint_op(iodev->info->mode_info[6].flags.flags5, ==, LUMP_MODE_FLAGS5_NONE); - tt_want_float_op(iodev->info->mode_info[6].raw_min, ==, 0.0); - tt_want_float_op(iodev->info->mode_info[6].raw_max, ==, 1023.0); - tt_want_float_op(iodev->info->mode_info[6].pct_min, ==, 0.0); - tt_want_float_op(iodev->info->mode_info[6].pct_max, ==, 100.0); - tt_want_float_op(iodev->info->mode_info[6].si_min, ==, 0.0); - tt_want_float_op(iodev->info->mode_info[6].si_max, ==, 1023.0); - tt_want_str_op(iodev->info->mode_info[6].uom, ==, "RAW"); tt_want_uint_op(iodev->info->mode_info[6].input_flags, ==, LPF2_MAPPING_FLAG_ABSOLUTE); tt_want_uint_op(iodev->info->mode_info[6].output_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[6].num_values, ==, 3); tt_want_uint_op(iodev->info->mode_info[6].data_type, ==, PBIO_IODEV_DATA_TYPE_INT16); - tt_want_uint_op(iodev->info->mode_info[6].digits, ==, 5); - tt_want_uint_op(iodev->info->mode_info[6].decimals, ==, 0); tt_want_uint_op(iodev->info->mode_info[7].flags.flags0, ==, LUMP_MODE_FLAGS0_NONE); tt_want_uint_op(iodev->info->mode_info[7].flags.flags1, ==, LUMP_MODE_FLAGS1_NONE); tt_want_uint_op(iodev->info->mode_info[7].flags.flags4, ==, LUMP_MODE_FLAGS4_NONE); tt_want_uint_op(iodev->info->mode_info[7].flags.flags5, ==, LUMP_MODE_FLAGS5_NONE); - tt_want_float_op(iodev->info->mode_info[7].raw_min, ==, 0.0); - tt_want_float_op(iodev->info->mode_info[7].raw_max, ==, 65535.0); - tt_want_float_op(iodev->info->mode_info[7].pct_min, ==, 0.0); - tt_want_float_op(iodev->info->mode_info[7].pct_max, ==, 100.0); - tt_want_float_op(iodev->info->mode_info[7].si_min, ==, 0.0); - tt_want_float_op(iodev->info->mode_info[7].si_max, ==, 65535.0); - tt_want_str_op(iodev->info->mode_info[7].uom, ==, "N/A"); tt_want_uint_op(iodev->info->mode_info[7].input_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[7].output_flags, ==, LPF2_MAPPING_FLAG_DISCRETE); tt_want_uint_op(iodev->info->mode_info[7].num_values, ==, 1); tt_want_uint_op(iodev->info->mode_info[7].data_type, ==, PBIO_IODEV_DATA_TYPE_INT16); - tt_want_uint_op(iodev->info->mode_info[7].digits, ==, 5); - tt_want_uint_op(iodev->info->mode_info[7].decimals, ==, 0); tt_want_uint_op(iodev->info->mode_info[8].flags.flags0, ==, LUMP_MODE_FLAGS0_NONE); tt_want_uint_op(iodev->info->mode_info[8].flags.flags1, ==, LUMP_MODE_FLAGS1_NONE); tt_want_uint_op(iodev->info->mode_info[8].flags.flags4, ==, LUMP_MODE_FLAGS4_NONE); tt_want_uint_op(iodev->info->mode_info[8].flags.flags5, ==, LUMP_MODE_FLAGS5_NONE); - tt_want_float_op(iodev->info->mode_info[8].raw_min, ==, 0.0); - tt_want_float_op(iodev->info->mode_info[8].raw_max, ==, 255.0); - tt_want_float_op(iodev->info->mode_info[8].pct_min, ==, 0.0); - tt_want_float_op(iodev->info->mode_info[8].pct_max, ==, 100.0); - tt_want_float_op(iodev->info->mode_info[8].si_min, ==, 0.0); - tt_want_float_op(iodev->info->mode_info[8].si_max, ==, 255.0); - tt_want_str_op(iodev->info->mode_info[8].uom, ==, "N/A"); tt_want_uint_op(iodev->info->mode_info[8].input_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[8].output_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[8].num_values, ==, 4); tt_want_uint_op(iodev->info->mode_info[8].data_type, ==, PBIO_IODEV_DATA_TYPE_INT8); - tt_want_uint_op(iodev->info->mode_info[8].digits, ==, 3); - tt_want_uint_op(iodev->info->mode_info[8].decimals, ==, 0); tt_want_uint_op(iodev->info->mode_info[9].flags.flags0, ==, LUMP_MODE_FLAGS0_NONE); tt_want_uint_op(iodev->info->mode_info[9].flags.flags1, ==, LUMP_MODE_FLAGS1_NONE); tt_want_uint_op(iodev->info->mode_info[9].flags.flags4, ==, LUMP_MODE_FLAGS4_NONE); tt_want_uint_op(iodev->info->mode_info[9].flags.flags5, ==, LUMP_MODE_FLAGS5_NONE); - tt_want_float_op(iodev->info->mode_info[9].raw_min, ==, 0.0); - tt_want_float_op(iodev->info->mode_info[9].raw_max, ==, 1023.0); - tt_want_float_op(iodev->info->mode_info[9].pct_min, ==, 0.0); - tt_want_float_op(iodev->info->mode_info[9].pct_max, ==, 100.0); - tt_want_float_op(iodev->info->mode_info[9].si_min, ==, 0.0); - tt_want_float_op(iodev->info->mode_info[9].si_max, ==, 10.0); - tt_want_str_op(iodev->info->mode_info[9].uom, ==, "N/A"); tt_want_uint_op(iodev->info->mode_info[9].input_flags, ==, LPF2_MAPPING_FLAG_ABSOLUTE); tt_want_uint_op(iodev->info->mode_info[9].output_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[9].num_values, ==, 2); tt_want_uint_op(iodev->info->mode_info[9].data_type, ==, PBIO_IODEV_DATA_TYPE_INT16); - tt_want_uint_op(iodev->info->mode_info[9].digits, ==, 5); - tt_want_uint_op(iodev->info->mode_info[9].decimals, ==, 0); tt_want_uint_op(iodev->info->mode_info[10].flags.flags0, ==, LUMP_MODE_FLAGS0_NONE); tt_want_uint_op(iodev->info->mode_info[10].flags.flags1, ==, LUMP_MODE_FLAGS1_NONE); tt_want_uint_op(iodev->info->mode_info[10].flags.flags4, ==, LUMP_MODE_FLAGS4_NONE); tt_want_uint_op(iodev->info->mode_info[10].flags.flags5, ==, LUMP_MODE_FLAGS5_NONE); - tt_want_float_op(iodev->info->mode_info[10].raw_min, ==, 0.0); - tt_want_float_op(iodev->info->mode_info[10].raw_max, ==, 65535.0); - tt_want_float_op(iodev->info->mode_info[10].pct_min, ==, 0.0); - tt_want_float_op(iodev->info->mode_info[10].pct_max, ==, 100.0); - tt_want_float_op(iodev->info->mode_info[10].si_min, ==, 0.0); - tt_want_float_op(iodev->info->mode_info[10].si_max, ==, 65535.0); - tt_want_str_op(iodev->info->mode_info[10].uom, ==, "N/A"); tt_want_uint_op(iodev->info->mode_info[10].input_flags, ==, LPF2_MAPPING_FLAG_ABSOLUTE); tt_want_uint_op(iodev->info->mode_info[10].output_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[10].num_values, ==, 8); tt_want_uint_op(iodev->info->mode_info[10].data_type, ==, PBIO_IODEV_DATA_TYPE_INT16); - tt_want_uint_op(iodev->info->mode_info[10].digits, ==, 5); - tt_want_uint_op(iodev->info->mode_info[10].decimals, ==, 0); // test changing the mode @@ -779,76 +680,40 @@ static PT_THREAD(test_boost_interactive_motor(struct pt *pt)) { tt_want_uint_op(iodev->info->mode_info[0].flags.flags1, ==, LUMP_MODE_FLAGS1_NONE); tt_want_uint_op(iodev->info->mode_info[0].flags.flags4, ==, LUMP_MODE_FLAGS4_USES_HBRIDGE); tt_want_uint_op(iodev->info->mode_info[0].flags.flags5, ==, LUMP_MODE_FLAGS5_UNKNOWN_BIT1); - tt_want_float_op(iodev->info->mode_info[0].raw_min, ==, -100.0); - tt_want_float_op(iodev->info->mode_info[0].raw_max, ==, 100.0); - tt_want_float_op(iodev->info->mode_info[0].pct_min, ==, -100.0); - tt_want_float_op(iodev->info->mode_info[0].pct_max, ==, 100.0); - tt_want_float_op(iodev->info->mode_info[0].si_min, ==, -100.0); - tt_want_float_op(iodev->info->mode_info[0].si_max, ==, 100.0); - tt_want_str_op(iodev->info->mode_info[0].uom, ==, "PCT"); tt_want_uint_op(iodev->info->mode_info[0].input_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[0].output_flags, ==, LPF2_MAPPING_FLAG_2_0 | LPF2_MAPPING_FLAG_ABSOLUTE); tt_want_uint_op(iodev->info->mode_info[0].num_values, ==, 1); tt_want_uint_op(iodev->info->mode_info[0].data_type, ==, PBIO_IODEV_DATA_TYPE_INT8); - tt_want_uint_op(iodev->info->mode_info[0].digits, ==, 4); - tt_want_uint_op(iodev->info->mode_info[0].decimals, ==, 0); tt_want_uint_op(iodev->info->mode_info[1].flags.flags0, ==, LUMP_MODE_FLAGS0_MOTOR | LUMP_MODE_FLAGS0_MOTOR_SPEED); tt_want_uint_op(iodev->info->mode_info[1].flags.flags1, ==, LUMP_MODE_FLAGS1_NONE); tt_want_uint_op(iodev->info->mode_info[1].flags.flags4, ==, LUMP_MODE_FLAGS4_USES_HBRIDGE); tt_want_uint_op(iodev->info->mode_info[1].flags.flags5, ==, LUMP_MODE_FLAGS5_UNKNOWN_BIT1); - tt_want_float_op(iodev->info->mode_info[1].raw_min, ==, -100.0); - tt_want_float_op(iodev->info->mode_info[1].raw_max, ==, 100.0); - tt_want_float_op(iodev->info->mode_info[1].pct_min, ==, -100.0); - tt_want_float_op(iodev->info->mode_info[1].pct_max, ==, 100.0); - tt_want_float_op(iodev->info->mode_info[1].si_min, ==, -100.0); - tt_want_float_op(iodev->info->mode_info[1].si_max, ==, 100.0); - tt_want_str_op(iodev->info->mode_info[1].uom, ==, "PCT"); tt_want_uint_op(iodev->info->mode_info[1].input_flags, ==, LPF2_MAPPING_FLAG_ABSOLUTE); tt_want_uint_op(iodev->info->mode_info[1].output_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[1].num_values, ==, 1); tt_want_uint_op(iodev->info->mode_info[1].data_type, ==, PBIO_IODEV_DATA_TYPE_INT8); - tt_want_uint_op(iodev->info->mode_info[1].digits, ==, 4); - tt_want_uint_op(iodev->info->mode_info[1].decimals, ==, 0); tt_want_uint_op(iodev->info->mode_info[2].flags.flags0, ==, LUMP_MODE_FLAGS0_MOTOR | LUMP_MODE_FLAGS0_MOTOR_REL_POS); tt_want_uint_op(iodev->info->mode_info[2].flags.flags1, ==, LUMP_MODE_FLAGS1_NONE); tt_want_uint_op(iodev->info->mode_info[2].flags.flags4, ==, LUMP_MODE_FLAGS4_USES_HBRIDGE); tt_want_uint_op(iodev->info->mode_info[2].flags.flags5, ==, LUMP_MODE_FLAGS5_UNKNOWN_BIT1); - tt_want_float_op(iodev->info->mode_info[2].raw_min, ==, -360.0); - tt_want_float_op(iodev->info->mode_info[2].raw_max, ==, 360.0); - tt_want_float_op(iodev->info->mode_info[2].pct_min, ==, -100.0); - tt_want_float_op(iodev->info->mode_info[2].pct_max, ==, 100.0); - tt_want_float_op(iodev->info->mode_info[2].si_min, ==, -360.0); - tt_want_float_op(iodev->info->mode_info[2].si_max, ==, 360.0); - tt_want_str_op(iodev->info->mode_info[2].uom, ==, "DEG"); tt_want_uint_op(iodev->info->mode_info[2].input_flags, ==, LPF2_MAPPING_FLAG_RELATIVE); tt_want_uint_op(iodev->info->mode_info[2].output_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[2].num_values, ==, 1); tt_want_uint_op(iodev->info->mode_info[2].data_type, ==, PBIO_IODEV_DATA_TYPE_INT32); - tt_want_uint_op(iodev->info->mode_info[2].digits, ==, 6); - tt_want_uint_op(iodev->info->mode_info[2].decimals, ==, 0); tt_want_uint_op(iodev->info->mode_info[3].flags.flags0, ==, LUMP_MODE_FLAGS0_NONE); tt_want_uint_op(iodev->info->mode_info[3].flags.flags1, ==, LUMP_MODE_FLAGS1_NONE); tt_want_uint_op(iodev->info->mode_info[3].flags.flags4, ==, LUMP_MODE_FLAGS4_USES_HBRIDGE); tt_want_uint_op(iodev->info->mode_info[3].flags.flags5, ==, LUMP_MODE_FLAGS5_UNKNOWN_BIT1); - tt_want_float_op(iodev->info->mode_info[3].raw_min, ==, -100.0); - tt_want_float_op(iodev->info->mode_info[3].raw_max, ==, 100.0); - tt_want_float_op(iodev->info->mode_info[3].pct_min, ==, -100.0); - tt_want_float_op(iodev->info->mode_info[3].pct_max, ==, 100.0); - tt_want_float_op(iodev->info->mode_info[3].si_min, ==, -100.0); - tt_want_float_op(iodev->info->mode_info[3].si_max, ==, 100.0); - tt_want_str_op(iodev->info->mode_info[3].uom, ==, "TST"); tt_want_uint_op(iodev->info->mode_info[3].input_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[3].output_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[3].num_values, ==, 5); tt_want_uint_op(iodev->info->mode_info[3].data_type, ==, PBIO_IODEV_DATA_TYPE_INT16); - tt_want_uint_op(iodev->info->mode_info[3].digits, ==, 6); - tt_want_uint_op(iodev->info->mode_info[3].decimals, ==, 0); PT_YIELD(pt); @@ -1047,20 +912,11 @@ static PT_THREAD(test_technic_large_motor(struct pt *pt)) { tt_want_uint_op(iodev->info->mode_info[0].flags.flags4, ==, LUMP_MODE_FLAGS4_UNKNOWN_BIT2 | LUMP_MODE_FLAGS4_USES_HBRIDGE); tt_want_uint_op(iodev->info->mode_info[0].flags.flags5, ==, LUMP_MODE_FLAGS5_UNKNOWN_BIT2); - tt_want_float_op(iodev->info->mode_info[0].raw_min, ==, -100.0); - tt_want_float_op(iodev->info->mode_info[0].raw_max, ==, 100.0); - tt_want_float_op(iodev->info->mode_info[0].pct_min, ==, -100.0); - tt_want_float_op(iodev->info->mode_info[0].pct_max, ==, 100.0); - tt_want_float_op(iodev->info->mode_info[0].si_min, ==, -100.0); - tt_want_float_op(iodev->info->mode_info[0].si_max, ==, 100.0); - tt_want_str_op(iodev->info->mode_info[0].uom, ==, "PCT"); tt_want_uint_op(iodev->info->mode_info[0].input_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[0].output_flags, ==, LPF2_MAPPING_FLAG_2_0 | LPF2_MAPPING_FLAG_ABSOLUTE); tt_want_uint_op(iodev->info->mode_info[0].num_values, ==, 1); tt_want_uint_op(iodev->info->mode_info[0].data_type, ==, PBIO_IODEV_DATA_TYPE_INT8); - tt_want_uint_op(iodev->info->mode_info[0].digits, ==, 4); - tt_want_uint_op(iodev->info->mode_info[0].decimals, ==, 0); tt_want_uint_op(iodev->info->mode_info[1].flags.flags0, ==, LUMP_MODE_FLAGS0_MOTOR | LUMP_MODE_FLAGS0_MOTOR_SPEED); @@ -1068,21 +924,12 @@ static PT_THREAD(test_technic_large_motor(struct pt *pt)) { tt_want_uint_op(iodev->info->mode_info[1].flags.flags4, ==, LUMP_MODE_FLAGS4_UNKNOWN_BIT2 | LUMP_MODE_FLAGS4_USES_HBRIDGE); tt_want_uint_op(iodev->info->mode_info[1].flags.flags5, ==, LUMP_MODE_FLAGS5_UNKNOWN_BIT2); - tt_want_float_op(iodev->info->mode_info[1].raw_min, ==, -100.0); - tt_want_float_op(iodev->info->mode_info[1].raw_max, ==, 100.0); - tt_want_float_op(iodev->info->mode_info[1].pct_min, ==, -100.0); - tt_want_float_op(iodev->info->mode_info[1].pct_max, ==, 100.0); - tt_want_float_op(iodev->info->mode_info[1].si_min, ==, -100.0); - tt_want_float_op(iodev->info->mode_info[1].si_max, ==, 100.0); - tt_want_str_op(iodev->info->mode_info[1].uom, ==, "PCT"); tt_want_uint_op(iodev->info->mode_info[1].input_flags, ==, LPF2_MAPPING_FLAG_UNKNOWN_BIT5 | LPF2_MAPPING_FLAG_ABSOLUTE); tt_want_uint_op(iodev->info->mode_info[1].output_flags, ==, LPF2_MAPPING_FLAG_2_0 | LPF2_MAPPING_FLAG_UNKNOWN_BIT5 | LPF2_MAPPING_FLAG_ABSOLUTE); tt_want_uint_op(iodev->info->mode_info[1].num_values, ==, 1); tt_want_uint_op(iodev->info->mode_info[1].data_type, ==, PBIO_IODEV_DATA_TYPE_INT8); - tt_want_uint_op(iodev->info->mode_info[1].digits, ==, 4); - tt_want_uint_op(iodev->info->mode_info[1].decimals, ==, 0); tt_want_uint_op(iodev->info->mode_info[2].flags.flags0, ==, LUMP_MODE_FLAGS0_MOTOR | LUMP_MODE_FLAGS0_MOTOR_REL_POS); @@ -1090,21 +937,12 @@ static PT_THREAD(test_technic_large_motor(struct pt *pt)) { tt_want_uint_op(iodev->info->mode_info[2].flags.flags4, ==, LUMP_MODE_FLAGS4_UNKNOWN_BIT2 | LUMP_MODE_FLAGS4_USES_HBRIDGE); tt_want_uint_op(iodev->info->mode_info[2].flags.flags5, ==, LUMP_MODE_FLAGS5_UNKNOWN_BIT2); - tt_want_float_op(iodev->info->mode_info[2].raw_min, ==, -360.0); - tt_want_float_op(iodev->info->mode_info[2].raw_max, ==, 360.0); - tt_want_float_op(iodev->info->mode_info[2].pct_min, ==, -100.0); - tt_want_float_op(iodev->info->mode_info[2].pct_max, ==, 100.0); - tt_want_float_op(iodev->info->mode_info[2].si_min, ==, -360.0); - tt_want_float_op(iodev->info->mode_info[2].si_max, ==, 360.0); - tt_want_str_op(iodev->info->mode_info[2].uom, ==, "DEG"); tt_want_uint_op(iodev->info->mode_info[2].input_flags, ==, LPF2_MAPPING_FLAG_UNKNOWN_BIT5 | LPF2_MAPPING_FLAG_RELATIVE); tt_want_uint_op(iodev->info->mode_info[2].output_flags, ==, LPF2_MAPPING_FLAG_2_0 | LPF2_MAPPING_FLAG_UNKNOWN_BIT5 | LPF2_MAPPING_FLAG_RELATIVE); tt_want_uint_op(iodev->info->mode_info[2].num_values, ==, 1); tt_want_uint_op(iodev->info->mode_info[2].data_type, ==, PBIO_IODEV_DATA_TYPE_INT32); - tt_want_uint_op(iodev->info->mode_info[2].digits, ==, 11); - tt_want_uint_op(iodev->info->mode_info[2].decimals, ==, 0); tt_want_uint_op(iodev->info->mode_info[3].flags.flags0, ==, LUMP_MODE_FLAGS0_MOTOR | LUMP_MODE_FLAGS0_MOTOR_ABS_POS); @@ -1112,21 +950,12 @@ static PT_THREAD(test_technic_large_motor(struct pt *pt)) { tt_want_uint_op(iodev->info->mode_info[3].flags.flags4, ==, LUMP_MODE_FLAGS4_UNKNOWN_BIT2 | LUMP_MODE_FLAGS4_USES_HBRIDGE); tt_want_uint_op(iodev->info->mode_info[3].flags.flags5, ==, LUMP_MODE_FLAGS5_UNKNOWN_BIT2); - tt_want_float_op(iodev->info->mode_info[3].raw_min, ==, -180.0); - tt_want_float_op(iodev->info->mode_info[3].raw_max, ==, 179.0); - tt_want_float_op(iodev->info->mode_info[3].pct_min, ==, -200.0); - tt_want_float_op(iodev->info->mode_info[3].pct_max, ==, 200.0); - tt_want_float_op(iodev->info->mode_info[3].si_min, ==, -180.0); - tt_want_float_op(iodev->info->mode_info[3].si_max, ==, 179.0); - tt_want_str_op(iodev->info->mode_info[3].uom, ==, "DEG"); tt_want_uint_op(iodev->info->mode_info[3].input_flags, ==, LPF2_MAPPING_FLAG_UNKNOWN_BIT5 | LPF2_MAPPING_FLAG_ABSOLUTE | LPF2_MAPPING_FLAG_UNKNOWN_BIT1); tt_want_uint_op(iodev->info->mode_info[3].output_flags, ==, LPF2_MAPPING_FLAG_UNKNOWN_BIT5 | LPF2_MAPPING_FLAG_ABSOLUTE | LPF2_MAPPING_FLAG_UNKNOWN_BIT1); tt_want_uint_op(iodev->info->mode_info[3].num_values, ==, 1); tt_want_uint_op(iodev->info->mode_info[3].data_type, ==, PBIO_IODEV_DATA_TYPE_INT16); - tt_want_uint_op(iodev->info->mode_info[3].digits, ==, 3); - tt_want_uint_op(iodev->info->mode_info[3].decimals, ==, 0); tt_want_uint_op(iodev->info->mode_info[4].flags.flags0, ==, LUMP_MODE_FLAGS0_MOTOR | LUMP_MODE_FLAGS0_MOTOR_ABS_POS); @@ -1134,38 +963,20 @@ static PT_THREAD(test_technic_large_motor(struct pt *pt)) { tt_want_uint_op(iodev->info->mode_info[4].flags.flags4, ==, LUMP_MODE_FLAGS4_UNKNOWN_BIT2 | LUMP_MODE_FLAGS4_USES_HBRIDGE); tt_want_uint_op(iodev->info->mode_info[4].flags.flags5, ==, LUMP_MODE_FLAGS5_UNKNOWN_BIT2); - tt_want_float_op(iodev->info->mode_info[4].raw_min, ==, 0.0); - tt_want_float_op(iodev->info->mode_info[4].raw_max, ==, 3600.0); - tt_want_float_op(iodev->info->mode_info[4].pct_min, ==, 0.0); - tt_want_float_op(iodev->info->mode_info[4].pct_max, ==, 100.0); - tt_want_float_op(iodev->info->mode_info[4].si_min, ==, 0.0); - tt_want_float_op(iodev->info->mode_info[4].si_max, ==, 3600.0); - tt_want_str_op(iodev->info->mode_info[4].uom, ==, "CAL"); tt_want_uint_op(iodev->info->mode_info[4].input_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[4].output_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[4].num_values, ==, 2); tt_want_uint_op(iodev->info->mode_info[4].data_type, ==, PBIO_IODEV_DATA_TYPE_INT16); - tt_want_uint_op(iodev->info->mode_info[4].digits, ==, 5); - tt_want_uint_op(iodev->info->mode_info[4].decimals, ==, 0); tt_want_uint_op(iodev->info->mode_info[5].flags.flags0, ==, LUMP_MODE_FLAGS0_NONE); tt_want_uint_op(iodev->info->mode_info[5].flags.flags1, ==, LUMP_MODE_FLAGS1_NONE); tt_want_uint_op(iodev->info->mode_info[5].flags.flags4, ==, LUMP_MODE_FLAGS4_UNKNOWN_BIT2 | LUMP_MODE_FLAGS4_USES_HBRIDGE); tt_want_uint_op(iodev->info->mode_info[5].flags.flags5, ==, LUMP_MODE_FLAGS5_UNKNOWN_BIT2); - tt_want_float_op(iodev->info->mode_info[5].raw_min, ==, 0.0); - tt_want_float_op(iodev->info->mode_info[5].raw_max, ==, 65535.0); - tt_want_float_op(iodev->info->mode_info[5].pct_min, ==, 0.0); - tt_want_float_op(iodev->info->mode_info[5].pct_max, ==, 100.0); - tt_want_float_op(iodev->info->mode_info[5].si_min, ==, 0.0); - tt_want_float_op(iodev->info->mode_info[5].si_max, ==, 65535.0); - tt_want_str_op(iodev->info->mode_info[5].uom, ==, "MIN"); tt_want_uint_op(iodev->info->mode_info[5].input_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[5].output_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[5].num_values, ==, 14); tt_want_uint_op(iodev->info->mode_info[5].data_type, ==, PBIO_IODEV_DATA_TYPE_INT16); - tt_want_uint_op(iodev->info->mode_info[5].digits, ==, 5); - tt_want_uint_op(iodev->info->mode_info[5].decimals, ==, 0); PT_YIELD(pt); @@ -1364,20 +1175,11 @@ static PT_THREAD(test_technic_xl_motor(struct pt *pt)) { tt_want_uint_op(iodev->info->mode_info[0].flags.flags4, ==, LUMP_MODE_FLAGS4_UNKNOWN_BIT2 | LUMP_MODE_FLAGS4_USES_HBRIDGE); tt_want_uint_op(iodev->info->mode_info[0].flags.flags5, ==, LUMP_MODE_FLAGS5_UNKNOWN_BIT2); - tt_want_float_op(iodev->info->mode_info[0].raw_min, ==, -100.0); - tt_want_float_op(iodev->info->mode_info[0].raw_max, ==, 100.0); - tt_want_float_op(iodev->info->mode_info[0].pct_min, ==, -100.0); - tt_want_float_op(iodev->info->mode_info[0].pct_max, ==, 100.0); - tt_want_float_op(iodev->info->mode_info[0].si_min, ==, -100.0); - tt_want_float_op(iodev->info->mode_info[0].si_max, ==, 100.0); - tt_want_str_op(iodev->info->mode_info[0].uom, ==, "PCT"); tt_want_uint_op(iodev->info->mode_info[0].input_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[0].output_flags, ==, LPF2_MAPPING_FLAG_2_0 | LPF2_MAPPING_FLAG_ABSOLUTE); tt_want_uint_op(iodev->info->mode_info[0].num_values, ==, 1); tt_want_uint_op(iodev->info->mode_info[0].data_type, ==, PBIO_IODEV_DATA_TYPE_INT8); - tt_want_uint_op(iodev->info->mode_info[0].digits, ==, 4); - tt_want_uint_op(iodev->info->mode_info[0].decimals, ==, 0); tt_want_uint_op(iodev->info->mode_info[1].flags.flags0, ==, LUMP_MODE_FLAGS0_MOTOR | LUMP_MODE_FLAGS0_MOTOR_SPEED); @@ -1385,21 +1187,12 @@ static PT_THREAD(test_technic_xl_motor(struct pt *pt)) { tt_want_uint_op(iodev->info->mode_info[1].flags.flags4, ==, LUMP_MODE_FLAGS4_UNKNOWN_BIT2 | LUMP_MODE_FLAGS4_USES_HBRIDGE); tt_want_uint_op(iodev->info->mode_info[1].flags.flags5, ==, LUMP_MODE_FLAGS5_UNKNOWN_BIT2); - tt_want_float_op(iodev->info->mode_info[1].raw_min, ==, -100.0); - tt_want_float_op(iodev->info->mode_info[1].raw_max, ==, 100.0); - tt_want_float_op(iodev->info->mode_info[1].pct_min, ==, -100.0); - tt_want_float_op(iodev->info->mode_info[1].pct_max, ==, 100.0); - tt_want_float_op(iodev->info->mode_info[1].si_min, ==, -100.0); - tt_want_float_op(iodev->info->mode_info[1].si_max, ==, 100.0); - tt_want_str_op(iodev->info->mode_info[1].uom, ==, "PCT"); tt_want_uint_op(iodev->info->mode_info[1].input_flags, ==, LPF2_MAPPING_FLAG_UNKNOWN_BIT5 | LPF2_MAPPING_FLAG_ABSOLUTE); tt_want_uint_op(iodev->info->mode_info[1].output_flags, ==, LPF2_MAPPING_FLAG_2_0 | LPF2_MAPPING_FLAG_UNKNOWN_BIT5 | LPF2_MAPPING_FLAG_ABSOLUTE); tt_want_uint_op(iodev->info->mode_info[1].num_values, ==, 1); tt_want_uint_op(iodev->info->mode_info[1].data_type, ==, PBIO_IODEV_DATA_TYPE_INT8); - tt_want_uint_op(iodev->info->mode_info[1].digits, ==, 4); - tt_want_uint_op(iodev->info->mode_info[1].decimals, ==, 0); tt_want_uint_op(iodev->info->mode_info[2].flags.flags0, ==, LUMP_MODE_FLAGS0_MOTOR | LUMP_MODE_FLAGS0_MOTOR_REL_POS); @@ -1407,21 +1200,12 @@ static PT_THREAD(test_technic_xl_motor(struct pt *pt)) { tt_want_uint_op(iodev->info->mode_info[2].flags.flags4, ==, LUMP_MODE_FLAGS4_UNKNOWN_BIT2 | LUMP_MODE_FLAGS4_USES_HBRIDGE); tt_want_uint_op(iodev->info->mode_info[2].flags.flags5, ==, LUMP_MODE_FLAGS5_UNKNOWN_BIT2); - tt_want_float_op(iodev->info->mode_info[2].raw_min, ==, -360.0); - tt_want_float_op(iodev->info->mode_info[2].raw_max, ==, 360.0); - tt_want_float_op(iodev->info->mode_info[2].pct_min, ==, -100.0); - tt_want_float_op(iodev->info->mode_info[2].pct_max, ==, 100.0); - tt_want_float_op(iodev->info->mode_info[2].si_min, ==, -360.0); - tt_want_float_op(iodev->info->mode_info[2].si_max, ==, 360.0); - tt_want_str_op(iodev->info->mode_info[2].uom, ==, "DEG"); tt_want_uint_op(iodev->info->mode_info[2].input_flags, ==, LPF2_MAPPING_FLAG_UNKNOWN_BIT5 | LPF2_MAPPING_FLAG_RELATIVE); tt_want_uint_op(iodev->info->mode_info[2].output_flags, ==, LPF2_MAPPING_FLAG_2_0 | LPF2_MAPPING_FLAG_UNKNOWN_BIT5 | LPF2_MAPPING_FLAG_RELATIVE); tt_want_uint_op(iodev->info->mode_info[2].num_values, ==, 1); tt_want_uint_op(iodev->info->mode_info[2].data_type, ==, PBIO_IODEV_DATA_TYPE_INT32); - tt_want_uint_op(iodev->info->mode_info[2].digits, ==, 11); - tt_want_uint_op(iodev->info->mode_info[2].decimals, ==, 0); tt_want_uint_op(iodev->info->mode_info[3].flags.flags0, ==, LUMP_MODE_FLAGS0_MOTOR | LUMP_MODE_FLAGS0_MOTOR_ABS_POS); @@ -1429,21 +1213,12 @@ static PT_THREAD(test_technic_xl_motor(struct pt *pt)) { tt_want_uint_op(iodev->info->mode_info[3].flags.flags4, ==, LUMP_MODE_FLAGS4_UNKNOWN_BIT2 | LUMP_MODE_FLAGS4_USES_HBRIDGE); tt_want_uint_op(iodev->info->mode_info[3].flags.flags5, ==, LUMP_MODE_FLAGS5_UNKNOWN_BIT2); - tt_want_float_op(iodev->info->mode_info[3].raw_min, ==, -180.0); - tt_want_float_op(iodev->info->mode_info[3].raw_max, ==, 179.0); - tt_want_float_op(iodev->info->mode_info[3].pct_min, ==, -200.0); - tt_want_float_op(iodev->info->mode_info[3].pct_max, ==, 200.0); - tt_want_float_op(iodev->info->mode_info[3].si_min, ==, -180.0); - tt_want_float_op(iodev->info->mode_info[3].si_max, ==, 179.0); - tt_want_str_op(iodev->info->mode_info[3].uom, ==, "DEG"); tt_want_uint_op(iodev->info->mode_info[3].input_flags, ==, LPF2_MAPPING_FLAG_UNKNOWN_BIT5 | LPF2_MAPPING_FLAG_ABSOLUTE | LPF2_MAPPING_FLAG_UNKNOWN_BIT1); tt_want_uint_op(iodev->info->mode_info[3].output_flags, ==, LPF2_MAPPING_FLAG_UNKNOWN_BIT5 | LPF2_MAPPING_FLAG_ABSOLUTE | LPF2_MAPPING_FLAG_UNKNOWN_BIT1); tt_want_uint_op(iodev->info->mode_info[3].num_values, ==, 1); tt_want_uint_op(iodev->info->mode_info[3].data_type, ==, PBIO_IODEV_DATA_TYPE_INT16); - tt_want_uint_op(iodev->info->mode_info[3].digits, ==, 3); - tt_want_uint_op(iodev->info->mode_info[3].decimals, ==, 0); tt_want_uint_op(iodev->info->mode_info[4].flags.flags0, ==, LUMP_MODE_FLAGS0_MOTOR | LUMP_MODE_FLAGS0_MOTOR_ABS_POS); @@ -1451,38 +1226,20 @@ static PT_THREAD(test_technic_xl_motor(struct pt *pt)) { tt_want_uint_op(iodev->info->mode_info[4].flags.flags4, ==, LUMP_MODE_FLAGS4_UNKNOWN_BIT2 | LUMP_MODE_FLAGS4_USES_HBRIDGE); tt_want_uint_op(iodev->info->mode_info[4].flags.flags5, ==, LUMP_MODE_FLAGS5_UNKNOWN_BIT2); - tt_want_float_op(iodev->info->mode_info[4].raw_min, ==, 0.0); - tt_want_float_op(iodev->info->mode_info[4].raw_max, ==, 3600.0); - tt_want_float_op(iodev->info->mode_info[4].pct_min, ==, 0.0); - tt_want_float_op(iodev->info->mode_info[4].pct_max, ==, 100.0); - tt_want_float_op(iodev->info->mode_info[4].si_min, ==, 0.0); - tt_want_float_op(iodev->info->mode_info[4].si_max, ==, 3600.0); - tt_want_str_op(iodev->info->mode_info[4].uom, ==, "CAL"); tt_want_uint_op(iodev->info->mode_info[4].input_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[4].output_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[4].num_values, ==, 2); tt_want_uint_op(iodev->info->mode_info[4].data_type, ==, PBIO_IODEV_DATA_TYPE_INT16); - tt_want_uint_op(iodev->info->mode_info[4].digits, ==, 5); - tt_want_uint_op(iodev->info->mode_info[4].decimals, ==, 0); tt_want_uint_op(iodev->info->mode_info[5].flags.flags0, ==, LUMP_MODE_FLAGS0_NONE); tt_want_uint_op(iodev->info->mode_info[5].flags.flags1, ==, LUMP_MODE_FLAGS1_NONE); tt_want_uint_op(iodev->info->mode_info[5].flags.flags4, ==, LUMP_MODE_FLAGS4_UNKNOWN_BIT2 | LUMP_MODE_FLAGS4_USES_HBRIDGE); tt_want_uint_op(iodev->info->mode_info[5].flags.flags5, ==, LUMP_MODE_FLAGS5_UNKNOWN_BIT2); - tt_want_float_op(iodev->info->mode_info[5].raw_min, ==, 0.0); - tt_want_float_op(iodev->info->mode_info[5].raw_max, ==, 65535.0); - tt_want_float_op(iodev->info->mode_info[5].pct_min, ==, 0.0); - tt_want_float_op(iodev->info->mode_info[5].pct_max, ==, 100.0); - tt_want_float_op(iodev->info->mode_info[5].si_min, ==, 0.0); - tt_want_float_op(iodev->info->mode_info[5].si_max, ==, 65535.0); - tt_want_str_op(iodev->info->mode_info[5].uom, ==, "MIN"); tt_want_uint_op(iodev->info->mode_info[5].input_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[5].output_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[5].num_values, ==, 14); tt_want_uint_op(iodev->info->mode_info[5].data_type, ==, PBIO_IODEV_DATA_TYPE_INT16); - tt_want_uint_op(iodev->info->mode_info[5].digits, ==, 5); - tt_want_uint_op(iodev->info->mode_info[5].decimals, ==, 0); PT_YIELD(pt);