Esp32 - code is not running

im connecting to the battery via BMS, BMS is based on the query type where im trying to send the requestID, i couldn't connect it, its not working, kindly please update me, where i did the mistake and explain how should i have to handle it.

#include <mcp_can.h>
#include <SPI.h>

void voltage(void);
void current(void);

// CAN TX Variables
//unsigned long prevTX = 0;
//const unsigned int invlTX = 1000;

byte data[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

// CAN RX Variables
long unsigned int rxId ;
unsigned char len;
unsigned char rxBuf[8];

// CAN0 INT and CS
#define CAN0_INT 4 //   #define MCP2515_CS_PIN 5   // Chip select pin
MCP_CAN CAN0(5);//#define MCP2515_INT_PIN 4 


void setup() {
  Serial.begin(115200);

  if (CAN0.begin(MCP_ANY, CAN_250KBPS, MCP_8MHZ) == CAN_OK)
    Serial.println("MCP2515 Initialized Successfully!");
  else
    Serial.println("Error Initializing MCP2515...");
  pinMode(CAN0_INT, INPUT);
}

void loop() {
  byte sendV = CAN0.sendMsgBuf(0x18910180, 0, 0, data);
  delay(100);
  voltage();
  byte sendC = CAN0.sendMsgBuf(0x18900180, 0, 0, data);
  delay(1000);
  current();
}

void voltage() {
  if (CAN0.readMsgBuf(&rxId, &len, rxBuf)) {
    byte voltage[8];
    for (byte i = 0; i < len; i++) {
      voltage[i] = rxBuf[i];
    }
    int voltageMax = ((voltage[0] << 8) | voltage[1]) * 0.001;  // milli v to v 
    Serial.print("Voltagemax: ");
    Serial.println(voltageMax);
    int voltageMin = ((voltage[3] << 8) | voltage[4] ) * 0.001; // milli v to volt
    Serial.print("Voltagemin: ");
    Serial.println(voltageMin);
  }
}

void current() {
  if (CAN0.readMsgBuf(&rxId, &len, rxBuf)) {
    byte current[8];
    for (int i = 0; i < len; i++) {
      current[i] = rxBuf[i];
    }
    int currentval = ((current[4] << 8 | current[5]) - 30000 ) * 0.01; // getting amps 0.1 converting from centi
    Serial.print("current: ");
    Serial.println(currentval);
  }
}

How fast can you run, maybe the code is faster. Without more information I cannot help you. I have no idea what the hardware setup is or how you have connected the pieces. BMS is a company that develops and provides medicines for serious diseases or is it something else? I think your mistake is you did not read or understand the forum guidelines. Post an annotated schematic showing exactly how you have wired everything and links to technical information on hardware.

I have mentioned clearly that I connected the battery via BMS; that makes sense of the battery monitoring system [BMS]. Again, on to the code. I extracted the data on voltage and battery through CAN communication. Using esp32 and mcp2515, I'm trying to extract the data from the battery.

Good luck, without the schematic and the thousands of combinations possible I do not want to burn time guessing.