Untitled

 avatar
unknown
plain_text
4 years ago
26 kB
6
Indexable
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//Libraries used
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

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


///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//Declaration used
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

const int spiCSPin = 10;
String firstvalue;
String secondvalue;
String command = "";
String response;




///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//SPI Config
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

MCP_CAN CAN(spiCSPin);


///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//Setup
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

void setup()
{
  pinMode(5, OUTPUT);
  SPI.begin();                          
  Serial.begin(115200);
  //while (CAN_OK != CAN.begin(CAN_500KBPS))
  while (CAN_OK != CAN.begin(CAN_500KBPS,MCP_8MHz))
  {
    Serial.println("CAN BUS Init Failed");
    delay(100);
  }
  Serial.println("CAN BUS  Init OK!");
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//loop
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


void loop()
{
  command = "";
  unsigned char len = 0;
  unsigned char buf[8];
  if (CAN_MSGAVAIL == CAN.checkReceive())
  {
    CAN.readMsgBuf(&len, buf);
    unsigned long canId = CAN.getCanId();
    Serial.println("canid input recieved");
    Serial.print("Data from ID: 0x");
    Serial.println(canId, HEX);

    if (buf[1] < 0x10) // If data byte is less than 0x10, add a leading zero
    {
      firstvalue = ("0" + String(buf[1]));
    }
    else {
      firstvalue = (String(buf[1]));
    }

    if (buf[2] < 0x10) // If data byte is less than 0x10, add a leading zero
    {
      secondvalue = ("0" + String(buf[2]));
    }
    else
    {
      secondvalue = (String(buf[2]));
    }
    Serial.println(firstvalue);
    Serial.println(secondvalue);
    command = (firstvalue + secondvalue);
    Serial.println("Recieved command");
    Serial.println(command);

    // String BuildMessage="";
    // for(int i = 0; i<len; i++)
    // {  
    //   BuildMessage = BuildMessage + buf[i] + ",";
    // }
    // Serial.println(BuildMessage);

    if (command == "0100")
    {
      unsigned char response0100x5j[7] = {6, 65, 0, 190, 31, 168, 19};
      CAN.sendMsgBuf(0x7E8, 0, 7, response0100x5j);
    }

    if (command == "0101")
    {
      unsigned char response0101mvy[7] = {6, 65, 1, 0, 7, 229, 4};
      CAN.sendMsgBuf(0x7E8, 0, 7, response0101mvy);
    }

    if (command == "0103")
    {
      unsigned char response0103mkv[4] = {4, 65, 3, 2};
      CAN.sendMsgBuf(0x7E8, 0, 4, response0103mkv);
    }

    if (command == "0104")
    {
      unsigned char response01040cj[4] = {3, 65, 4, 85};
      CAN.sendMsgBuf(0x7E8, 0, 4, response01040cj);
    }

    if (command == "0105")
    {
      unsigned char response0105lqo[4] = {3, 65, 5, 125};
      CAN.sendMsgBuf(0x7E8, 0, 4, response0105lqo);
    }

    if (command == "0106")
    {
      unsigned char response0106tj8[4] = {3, 65, 6, 127};
      CAN.sendMsgBuf(0x7E8, 0, 4, response0106tj8);
    }

    if (command == "0107")
    {
      unsigned char response010747b[4] = {3, 65, 7, 139};
      CAN.sendMsgBuf(0x7E8, 0, 4, response010747b);
    }

    if (command == "01012")
    {
      unsigned char response010Cthn[5] = {4, 65, 12, 10, 90};
      CAN.sendMsgBuf(0x7E8, 0, 5, response010Cthn);
    }

    if (command == "01013")
    {
      unsigned char response010Dht5[3] = {3, 65, 13};
      CAN.sendMsgBuf(0x7E8, 0, 3, response010Dht5);
    }

    if (command == "01014")
    {
      unsigned char response010Ebh1[4] = {3, 65, 14, 147};
      CAN.sendMsgBuf(0x7E8, 0, 4, response010Ebh1);
    }

    if (command == "01015")
    {
      unsigned char response010Fghc[4] = {3, 65, 15, 98};
      CAN.sendMsgBuf(0x7E8, 0, 4, response010Fghc);
    }

    if (command == "0116")
    {
      unsigned char response0110iyf[5] = {4, 65, 16, 1, 48};
      CAN.sendMsgBuf(0x7E8, 0, 5, response0110iyf);
    }

    if (command == "0117")
    {
      unsigned char response0111pu7[4] = {3, 65, 17, 43};
      CAN.sendMsgBuf(0x7E8, 0, 4, response0111pu7);
    }

    if (command == "0119")
    {
      unsigned char response0113cl4[4] = {3, 65, 19, 3};
      CAN.sendMsgBuf(0x7E8, 0, 4, response0113cl4);
    }

    if (command == "0121")
    {
      unsigned char response0115mzr[5] = {4, 65, 21, 0, 255};
      CAN.sendMsgBuf(0x7E8, 0, 5, response0115mzr);
    }

    if (command == "0128")
    {
      unsigned char response011Cgzz[4] = {3, 65, 28, 1};
      CAN.sendMsgBuf(0x7E8, 0, 4, response011Cgzz);
    }

    if (command == "0131")
    {
      unsigned char response011F55r[5] = {4, 65, 31, 0, 68};
      CAN.sendMsgBuf(0x7E8, 0, 5, response011F55r);
    }

    if (command == "0132")
    {
      unsigned char response012013u[7] = {6, 65, 32, 144, 5, 176, 21};
      CAN.sendMsgBuf(0x7E8, 0, 7, response012013u);
    }

    if (command == "0133")
    {
      unsigned char response0121pcc[3] = {4, 65, 33};
      CAN.sendMsgBuf(0x7E8, 0, 3, response0121pcc);
    }

    if (command == "0136")
    {
      unsigned char response0124rj3[7] = {6, 65, 36, 125, 180, 102, 41};
      CAN.sendMsgBuf(0x7E8, 0, 7, response0124rj3);
    }

//    if (command == "0146")
//    {
////      unsigned char response012Ezci[3] = {3, 65, 46}; // actual
//      unsigned char response012Ezci[3] = {3, 65, 150};
//      CAN.sendMsgBuf(0x7E8, 0, 3, response012Ezci);
//    }

    if (command == "0148")
    {
      unsigned char response0130yg4[3] = {3, 65, 48};
      CAN.sendMsgBuf(0x7E8, 0, 3, response0130yg4);
    }

    if (command == "0149")
    {
      unsigned char response0131fzb[5] = {4, 65, 49, 0, 71};
      CAN.sendMsgBuf(0x7E8, 0, 5, response0131fzb);
    }

    if (command == "0151")
    {
      unsigned char response0133slu[4] = {3, 65, 51, 100};
      CAN.sendMsgBuf(0x7E8, 0, 4, response0133slu);
    }

    if (command == "0152")
    {
      unsigned char response0134t4k[7] = {6, 65, 52, 124, 57, 127, 239};
      CAN.sendMsgBuf(0x7E8, 0, 7, response0134t4k);
    }

    if (command == "0160")
    {
      unsigned char response013Cjir[5] = {4, 65, 60, 14, 52};
      CAN.sendMsgBuf(0x7E8, 0, 5, response013Cjir);
    }

    if (command == "0162")
    {
      unsigned char response013Eb2p[5] = {4, 65, 62, 4, 144};
      CAN.sendMsgBuf(0x7E8, 0, 5, response013Eb2p);
    }

    if (command == "0164")
    {
      unsigned char response0140xq8[7] = {6, 65, 64, 250, 220, 160, 1};
      CAN.sendMsgBuf(0x7E8, 0, 7, response0140xq8);
    }

    if (command == "0165")
    {
      unsigned char response0141d5g[7] = {6, 65, 65, 0, 7, 229, 229};
      CAN.sendMsgBuf(0x7E8, 0, 7, response0141d5g);
    }

    if (command == "0166")
    {
      unsigned char response014243d[5] = {4, 65, 66, 51, 244};
      CAN.sendMsgBuf(0x7E8, 0, 5, response014243d);
    }

    if (command == "0167")
    {
      unsigned char response0143649[5] = {4, 65, 67, 0, 46};
      CAN.sendMsgBuf(0x7E8, 0, 5, response0143649);
    }

    if (command == "0168")
    {
      unsigned char response0144r4z[4] = {4, 65, 68, 128};
      CAN.sendMsgBuf(0x7E8, 0, 4, response0144r4z);
    }

    if (command == "0169")
    {
      unsigned char response0145qns[3] = {3, 65, 69};
      CAN.sendMsgBuf(0x7E8, 0, 3, response0145qns);
    }

    if (command == "0171")
    {
      unsigned char response0147sao[4] = {3, 65, 71, 125};
      CAN.sendMsgBuf(0x7E8, 0, 4, response0147sao);
    }

    if (command == "0173")
    {
      unsigned char response01493xz[4] = {3, 65, 73, 41};
      CAN.sendMsgBuf(0x7E8, 0, 4, response01493xz);
    }

    if (command == "0174")
    {
      unsigned char response014Adj0[4] = {3, 65, 74, 82};
      CAN.sendMsgBuf(0x7E8, 0, 4, response014Adj0);
    }

    if (command == "0176")
    {
      unsigned char response014Ck48[4] = {3, 65, 76, 43};
      CAN.sendMsgBuf(0x7E8, 0, 4, response014Ck48);
    }

    if (command == "0177")
    {
      unsigned char response014Dd7m[3] = {4, 65, 77};
      CAN.sendMsgBuf(0x7E8, 0, 3, response014Dd7m);
    }

    if (command == "0178")
    {
      unsigned char response014E76w[5] = {4, 65, 78, 0, 84};
      CAN.sendMsgBuf(0x7E8, 0, 5, response014E76w);
    }

    if (command == "0181")
    {
      unsigned char response0151113[4] = {3, 65, 81, 1};
      CAN.sendMsgBuf(0x7E8, 0, 4, response0151113);
    }

//    if (command == "0183")
//    {
//      //unsigned char response01532iy[5] = {4, 65, 83, 78, 183};//actual
//      unsigned char response01532iy[5] = {4, 65, 83, 38, 183};
//      CAN.sendMsgBuf(0x7E8, 0, 5, response01532iy);
//    }

    if (command == "0201")
    {
      unsigned char response0201gxi[4] = {3, 127, 2, 18};
      CAN.sendMsgBuf(0x7E8, 0, 4, response0201gxi);
    }

    if (command == "0203")
    {
      unsigned char response0203ua4[4] = {3, 127, 2, 18};
      CAN.sendMsgBuf(0x7E8, 0, 4, response0203ua4);
    }

    if (command == "0204")
    {
      unsigned char response0204xj4[4] = {3, 127, 2, 18};
      CAN.sendMsgBuf(0x7E8, 0, 4, response0204xj4);
    }

    if (command == "0205")
    {
      unsigned char response020570v[4] = {3, 127, 2, 18};
      CAN.sendMsgBuf(0x7E8, 0, 4, response020570v);
    }

    if (command == "0206")
    {
      unsigned char response0206azb[4] = {3, 127, 2, 18};
      CAN.sendMsgBuf(0x7E8, 0, 4, response0206azb);
    }

    if (command == "0207")
    {
      unsigned char response0207ihw[4] = {3, 127, 2, 18};
      CAN.sendMsgBuf(0x7E8, 0, 4, response0207ihw);
    }

    if (command == "02012")
    {
      unsigned char response020C81t[4] = {3, 127, 2, 18};
      CAN.sendMsgBuf(0x7E8, 0, 4, response020C81t);
    }

    if (command == "02013")
    {
      unsigned char response020Djjf[4] = {3, 127, 2, 18};
      CAN.sendMsgBuf(0x7E8, 0, 4, response020Djjf);
    }

    if (command == "02014")
    {
      unsigned char response020Eh32[4] = {3, 127, 2, 18};
      CAN.sendMsgBuf(0x7E8, 0, 4, response020Eh32);
    }

    if (command == "02015")
    {
      unsigned char response020Fcve[4] = {3, 127, 2, 18};
      CAN.sendMsgBuf(0x7E8, 0, 4, response020Fcve);
    }

    if (command == "0216")
    {
      unsigned char response021007k[4] = {3, 127, 2, 18};
      CAN.sendMsgBuf(0x7E8, 0, 4, response021007k);
    }

    if (command == "0217")
    {
      unsigned char response02113ov[4] = {3, 127, 2, 18};
      CAN.sendMsgBuf(0x7E8, 0, 4, response02113ov);
    }

    if (command == "0219")
    {
      unsigned char response0213tky[4] = {3, 127, 2, 18};
      CAN.sendMsgBuf(0x7E8, 0, 4, response0213tky);
    }

    if (command == "0221")
    {
      unsigned char response0215msa[4] = {3, 127, 2, 18};
      CAN.sendMsgBuf(0x7E8, 0, 4, response0215msa);
    }

    if (command == "0228")
    {
      unsigned char response021Cswc[4] = {3, 127, 2, 18};
      CAN.sendMsgBuf(0x7E8, 0, 4, response021Cswc);
    }

    if (command == "0231")
    {
      unsigned char response021Fgqy[4] = {3, 127, 2, 18};
      CAN.sendMsgBuf(0x7E8, 0, 4, response021Fgqy);
    }

    if (command == "0232")
    {
      unsigned char response0220q7i[4] = {3, 127, 2, 18};
      CAN.sendMsgBuf(0x7E8, 0, 4, response0220q7i);
    }

    if (command == "0233")
    {
      unsigned char response0221jw2[4] = {3, 127, 2, 18};
      CAN.sendMsgBuf(0x7E8, 0, 4, response0221jw2);
    }

    if (command == "0236")
    {
      unsigned char response0224t63[4] = {3, 127, 2, 18};
      CAN.sendMsgBuf(0x7E8, 0, 4, response0224t63);
    }

    if (command == "0246")
    {
      unsigned char response022Evtv[4] = {3, 127, 2, 18};
      CAN.sendMsgBuf(0x7E8, 0, 4, response022Evtv);
    }

    if (command == "0248")
    {
      unsigned char response0230aig[4] = {3, 127, 2, 18};
      CAN.sendMsgBuf(0x7E8, 0, 4, response0230aig);
    }

    if (command == "0249")
    {
      unsigned char response0231fe2[4] = {3, 127, 2, 18};
      CAN.sendMsgBuf(0x7E8, 0, 4, response0231fe2);
    }

    if (command == "0251")
    {
      unsigned char response023339h[4] = {3, 127, 2, 18};
      CAN.sendMsgBuf(0x7E8, 0, 4, response023339h);
    }

    if (command == "0252")
    {
      unsigned char response0234vre[4] = {3, 127, 2, 18};
      CAN.sendMsgBuf(0x7E8, 0, 4, response0234vre);
    }

    if (command == "0260")
    {
      unsigned char response023C8kv[4] = {3, 127, 2, 18};
      CAN.sendMsgBuf(0x7E8, 0, 4, response023C8kv);
    }

    if (command == "0262")
    {
      unsigned char response023Ed5o[4] = {3, 127, 2, 18};
      CAN.sendMsgBuf(0x7E8, 0, 4, response023Ed5o);
    }

    if (command == "0264")
    {
      unsigned char response02404lt[4] = {3, 127, 2, 18};
      CAN.sendMsgBuf(0x7E8, 0, 4, response02404lt);
    }

    if (command == "0265")
    {
      unsigned char response0241aut[4] = {3, 127, 2, 18};
      CAN.sendMsgBuf(0x7E8, 0, 4, response0241aut);
    }

    if (command == "0266")
    {
      unsigned char response02427vn[4] = {3, 127, 2, 18};
      CAN.sendMsgBuf(0x7E8, 0, 4, response02427vn);
    }

    if (command == "0267")
    {
      unsigned char response02431mx[4] = {3, 127, 2, 18};
      CAN.sendMsgBuf(0x7E8, 0, 4, response02431mx);
    }

    if (command == "0268")
    {
      unsigned char response0244y61[4] = {3, 127, 2, 18};
      CAN.sendMsgBuf(0x7E8, 0, 4, response0244y61);
    }

    if (command == "0269")
    {
      unsigned char response0245e5w[4] = {3, 127, 2, 18};
      CAN.sendMsgBuf(0x7E8, 0, 4, response0245e5w);
    }

    if (command == "0271")
    {
      unsigned char response0247b5x[4] = {3, 127, 2, 18};
      CAN.sendMsgBuf(0x7E8, 0, 4, response0247b5x);
    }

    if (command == "0273")
    {
      unsigned char response02497ob[4] = {3, 127, 2, 18};
      CAN.sendMsgBuf(0x7E8, 0, 4, response02497ob);
    }

    if (command == "0274")
    {
      unsigned char response024Axgr[4] = {3, 127, 2, 18};
      CAN.sendMsgBuf(0x7E8, 0, 4, response024Axgr);
    }

    if (command == "0276")
    {
      unsigned char response024Cvi1[4] = {3, 127, 2, 18};
      CAN.sendMsgBuf(0x7E8, 0, 4, response024Cvi1);
    }

    if (command == "0277")
    {
      unsigned char response024Dyx7[4] = {3, 127, 2, 18};
      CAN.sendMsgBuf(0x7E8, 0, 4, response024Dyx7);
    }

    if (command == "0278")
    {
      unsigned char response024Eh8n[4] = {3, 127, 2, 18};
      CAN.sendMsgBuf(0x7E8, 0, 4, response024Eh8n);
    }

    if (command == "0281")
    {
      unsigned char response02514il[4] = {3, 127, 2, 18};
      CAN.sendMsgBuf(0x7E8, 0, 4, response02514il);
    }

    if (command == "0283")
    {
      unsigned char response0253isx[4] = {3, 127, 2, 18};
      CAN.sendMsgBuf(0x7E8, 0, 4, response0253isx);
    }

    if (command == "03")
    {
      unsigned char response03k5l[2] = {2, 67};
      CAN.sendMsgBuf(0x7E8, 0, 2, response03k5l);
    }

    if (command == "0600")
    {
      unsigned char response0600g6p[7] = {6, 70, 0, 192, 0, 0, 1};
      CAN.sendMsgBuf(0x7E8, 0, 7, response0600g6p);
    }

    if (command == "0601")
    {
      unsigned char response060123y[8] = {16, 19, 70, 1, 142, 11, 3, 101};
      CAN.sendMsgBuf(0x7E8, 0, 8, response060123y);
      unsigned char response06018z3[8] = {33, 0, 119, 77, 186, 1, 145, 141};
      CAN.sendMsgBuf(0x7E8, 0, 8, response06018z3);
      unsigned char response060194s[7] = {34, 1, 145, 0, 171, 2, 45};
      CAN.sendMsgBuf(0x7E8, 0, 7, response060194s);
    }

    if (command == "0602")
    {
      unsigned char response0602yok[8] = {16, 37, 70, 2, 8, 11, 2, 210};
      CAN.sendMsgBuf(0x7E8, 0, 8, response0602yok);
      unsigned char response06024r8[8] = {33, 2, 171, 4, 166, 2, 139, 16};
      CAN.sendMsgBuf(0x7E8, 0, 8, response06024r8);
      unsigned char response06029xg[8] = {34, 0, 49, 0, 0, 3, 230, 2};
      CAN.sendMsgBuf(0x7E8, 0, 8, response06029xg);
      unsigned char response0602knc[8] = {35, 141, 16, 5, 210, 0, 0, 27};
      CAN.sendMsgBuf(0x7E8, 0, 8, response0602knc);
      unsigned char response06025rt[7] = {36, 82, 2, 143, 134, 10, 246};
      CAN.sendMsgBuf(0x7E8, 0, 7, response06025rt);
      unsigned char response06027ea[4] = {37, 0, 34, 142};
      CAN.sendMsgBuf(0x7E8, 0, 4, response06027ea);
    }

    if (command == "0632")
    {
      unsigned char response0620del[7] = {6, 70, 32, 128, 0, 8, 9};
      CAN.sendMsgBuf(0x7E8, 0, 7, response0620del);
    }

    if (command == "0633")
    {
      unsigned char response06212bh[8] = {16, 10, 70, 33, 169, 134, 3, 185};
      CAN.sendMsgBuf(0x7E8, 0, 8, response06212bh);
      unsigned char response0621rx2[5] = {33, 3, 178, 127, 255};
      CAN.sendMsgBuf(0x7E8, 0, 5, response0621rx2);
    }

    if (command == "0653")
    {
      unsigned char response0635mqh[6] = {16, 19, 70, 53, 129, 53};
      CAN.sendMsgBuf(0x7E8, 0, 6, response0635mqh);
      unsigned char response0635uae[8] = {33, 0, 0, 3, 181, 53, 133, 53};
      CAN.sendMsgBuf(0x7E8, 0, 8, response0635uae);
      unsigned char response063564v[7] = {34, 0, 0, 0, 0, 3, 181};
      CAN.sendMsgBuf(0x7E8, 0, 7, response063564v);
    }

    if (command == "0661")
    {
      unsigned char response063Dkm5[6] = {16, 100, 70, 61, 201, 253};
      CAN.sendMsgBuf(0x7E8, 0, 6, response063Dkm5);
      unsigned char response063Dbys[8] = {33, 0, 0, 0, 0, 61, 202, 253};
      CAN.sendMsgBuf(0x7E8, 0, 8, response063Dbys);
      unsigned char response063Dm8e[8] = {34, 0, 0, 0, 0, 0, 0, 61};
      CAN.sendMsgBuf(0x7E8, 0, 8, response063Dm8e);
      unsigned char response063Df97[3] = {35, 203, 253};
      CAN.sendMsgBuf(0x7E8, 0, 3, response063Df97);
      unsigned char response063Do2w[5] = {36, 0, 61, 205, 253};
      CAN.sendMsgBuf(0x7E8, 0, 5, response063Do2w);
      unsigned char response063Dp8e[7] = {37, 0, 0, 0, 61, 206, 253};
      CAN.sendMsgBuf(0x7E8, 0, 7, response063Dp8e);
      unsigned char response063D3sb[8] = {38, 0, 0, 0, 0, 0, 61, 207};
      CAN.sendMsgBuf(0x7E8, 0, 8, response063D3sb);
      unsigned char response063Dz4c[2] = {39, 253};
      CAN.sendMsgBuf(0x7E8, 0, 2, response063Dz4c);
      unsigned char response063D0uq[4] = {40, 61, 208, 253};
      CAN.sendMsgBuf(0x7E8, 0, 4, response063D0uq);
      unsigned char response063Dml4[6] = {41, 0, 0, 61, 209, 253};
      CAN.sendMsgBuf(0x7E8, 0, 6, response063Dml4);
      unsigned char response063Dy8a[8] = {42, 0, 0, 0, 0, 61, 212, 253};
      CAN.sendMsgBuf(0x7E8, 0, 8, response063Dy8a);
      unsigned char response063D6q8[8] = {43, 0, 0, 0, 0, 0, 0, 61};
      CAN.sendMsgBuf(0x7E8, 0, 8, response063D6q8);
      unsigned char response063D79y[3] = {44, 213, 253};
      CAN.sendMsgBuf(0x7E8, 0, 3, response063D79y);
      unsigned char response063Di7x[5] = {45, 0, 61, 215, 253};
      CAN.sendMsgBuf(0x7E8, 0, 5, response063Di7x);
      unsigned char response063Dn5o[4] = {46, 0, 127, 255};
      CAN.sendMsgBuf(0x7E8, 0, 4, response063Dn5o);
    }

    if (command == "0664")
    {
      unsigned char response06409vh[7] = {6, 70, 64, 64, 0, 0, 1};
      CAN.sendMsgBuf(0x7E8, 0, 7, response06409vh);
    }

    if (command == "0666")
    {
      unsigned char response06426jg[8] = {16, 10, 70, 66, 145, 19, 76, 229};
      CAN.sendMsgBuf(0x7E8, 0, 8, response06426jg);
      unsigned char response0642uwe[5] = {33, 0, 0, 128, 145};
      CAN.sendMsgBuf(0x7E8, 0, 5, response0642uwe);
    }

    if (command == "0696")
    {
      unsigned char response0660ejc[7] = {6, 70, 96, 0, 0, 0, 1};
      CAN.sendMsgBuf(0x7E8, 0, 7, response0660ejc);
    }

    if (command == "06128")
    {
      unsigned char response0680he0[7] = {6, 70, 128, 128, 0, 0, 1};
      CAN.sendMsgBuf(0x7E8, 0, 7, response0680he0);
    }

    if (command == "06129")
    {
      unsigned char response0681i4c[6] = {16, 19, 70, 129, 129, 133};
      CAN.sendMsgBuf(0x7E8, 0, 6, response0681i4c);
      unsigned char response0681lw0[8] = {33, 0, 0, 0, 0, 129, 130, 132};
      CAN.sendMsgBuf(0x7E8, 0, 8, response0681lw0);
      unsigned char response0681z0r[2] = {34, 0};
      CAN.sendMsgBuf(0x7E8, 0, 2, response0681z0r);
    }

    if (command == "06160")
    {
      unsigned char response06A0qwb[4] = {6, 70, 160, 248};
      CAN.sendMsgBuf(0x7E8, 0, 4, response06A0qwb);
    }

    if (command == "06161")
    {
      unsigned char response06A1nh0[6] = {16, 19, 70, 161, 11, 36};
      CAN.sendMsgBuf(0x7E8, 0, 6, response06A1nh0);
      unsigned char response06A1rzm[8] = {33, 0, 0, 255, 255, 161, 12, 36};
      CAN.sendMsgBuf(0x7E8, 0, 8, response06A1rzm);
      unsigned char response06A1c56[7] = {34, 0, 0, 0, 0, 255, 255};
      CAN.sendMsgBuf(0x7E8, 0, 7, response06A1c56);
    }

    if (command == "06162")
    {
      unsigned char response06A2zgt[6] = {16, 19, 70, 162, 11, 36};
      CAN.sendMsgBuf(0x7E8, 0, 6, response06A2zgt);
      unsigned char response06A2j5o[8] = {33, 0, 0, 255, 255, 162, 12, 36};
      CAN.sendMsgBuf(0x7E8, 0, 8, response06A2j5o);
      unsigned char response06A2qzu[7] = {34, 0, 0, 0, 0, 255, 255};
      CAN.sendMsgBuf(0x7E8, 0, 7, response06A2qzu);
    }

    if (command == "06163")
    {
      unsigned char response06A3cuz[6] = {16, 19, 70, 163, 11, 36};
      CAN.sendMsgBuf(0x7E8, 0, 6, response06A3cuz);
      unsigned char response06A3haf[8] = {33, 0, 0, 255, 255, 163, 12, 36};
      CAN.sendMsgBuf(0x7E8, 0, 8, response06A3haf);
      unsigned char response06A3b22[7] = {34, 0, 0, 0, 0, 255, 255};
      CAN.sendMsgBuf(0x7E8, 0, 7, response06A3b22);
    }

    if (command == "06164")
    {
      unsigned char response06A4b1f[6] = {16, 19, 70, 164, 11, 36};
      CAN.sendMsgBuf(0x7E8, 0, 6, response06A4b1f);
      unsigned char response06A42pl[8] = {33, 0, 0, 255, 255, 164, 12, 36};
      CAN.sendMsgBuf(0x7E8, 0, 8, response06A42pl);
      unsigned char response06A4k80[7] = {34, 0, 0, 0, 0, 255, 255};
      CAN.sendMsgBuf(0x7E8, 0, 7, response06A4k80);
    }

    if (command == "06165")
    {
      unsigned char response06A5tkw[6] = {16, 19, 70, 165, 11, 36};
      CAN.sendMsgBuf(0x7E8, 0, 6, response06A5tkw);
      unsigned char response06A5dyi[8] = {33, 0, 0, 255, 255, 165, 12, 36};
      CAN.sendMsgBuf(0x7E8, 0, 8, response06A5dyi);
      unsigned char response06A587c[7] = {34, 0, 0, 0, 0, 255, 255};
      CAN.sendMsgBuf(0x7E8, 0, 7, response06A587c);
    }

    if (command == "07")
    {
      unsigned char response07uh3[2] = {2, 71};
      CAN.sendMsgBuf(0x7E8, 0, 2, response07uh3);
    }
    

    if (command == "0900")
    {
      unsigned char response0900i9[7] = {6, 73, 0, 85, 64, 0, 0};
      CAN.sendMsgBuf(0x7E8, 0, 7, response0900i9);
      unsigned char response09006b[7] = {6, 73, 0, 20, 64, 0, 0};
      CAN.sendMsgBuf(0x7E9, 0, 7, response09006b);
    }

    if (command == "0902")
    {
      unsigned char responsetocar0902a[8] = {16, 20, 73, 02, 01, 50, 84, 50};
      unsigned char responsetocar0902b[8] = {33, 90, 90, 77, 67, 65, 55, 75};
      // Phong vin
      unsigned char responsetocar0902c[8] = {34, 67, 49, 80, 72, 79, 78, 71};
      // actual vin
      // unsigned char responsetocar0902c[8] = {34, 67, 49, 51, 50, 55, 52, 57};
      
      CAN.sendMsgBuf(0x7E8, 0, 8, responsetocar0902a);
      CAN.sendMsgBuf(0x7E8, 0, 8, responsetocar0902b);
      CAN.sendMsgBuf(0x7E8, 0, 8, responsetocar0902c);
    }

    if (command == "0904")
    {
      unsigned char response0904wj[8] = {16, 19, 73, 4, 1, 71, 83, 65};
      CAN.sendMsgBuf(0x7E8, 0, 8, response0904wj);
      unsigned char response0904nq[8] = {33, 72, 45, 75, 73, 52, 49, 70};
      CAN.sendMsgBuf(0x7E8, 0, 8, response0904nq);
      unsigned char response0904ay[8] = {34, 83, 48, 48, 77, 48, 49, 170};
      CAN.sendMsgBuf(0x7E8, 0, 8, response0904ay);
      unsigned char response0904sw[8] = {16, 19, 73, 4, 1, 65, 65, 72};
      CAN.sendMsgBuf(0x7E9, 0, 8, response0904sw);
      unsigned char response090457[8] = {33, 48, 77, 49, 49, 72, 66, 49};
      CAN.sendMsgBuf(0x7E9, 0, 8, response090457);
      unsigned char response0904j9[8] = {34, 0, 0, 0, 0, 0, 0, 170};
      CAN.sendMsgBuf(0x7E9, 0, 8, response0904j9);
    }

    if (command == "0906")
    {
      unsigned char response0906jl[8] = {7, 73, 6, 1, 183, 77, 3, 238};
      CAN.sendMsgBuf(0x7E8, 0, 8, response0906jl);
      unsigned char response0906s0[8] = {7, 73, 6, 1, 190, 236, 54, 17};
      CAN.sendMsgBuf(0x7E9, 0, 8, response0906s0);
    }
    command = "";
  }
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//End of File
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Editor is loading...