TEST: disable BLE init to isolate button press crash
This commit is contained in:
@@ -111,20 +111,7 @@ void BleMidiTransport::on_midi_receive(std::function<void(const MidiEvent&)> cal
|
||||
}
|
||||
|
||||
void BleMidiTransport::send_midi_packet(const uint8_t* data, uint8_t len) {
|
||||
if (!initialized) {
|
||||
Serial.println("[BLE DBG] send_midi_packet: not initialized");
|
||||
return;
|
||||
}
|
||||
if (!client_connected) {
|
||||
Serial.println("[BLE DBG] send_midi_packet: no client");
|
||||
return;
|
||||
}
|
||||
if (!ble_char) {
|
||||
Serial.println("[BLE DBG] send_midi_packet: null char");
|
||||
return;
|
||||
}
|
||||
|
||||
Serial.println("[BLE DBG] send_midi_packet: proceeding to send");
|
||||
if (!initialized || !client_connected || !ble_char) return;
|
||||
|
||||
uint16_t timestamp = micros() & 0x3FFF;
|
||||
uint8_t packet[16];
|
||||
@@ -135,11 +122,8 @@ void BleMidiTransport::send_midi_packet(const uint8_t* data, uint8_t len) {
|
||||
packet[idx++] = data[i];
|
||||
}
|
||||
|
||||
Serial.println("[BLE DBG] calling setValue...");
|
||||
ble_char->setValue(packet, idx);
|
||||
Serial.println("[BLE DBG] calling notify...");
|
||||
ble_char->notify();
|
||||
Serial.println("[BLE DBG] notify done");
|
||||
}
|
||||
|
||||
void BleMidiTransport::send_note_on(uint8_t channel, uint8_t note, uint8_t velocity) {
|
||||
@@ -155,11 +139,8 @@ void BleMidiTransport::send_note_off(uint8_t channel, uint8_t note, uint8_t velo
|
||||
}
|
||||
|
||||
void BleMidiTransport::send_cc(uint8_t channel, uint8_t cc, uint8_t value) {
|
||||
Serial.printf("[BLE DBG] send_cc entered: ch=%d cc=%d val=%d init=%d conn=%d char=%p\n",
|
||||
channel, cc, value, initialized, client_connected, ble_char);
|
||||
uint8_t packet[3] = {(uint8_t)(0xB0 | (channel - 1)), cc, value};
|
||||
send_midi_packet(packet, 3);
|
||||
Serial.printf("[BLE OUT] Ch:%d CC:%d:%d\n", channel, cc, value);
|
||||
}
|
||||
|
||||
bool BleMidiTransport::is_connected() {
|
||||
|
||||
Reference in New Issue
Block a user