| 461 | return true; |
| 462 | } |
| 463 | bool load_cycle(pb_istream_t *stream, const pb_field_t *field, void **arg) |
| 464 | { |
| 465 | auto profile = working_profile; |
| 466 | printf("found cycle! %p\r\n", profile.get()); |
| 467 | auto last_cycle = new CycleInput(); |
| 468 | last_special = last_cycle; |
| 469 | proto_CycleInput input; |
| 470 | input.input.cb_input.funcs.decode = load_input_dev; |
| 471 | input.input.cb_input.arg = arg; |
| 472 | if (!pb_decode(stream, proto_CycleInput_fields, &input)) |
| 473 | { |
| 474 | printf("couldnt decode cycle input?\r\n"); |
| 475 | return false; |
| 476 | } |
| 477 | |
| 478 | printf("check %d %d\r\n", input.deviceid, profile->devices.size()); |
| 479 | if (profile->devices.find(input.deviceid) == profile->devices.end()) |
| 480 | { |
| 481 | printf("why tho\r\n"); |
| 482 | return true; |
| 483 | } |
| 484 | printf("loading cycle\r\n"); |
| 485 | last_cycle->load(input, std::static_pointer_cast<CycleDevice>(profile->devices[input.deviceid]), input.has_input ? make_input(input.input, profile, stream) : nullptr, input.has_inputReverse ? make_input(input.inputReverse, profile, stream) : nullptr); |
| 486 | printf("loaded cycle\r\n"); |
| 487 | return true; |
| 488 | } |
| 489 | bool load_toggle(pb_istream_t *stream, const pb_field_t *field, void **arg) |
| 490 | { |
| 491 | auto profile = working_profile; |
nothing calls this directly
no test coverage detected