MCPcopy Create free account
hub / github.com/BruceDevices/firmware / txSubFile

Function txSubFile

src/modules/rf/rf_send.cpp:276–336  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

274}
275
276bool txSubFile(RfCodes &selected_code, bool hideDefaultUI) {
277 int sent = 0;
278
279 int total = bitList.size() + bitRawList.size() + keyList.size() + rawDataList.size() > 0 ? 1 : 0;
280 Serial.printf("Total signals found: %d\n", total);
281 // If the signal is complete, send all of the code(s) that were found in it.
282 // TODO: try to minimize the overhead between codes.
283 if (selected_code.protocol != "" && selected_code.preset != "" && selected_code.frequency > 0) {
284 for (int bit : bitList) {
285 selected_code.Bit = bit;
286 sendRfCommand(selected_code, hideDefaultUI);
287 sent++;
288 if (!hideDefaultUI) {
289 if (check(EscPress)) break;
290 displayTextLine("Sent " + String(sent) + "/" + String(total));
291 }
292 }
293 for (int bitRaw : bitRawList) {
294 selected_code.Bit = bitRaw;
295 sendRfCommand(selected_code, hideDefaultUI);
296 sent++;
297 if (!hideDefaultUI) {
298 if (check(EscPress)) break;
299 displayTextLine("Sent " + String(sent) + "/" + String(total));
300 }
301 }
302 for (uint64_t key : keyList) {
303 selected_code.key = key;
304 sendRfCommand(selected_code, hideDefaultUI);
305 sent++;
306 if (!hideDefaultUI) {
307 if (check(EscPress)) break;
308 displayTextLine("Sent " + String(sent) + "/" + String(total));
309 }
310 }
311
312 // RAS_Data is considered one long signal, doesn't matter the number of lines it has
313 if (rawDataList.size() > 0) sent++;
314 for (String rawData : rawDataList) {
315 selected_code.data = rawData;
316 sendRfCommand(selected_code, hideDefaultUI);
317 // sent++;
318 if (check(EscPress)) break;
319 // displayTextLine("Sent " + String(sent) + "/" + String(total));
320 }
321 addToRecentCodes(selected_code);
322 }
323
324 Serial.printf("\nSent %d of %d signals\n", sent, total);
325 if (!hideDefaultUI) { displayTextLine("Sent " + String(sent) + "/" + String(total), true); }
326
327 // Reset vectors
328 bitList.clear();
329 bitRawList.clear();
330 keyList.clear();
331 rawDataList.clear();
332
333 delay(1000);

Callers 4

sendCustomRFFunction · 0.85
loopSDFunction · 0.85
rfTxFileCallbackFunction · 0.85
rfTxBufferCallbackFunction · 0.85

Calls 8

sendRfCommandFunction · 0.85
checkFunction · 0.85
displayTextLineFunction · 0.85
deinitRfModuleFunction · 0.85
sizeMethod · 0.80
addToRecentCodesFunction · 0.70
printfMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected