Explorar el Código

fixed:出问题

develop
qi-qin hace 1 año
padre
commit
564d61c008

BIN
Release/libcan_BMSer.so Ver fichero


BIN
Release/service/impl/ProtocolImpl.o Ver fichero


+ 9
- 55
service/impl/ProtocolImpl.cpp Ver fichero

437
 	pbuf[5] = static_cast<uint8_t>(maxId); // 转换为字节
437
 	pbuf[5] = static_cast<uint8_t>(maxId); // 转换为字节
438
 	pbuf[6] = static_cast<uint8_t>(orderMode); // 转换为字节
438
 	pbuf[6] = static_cast<uint8_t>(orderMode); // 转换为字节
439
 	pbuf[7] = static_cast<uint8_t>(orderState); // 转换为字节
439
 	pbuf[7] = static_cast<uint8_t>(orderState); // 转换为字节
440
-	pbuf[8] = 0;
441
-	pbuf[9] = 0;
442
-	pbuf[10] = 0;
443
-	pbuf[11] = 0;
440
+//	pbuf[8] = 0;
441
+//	pbuf[9] = 0;
442
+//	pbuf[10] = 0;
443
+//	pbuf[11] = 0;
444
 	// 打印调试信息
444
 	// 打印调试信息
445
 	log_i("发送分配地址帧: ");
445
 	log_i("发送分配地址帧: ");
446
 	for (int i = 0; i < 8; i++) {
446
 	for (int i = 0; i < 8; i++) {
448
 	}
448
 	}
449
 	currentState = RECEIVED ;
449
 	currentState = RECEIVED ;
450
 
450
 
451
-	len = 12;
451
+	len = 8;
452
 
452
 
453
 }
453
 }
454
 
454
 
565
 	if(currentState == INIT)
565
 	if(currentState == INIT)
566
 	{
566
 	{
567
 		initIO();
567
 		initIO();
568
+		sendDelay = 0;
568
 	}
569
 	}
570
+
569
 	if(currentState == SEND)
571
 	if(currentState == SEND)
570
 	{
572
 	{
571
 		sendAllocFrame(pbuf,currentId , len);
573
 		sendAllocFrame(pbuf,currentId , len);
573
 		//pdevice->getBase().setRwstate(READ_WAIT);
575
 		//pdevice->getBase().setRwstate(READ_WAIT);
574
 		pdevice->getBase().setRwstate(WRITE_WAIT);
576
 		pdevice->getBase().setRwstate(WRITE_WAIT);
575
 	}
577
 	}
578
+
576
 	if(currentState == RECEIVED)
579
 	if(currentState == RECEIVED)
577
 	{
580
 	{
578
 		if(timeOut > 30)
581
 		if(timeOut > 30)
588
 		  return S_OK;
591
 		  return S_OK;
589
 	}
592
 	}
590
 
593
 
591
-//	if(findAddrFlag  == 0)
592
-//	{
593
-//		log_i("寻址标志是0");
594
-//       if(currentId == 1)
595
-//       {
596
-//    	   //setGpioDetrict();
597
-//
598
-//    	   // 设置 GPIO 436 为高电平
599
-//    	   log_i("计数count = %d",count);
600
-//    	  if(count == 1)
601
-//    	  {
602
-//			  if (set_gpio_value(devPath, lowLevel) == 0)
603
-//			  {
604
-//				  log_i("Set GPIO 436 to high");
605
-//			  }
606
-//			  else
607
-//			  {
608
-//				  log_e("Failed to set GPIO 436 to high");
609
-//			  }
610
-//    	  }
611
-//
612
-//    	  else
613
-//    	  {
614
-//    		  if(count > 4)
615
-//    		  {
616
-//    			  // 设置 GPIO 436 为低电平
617
-//				  if (set_gpio_value(devPath, highLevel) == 0)
618
-//				  {
619
-//					  log_i("Set GPIO 436 to low");
620
-//				  }
621
-//				  else
622
-//				  {
623
-//					  log_e("Failed to set GPIO 436 to low");
624
-//				  }
625
-//				  sendAllocFrame(pbuf,currentId , len);
626
-//				  count = 0;
627
-//    		  }
628
-//    	  }
629
-//    	  count ++;
630
-//
631
-//
632
-//       }
633
-//       if()
634
-//       {
635
-//    	   sendAllocFrame(pbuf,currentId , len);
636
-//       }
637
-//       log_i("len的长度:%d",len);
638
-//       return S_OK;
639
-
640
-	//}
594
+
641
 	if(currentState == END)
595
 	if(currentState == END)
642
 	//if(findAddrFlag  == 1)
596
 	//if(findAddrFlag  == 1)
643
 	{
597
 	{

+ 1
- 0
service/impl/ProtocolImpl.h Ver fichero

142
 	int count  = 0;
142
 	int count  = 0;
143
 
143
 
144
 	int currentState = 0;
144
 	int currentState = 0;
145
+	int sendDelay = 0;
145
 
146
 
146
 
147
 
147
 
148
 

Loading…
Cancelar
Guardar