|
1 | 1 | #include <BaseClasses/ANT_BaseAntWithCallbacks.h> |
2 | 2 |
|
| 3 | +// cppcheck-suppress unusedFunction |
3 | 4 | void BaseAntWithCallbacks::loop() { |
4 | 5 | if (loopTop()) |
5 | 6 | loopBottom(); |
@@ -155,111 +156,111 @@ uint8_t BaseAntWithCallbacks::waitForInternal(uint8_t msgId, void *response, uin |
155 | 156 | // must be unified as well). |
156 | 157 | switch(msgId) { |
157 | 158 | case AcknowledgedData::MSG_ID: { |
158 | | - AcknowledgedData *r = (AcknowledgedData*)response; |
| 159 | + AcknowledgedData *r = static_cast<AcknowledgedData*>(response); |
159 | 160 | bool(*f)(AcknowledgedData&,uintptr_t) = (bool(*)(AcknowledgedData&,uintptr_t))func; |
160 | 161 | getResponse().getAcknowledgedDataMsg(*r); |
161 | 162 | if(!f || f(*r, data)) |
162 | 163 | return 0; |
163 | 164 | break; |
164 | 165 | } |
165 | 166 | case AdvancedBurstData::MSG_ID: { |
166 | | - AdvancedBurstData *r = (AdvancedBurstData*)response; |
| 167 | + AdvancedBurstData *r = static_cast<AdvancedBurstData*>(response); |
167 | 168 | bool(*f)(AdvancedBurstData&,uintptr_t) = (bool(*)(AdvancedBurstData&,uintptr_t))func; |
168 | 169 | getResponse().getAdvancedBurstDataMsg(*r); |
169 | 170 | if(!f || f(*r, data)) |
170 | 171 | return 0; |
171 | 172 | break; |
172 | 173 | } |
173 | 174 | case BroadcastData::MSG_ID: { |
174 | | - BroadcastData *r = (BroadcastData*)response; |
| 175 | + BroadcastData *r = static_cast<BroadcastData*>(response); |
175 | 176 | bool(*f)(BroadcastData&,uintptr_t) = (bool(*)(BroadcastData&,uintptr_t))func; |
176 | 177 | getResponse().getBroadcastDataMsg(*r); |
177 | 178 | if(!f || f(*r, data)) |
178 | 179 | return 0; |
179 | 180 | break; |
180 | 181 | } |
181 | 182 | case BurstTransferData::MSG_ID: { |
182 | | - BurstTransferData *r = (BurstTransferData*)response; |
| 183 | + BurstTransferData *r = static_cast<BurstTransferData*>(response); |
183 | 184 | bool(*f)(BurstTransferData&,uintptr_t) = (bool(*)(BurstTransferData&,uintptr_t))func; |
184 | 185 | getResponse().getBurstTransferDataMsg(*r); |
185 | 186 | if(!f || f(*r, data)) |
186 | 187 | return 0; |
187 | 188 | break; |
188 | 189 | } |
189 | 190 | case AdvancedBurstCapabilitiesConfiguration::MSG_ID: { |
190 | | - AdvancedBurstCapabilitiesConfiguration *r = (AdvancedBurstCapabilitiesConfiguration*)response; |
| 191 | + AdvancedBurstCapabilitiesConfiguration *r = static_cast<AdvancedBurstCapabilitiesConfiguration*>(response); |
191 | 192 | bool(*f)(AdvancedBurstCapabilitiesConfiguration&,uintptr_t) = (bool(*)(AdvancedBurstCapabilitiesConfiguration&,uintptr_t))func; |
192 | 193 | getResponse().getAdvancedBurstDataMsg(*r); |
193 | 194 | if(!f || f(*r, data)) |
194 | 195 | return 0; |
195 | 196 | break; |
196 | 197 | } |
197 | 198 | case AntVersion::MSG_ID: { |
198 | | - AntVersion *r = (AntVersion*)response; |
| 199 | + AntVersion *r = static_cast<AntVersion*>(response); |
199 | 200 | bool(*f)(AntVersion&,uintptr_t) = (bool(*)(AntVersion&,uintptr_t))func; |
200 | 201 | getResponse().getAntVersionMsg(*r); |
201 | 202 | if(!f || f(*r, data)) |
202 | 203 | return 0; |
203 | 204 | break; |
204 | 205 | } |
205 | 206 | case Capabilities::MSG_ID: { |
206 | | - Capabilities *r = (Capabilities*)response; |
| 207 | + Capabilities *r = static_cast<Capabilities*>(response); |
207 | 208 | bool(*f)(Capabilities&,uintptr_t) = (bool(*)(Capabilities&,uintptr_t))func; |
208 | 209 | getResponse().getCapabilitiesMsg(*r); |
209 | 210 | if(!f || f(*r, data)) |
210 | 211 | return 0; |
211 | 212 | break; |
212 | 213 | } |
213 | 214 | case ChannelEventResponse::MSG_ID: { |
214 | | - ChannelEventResponse *r = (ChannelEventResponse*)response; |
| 215 | + ChannelEventResponse *r = static_cast<ChannelEventResponse*>(response); |
215 | 216 | bool(*f)(ChannelEventResponse&,uintptr_t) = (bool(*)(ChannelEventResponse&,uintptr_t))func; |
216 | 217 | getResponse().getChannelEventResponseMsg(*r); |
217 | 218 | if(!f || f(*r, data)) |
218 | 219 | return 0; |
219 | 220 | break; |
220 | 221 | } |
221 | 222 | case ChannelIdResponse::MSG_ID: { |
222 | | - ChannelIdResponse *r = (ChannelIdResponse*)response; |
| 223 | + ChannelIdResponse *r = static_cast<ChannelIdResponse*>(response); |
223 | 224 | bool(*f)(ChannelIdResponse&,uintptr_t) = (bool(*)(ChannelIdResponse&,uintptr_t))func; |
224 | 225 | getResponse().getChannelIdResponseMsg(*r); |
225 | 226 | if(!f || f(*r, data)) |
226 | 227 | return 0; |
227 | 228 | break; |
228 | 229 | } |
229 | 230 | case ChannelStatus::MSG_ID: { |
230 | | - ChannelStatus *r = (ChannelStatus*)response; |
| 231 | + ChannelStatus *r = static_cast<ChannelStatus*>(response); |
231 | 232 | bool(*f)(ChannelStatus&,uintptr_t) = (bool(*)(ChannelStatus&,uintptr_t))func; |
232 | 233 | getResponse().getChannelStatusMsg(*r); |
233 | 234 | if(!f || f(*r, data)) |
234 | 235 | return 0; |
235 | 236 | break; |
236 | 237 | } |
237 | 238 | case EncryptionModeParameters::MSG_ID: { |
238 | | - EncryptionModeParameters *r = (EncryptionModeParameters*)response; |
| 239 | + EncryptionModeParameters *r = static_cast<EncryptionModeParameters*>(response); |
239 | 240 | bool(*f)(EncryptionModeParameters&,uintptr_t) = (bool(*)(EncryptionModeParameters&,uintptr_t))func; |
240 | 241 | getResponse().getEncryptionModeParametersMsg(*r); |
241 | 242 | if(!f || f(*r, data)) |
242 | 243 | return 0; |
243 | 244 | break; |
244 | 245 | } |
245 | 246 | case EventFilter::MSG_ID: { |
246 | | - EventFilter *r = (EventFilter*)response; |
| 247 | + EventFilter *r = static_cast<EventFilter*>(response); |
247 | 248 | bool(*f)(EventFilter&,uintptr_t) = (bool(*)(EventFilter&,uintptr_t))func; |
248 | 249 | getResponse().getEventFilterMsg(*r); |
249 | 250 | if(!f || f(*r, data)) |
250 | 251 | return 0; |
251 | 252 | break; |
252 | 253 | } |
253 | 254 | case SelectiveDataUpdateMaskSetting::MSG_ID: { |
254 | | - SelectiveDataUpdateMaskSetting *r = (SelectiveDataUpdateMaskSetting*)response; |
| 255 | + SelectiveDataUpdateMaskSetting *r = static_cast<SelectiveDataUpdateMaskSetting*>(response); |
255 | 256 | bool(*f)(SelectiveDataUpdateMaskSetting&,uintptr_t) = (bool(*)(SelectiveDataUpdateMaskSetting&,uintptr_t))func; |
256 | 257 | getResponse().getSelectiveDataUpdateMaskSettingMsg(*r); |
257 | 258 | if(!f || f(*r, data)) |
258 | 259 | return 0; |
259 | 260 | break; |
260 | 261 | } |
261 | 262 | case StartUpMessage::MSG_ID: { |
262 | | - StartUpMessage *r = (StartUpMessage*)response; |
| 263 | + StartUpMessage *r = static_cast<StartUpMessage*>(response); |
263 | 264 | bool(*f)(StartUpMessage&,uintptr_t) = (bool(*)(StartUpMessage&,uintptr_t))func; |
264 | 265 | getResponse().getStartUpMsg(*r); |
265 | 266 | if(!f || f(*r, data)) |
|
0 commit comments