@@ -1044,11 +1044,11 @@ void OpenBCI_32bit_Library::sendChannelData(PACKET_TYPE packetType) {
10441044 if (wifi.present && wifi.tx ) {
10451045 sendChannelDataWifi (packetType, false );
10461046 if (daisyPresent) sendChannelDataWifi (packetType, true );
1047+ } else {
1048+ // Send over bluetooth
1049+ if (iSerial0.tx || iSerial1.tx ) sendChannelDataSerial (packetType);
10471050 }
10481051
1049- // Send over bluetooth
1050- if (iSerial0.tx || iSerial1.tx ) sendChannelDataSerial (packetType);
1051-
10521052 if (packetType == PACKET_TYPE_ACCEL ) LIS3DH_zeroAxisData ();
10531053 if (packetType == PACKET_TYPE_RAW_AUX || packetType == PACKET_TYPE_RAW_AUX_TIME_SYNC ) zeroAuxData ();
10541054
@@ -1558,19 +1558,27 @@ void OpenBCI_32bit_Library::streamSafeSetAllChannelsToDefault(void) {
15581558 }
15591559}
15601560
1561+ /* *
1562+ * Return an array of gains in coded ADS form i.e. 0-6 where 6 is x24 and so on.
1563+ * @return [description]
1564+ */
1565+ uint8_t *OpenBCI_32bit_Library::getGains (void ) {
1566+ uint8_t gains[numChannels];
1567+ for (uint8_t i = 0 ; i < numChannels; i++) {
1568+ gains[i] = channelSettings[i][GAIN_SET ];
1569+ }
1570+ return gains;
1571+ }
1572+
15611573/* *
15621574* @description Call this to start the streaming data from the ADS1299
15631575* @returns boolean if able to start streaming
15641576*/
15651577void OpenBCI_32bit_Library::streamStart (){ // needs daisy functionality
15661578
15671579 if (wifi.present && wifi.tx ) {
1568- uint8_t gains[numChannels];
1569- for (uint8_t i = 0 ; i < numChannels; i++) {
1570- gains[i] = channelSettings[i][GAIN_SET ];
1571- }
15721580 // TODO: Remove this debug line
1573- wifi.sendGains (numChannels, gains );
1581+ wifi.sendGains (numChannels, getGains () );
15741582 }
15751583 streaming = true ;
15761584 startADS ();
0 commit comments