|
8 | 8 |
|
9 | 9 | namespace TeslaBLE |
10 | 10 | { |
11 | | - // Helper function to complete the encoding - will be moved to Client class |
12 | | - static int completeVehicleActionEncoding( |
13 | | - CarServer_Action& action, |
14 | | - pb_byte_t* output_buffer, |
15 | | - size_t* output_length) |
16 | | - { |
17 | | - // For now, return error to indicate incomplete implementation |
18 | | - // This will be completed when we integrate with Client class |
19 | | - return TeslaBLE_Status_E_ERROR_INTERNAL; |
20 | | - } |
21 | 11 |
|
22 | 12 | // Forward declarations of builder functions |
23 | 13 | static int buildChargingSetLimit(CarServer_VehicleAction& action, const void* data); |
@@ -75,49 +65,6 @@ namespace TeslaBLE |
75 | 65 | {CarServer_VehicleAction_hvacBioweaponModeAction_tag, buildHvacBioweaponMode} |
76 | 66 | }; |
77 | 67 |
|
78 | | - int VehicleActionBuilder::buildVehicleAction( |
79 | | - pb_size_t action_type, |
80 | | - const void* action_data, |
81 | | - pb_byte_t* output_buffer, |
82 | | - size_t* output_length) |
83 | | - { |
84 | | - // Validate input parameters |
85 | | - int result = validateInputParameters(output_buffer, output_length); |
86 | | - if (result != TeslaBLE_Status_E_OK) { |
87 | | - return result; |
88 | | - } |
89 | | - |
90 | | - // Find the appropriate builder |
91 | | - auto it = builders_.find(action_type); |
92 | | - if (it == builders_.end()) { |
93 | | - LOG_ERROR("Unsupported vehicle action type: %d", action_type); |
94 | | - return TeslaBLE_Status_E_ERROR_INVALID_PARAMS; |
95 | | - } |
96 | | - |
97 | | - // Create the action structure |
98 | | - CarServer_Action action = CarServer_Action_init_default; |
99 | | - action.which_action_msg = CarServer_Action_vehicleAction_tag; |
100 | | - |
101 | | - CarServer_VehicleAction vehicle_action = CarServer_VehicleAction_init_default; |
102 | | - vehicle_action.which_vehicle_action_msg = action_type; |
103 | | - |
104 | | - // Build the specific action |
105 | | - result = it->second(vehicle_action, action_data); |
106 | | - if (result != TeslaBLE_Status_E_OK) { |
107 | | - return result; |
108 | | - } |
109 | | - |
110 | | - action.action_msg.vehicleAction = vehicle_action; |
111 | | - |
112 | | - // Complete the encoding using the helper function |
113 | | - return completeVehicleActionEncoding(action, output_buffer, output_length); |
114 | | - } |
115 | | - |
116 | | - const std::unordered_map<pb_size_t, VehicleActionBuilder::BuilderFunction>& |
117 | | - VehicleActionBuilder::getBuilders() { |
118 | | - return builders_; |
119 | | - } |
120 | | - |
121 | 68 | // Builder implementations |
122 | 69 | int VehicleActionBuilder::buildChargingSetLimit(CarServer_VehicleAction& action, const void* data) |
123 | 70 | { |
|
0 commit comments